diff --git a/contracts/upgradeable_contracts/AbsoluteDailyLimit.sol b/contracts/upgradeable_contracts/AbsoluteDailyLimit.sol new file mode 100644 index 000000000..2dd22e24c --- /dev/null +++ b/contracts/upgradeable_contracts/AbsoluteDailyLimit.sol @@ -0,0 +1,143 @@ +pragma solidity 0.4.24; + +import "openzeppelin-solidity/contracts/math/SafeMath.sol"; +import "../upgradeability/EternalStorage.sol"; + +contract AbsoluteDailyLimit is EternalStorage { + using SafeMath for uint256; + + event DailyLimitChanged(uint256 newLimit); + event ExecutionDailyLimitChanged(uint256 newLimit); + + bytes32 internal constant MIN_PER_TX = 0xbbb088c505d18e049d114c7c91f11724e69c55ad6c5397e2b929e68b41fa05d1; // keccak256(abi.encodePacked("minPerTx")) + bytes32 internal constant MAX_PER_TX = 0x0f8803acad17c63ee38bf2de71e1888bc7a079a6f73658e274b08018bea4e29c; // keccak256(abi.encodePacked("maxPerTx")) + bytes32 internal constant DAILY_LIMIT = 0x4a6a899679f26b73530d8cf1001e83b6f7702e04b6fdb98f3c62dc7e47e041a5; // keccak256(abi.encodePacked("dailyLimit")) + bytes32 internal constant EXECUTION_MIN_PER_TX = 0x0fc9356d7bc6ba08bb648a3ab811cf6e7c168745644ba25095b79e4d8a0c65ec; // keccak256(abi.encodePacked("executionMinPerTx")) + bytes32 internal constant EXECUTION_MAX_PER_TX = 0xc0ed44c192c86d1cc1ba51340b032c2766b4a2b0041031de13c46dd7104888d5; // keccak256(abi.encodePacked("executionMaxPerTx")) + bytes32 internal constant EXECUTION_DAILY_LIMIT = 0x21dbcab260e413c20dc13c28b7db95e2b423d1135f42bb8b7d5214a92270d237; // keccak256(abi.encodePacked("executionDailyLimit")) + + function setLimits(uint256[] _requestLimitsArray, uint256[] _executionLimitsArray) external { + _setRequestLimits(_requestLimitsArray); + _setExecutionLimits(_executionLimitsArray); + } + + function _setRequestLimits( + uint256[] _requestLimitsArray // [ 0 = _requestDailyLimit, 1 = _requestMaxPerTx, 2 = _requestMinPerTx ] + ) internal { + require( + _requestLimitsArray[2] > 0 && // _requestMinPerTx > 0 + _requestLimitsArray[1] > _requestLimitsArray[2] && // _requestMaxPerTx > _requestMinPerTx + _requestLimitsArray[0] > _requestLimitsArray[1] // _requestDailyLimit > _requestMaxPerTx + ); + uintStorage[DAILY_LIMIT] = _requestLimitsArray[0]; + uintStorage[MAX_PER_TX] = _requestLimitsArray[1]; + uintStorage[MIN_PER_TX] = _requestLimitsArray[2]; + emit DailyLimitChanged(_requestLimitsArray[0]); + } + + function _setExecutionLimits( + uint256[] _executionLimitsArray // [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx, 2 = _executionMinPerTx ] + ) internal { + require( + _executionLimitsArray[2] > 0 && // _foreignMinPerTx > 0 + _executionLimitsArray[1] > _executionLimitsArray[2] && // _foreignMaxPerTx > _foreignMinPerTx + _executionLimitsArray[0] > _executionLimitsArray[1] // _foreignDailyLimit > _foreignMaxPerTx + ); + uintStorage[EXECUTION_DAILY_LIMIT] = _executionLimitsArray[0]; + uintStorage[EXECUTION_MAX_PER_TX] = _executionLimitsArray[1]; + uintStorage[EXECUTION_MIN_PER_TX] = _executionLimitsArray[2]; + emit ExecutionDailyLimitChanged(_executionLimitsArray[0]); + } + + function totalSpentPerDay(uint256 _day) public view returns (uint256) { + return uintStorage[keccak256(abi.encodePacked("totalSpentPerDay", _day))]; + } + + function totalExecutedPerDay(uint256 _day) public view returns (uint256) { + return uintStorage[keccak256(abi.encodePacked("totalExecutedPerDay", _day))]; + } + + function dailyLimit(uint256) public view returns (uint256) { + return uintStorage[DAILY_LIMIT]; + } + + function executionDailyLimit(uint256) public view returns (uint256) { + return uintStorage[EXECUTION_DAILY_LIMIT]; + } + + function maxPerTx() public view returns (uint256) { + return uintStorage[MAX_PER_TX]; + } + + function executionMaxPerTx() public view returns (uint256) { + return uintStorage[EXECUTION_MAX_PER_TX]; + } + + function minPerTx() public view returns (uint256) { + return uintStorage[MIN_PER_TX]; + } + + function executionMinPerTx() public view returns (uint256) { + return uintStorage[EXECUTION_MIN_PER_TX]; + } + + function withinLimit(uint256 _amount, uint256 _tokenBalance) external view returns (bool) { + uint256 nextLimit = totalSpentPerDay(getCurrentDay()).add(_amount); + return dailyLimit(_tokenBalance) >= nextLimit && _amount <= maxPerTx() && _amount >= minPerTx(); + } + + function withinExecutionLimit(uint256 _amount, uint256 _tokenBalance) external view returns (bool) { + uint256 nextLimit = totalExecutedPerDay(getCurrentDay()).add(_amount); + return executionDailyLimit(_tokenBalance) >= nextLimit && _amount <= executionMaxPerTx(); + } + + function getCurrentDay() public view returns (uint256) { + // solhint-disable-next-line not-rely-on-time + return now / 1 days; + } + + function increaseTotalSpentPerDay(uint256 _value) external payable { + uint256 totalSpent = totalSpentPerDay(getCurrentDay()).add(_value); + uintStorage[keccak256(abi.encodePacked("totalSpentPerDay", getCurrentDay()))] = totalSpent; + } + + function increaseTotalExecutedPerDay(uint256 _value) external payable { + uint256 totalExecuted = totalExecutedPerDay(getCurrentDay()).add(_value); + uintStorage[keccak256(abi.encodePacked("totalExecutedPerDay", getCurrentDay()))] = totalExecuted; + } + + function setDailyLimit(uint256 _dailyLimit) external { + require(_dailyLimit > maxPerTx() || _dailyLimit == 0); + uintStorage[DAILY_LIMIT] = _dailyLimit; + emit DailyLimitChanged(_dailyLimit); + } + + function setExecutionDailyLimit(uint256 _dailyLimit) external { + require(_dailyLimit > executionMaxPerTx() || _dailyLimit == 0); + uintStorage[EXECUTION_DAILY_LIMIT] = _dailyLimit; + emit ExecutionDailyLimitChanged(_dailyLimit); + } + + function setExecutionMaxPerTx(uint256 _maxPerTx) external { + require(_maxPerTx < executionDailyLimit(0)); + uintStorage[EXECUTION_MAX_PER_TX] = _maxPerTx; + } + + function setExecutionMinPerTx(uint256 _minPerTx) external { + require(_minPerTx < executionDailyLimit(0) && _minPerTx < executionMaxPerTx()); + uintStorage[EXECUTION_MIN_PER_TX] = _minPerTx; + } + + function setMaxPerTx(uint256 _maxPerTx) external { + require(_maxPerTx == 0 || (_maxPerTx > minPerTx() && _maxPerTx < dailyLimit(0))); + uintStorage[MAX_PER_TX] = _maxPerTx; + } + + function setMinPerTx(uint256 _minPerTx) external { + require(_minPerTx > 0 && _minPerTx < dailyLimit(0) && _minPerTx < maxPerTx()); + uintStorage[MIN_PER_TX] = _minPerTx; + } + + // solhint-disable-next-line no-empty-blocks + function updateTodayLimit(uint256) external payable {} +} diff --git a/contracts/upgradeable_contracts/BaseERC677Bridge.sol b/contracts/upgradeable_contracts/BaseERC677Bridge.sol index 959ce2dc9..2c00fd746 100644 --- a/contracts/upgradeable_contracts/BaseERC677Bridge.sol +++ b/contracts/upgradeable_contracts/BaseERC677Bridge.sol @@ -20,8 +20,9 @@ contract BaseERC677Bridge is BasicTokenBridge, ERC677Receiver, ERC677Storage { function onTokenTransfer(address _from, uint256 _value, bytes _data) external returns (bool) { ERC677 token = erc677token(); require(msg.sender == address(token)); + _updateTodayLimit(); require(withinLimit(_value)); - setTotalSpentPerDay(getCurrentDay(), totalSpentPerDay(getCurrentDay()).add(_value)); + _increaseTotalSpentPerDay(_value); bridgeSpecificActionsOnTokenTransfer(token, _from, _value, _data); return true; } diff --git a/contracts/upgradeable_contracts/BasicForeignBridge.sol b/contracts/upgradeable_contracts/BasicForeignBridge.sol index 494c26a60..d4fd44f71 100644 --- a/contracts/upgradeable_contracts/BasicForeignBridge.sol +++ b/contracts/upgradeable_contracts/BasicForeignBridge.sol @@ -22,6 +22,7 @@ contract BasicForeignBridge is EternalStorage, Validatable, BasicBridge, BasicTo bytes32 txHash; address contractAddress; (recipient, amount, txHash, contractAddress) = Message.parseMessage(message); + _updateTodayLimit(); if (withinExecutionLimit(amount)) { require(contractAddress == address(this)); require(!relayedMessages(txHash)); diff --git a/contracts/upgradeable_contracts/BasicHomeBridge.sol b/contracts/upgradeable_contracts/BasicHomeBridge.sol index e8bac509e..9687930d7 100644 --- a/contracts/upgradeable_contracts/BasicHomeBridge.sol +++ b/contracts/upgradeable_contracts/BasicHomeBridge.sol @@ -23,6 +23,7 @@ contract BasicHomeBridge is EternalStorage, Validatable, BasicBridge, BasicToken ); function executeAffirmation(address recipient, uint256 value, bytes32 transactionHash) external onlyValidator { + _updateTodayLimit(); if (withinExecutionLimit(value)) { bytes32 hashMsg = keccak256(abi.encodePacked(recipient, value, transactionHash)); bytes32 hashSender = keccak256(abi.encodePacked(msg.sender, hashMsg)); diff --git a/contracts/upgradeable_contracts/BasicRelativeDailyLimit.sol b/contracts/upgradeable_contracts/BasicRelativeDailyLimit.sol new file mode 100644 index 000000000..0bfb0b2e0 --- /dev/null +++ b/contracts/upgradeable_contracts/BasicRelativeDailyLimit.sol @@ -0,0 +1,83 @@ +pragma solidity 0.4.24; + +import "openzeppelin-solidity/contracts/math/SafeMath.sol"; +import "./AbsoluteDailyLimit.sol"; + +contract BasicRelativeDailyLimit is AbsoluteDailyLimit { + using SafeMath for uint256; + + event TargetLimitChanged(uint256 newLimit); + event ThresholdChanged(uint256 newThreshold); + event TodayLimitSet(uint256 limit); + + bytes32 internal constant TARGET_LIMIT = 0x192ac2d88a9de45ce541663ebe1aaf6d6b1d4a6299d3fd0abf2ba7e8b920342b; // keccak256(abi.encodePacked("targetLimit")) + bytes32 internal constant THRESHOLD = 0xd46c2b20c7303c2e50535d224276492e8a1eda2a3d7398e0bea254640c1154e7; // keccak256(abi.encodePacked("threshold")) + + function _calculateLimit(uint256 _balance) internal view returns (uint256) { + uint256 unlimitedBalance = _minPerTx(); + if (_balance <= unlimitedBalance) { + return _balance; + } + uint256 limit = targetLimit(); + uint256 thresh = threshold(); + uint256 multiplier = 1 ether**2; + if (_balance < thresh) { + // to save the gas we don't need to use safe math here + // because we check in setters that limit is always less than 1 ether + // and threshold is greater than minPerTx + // and minPerTx is less than threshold + uint256 a = ((1 ether - limit) * multiplier) / (thresh - unlimitedBalance)**2; + uint256 b = 2 * a * thresh; + uint256 c = (limit * multiplier) + a * thresh**2; + limit = (a * _balance**2 - b * _balance + c) / multiplier; + } + return (_balance * limit) / 1 ether; + } + + function targetLimit() public view returns (uint256) { + return uintStorage[TARGET_LIMIT]; + } + + function threshold() public view returns (uint256) { + return uintStorage[THRESHOLD]; + } + + function setTargetLimit(uint256 _targetLimit) external { + require(_targetLimit <= 1 ether); + uintStorage[TARGET_LIMIT] = _targetLimit; + emit TargetLimitChanged(_targetLimit); + } + + function setThreshold(uint256 _threshold) external { + require(_threshold >= _minPerTx()); + uintStorage[THRESHOLD] = _threshold; + emit ThresholdChanged(_threshold); + } + + function updateTodayLimit(uint256 _balance) external payable { + if (_todayLimit() == 0) { + uint256 limit = _calculateLimit(_balance); + _setTodayLimit(limit); + emit TodayLimitSet(limit); + } + } + + function _getTodayLimit(uint256 _tokenBalance) internal view returns (uint256) { + uint256 limit = _todayLimit(); + if (limit == 0) { + // not set yet + limit = _calculateLimit(_tokenBalance); + } + return limit; + } + + function _todayLimit() internal view returns (uint256) { + return uintStorage[keccak256(abi.encodePacked("todayLimit", getCurrentDay()))]; + } + + function _setTodayLimit(uint256 _value) internal { + uintStorage[keccak256(abi.encodePacked("todayLimit", getCurrentDay()))] = _value; + } + + function _minPerTx() internal view returns (uint256); +} diff --git a/contracts/upgradeable_contracts/BasicTokenBridge.sol b/contracts/upgradeable_contracts/BasicTokenBridge.sol index 96fe6252b..284c7b201 100644 --- a/contracts/upgradeable_contracts/BasicTokenBridge.sol +++ b/contracts/upgradeable_contracts/BasicTokenBridge.sol @@ -1,101 +1,205 @@ pragma solidity 0.4.24; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; +import "openzeppelin-solidity/contracts/AddressUtils.sol"; import "../upgradeability/EternalStorage.sol"; import "./Ownable.sol"; contract BasicTokenBridge is EternalStorage, Ownable { using SafeMath for uint256; - event DailyLimitChanged(uint256 newLimit); - event ExecutionDailyLimitChanged(uint256 newLimit); - - bytes32 internal constant MIN_PER_TX = 0xbbb088c505d18e049d114c7c91f11724e69c55ad6c5397e2b929e68b41fa05d1; // keccak256(abi.encodePacked("minPerTx")) - bytes32 internal constant MAX_PER_TX = 0x0f8803acad17c63ee38bf2de71e1888bc7a079a6f73658e274b08018bea4e29c; // keccak256(abi.encodePacked("maxPerTx")) - bytes32 internal constant DAILY_LIMIT = 0x4a6a899679f26b73530d8cf1001e83b6f7702e04b6fdb98f3c62dc7e47e041a5; // keccak256(abi.encodePacked("dailyLimit")) - bytes32 internal constant EXECUTION_MAX_PER_TX = 0xc0ed44c192c86d1cc1ba51340b032c2766b4a2b0041031de13c46dd7104888d5; // keccak256(abi.encodePacked("executionMaxPerTx")) - bytes32 internal constant EXECUTION_DAILY_LIMIT = 0x21dbcab260e413c20dc13c28b7db95e2b423d1135f42bb8b7d5214a92270d237; // keccak256(abi.encodePacked("executionDailyLimit")) bytes32 internal constant DECIMAL_SHIFT = 0x1e8ecaafaddea96ed9ac6d2642dcdfe1bebe58a930b1085842d8fc122b371ee5; // keccak256(abi.encodePacked("decimalShift")) + bytes32 internal constant LIMITS_CONTRACT = 0xa31e93f7d43dce967fc79ad66bd710eaf96d9f4737de61bb298c289276986887; // keccak256(abi.encodePacked("limitsContract")) + + bytes4 internal constant GET_MAX_PER_TX = 0xf968adbe; // maxPerTx() + bytes4 internal constant GET_MIN_PER_TX = 0xdf25f3f0; // minPerTx() + bytes4 internal constant GET_DAILY_LIMIT = 0x56ee0405; // dailyLimit(uint256) + bytes4 internal constant GET_EXECUTION_MAX_PER_TX = 0x8aa1949a; // executionMaxPerTx() + bytes4 internal constant GET_EXECUTION_MIN_PER_TX = 0x35b00293; // executionMinPerTx() + bytes4 internal constant GET_EXECUTION_DAILY_LIMIT = 0x5cd79c3a; // executionDailyLimit(uint256) + bytes4 internal constant GET_TARGET_LIMIT = 0xa70021f3; // targetLimit() + bytes4 internal constant GET_THRESHOLD = 0x42cde4e8; // threshold() + bytes4 internal constant GET_WITHIN_LIMIT = 0x894d5ea8; // withinLimit(uint256,uint256) + bytes4 internal constant GET_WITHIN_EXECUTION_LIMIT = 0x84e43616; // withinExecutionLimit(uint256,uint256) + bytes4 internal constant GET_TOTAL_SPENT_PER_DAY = 0x2bd0bb05; // totalSpentPerDay(uint256) + bytes4 internal constant GET_TOTAL_EXECUTED_PER_DAY = 0x4fb3fef7; // totalExecutedPerDay(uint256) + bytes4 internal constant GET_CURRENT_DAY = 0x3e6968b6; // getCurrentDay() + bytes4 internal constant INCREASE_TOTAL_SPENT_PER_DAY = 0xb47584cd; // increaseTotalSpentPerDay(uint256) + bytes4 internal constant INCREASE_TOTAL_EXECUTED_PER_DAY = 0x79d9623a; // increaseTotalExecutedPerDay(uint256) + bytes4 internal constant SET_LIMITS = 0x1558bff0; // setLimits(uint256[],uint256[]) + bytes4 internal constant SET_MAX_PER_TX = 0xc6f6f216; // setMaxPerTx(uint256) + bytes4 internal constant SET_MIN_PER_TX = 0xa2a6ca27; // setMinPerTx(uint256) + bytes4 internal constant SET_DAILY_LIMIT = 0xb20d30a9; // setDailyLimit(uint256) + bytes4 internal constant SET_EXECUTION_MAX_PER_TX = 0xf20151e1; // setExecutionMaxPerTx(uint256) + bytes4 internal constant SET_EXECUTION_MIN_PER_TX = 0xf56d2fec; // setExecutionMinPerTx(uint256) + bytes4 internal constant SET_EXECUTION_DAILY_LIMIT = 0x3dd95d1b; // setExecutionDailyLimit(uint256) + bytes4 internal constant SET_TARGET_LIMIT = 0x8253a36a; // setTargetLimit(uint256) + bytes4 internal constant SET_THRESHOLD = 0x960bfe04; // setThreshold(uint256) + bytes4 internal constant UPDATE_TODAY_LIMIT = 0x0097eff6; // updateTodayLimit(uint256) + + function setLimitsContract(address _limitsContract) external onlyOwner { + require(AddressUtils.isContract(_limitsContract)); + addressStorage[LIMITS_CONTRACT] = _limitsContract; + } + + function setLimits(uint256[] _requestLimitsArray, uint256[] _executionLimitsArray) external onlyOwner { + _setLimits(_requestLimitsArray, _executionLimitsArray); + } - function totalSpentPerDay(uint256 _day) public view returns (uint256) { - return uintStorage[keccak256(abi.encodePacked("totalSpentPerDay", _day))]; + function setMaxPerTx(uint256 _maxPerTx) external onlyOwner { + _execute(SET_MAX_PER_TX, _maxPerTx); } - function totalExecutedPerDay(uint256 _day) public view returns (uint256) { - return uintStorage[keccak256(abi.encodePacked("totalExecutedPerDay", _day))]; + function setMinPerTx(uint256 _minPerTx) external onlyOwner { + _execute(SET_MIN_PER_TX, _minPerTx); } - function dailyLimit() public view returns (uint256) { - return uintStorage[DAILY_LIMIT]; + function setDailyLimit(uint256 _dailyLimit) external onlyOwner { + _execute(SET_DAILY_LIMIT, _dailyLimit); } - function executionDailyLimit() public view returns (uint256) { - return uintStorage[EXECUTION_DAILY_LIMIT]; + function setExecutionMaxPerTx(uint256 _maxPerTx) external onlyOwner { + _execute(SET_EXECUTION_MAX_PER_TX, _maxPerTx); } - function maxPerTx() public view returns (uint256) { - return uintStorage[MAX_PER_TX]; + function setExecutionMinPerTx(uint256 _minPerTx) external onlyOwner { + _execute(SET_EXECUTION_MIN_PER_TX, _minPerTx); } - function executionMaxPerTx() public view returns (uint256) { - return uintStorage[EXECUTION_MAX_PER_TX]; + function setExecutionDailyLimit(uint256 _dailyLimit) external onlyOwner { + _execute(SET_EXECUTION_DAILY_LIMIT, _dailyLimit); } - function minPerTx() public view returns (uint256) { - return uintStorage[MIN_PER_TX]; + function setTargetLimit(uint256 _targetLimit) external onlyOwner { + _execute(SET_TARGET_LIMIT, _targetLimit); + } + + function setThreshold(uint256 _threshold) external onlyOwner { + _execute(SET_THRESHOLD, _threshold); + } + + function limitsContract() public view returns (address) { + return addressStorage[LIMITS_CONTRACT]; } function decimalShift() public view returns (uint256) { return uintStorage[DECIMAL_SHIFT]; } + function maxPerTx() public view returns (uint256) { + return _getUint(GET_MAX_PER_TX); + } + + function minPerTx() public view returns (uint256) { + return _getUint(GET_MIN_PER_TX); + } + + function dailyLimit() public view returns (uint256) { + return _getUint(GET_DAILY_LIMIT, _getTokenBalance()); + } + + function executionMaxPerTx() public view returns (uint256) { + return _getUint(GET_EXECUTION_MAX_PER_TX); + } + + function executionMinPerTx() public view returns (uint256) { + return _getUint(GET_EXECUTION_MIN_PER_TX); + } + + function executionDailyLimit() public view returns (uint256) { + return _getUint(GET_EXECUTION_DAILY_LIMIT, _getTokenBalance()); + } + + function targetLimit() public view returns (uint256) { + return _getUint(GET_TARGET_LIMIT); + } + + function threshold() public view returns (uint256) { + return _getUint(GET_THRESHOLD); + } + function withinLimit(uint256 _amount) public view returns (bool) { - uint256 nextLimit = totalSpentPerDay(getCurrentDay()).add(_amount); - return dailyLimit() >= nextLimit && _amount <= maxPerTx() && _amount >= minPerTx(); + return _getWithinLimit(GET_WITHIN_LIMIT, _amount, _getTokenBalance()); } function withinExecutionLimit(uint256 _amount) public view returns (bool) { - uint256 nextLimit = totalExecutedPerDay(getCurrentDay()).add(_amount); - return executionDailyLimit() >= nextLimit && _amount <= executionMaxPerTx(); + return _getWithinLimit(GET_WITHIN_EXECUTION_LIMIT, _amount, _getTokenBalance()); + } + + function totalSpentPerDay(uint256 _day) public view returns (uint256) { + return _getUint(GET_TOTAL_SPENT_PER_DAY, _day); + } + + function totalExecutedPerDay(uint256 _day) public view returns (uint256) { + return _getUint(GET_TOTAL_EXECUTED_PER_DAY, _day); } function getCurrentDay() public view returns (uint256) { - // solhint-disable-next-line not-rely-on-time - return now / 1 days; + return _getUint(GET_CURRENT_DAY); } - function setTotalSpentPerDay(uint256 _day, uint256 _value) internal { - uintStorage[keccak256(abi.encodePacked("totalSpentPerDay", _day))] = _value; + function _setLimits(uint256[] _requestLimitsArray, uint256[] _executionLimitsArray) internal { + require( + limitsContract().delegatecall( + abi.encodeWithSelector(SET_LIMITS, _requestLimitsArray, _executionLimitsArray) + ) + ); } - function setTotalExecutedPerDay(uint256 _day, uint256 _value) internal { - uintStorage[keccak256(abi.encodePacked("totalExecutedPerDay", _day))] = _value; + function _increaseTotalSpentPerDay(uint256 _amount) internal { + _execute(INCREASE_TOTAL_SPENT_PER_DAY, _amount); } - function setDailyLimit(uint256 _dailyLimit) external onlyOwner { - require(_dailyLimit > maxPerTx() || _dailyLimit == 0); - uintStorage[DAILY_LIMIT] = _dailyLimit; - emit DailyLimitChanged(_dailyLimit); + function _increaseTotalExecutedPerDay(uint256 _amount) internal { + _execute(INCREASE_TOTAL_EXECUTED_PER_DAY, _amount); } - function setExecutionDailyLimit(uint256 _dailyLimit) external onlyOwner { - require(_dailyLimit > executionMaxPerTx() || _dailyLimit == 0); - uintStorage[EXECUTION_DAILY_LIMIT] = _dailyLimit; - emit ExecutionDailyLimitChanged(_dailyLimit); + function _updateTodayLimit() internal { + _execute(UPDATE_TODAY_LIMIT, _getTokenBalance()); } - function setExecutionMaxPerTx(uint256 _maxPerTx) external onlyOwner { - require(_maxPerTx < executionDailyLimit()); - uintStorage[EXECUTION_MAX_PER_TX] = _maxPerTx; + function _execute(bytes4 _method, uint256 _value) internal { + require(limitsContract().delegatecall(abi.encodeWithSelector(_method, _value))); } - function setMaxPerTx(uint256 _maxPerTx) external onlyOwner { - require(_maxPerTx == 0 || (_maxPerTx > minPerTx() && _maxPerTx < dailyLimit())); - uintStorage[MAX_PER_TX] = _maxPerTx; + function _getTokenBalance() internal view returns (uint256); + + function _getUint(bytes4 _method) internal view returns (uint256) { + return _getUint(abi.encodeWithSelector(_method)); } - function setMinPerTx(uint256 _minPerTx) external onlyOwner { - require(_minPerTx > 0 && _minPerTx < dailyLimit() && _minPerTx < maxPerTx()); - uintStorage[MIN_PER_TX] = _minPerTx; + function _getUint(bytes4 _method, uint256 _param) internal view returns (uint256) { + return _getUint(abi.encodeWithSelector(_method, _param)); + } + + function _getUint(bytes memory _calldata) internal view returns (uint256) { + uint256 value; + address contractAddress = limitsContract(); + assembly { + let result := callcode(gas, contractAddress, 0x0, add(_calldata, 0x20), mload(_calldata), 0, 32) + value := mload(0) + + switch result + case 0 { + revert(0, 0) + } + } + return value; + } + + function _getWithinLimit(bytes4 _method, uint256 _amount, uint256 _tokenBalance) internal view returns (bool) { + bool value; + bytes memory callData = abi.encodeWithSelector(_method, _amount, _tokenBalance); + address contractAddress = limitsContract(); + assembly { + let result := callcode(gas, contractAddress, 0x0, add(callData, 0x20), mload(callData), 0, 32) + value := mload(0) + + switch result + case 0 { + revert(0, 0) + } + } + return value; } } diff --git a/contracts/upgradeable_contracts/ERC20Bridge.sol b/contracts/upgradeable_contracts/ERC20Bridge.sol index 5f77b3476..7a1511206 100644 --- a/contracts/upgradeable_contracts/ERC20Bridge.sol +++ b/contracts/upgradeable_contracts/ERC20Bridge.sol @@ -20,8 +20,9 @@ contract ERC20Bridge is BasicForeignBridge { require(_receiver != address(0)); require(_receiver != address(this)); require(_amount > 0); + _updateTodayLimit(); require(withinLimit(_amount)); - setTotalSpentPerDay(getCurrentDay(), totalSpentPerDay(getCurrentDay()).add(_amount)); + _increaseTotalSpentPerDay(_amount); erc20token().transferFrom(_sender, address(this), _amount); emit UserRequestForAffirmation(_receiver, _amount); diff --git a/contracts/upgradeable_contracts/RelativeDailyLimit.sol b/contracts/upgradeable_contracts/RelativeDailyLimit.sol new file mode 100644 index 000000000..6cbdde364 --- /dev/null +++ b/contracts/upgradeable_contracts/RelativeDailyLimit.sol @@ -0,0 +1,38 @@ +pragma solidity 0.4.24; + +import "./BasicRelativeDailyLimit.sol"; + +contract RelativeDailyLimit is BasicRelativeDailyLimit { + function _setRequestLimits( + uint256[] _requestLimitsArray // [ 0 = _targetLimit, 1 = _threshold, 2 = _requestMaxPerTx, 3 = _requestMinPerTx ] + ) internal { + require( + _requestLimitsArray[3] > 0 && // _requestMinPerTx > 0 + _requestLimitsArray[2] > _requestLimitsArray[3] && // _requestMaxPerTx > _requestMinPerTx + _requestLimitsArray[1] >= _requestLimitsArray[3] && // _threshold >= _requestMinPerTx + _requestLimitsArray[0] <= 1 ether // _targetLimit <= 1 ether + ); + uintStorage[TARGET_LIMIT] = _requestLimitsArray[0]; + uintStorage[THRESHOLD] = _requestLimitsArray[1]; + uintStorage[MAX_PER_TX] = _requestLimitsArray[2]; + uintStorage[MIN_PER_TX] = _requestLimitsArray[3]; + } + + function _minPerTx() internal view returns (uint256) { + return minPerTx(); + } + + function dailyLimit(uint256 _tokenBalance) public view returns (uint256) { + return _getTodayLimit(_tokenBalance); + } + + function setMinPerTx(uint256 _minPerTx) external { + require(_minPerTx > 0 && _minPerTx < maxPerTx()); + uintStorage[MIN_PER_TX] = _minPerTx; + } + + function setMaxPerTx(uint256 _maxPerTx) external { + require(_maxPerTx == 0 || _maxPerTx > minPerTx()); + uintStorage[MAX_PER_TX] = _maxPerTx; + } +} diff --git a/contracts/upgradeable_contracts/RelativeExecutionDailyLimit.sol b/contracts/upgradeable_contracts/RelativeExecutionDailyLimit.sol new file mode 100644 index 000000000..472b54aa8 --- /dev/null +++ b/contracts/upgradeable_contracts/RelativeExecutionDailyLimit.sol @@ -0,0 +1,38 @@ +pragma solidity 0.4.24; + +import "./BasicRelativeDailyLimit.sol"; + +contract RelativeExecutionDailyLimit is BasicRelativeDailyLimit { + function _setExecutionLimits( + uint256[] _executionLimitsArray // [ 0 = _targetLimit, 1 = _threshold, 2 = _executionMaxPerTx, 3 = _executionMinPerTx ] + ) internal { + require( + _executionLimitsArray[3] > 0 && // _executionMinPerTx > 0 + _executionLimitsArray[2] > _executionLimitsArray[3] && // _executionMaxPerTx > _executionMinPerTx + _executionLimitsArray[1] >= _executionLimitsArray[3] && // _threshold >= _executionMinPerTx + _executionLimitsArray[0] <= 1 ether // _targetLimit <= 1 ether + ); + uintStorage[TARGET_LIMIT] = _executionLimitsArray[0]; + uintStorage[THRESHOLD] = _executionLimitsArray[1]; + uintStorage[EXECUTION_MAX_PER_TX] = _executionLimitsArray[2]; + uintStorage[EXECUTION_MIN_PER_TX] = _executionLimitsArray[3]; + } + + function _minPerTx() internal view returns (uint256) { + return executionMinPerTx(); + } + + function executionDailyLimit(uint256 _tokenBalance) public view returns (uint256) { + return _getTodayLimit(_tokenBalance); + } + + function setExecutionMinPerTx(uint256 _minPerTx) external { + require(_minPerTx < executionMaxPerTx()); + uintStorage[EXECUTION_MIN_PER_TX] = _minPerTx; + } + + function setExecutionMaxPerTx(uint256 _maxPerTx) external { + require(_maxPerTx > executionMinPerTx() || _maxPerTx == 0); + uintStorage[EXECUTION_MAX_PER_TX] = _maxPerTx; + } +} diff --git a/contracts/upgradeable_contracts/amb_erc677_to_erc677/BasicAMBErc677ToErc677.sol b/contracts/upgradeable_contracts/amb_erc677_to_erc677/BasicAMBErc677ToErc677.sol index 8010e96a8..3a0cf55b3 100644 --- a/contracts/upgradeable_contracts/amb_erc677_to_erc677/BasicAMBErc677ToErc677.sol +++ b/contracts/upgradeable_contracts/amb_erc677_to_erc677/BasicAMBErc677ToErc677.sol @@ -33,37 +33,31 @@ contract BasicAMBErc677ToErc677 is address _bridgeContract, address _mediatorContract, address _erc677token, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] - uint256[] _executionDailyLimitExecutionMaxPerTxArray, // [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx ] + // absolute: [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // relative: [ 0 = _targetLimit, 1 = threshold, 2 = _maxPerTx, 3 = _minPerTx ] + uint256[] _requestLimitsArray, + // absolute: [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx, 2 = _executionMinPerTx ] + // relative: [ 0 = _targetLimit, 1 = _threshold, 2 = _executionMaxPerTx, 3 = _executionMinPerTx ] + uint256[] _executionLimitsArray, uint256 _requestGasLimit, uint256 _decimalShift, - address _owner + address _owner, + address _limitsContract ) external onlyRelevantSender returns (bool) { require(!isInitialized()); - require( - _dailyLimitMaxPerTxMinPerTxArray[2] > 0 && // _minPerTx > 0 - _dailyLimitMaxPerTxMinPerTxArray[1] > _dailyLimitMaxPerTxMinPerTxArray[2] && // _maxPerTx > _minPerTx - _dailyLimitMaxPerTxMinPerTxArray[0] > _dailyLimitMaxPerTxMinPerTxArray[1] // _dailyLimit > _maxPerTx - ); - require(_executionDailyLimitExecutionMaxPerTxArray[1] < _executionDailyLimitExecutionMaxPerTxArray[0]); // _executionMaxPerTx < _executionDailyLimit + require(AddressUtils.isContract(_limitsContract)); _setBridgeContract(_bridgeContract); _setMediatorContractOnOtherSide(_mediatorContract); setErc677token(_erc677token); - uintStorage[DAILY_LIMIT] = _dailyLimitMaxPerTxMinPerTxArray[0]; - uintStorage[MAX_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[1]; - uintStorage[MIN_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[2]; - uintStorage[EXECUTION_DAILY_LIMIT] = _executionDailyLimitExecutionMaxPerTxArray[0]; - uintStorage[EXECUTION_MAX_PER_TX] = _executionDailyLimitExecutionMaxPerTxArray[1]; _setRequestGasLimit(_requestGasLimit); uintStorage[DECIMAL_SHIFT] = _decimalShift; setOwner(_owner); setNonce(keccak256(abi.encodePacked(address(this)))); - setInitialize(); - - emit DailyLimitChanged(_dailyLimitMaxPerTxMinPerTxArray[0]); - emit ExecutionDailyLimitChanged(_executionDailyLimitExecutionMaxPerTxArray[0]); + addressStorage[LIMITS_CONTRACT] = _limitsContract; + _setLimits(_requestLimitsArray, _executionLimitsArray); + setInitialize(); return isInitialized(); } @@ -95,8 +89,9 @@ contract BasicAMBErc677ToErc677 is require(!lock()); ERC677 token = erc677token(); address to = address(this); + _updateTodayLimit(); require(withinLimit(_value)); - setTotalSpentPerDay(getCurrentDay(), totalSpentPerDay(getCurrentDay()).add(_value)); + _increaseTotalSpentPerDay(_value); setLock(true); token.transferFrom(_from, to, _value); @@ -112,8 +107,9 @@ contract BasicAMBErc677ToErc677 is ERC677 token = erc677token(); require(msg.sender == address(token)); if (!lock()) { + _updateTodayLimit(); require(withinLimit(_value)); - setTotalSpentPerDay(getCurrentDay(), totalSpentPerDay(getCurrentDay()).add(_value)); + _increaseTotalSpentPerDay(_value); } bridgeSpecificActionsOnTokenTransfer(token, _from, _value, _data); return true; @@ -216,8 +212,9 @@ contract BasicAMBErc677ToErc677 is ) external { require(msg.sender == address(bridgeContract())); require(messageSender() == mediatorContractOnOtherSide()); + _updateTodayLimit(); if (withinExecutionLimit(_value)) { - setTotalExecutedPerDay(getCurrentDay(), totalExecutedPerDay(getCurrentDay()).add(_value)); + _increaseTotalExecutedPerDay(_value); executeActionOnBridgedTokens(_recipient, _value); } else { bytes32 txHash = transactionHash(); diff --git a/contracts/upgradeable_contracts/amb_erc677_to_erc677/ForeignAMBErc677ToErc677.sol b/contracts/upgradeable_contracts/amb_erc677_to_erc677/ForeignAMBErc677ToErc677.sol index 7b79ecd62..747d6943d 100644 --- a/contracts/upgradeable_contracts/amb_erc677_to_erc677/ForeignAMBErc677ToErc677.sol +++ b/contracts/upgradeable_contracts/amb_erc677_to_erc677/ForeignAMBErc677ToErc677.sol @@ -22,4 +22,8 @@ contract ForeignAMBErc677ToErc677 is BasicAMBErc677ToErc677 { function executeActionOnFixedTokens(address _recipient, uint256 _value) internal { erc677token().transfer(_recipient, _value); } + + function _getTokenBalance() internal view returns (uint256) { + return erc677token().balanceOf(address(this)); + } } diff --git a/contracts/upgradeable_contracts/amb_erc677_to_erc677/HomeAMBErc677ToErc677.sol b/contracts/upgradeable_contracts/amb_erc677_to_erc677/HomeAMBErc677ToErc677.sol index 8475523d6..d1a29ed0f 100644 --- a/contracts/upgradeable_contracts/amb_erc677_to_erc677/HomeAMBErc677ToErc677.sol +++ b/contracts/upgradeable_contracts/amb_erc677_to_erc677/HomeAMBErc677ToErc677.sol @@ -19,4 +19,8 @@ contract HomeAMBErc677ToErc677 is BasicAMBErc677ToErc677 { function executeActionOnFixedTokens(address _recipient, uint256 _value) internal { IBurnableMintableERC677Token(erc677token()).mint(_recipient, _value); } + + function _getTokenBalance() internal view returns (uint256) { + return erc677token().totalSupply(); + } } diff --git a/contracts/upgradeable_contracts/erc20_to_erc20/BasicForeignBridgeErcToErc.sol b/contracts/upgradeable_contracts/erc20_to_erc20/BasicForeignBridgeErcToErc.sol index 06d9753f0..48098a16c 100644 --- a/contracts/upgradeable_contracts/erc20_to_erc20/BasicForeignBridgeErcToErc.sol +++ b/contracts/upgradeable_contracts/erc20_to_erc20/BasicForeignBridgeErcToErc.sol @@ -4,46 +4,42 @@ import "../BasicForeignBridge.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; contract BasicForeignBridgeErcToErc is BasicForeignBridge { - function _initialize( + function initialize( address _validatorContract, address _erc20token, uint256 _requiredBlockConfirmations, uint256 _gasPrice, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] - uint256[] _homeDailyLimitHomeMaxPerTxArray, // [ 0 = _homeDailyLimit, 1 = _homeMaxPerTx ] + // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + uint256[] _requestLimitsArray, + // absolute: [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx, 2 = _executionMinPerTx ] + // relative: [ 0 = _targetLimit, 1 = _threshold, 2 = _executionMaxPerTx, 3 = _executionMinPerTx ] + uint256[] _executionLimitsArray, address _owner, - uint256 _decimalShift - ) internal { + uint256 _decimalShift, + address _limitsContract + ) external onlyRelevantSender returns (bool) { require(!isInitialized()); require(AddressUtils.isContract(_validatorContract)); require(_requiredBlockConfirmations != 0); require(_gasPrice > 0); - require( - _dailyLimitMaxPerTxMinPerTxArray[2] > 0 && // _minPerTx > 0 - _dailyLimitMaxPerTxMinPerTxArray[1] > _dailyLimitMaxPerTxMinPerTxArray[2] && // _maxPerTx > _minPerTx - _dailyLimitMaxPerTxMinPerTxArray[0] > _dailyLimitMaxPerTxMinPerTxArray[1] // _dailyLimit > _maxPerTx - ); - require(_homeDailyLimitHomeMaxPerTxArray[1] < _homeDailyLimitHomeMaxPerTxArray[0]); // _homeMaxPerTx < _homeDailyLimit require(_owner != address(0)); + require(AddressUtils.isContract(_limitsContract)); addressStorage[VALIDATOR_CONTRACT] = _validatorContract; setErc20token(_erc20token); uintStorage[DEPLOYED_AT_BLOCK] = block.number; uintStorage[REQUIRED_BLOCK_CONFIRMATIONS] = _requiredBlockConfirmations; uintStorage[GAS_PRICE] = _gasPrice; - uintStorage[DAILY_LIMIT] = _dailyLimitMaxPerTxMinPerTxArray[0]; - uintStorage[MAX_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[1]; - uintStorage[MIN_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[2]; - uintStorage[EXECUTION_DAILY_LIMIT] = _homeDailyLimitHomeMaxPerTxArray[0]; - uintStorage[EXECUTION_MAX_PER_TX] = _homeDailyLimitHomeMaxPerTxArray[1]; uintStorage[DECIMAL_SHIFT] = _decimalShift; setOwner(_owner); - setInitialize(); + addressStorage[LIMITS_CONTRACT] = _limitsContract; + _setLimits(_requestLimitsArray, _executionLimitsArray); emit RequiredBlockConfirmationChanged(_requiredBlockConfirmations); emit GasPriceChanged(_gasPrice); - emit DailyLimitChanged(_dailyLimitMaxPerTxMinPerTxArray[0]); - emit ExecutionDailyLimitChanged(_homeDailyLimitHomeMaxPerTxArray[0]); + + setInitialize(); + return isInitialized(); } function getBridgeMode() external pure returns (bytes4 _data) { @@ -60,7 +56,7 @@ contract BasicForeignBridgeErcToErc is BasicForeignBridge { uint256 _amount, bytes32 /*_txHash*/ ) internal returns (bool) { - setTotalExecutedPerDay(getCurrentDay(), totalExecutedPerDay(getCurrentDay()).add(_amount)); + _increaseTotalExecutedPerDay(_amount); uint256 amount = _amount.div(10**decimalShift()); return erc20token().transfer(_recipient, amount); } @@ -69,6 +65,10 @@ contract BasicForeignBridgeErcToErc is BasicForeignBridge { revert(); } + function _getTokenBalance() internal view returns (uint256) { + return erc20token().balanceOf(address(this)); + } + /* solcov ignore next */ function erc20token() public view returns (ERC20); diff --git a/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErc677ToErc677.sol b/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErc677ToErc677.sol index 0572ae41c..1e3a8f809 100644 --- a/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErc677ToErc677.sol +++ b/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErc677ToErc677.sol @@ -4,30 +4,6 @@ import "./BasicForeignBridgeErcToErc.sol"; import "../ERC677Bridge.sol"; contract ForeignBridgeErc677ToErc677 is ERC677Bridge, BasicForeignBridgeErcToErc { - function initialize( - address _validatorContract, - address _erc20token, - uint256 _requiredBlockConfirmations, - uint256 _gasPrice, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] - uint256[] _homeDailyLimitHomeMaxPerTxArray, // [ 0 = _homeDailyLimit, 1 = _homeMaxPerTx ] - address _owner, - uint256 _decimalShift - ) external onlyRelevantSender returns (bool) { - _initialize( - _validatorContract, - _erc20token, - _requiredBlockConfirmations, - _gasPrice, - _dailyLimitMaxPerTxMinPerTxArray, - _homeDailyLimitHomeMaxPerTxArray, - _owner, - _decimalShift - ); - - return isInitialized(); - } - function erc20token() public view returns (ERC20) { return erc677token(); } diff --git a/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol b/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol index eb51f2b0b..5bcab457e 100644 --- a/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol +++ b/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol @@ -3,27 +3,5 @@ pragma solidity 0.4.24; import "./BasicForeignBridgeErcToErc.sol"; import "../ERC20Bridge.sol"; -contract ForeignBridgeErcToErc is BasicForeignBridgeErcToErc, ERC20Bridge { - function initialize( - address _validatorContract, - address _erc20token, - uint256 _requiredBlockConfirmations, - uint256 _gasPrice, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] - uint256[] _homeDailyLimitHomeMaxPerTxArray, // [ 0 = _homeDailyLimit, 1 = _homeMaxPerTx ] - address _owner, - uint256 _decimalShift - ) external onlyRelevantSender returns (bool) { - _initialize( - _validatorContract, - _erc20token, - _requiredBlockConfirmations, - _gasPrice, - _dailyLimitMaxPerTxMinPerTxArray, - _homeDailyLimitHomeMaxPerTxArray, - _owner, - _decimalShift - ); - return isInitialized(); - } -} +// solhint-disable-next-line no-empty-blocks +contract ForeignBridgeErcToErc is BasicForeignBridgeErcToErc, ERC20Bridge {} diff --git a/contracts/upgradeable_contracts/erc20_to_erc20/HomeBridgeErcToErc.sol b/contracts/upgradeable_contracts/erc20_to_erc20/HomeBridgeErcToErc.sol index 572ccb332..f90318dad 100644 --- a/contracts/upgradeable_contracts/erc20_to_erc20/HomeBridgeErcToErc.sol +++ b/contracts/upgradeable_contracts/erc20_to_erc20/HomeBridgeErcToErc.sol @@ -17,123 +17,72 @@ contract HomeBridgeErcToErc is { function initialize( address _validatorContract, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // absolute: [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // relative: [ 0 = _targetLimit, 1 = _threshold, 2 = _maxPerTx, 3 = _minPerTx ] + uint256[] _requestLimitsArray, uint256 _homeGasPrice, uint256 _requiredBlockConfirmations, address _erc677token, - uint256[] _foreignDailyLimitForeignMaxPerTxArray, // [ 0 = _foreignDailyLimit, 1 = _foreignMaxPerTx ] + uint256[] _executionLimitsArray, // [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx, 2 = _executionMinPerTx ] address _owner, - uint256 _decimalShift - ) external onlyRelevantSender returns (bool) { - _initialize( - _validatorContract, - _dailyLimitMaxPerTxMinPerTxArray, - _homeGasPrice, - _requiredBlockConfirmations, - _erc677token, - _foreignDailyLimitForeignMaxPerTxArray, - _owner, - _decimalShift - ); - setInitialize(); + uint256 _decimalShift, + address _limitsContract + ) public onlyRelevantSender returns (bool) { + require(!isInitialized()); + require(AddressUtils.isContract(_validatorContract)); + require(_requiredBlockConfirmations > 0); + require(_owner != address(0)); + require(AddressUtils.isContract(_limitsContract)); - return isInitialized(); - } + addressStorage[VALIDATOR_CONTRACT] = _validatorContract; + uintStorage[DEPLOYED_AT_BLOCK] = block.number; + uintStorage[GAS_PRICE] = _homeGasPrice; + uintStorage[REQUIRED_BLOCK_CONFIRMATIONS] = _requiredBlockConfirmations; + uintStorage[DECIMAL_SHIFT] = _decimalShift; + setOwner(_owner); + setErc677token(_erc677token); + addressStorage[LIMITS_CONTRACT] = _limitsContract; + _setLimits(_requestLimitsArray, _executionLimitsArray); - function rewardableInitialize( - address _validatorContract, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] - uint256 _homeGasPrice, - uint256 _requiredBlockConfirmations, - address _erc677token, - uint256[] _foreignDailyLimitForeignMaxPerTxArray, // [ 0 = _foreignDailyLimit, 1 = _foreignMaxPerTx ] - address _owner, - address _feeManager, - uint256[] _homeFeeForeignFeeArray, // [ 0 = _homeFee, 1 = _foreignFee ] - uint256 _decimalShift - ) external onlyRelevantSender returns (bool) { - _rewardableInitialize( - _validatorContract, - _dailyLimitMaxPerTxMinPerTxArray, - _homeGasPrice, - _requiredBlockConfirmations, - _erc677token, - _foreignDailyLimitForeignMaxPerTxArray, - _owner, - _feeManager, - _homeFeeForeignFeeArray, - _decimalShift - ); - setInitialize(); + emit RequiredBlockConfirmationChanged(_requiredBlockConfirmations); + emit GasPriceChanged(_homeGasPrice); + setInitialize(); return isInitialized(); } - function _rewardableInitialize( + function rewardableInitialize( address _validatorContract, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // absolute: [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // relative: [ 0 = _targetLimit, 1 = _threshold, 2 = _maxPerTx, 3 = _minPerTx ] + uint256[] _requestLimitsArray, uint256 _homeGasPrice, uint256 _requiredBlockConfirmations, address _erc677token, - uint256[] _foreignDailyLimitForeignMaxPerTxArray, // [ 0 = _foreignDailyLimit, 1 = _foreignMaxPerTx ] + uint256[] _executionLimitsArray, // [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx, 2 = _executionMinPerTx ] address _owner, address _feeManager, uint256[] _homeFeeForeignFeeArray, // [ 0 = _homeFee, 1 = _foreignFee ] - uint256 _decimalShift - ) internal { - _initialize( - _validatorContract, - _dailyLimitMaxPerTxMinPerTxArray, - _homeGasPrice, - _requiredBlockConfirmations, - _erc677token, - _foreignDailyLimitForeignMaxPerTxArray, - _owner, - _decimalShift - ); + uint256 _decimalShift, + address _limitsContract + ) public returns (bool) { require(AddressUtils.isContract(_feeManager)); addressStorage[FEE_MANAGER_CONTRACT] = _feeManager; _setFee(_feeManager, _homeFeeForeignFeeArray[0], HOME_FEE); _setFee(_feeManager, _homeFeeForeignFeeArray[1], FOREIGN_FEE); - } - - function _initialize( - address _validatorContract, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] - uint256 _homeGasPrice, - uint256 _requiredBlockConfirmations, - address _erc677token, - uint256[] _foreignDailyLimitForeignMaxPerTxArray, // [ 0 = _foreignDailyLimit, 1 = _foreignMaxPerTx ] - address _owner, - uint256 _decimalShift - ) internal { - require(!isInitialized()); - require(AddressUtils.isContract(_validatorContract)); - require(_requiredBlockConfirmations > 0); - require( - _dailyLimitMaxPerTxMinPerTxArray[2] > 0 && // _minPerTx > 0 - _dailyLimitMaxPerTxMinPerTxArray[1] > _dailyLimitMaxPerTxMinPerTxArray[2] && // _maxPerTx > _minPerTx - _dailyLimitMaxPerTxMinPerTxArray[0] > _dailyLimitMaxPerTxMinPerTxArray[1] // _dailyLimit > _maxPerTx - ); - require(_foreignDailyLimitForeignMaxPerTxArray[1] < _foreignDailyLimitForeignMaxPerTxArray[0]); // _foreignMaxPerTx < _foreignDailyLimit - require(_owner != address(0)); - addressStorage[VALIDATOR_CONTRACT] = _validatorContract; - uintStorage[DEPLOYED_AT_BLOCK] = block.number; - uintStorage[DAILY_LIMIT] = _dailyLimitMaxPerTxMinPerTxArray[0]; - uintStorage[MAX_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[1]; - uintStorage[MIN_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[2]; - uintStorage[GAS_PRICE] = _homeGasPrice; - uintStorage[REQUIRED_BLOCK_CONFIRMATIONS] = _requiredBlockConfirmations; - uintStorage[EXECUTION_DAILY_LIMIT] = _foreignDailyLimitForeignMaxPerTxArray[0]; - uintStorage[EXECUTION_MAX_PER_TX] = _foreignDailyLimitForeignMaxPerTxArray[1]; - uintStorage[DECIMAL_SHIFT] = _decimalShift; - setOwner(_owner); - setErc677token(_erc677token); - emit RequiredBlockConfirmationChanged(_requiredBlockConfirmations); - emit GasPriceChanged(_homeGasPrice); - emit DailyLimitChanged(_dailyLimitMaxPerTxMinPerTxArray[0]); - emit ExecutionDailyLimitChanged(_foreignDailyLimitForeignMaxPerTxArray[0]); + return + initialize( + _validatorContract, + _requestLimitsArray, + _homeGasPrice, + _requiredBlockConfirmations, + _erc677token, + _executionLimitsArray, + _owner, + _decimalShift, + _limitsContract + ); } function claimTokensFromErc677(address _token, address _to) external onlyIfUpgradeabilityOwner { @@ -145,7 +94,7 @@ contract HomeBridgeErcToErc is } function onExecuteAffirmation(address _recipient, uint256 _value, bytes32 txHash) internal returns (bool) { - setTotalExecutedPerDay(getCurrentDay(), totalExecutedPerDay(getCurrentDay()).add(_value)); + _increaseTotalExecutedPerDay(_value); uint256 valueToMint = _value.mul(10**decimalShift()); address feeManager = feeManagerContract(); if (feeManager != address(0)) { @@ -188,4 +137,8 @@ contract HomeBridgeErcToErc is setTxAboveLimits(_recipient, _value, _txHash); emit AmountLimitExceeded(_recipient, _value, _txHash); } + + function _getTokenBalance() internal view returns (uint256) { + return erc677token().totalSupply(); + } } diff --git a/contracts/upgradeable_contracts/erc20_to_erc20/HomeBridgeErcToErcPOSDAO.sol b/contracts/upgradeable_contracts/erc20_to_erc20/HomeBridgeErcToErcPOSDAO.sol index cf90e8746..9438763ff 100644 --- a/contracts/upgradeable_contracts/erc20_to_erc20/HomeBridgeErcToErcPOSDAO.sol +++ b/contracts/upgradeable_contracts/erc20_to_erc20/HomeBridgeErcToErcPOSDAO.sol @@ -8,33 +8,35 @@ contract HomeBridgeErcToErcPOSDAO is HomeBridgeErcToErc { function rewardableInitialize( address _validatorContract, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // absolute: [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // relative: [ 0 = _targetLimit, 1 = _threshold, 2 = _maxPerTx, 3 = _minPerTx ] + uint256[] _requestLimitsArray, uint256 _homeGasPrice, uint256 _requiredBlockConfirmations, address _erc677token, - uint256[] _foreignDailyLimitForeignMaxPerTxArray, // [ 0 = _foreignDailyLimit, 1 = _foreignMaxPerTx ] + uint256[] _executionLimitsArray, // [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx, 2 = _executionMinPerTx ] address _owner, address _feeManager, uint256[] _homeFeeForeignFeeArray, // [ 0 = _homeFee, 1 = _foreignFee ] address _blockReward, - uint256 _decimalShift - ) external onlyRelevantSender returns (bool) { - _rewardableInitialize( - _validatorContract, - _dailyLimitMaxPerTxMinPerTxArray, - _homeGasPrice, - _requiredBlockConfirmations, - _erc677token, - _foreignDailyLimitForeignMaxPerTxArray, - _owner, - _feeManager, - _homeFeeForeignFeeArray, - _decimalShift - ); + uint256 _decimalShift, + address _limitsContract + ) public onlyRelevantSender returns (bool) { _setBlockRewardContract(_feeManager, _blockReward); - setInitialize(); - - return isInitialized(); + return + super.rewardableInitialize( + _validatorContract, + _requestLimitsArray, + _homeGasPrice, + _requiredBlockConfirmations, + _erc677token, + _executionLimitsArray, + _owner, + _feeManager, + _homeFeeForeignFeeArray, + _decimalShift, + _limitsContract + ); } function blockRewardContract() public view returns (address) { diff --git a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol index 0341d2889..99e7faec0 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol @@ -16,45 +16,39 @@ contract ForeignBridgeErcToNative is BasicForeignBridge, ERC20Bridge, OtherSideB address _erc20token, uint256 _requiredBlockConfirmations, uint256 _gasPrice, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] - uint256[] _homeDailyLimitHomeMaxPerTxArray, //[ 0 = _homeDailyLimit, 1 = _homeMaxPerTx ] + // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + uint256[] _requestLimitsArray, + // absolute: [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx, 2 = _executionMinPerTx ] + // relative: [ 0 = _targetLimit, 1 = _threshold, 2 = _executionMaxPerTx, 3 = _executionMinPerTx ] + uint256[] _executionLimitsArray, address _owner, uint256 _decimalShift, - address _bridgeOnOtherSide + address _bridgeOnOtherSide, + address _limitsContract ) external onlyRelevantSender returns (bool) { require(!isInitialized()); require(AddressUtils.isContract(_validatorContract)); require(_requiredBlockConfirmations != 0); require(_gasPrice > 0); - require( - _dailyLimitMaxPerTxMinPerTxArray[2] > 0 && // _minPerTx > 0 - _dailyLimitMaxPerTxMinPerTxArray[1] > _dailyLimitMaxPerTxMinPerTxArray[2] && // _maxPerTx > _minPerTx - _dailyLimitMaxPerTxMinPerTxArray[0] > _dailyLimitMaxPerTxMinPerTxArray[1] // _dailyLimit > _maxPerTx - ); - require(_homeDailyLimitHomeMaxPerTxArray[1] < _homeDailyLimitHomeMaxPerTxArray[0]); // _homeMaxPerTx < _homeDailyLimit require(_owner != address(0)); require(_bridgeOnOtherSide != address(0)); + require(AddressUtils.isContract(_limitsContract)); addressStorage[VALIDATOR_CONTRACT] = _validatorContract; setErc20token(_erc20token); uintStorage[DEPLOYED_AT_BLOCK] = block.number; uintStorage[REQUIRED_BLOCK_CONFIRMATIONS] = _requiredBlockConfirmations; uintStorage[GAS_PRICE] = _gasPrice; - uintStorage[DAILY_LIMIT] = _dailyLimitMaxPerTxMinPerTxArray[0]; - uintStorage[MAX_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[1]; - uintStorage[MIN_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[2]; - uintStorage[EXECUTION_DAILY_LIMIT] = _homeDailyLimitHomeMaxPerTxArray[0]; - uintStorage[EXECUTION_MAX_PER_TX] = _homeDailyLimitHomeMaxPerTxArray[1]; uintStorage[DECIMAL_SHIFT] = _decimalShift; setOwner(_owner); _setBridgeContractOnOtherSide(_bridgeOnOtherSide); - setInitialize(); + addressStorage[LIMITS_CONTRACT] = _limitsContract; + _setLimits(_requestLimitsArray, _executionLimitsArray); emit RequiredBlockConfirmationChanged(_requiredBlockConfirmations); emit GasPriceChanged(_gasPrice); - emit DailyLimitChanged(_dailyLimitMaxPerTxMinPerTxArray[0]); - emit ExecutionDailyLimitChanged(_homeDailyLimitHomeMaxPerTxArray[0]); + setInitialize(); return isInitialized(); } @@ -77,7 +71,7 @@ contract ForeignBridgeErcToNative is BasicForeignBridge, ERC20Bridge, OtherSideB uint256 _amount, bytes32 /*_txHash*/ ) internal returns (bool) { - setTotalExecutedPerDay(getCurrentDay(), totalExecutedPerDay(getCurrentDay()).add(_amount)); + _increaseTotalExecutedPerDay(_amount); uint256 amount = _amount.div(10**decimalShift()); bool res = erc20token().transfer(_recipient, amount); @@ -185,6 +179,7 @@ contract ForeignBridgeErcToNative is BasicForeignBridge, ERC20Bridge, OtherSideB require(_receiver != address(0)); require(_receiver != address(this)); require(_amount > 0); + _updateTodayLimit(); require(withinLimit(_amount)); ERC20 tokenToOperate = ERC20(_token); @@ -197,7 +192,7 @@ contract ForeignBridgeErcToNative is BasicForeignBridge, ERC20Bridge, OtherSideB require(tokenToOperate == fdToken || tokenToOperate == hdToken); - setTotalSpentPerDay(getCurrentDay(), totalSpentPerDay(getCurrentDay()).add(_amount)); + _increaseTotalSpentPerDay(_amount); tokenToOperate.transferFrom(_sender, address(this), _amount); emit UserRequestForAffirmation(_receiver, _amount); @@ -206,4 +201,8 @@ contract ForeignBridgeErcToNative is BasicForeignBridge, ERC20Bridge, OtherSideB swapTokens(); } } + + function _getTokenBalance() internal view returns (uint256) { + return erc20token().balanceOf(address(this)); + } } diff --git a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol index 180ba37d0..57c4a6964 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol @@ -24,12 +24,13 @@ contract HomeBridgeErcToNative is function nativeTransfer(address _receiver) internal { require(msg.value > 0); + _updateTodayLimit(); require(withinLimit(msg.value)); IBlockReward blockReward = blockRewardContract(); uint256 totalMinted = blockReward.mintedTotallyByBridge(address(this)); uint256 totalBurnt = totalBurntCoins(); require(msg.value <= totalMinted.sub(totalBurnt)); - setTotalSpentPerDay(getCurrentDay(), totalSpentPerDay(getCurrentDay()).add(msg.value)); + _increaseTotalSpentPerDay(msg.value); uint256 valueToTransfer = msg.value; address feeManager = feeManagerContract(); uint256 valueToBurn = msg.value; @@ -49,58 +50,72 @@ contract HomeBridgeErcToNative is function initialize( address _validatorContract, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // absolute: [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // relative: [ 0 = _targetLimit, 1 = _threshold, 2 = _maxPerTx, 3 = _minPerTx ] + uint256[] _requestLimitsArray, uint256 _homeGasPrice, uint256 _requiredBlockConfirmations, address _blockReward, - uint256[] _foreignDailyLimitForeignMaxPerTxArray, // [ 0 = _foreignDailyLimit, 1 = _foreignMaxPerTx ] + uint256[] _executionLimitsArray, // [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx, 2 = _executionMinPerTx ] address _owner, - uint256 _decimalShift - ) external onlyRelevantSender returns (bool) { - _initialize( - _validatorContract, - _dailyLimitMaxPerTxMinPerTxArray, - _homeGasPrice, - _requiredBlockConfirmations, - _blockReward, - _foreignDailyLimitForeignMaxPerTxArray, - _owner, - _decimalShift - ); - setInitialize(); + uint256 _decimalShift, + address _limitsContract + ) public onlyRelevantSender returns (bool) { + require(!isInitialized()); + require(AddressUtils.isContract(_validatorContract)); + require(_requiredBlockConfirmations > 0); + require(_blockReward == address(0) || AddressUtils.isContract(_blockReward)); + require(_owner != address(0)); + require(AddressUtils.isContract(_limitsContract)); + + addressStorage[VALIDATOR_CONTRACT] = _validatorContract; + uintStorage[DEPLOYED_AT_BLOCK] = block.number; + uintStorage[GAS_PRICE] = _homeGasPrice; + uintStorage[REQUIRED_BLOCK_CONFIRMATIONS] = _requiredBlockConfirmations; + addressStorage[BLOCK_REWARD_CONTRACT] = _blockReward; + uintStorage[DECIMAL_SHIFT] = _decimalShift; + setOwner(_owner); + addressStorage[LIMITS_CONTRACT] = _limitsContract; + _setLimits(_requestLimitsArray, _executionLimitsArray); + + emit RequiredBlockConfirmationChanged(_requiredBlockConfirmations); + emit GasPriceChanged(_homeGasPrice); + setInitialize(); return isInitialized(); } function rewardableInitialize( address _validatorContract, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // absolute: [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // relative: [ 0 = _targetLimit, 1 = _threshold, 2 = _maxPerTx, 3 = _minPerTx ] + uint256[] _requestLimitsArray, uint256 _homeGasPrice, uint256 _requiredBlockConfirmations, address _blockReward, - uint256[] _foreignDailyLimitForeignMaxPerTxArray, // [ 0 = _foreignDailyLimit, 1 = _foreignMaxPerTx ] + uint256[] _executionLimitsArray, // [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx, 2 = _executionMinPerTx ] address _owner, address _feeManager, uint256[] _homeFeeForeignFeeArray, // [ 0 = _homeFee, 1 = _foreignFee ] - uint256 _decimalShift - ) external onlyRelevantSender returns (bool) { - _initialize( - _validatorContract, - _dailyLimitMaxPerTxMinPerTxArray, - _homeGasPrice, - _requiredBlockConfirmations, - _blockReward, - _foreignDailyLimitForeignMaxPerTxArray, - _owner, - _decimalShift - ); + uint256 _decimalShift, + address _limitsContract + ) external returns (bool) { require(AddressUtils.isContract(_feeManager)); addressStorage[FEE_MANAGER_CONTRACT] = _feeManager; _setFee(_feeManager, _homeFeeForeignFeeArray[0], HOME_FEE); _setFee(_feeManager, _homeFeeForeignFeeArray[1], FOREIGN_FEE); - setInitialize(); - - return isInitialized(); + return + initialize( + _validatorContract, + _requestLimitsArray, + _homeGasPrice, + _requiredBlockConfirmations, + _blockReward, + _executionLimitsArray, + _owner, + _decimalShift, + _limitsContract + ); } function getBridgeMode() external pure returns (bytes4 _data) { @@ -119,49 +134,8 @@ contract HomeBridgeErcToNative is _setBlockRewardContract(_blockReward); } - function _initialize( - address _validatorContract, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] - uint256 _homeGasPrice, - uint256 _requiredBlockConfirmations, - address _blockReward, - uint256[] _foreignDailyLimitForeignMaxPerTxArray, // [ 0 = _foreignDailyLimit, 1 = _foreignMaxPerTx ] - address _owner, - uint256 _decimalShift - ) internal { - require(!isInitialized()); - require(AddressUtils.isContract(_validatorContract)); - require(_requiredBlockConfirmations > 0); - require( - _dailyLimitMaxPerTxMinPerTxArray[2] > 0 && // _minPerTx > 0 - _dailyLimitMaxPerTxMinPerTxArray[1] > _dailyLimitMaxPerTxMinPerTxArray[2] && // _maxPerTx > _minPerTx - _dailyLimitMaxPerTxMinPerTxArray[0] > _dailyLimitMaxPerTxMinPerTxArray[1] // _dailyLimit > _maxPerTx - ); - require(_blockReward == address(0) || AddressUtils.isContract(_blockReward)); - require(_foreignDailyLimitForeignMaxPerTxArray[1] < _foreignDailyLimitForeignMaxPerTxArray[0]); // _foreignMaxPerTx < _foreignDailyLimit - require(_owner != address(0)); - - addressStorage[VALIDATOR_CONTRACT] = _validatorContract; - uintStorage[DEPLOYED_AT_BLOCK] = block.number; - uintStorage[DAILY_LIMIT] = _dailyLimitMaxPerTxMinPerTxArray[0]; - uintStorage[MAX_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[1]; - uintStorage[MIN_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[2]; - uintStorage[GAS_PRICE] = _homeGasPrice; - uintStorage[REQUIRED_BLOCK_CONFIRMATIONS] = _requiredBlockConfirmations; - addressStorage[BLOCK_REWARD_CONTRACT] = _blockReward; - uintStorage[EXECUTION_DAILY_LIMIT] = _foreignDailyLimitForeignMaxPerTxArray[0]; - uintStorage[EXECUTION_MAX_PER_TX] = _foreignDailyLimitForeignMaxPerTxArray[1]; - uintStorage[DECIMAL_SHIFT] = _decimalShift; - setOwner(_owner); - - emit RequiredBlockConfirmationChanged(_requiredBlockConfirmations); - emit GasPriceChanged(_homeGasPrice); - emit DailyLimitChanged(_dailyLimitMaxPerTxMinPerTxArray[0]); - emit ExecutionDailyLimitChanged(_foreignDailyLimitForeignMaxPerTxArray[0]); - } - function onExecuteAffirmation(address _recipient, uint256 _value, bytes32 txHash) internal returns (bool) { - setTotalExecutedPerDay(getCurrentDay(), totalExecutedPerDay(getCurrentDay()).add(_value)); + _increaseTotalExecutedPerDay(_value); IBlockReward blockReward = blockRewardContract(); require(blockReward != address(0)); uint256 valueToMint = _value.mul(10**decimalShift()); @@ -201,4 +175,10 @@ contract HomeBridgeErcToNative is setTxAboveLimits(_recipient, _value, _txHash); emit AmountLimitExceeded(_recipient, _value, _txHash); } + + function _getTokenBalance() internal view returns (uint256) { + uint256 totalMinted = blockRewardContract().mintedTotallyByBridge(address(this)); + uint256 totalBurnt = totalBurntCoins(); + return totalMinted.sub(totalBurnt); + } } diff --git a/contracts/upgradeable_contracts/native_to_erc20/ClassicHomeBridgeNativeToErc.sol b/contracts/upgradeable_contracts/native_to_erc20/ClassicHomeBridgeNativeToErc.sol index 74ec8e291..eeef2a6ad 100644 --- a/contracts/upgradeable_contracts/native_to_erc20/ClassicHomeBridgeNativeToErc.sol +++ b/contracts/upgradeable_contracts/native_to_erc20/ClassicHomeBridgeNativeToErc.sol @@ -5,22 +5,12 @@ import "./HomeBridgeNativeToErc.sol"; contract ClassicHomeBridgeNativeToErc is HomeBridgeNativeToErc { function _initialize( address _validatorContract, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] uint256 _homeGasPrice, uint256 _requiredBlockConfirmations, - uint256[] _foreignDailyLimitForeignMaxPerTxArray, // [ 0 = _foreignDailyLimit, 1 = _foreignMaxPerTx ] address _owner, uint256 _decimalShift ) internal { - super._initialize( - _validatorContract, - _dailyLimitMaxPerTxMinPerTxArray, - _homeGasPrice, - _requiredBlockConfirmations, - _foreignDailyLimitForeignMaxPerTxArray, - _owner, - _decimalShift - ); + super._initialize(_validatorContract, _homeGasPrice, _requiredBlockConfirmations, _owner, _decimalShift); uintStorage[0x5e16d82565fc7ee8775cc18db290ff4010745d3fd46274a7bc7ddbebb727fa54] = 132; // keccak256(abi.encodePacked("dataSizes", bytes4(keccak256("signature(bytes32,uint256)")))) uintStorage[0x3b0a1ac531be1657049cf649eca2510ce9e3ef7df1be26d5c248fe8b298f4374] = 210; // keccak256(abi.encodePacked("dataSizes", bytes4(keccak256("message(bytes32)")))) } diff --git a/contracts/upgradeable_contracts/native_to_erc20/ForeignBridgeNativeToErc.sol b/contracts/upgradeable_contracts/native_to_erc20/ForeignBridgeNativeToErc.sol index ec3ce548e..b69600ff8 100644 --- a/contracts/upgradeable_contracts/native_to_erc20/ForeignBridgeNativeToErc.sol +++ b/contracts/upgradeable_contracts/native_to_erc20/ForeignBridgeNativeToErc.sol @@ -14,25 +14,38 @@ contract ForeignBridgeNativeToErc is function initialize( address _validatorContract, address _erc677token, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // absolute: [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // relative: [ 0 = _targetLimit, 1 = threshold, 2 = _maxPerTx, 3 = _minPerTx ] + uint256[] _requestLimitsArray, uint256 _foreignGasPrice, uint256 _requiredBlockConfirmations, - uint256[] _homeDailyLimitHomeMaxPerTxArray, // [ 0 = _homeDailyLimit, 1 = _homeMaxPerTx ] + uint256[] _executionLimitsArray, // [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx, 2 = _executionMinPerTx ] address _owner, uint256 _decimalShift, - address _bridgeOnOtherSide - ) external onlyRelevantSender returns (bool) { - _initialize( - _validatorContract, - _erc677token, - _dailyLimitMaxPerTxMinPerTxArray, - _foreignGasPrice, - _requiredBlockConfirmations, - _homeDailyLimitHomeMaxPerTxArray, - _owner, - _decimalShift, - _bridgeOnOtherSide - ); + address _bridgeOnOtherSide, + address _limitsContract + ) public onlyRelevantSender returns (bool) { + require(!isInitialized()); + require(AddressUtils.isContract(_validatorContract)); + require(_requiredBlockConfirmations > 0); + require(_foreignGasPrice > 0); + require(_owner != address(0)); + require(AddressUtils.isContract(_limitsContract)); + + addressStorage[VALIDATOR_CONTRACT] = _validatorContract; + setErc677token(_erc677token); + uintStorage[DEPLOYED_AT_BLOCK] = block.number; + uintStorage[GAS_PRICE] = _foreignGasPrice; + uintStorage[REQUIRED_BLOCK_CONFIRMATIONS] = _requiredBlockConfirmations; + uintStorage[DECIMAL_SHIFT] = _decimalShift; + setOwner(_owner); + _setBridgeContractOnOtherSide(_bridgeOnOtherSide); + addressStorage[LIMITS_CONTRACT] = _limitsContract; + _setLimits(_requestLimitsArray, _executionLimitsArray); + + emit RequiredBlockConfirmationChanged(_requiredBlockConfirmations); + emit GasPriceChanged(_foreignGasPrice); + setInitialize(); return isInitialized(); } @@ -40,32 +53,35 @@ contract ForeignBridgeNativeToErc is function rewardableInitialize( address _validatorContract, address _erc677token, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // absolute: [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + // relative: [ 0 = _targetLimit, 1 = threshold, 2 = _maxPerTx, 3 = _minPerTx ] + uint256[] _requestLimitsArray, uint256 _foreignGasPrice, uint256 _requiredBlockConfirmations, - uint256[] _homeDailyLimitHomeMaxPerTxArray, // [ 0 = _homeDailyLimit, 1 = _homeMaxPerTx ] + uint256[] _executionLimitsArray, // [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx, 2 = _executionMinPerTx ] address _owner, address _feeManager, uint256 _homeFee, uint256 _decimalShift, - address _bridgeOnOtherSide - ) external onlyRelevantSender returns (bool) { - _initialize( - _validatorContract, - _erc677token, - _dailyLimitMaxPerTxMinPerTxArray, - _foreignGasPrice, - _requiredBlockConfirmations, - _homeDailyLimitHomeMaxPerTxArray, - _owner, - _decimalShift, - _bridgeOnOtherSide - ); + address _bridgeOnOtherSide, + address _limitsContract + ) external returns (bool) { require(AddressUtils.isContract(_feeManager)); addressStorage[FEE_MANAGER_CONTRACT] = _feeManager; _setFee(_feeManager, _homeFee, HOME_FEE); - setInitialize(); - return isInitialized(); + return + initialize( + _validatorContract, + _erc677token, + _requestLimitsArray, + _foreignGasPrice, + _requiredBlockConfirmations, + _executionLimitsArray, + _owner, + _decimalShift, + _bridgeOnOtherSide, + _limitsContract + ); } function getBridgeMode() external pure returns (bytes4 _data) { @@ -76,51 +92,8 @@ contract ForeignBridgeNativeToErc is IBurnableMintableERC677Token(erc677token()).claimTokens(_token, _to); } - function _initialize( - address _validatorContract, - address _erc677token, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] - uint256 _foreignGasPrice, - uint256 _requiredBlockConfirmations, - uint256[] _homeDailyLimitHomeMaxPerTxArray, // [ 0 = _homeDailyLimit, 1 = _homeMaxPerTx ] - address _owner, - uint256 _decimalShift, - address _bridgeOnOtherSide - ) internal { - require(!isInitialized()); - require(AddressUtils.isContract(_validatorContract)); - require( - _dailyLimitMaxPerTxMinPerTxArray[2] > 0 && // _minPerTx > 0 - _dailyLimitMaxPerTxMinPerTxArray[1] > _dailyLimitMaxPerTxMinPerTxArray[2] && // _maxPerTx > _minPerTx - _dailyLimitMaxPerTxMinPerTxArray[0] > _dailyLimitMaxPerTxMinPerTxArray[1] // _dailyLimit > _maxPerTx - ); - require(_requiredBlockConfirmations > 0); - require(_foreignGasPrice > 0); - require(_homeDailyLimitHomeMaxPerTxArray[1] < _homeDailyLimitHomeMaxPerTxArray[0]); // _homeMaxPerTx < _homeDailyLimit - require(_owner != address(0)); - - addressStorage[VALIDATOR_CONTRACT] = _validatorContract; - setErc677token(_erc677token); - uintStorage[DAILY_LIMIT] = _dailyLimitMaxPerTxMinPerTxArray[0]; - uintStorage[DEPLOYED_AT_BLOCK] = block.number; - uintStorage[MAX_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[1]; - uintStorage[MIN_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[2]; - uintStorage[GAS_PRICE] = _foreignGasPrice; - uintStorage[REQUIRED_BLOCK_CONFIRMATIONS] = _requiredBlockConfirmations; - uintStorage[EXECUTION_DAILY_LIMIT] = _homeDailyLimitHomeMaxPerTxArray[0]; - uintStorage[EXECUTION_MAX_PER_TX] = _homeDailyLimitHomeMaxPerTxArray[1]; - uintStorage[DECIMAL_SHIFT] = _decimalShift; - setOwner(_owner); - _setBridgeContractOnOtherSide(_bridgeOnOtherSide); - - emit RequiredBlockConfirmationChanged(_requiredBlockConfirmations); - emit GasPriceChanged(_foreignGasPrice); - emit DailyLimitChanged(_dailyLimitMaxPerTxMinPerTxArray[0]); - emit ExecutionDailyLimitChanged(_homeDailyLimitHomeMaxPerTxArray[0]); - } - function onExecuteMessage(address _recipient, uint256 _amount, bytes32 _txHash) internal returns (bool) { - setTotalExecutedPerDay(getCurrentDay(), totalExecutedPerDay(getCurrentDay()).add(_amount)); + _increaseTotalExecutedPerDay(_amount); uint256 valueToMint = _amount.div(10**decimalShift()); address feeManager = feeManagerContract(); if (feeManager != address(0)) { @@ -140,4 +113,8 @@ contract ForeignBridgeNativeToErc is function onFailedMessage(address, uint256, bytes32) internal { revert(); } + + function _getTokenBalance() internal view returns (uint256) { + return erc677token().totalSupply(); + } } diff --git a/contracts/upgradeable_contracts/native_to_erc20/HomeBridgeNativeToErc.sol b/contracts/upgradeable_contracts/native_to_erc20/HomeBridgeNativeToErc.sol index 783a0b1d8..a8a96f044 100644 --- a/contracts/upgradeable_contracts/native_to_erc20/HomeBridgeNativeToErc.sol +++ b/contracts/upgradeable_contracts/native_to_erc20/HomeBridgeNativeToErc.sol @@ -14,8 +14,9 @@ contract HomeBridgeNativeToErc is EternalStorage, BasicHomeBridge, RewardableHom function nativeTransfer(address _receiver) internal { require(msg.value > 0); + _updateTodayLimit(); require(withinLimit(msg.value)); - setTotalSpentPerDay(getCurrentDay(), totalSpentPerDay(getCurrentDay()).add(msg.value)); + _increaseTotalSpentPerDay(msg.value); uint256 valueToTransfer = msg.value; address feeManager = feeManagerContract(); if (feeManager != address(0)) { @@ -31,52 +32,53 @@ contract HomeBridgeNativeToErc is EternalStorage, BasicHomeBridge, RewardableHom function initialize( address _validatorContract, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + uint256[] _requestLimitsArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] uint256 _homeGasPrice, uint256 _requiredBlockConfirmations, - uint256[] _foreignDailyLimitForeignMaxPerTxArray, // [ 0 = _foreignDailyLimit, 1 = _foreignMaxPerTx ] + // absolute: [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx, 2 = _executionMinPerTx ] + // relative: [ 0 = _targetLimit, 1 = _threshold, 2 = _executionMaxPerTx, 3 = _executionMinPerTx ] + uint256[] _executionLimitsArray, address _owner, - uint256 _decimalShift - ) external onlyRelevantSender returns (bool) { - _initialize( - _validatorContract, - _dailyLimitMaxPerTxMinPerTxArray, - _homeGasPrice, - _requiredBlockConfirmations, - _foreignDailyLimitForeignMaxPerTxArray, - _owner, - _decimalShift - ); + uint256 _decimalShift, + address _limitsContract + ) public onlyRelevantSender returns (bool) { + require(AddressUtils.isContract(_limitsContract)); + addressStorage[LIMITS_CONTRACT] = _limitsContract; + _setLimits(_requestLimitsArray, _executionLimitsArray); + _initialize(_validatorContract, _homeGasPrice, _requiredBlockConfirmations, _owner, _decimalShift); setInitialize(); return isInitialized(); } function rewardableInitialize( address _validatorContract, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + uint256[] _requestLimitsArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] uint256 _homeGasPrice, uint256 _requiredBlockConfirmations, - uint256[] _foreignDailyLimitForeignMaxPerTxArray, // [ 0 = _foreignDailyLimit, 1 = _foreignMaxPerTx ] + // absolute: [ 0 = _executionDailyLimit, 1 = _executionMaxPerTx, 2 = _executionMinPerTx ] + // relative: [ 0 = _targetLimit, 1 = _threshold, 2 = _executionMaxPerTx, 3 = _executionMinPerTx ] + uint256[] _executionLimitsArray, address _owner, address _feeManager, uint256[] _homeFeeForeignFeeArray, // [ 0 = _homeFee, 1 = _foreignFee ] - uint256 _decimalShift - ) external onlyRelevantSender returns (bool) { - _initialize( - _validatorContract, - _dailyLimitMaxPerTxMinPerTxArray, - _homeGasPrice, - _requiredBlockConfirmations, - _foreignDailyLimitForeignMaxPerTxArray, - _owner, - _decimalShift - ); + uint256 _decimalShift, + address _limitsContract + ) external returns (bool) { require(AddressUtils.isContract(_feeManager)); addressStorage[FEE_MANAGER_CONTRACT] = _feeManager; _setFee(_feeManager, _homeFeeForeignFeeArray[0], HOME_FEE); _setFee(_feeManager, _homeFeeForeignFeeArray[1], FOREIGN_FEE); - setInitialize(); - return isInitialized(); + return + initialize( + _validatorContract, + _requestLimitsArray, + _homeGasPrice, + _requiredBlockConfirmations, + _executionLimitsArray, + _owner, + _decimalShift, + _limitsContract + ); } function getBridgeMode() external pure returns (bytes4 _data) { @@ -85,10 +87,8 @@ contract HomeBridgeNativeToErc is EternalStorage, BasicHomeBridge, RewardableHom function _initialize( address _validatorContract, - uint256[] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] uint256 _homeGasPrice, uint256 _requiredBlockConfirmations, - uint256[] _foreignDailyLimitForeignMaxPerTxArray, // [ 0 = _foreignDailyLimit, 1 = _foreignMaxPerTx ] address _owner, uint256 _decimalShift ) internal { @@ -96,30 +96,17 @@ contract HomeBridgeNativeToErc is EternalStorage, BasicHomeBridge, RewardableHom require(AddressUtils.isContract(_validatorContract)); require(_homeGasPrice > 0); require(_requiredBlockConfirmations > 0); - require( - _dailyLimitMaxPerTxMinPerTxArray[2] > 0 && // _minPerTx > 0 - _dailyLimitMaxPerTxMinPerTxArray[1] > _dailyLimitMaxPerTxMinPerTxArray[2] && // _maxPerTx > _minPerTx - _dailyLimitMaxPerTxMinPerTxArray[0] > _dailyLimitMaxPerTxMinPerTxArray[1] // _dailyLimit > _maxPerTx - ); - require(_foreignDailyLimitForeignMaxPerTxArray[1] < _foreignDailyLimitForeignMaxPerTxArray[0]); // _foreignMaxPerTx < _foreignDailyLimit require(_owner != address(0)); addressStorage[VALIDATOR_CONTRACT] = _validatorContract; uintStorage[DEPLOYED_AT_BLOCK] = block.number; - uintStorage[DAILY_LIMIT] = _dailyLimitMaxPerTxMinPerTxArray[0]; - uintStorage[MAX_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[1]; - uintStorage[MIN_PER_TX] = _dailyLimitMaxPerTxMinPerTxArray[2]; uintStorage[GAS_PRICE] = _homeGasPrice; uintStorage[REQUIRED_BLOCK_CONFIRMATIONS] = _requiredBlockConfirmations; - uintStorage[EXECUTION_DAILY_LIMIT] = _foreignDailyLimitForeignMaxPerTxArray[0]; - uintStorage[EXECUTION_MAX_PER_TX] = _foreignDailyLimitForeignMaxPerTxArray[1]; uintStorage[DECIMAL_SHIFT] = _decimalShift; setOwner(_owner); emit RequiredBlockConfirmationChanged(_requiredBlockConfirmations); emit GasPriceChanged(_homeGasPrice); - emit DailyLimitChanged(_dailyLimitMaxPerTxMinPerTxArray[0]); - emit ExecutionDailyLimitChanged(_foreignDailyLimitForeignMaxPerTxArray[0]); } function onSignaturesCollected(bytes _message) internal { @@ -138,7 +125,7 @@ contract HomeBridgeNativeToErc is EternalStorage, BasicHomeBridge, RewardableHom } function onExecuteAffirmation(address _recipient, uint256 _value, bytes32 txHash) internal returns (bool) { - setTotalExecutedPerDay(getCurrentDay(), totalExecutedPerDay(getCurrentDay()).add(_value)); + _increaseTotalExecutedPerDay(_value); uint256 valueToTransfer = _value.mul(10**decimalShift()); address feeManager = feeManagerContract(); @@ -161,4 +148,8 @@ contract HomeBridgeNativeToErc is EternalStorage, BasicHomeBridge, RewardableHom ) internal { revert(); } + + function _getTokenBalance() internal view returns (uint256) { + return address(this).balance; + } } diff --git a/deploy/.env.example b/deploy/.env.example index d07bfc0a3..135fc943f 100644 --- a/deploy/.env.example +++ b/deploy/.env.example @@ -58,6 +58,12 @@ FOREIGN_REWARDABLE=false #E.g. VALIDATORS_REWARD_ACCOUNTS=0x 0x 0x VALIDATORS_REWARD_ACCOUNTS=0x +# Relative or absolute daily limit +RELATIVE_DAILY_LIMIT=false +# Fixed percentage of balance after threshold (e.g. 5%) +TARGET_LIMIT=50000000000000000 +THRESHOLD=100000000000000000000000 + # Fee to be taken for every transaction directed from the Home network to the Foreign network # E.g. 0.1% fee HOME_TRANSACTIONS_FEE=0.001 diff --git a/deploy/README.md b/deploy/README.md index 0869a1b5b..fc6a10972 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -148,6 +148,13 @@ FOREIGN_REWARDABLE=false # Makes sense only when HOME_REWARDABLE!=false or FOREIGN_REWARDABLE!=false VALIDATORS_REWARD_ACCOUNTS=0x 0x 0x +# Relative or absolute daily limit. If true then TARGET_LIMIT and THRESHOLD will be used in the calculation +RELATIVE_DAILY_LIMIT=true +# Fixed percentage of balance after threshold (e.g. 5%). Must be less than or equal to 1 ether in wei +TARGET_LIMIT=50000000000000000 +# Must be greater than or equal to MIN_AMOUNT_PER_TX of the side on which relative daily limit is used +THRESHOLD=100000000000000000000000 + # Fee to be taken for every transaction directed from the Home network to the Foreign network # Makes sense only when FOREIGN_REWARDABLE=ONE_DIRECTION or HOME_REWARDABLE=BOTH_DIRECTIONS # e.g. 0.1% fee diff --git a/deploy/deploy.js b/deploy/deploy.js index 1a413dc56..0ddcb4fec 100644 --- a/deploy/deploy.js +++ b/deploy/deploy.js @@ -128,9 +128,16 @@ async function deployAMBErcToErc() { const deployForeign = require('./src/amb_erc677_to_erc677/foreign') const initialize = require('./src/amb_erc677_to_erc677/initialize') await preDeploy() - const { homeBridgeMediator, bridgeableErc677 } = await deployHome() - const { foreignBridgeMediator } = await deployForeign() - await initialize({ homeBridge: homeBridgeMediator.address, foreignBridge: foreignBridgeMediator.address, homeErc677: bridgeableErc677.address }) + const { homeBridgeMediator, bridgeableErc677, homeLimitsContract } = await deployHome() + const { foreignBridgeMediator, foreignLimitsContract } = await deployForeign() + await initialize({ + homeBridge: homeBridgeMediator.address, + foreignBridge: + foreignBridgeMediator.address, + homeErc677: bridgeableErc677.address, + homeLimitsContract: homeLimitsContract.address, + foreignLimitsContract: foreignLimitsContract.address + }) console.log('\nDeployment has been completed.\n\n') console.log(`[ Home ] Bridge Mediator: ${homeBridgeMediator.address}`) console.log(`[ Home ] ERC677 Bridgeable Token: ${bridgeableErc677.address}`) diff --git a/deploy/src/amb_erc677_to_erc677/foreign.js b/deploy/src/amb_erc677_to_erc677/foreign.js index 985c6883b..556b05139 100644 --- a/deploy/src/amb_erc677_to_erc677/foreign.js +++ b/deploy/src/amb_erc677_to_erc677/foreign.js @@ -2,9 +2,17 @@ const Web3Utils = require('web3-utils') const { web3Foreign, FOREIGN_RPC_URL } = require('../web3') const { deployContract, privateKeyToAddress, upgradeProxy } = require('../deploymentUtils') const { - foreignContracts: { EternalStorageProxy, ForeignAMBErc677ToErc677: ForeignBridge } + foreignContracts: { + EternalStorageProxy, + ForeignAMBErc677ToErc677, + AbsoluteDailyLimit, + RelativeExecutionDailyLimit + } } = require('../loadContracts') -const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY } = require('../loadEnv') +const { + DEPLOYMENT_ACCOUNT_PRIVATE_KEY, + RELATIVE_DAILY_LIMIT +} = require('../loadEnv') const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) @@ -21,7 +29,7 @@ async function deployForeign() { console.log('[Foreign] Bridge Mediator Storage: ', foreignBridgeStorage.options.address) console.log('\n[Foreign] Deploying Bridge Mediator implementation\n') - const foreignBridgeImplementation = await deployContract(ForeignBridge, [], { + const foreignBridgeImplementation = await deployContract(ForeignAMBErc677ToErc677, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce @@ -37,10 +45,22 @@ async function deployForeign() { nonce, url: FOREIGN_RPC_URL }) + nonce++ + console.log('\n[Foreign] Hooking up Mediator storage to Mediator implementation - Done') + + console.log('\n[Foreign] Deploying Limits Contracts') + const LimitsContract = RELATIVE_DAILY_LIMIT ? RelativeExecutionDailyLimit : AbsoluteDailyLimit + const limitsContract = await deployContract(LimitsContract, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce + }) + console.log('[Foreign] Limits Contract: ', limitsContract.options.address) console.log('\nForeign part of ERC677-to-ERC677 bridge deployed\n') return { - foreignBridgeMediator: { address: foreignBridgeStorage.options.address } + foreignBridgeMediator: { address: foreignBridgeStorage.options.address }, + foreignLimitsContract: { address: limitsContract.options.address } } } diff --git a/deploy/src/amb_erc677_to_erc677/home.js b/deploy/src/amb_erc677_to_erc677/home.js index be87201cd..aa37e14c7 100644 --- a/deploy/src/amb_erc677_to_erc677/home.js +++ b/deploy/src/amb_erc677_to_erc677/home.js @@ -17,15 +17,18 @@ const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, DEPLOY_REWARDABLE_TOKEN, BLOCK_REWARD_ADDRESS, - DPOS_STAKING_ADDRESS + DPOS_STAKING_ADDRESS, + RELATIVE_DAILY_LIMIT } = require('../loadEnv') const { homeContracts: { EternalStorageProxy, - HomeAMBErc677ToErc677: HomeBridge, + HomeAMBErc677ToErc677, ERC677BridgeToken, - ERC677BridgeTokenRewardable + ERC677BridgeTokenRewardable, + AbsoluteDailyLimit, + RelativeDailyLimit } } = require('../loadContracts') @@ -43,7 +46,7 @@ async function deployHome() { console.log('[Home] Bridge Mediator Storage: ', homeBridgeStorage.options.address) console.log('\n[Home] Deploying Bridge Mediator implementation\n') - const homeBridgeImplementation = await deployContract(HomeBridge, [], { + const homeBridgeImplementation = await deployContract(HomeAMBErc677ToErc677, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, nonce }) @@ -122,11 +125,22 @@ async function deployHome() { nonce, url: HOME_RPC_URL }) + nonce++ + console.log('[Home] Transferring ownership of Bridgeable token to Bridge Mediator contract - Done') + + console.log('\n[Home] Deploying Limits Contract') + const LimitsContract = RELATIVE_DAILY_LIMIT ? RelativeDailyLimit : AbsoluteDailyLimit + const limitsContract = await deployContract(LimitsContract, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce + }) + console.log('[Home] Limits Contract: ', limitsContract.options.address) console.log('\nHome part of ERC677-to-ERC677 bridge deployed\n') return { homeBridgeMediator: { address: homeBridgeStorage.options.address }, - bridgeableErc677: { address: erc677token.options.address } + bridgeableErc677: { address: erc677token.options.address }, + homeLimitsContract: { address: limitsContract.options.address } } } diff --git a/deploy/src/amb_erc677_to_erc677/initialize.js b/deploy/src/amb_erc677_to_erc677/initialize.js index 8a9f5cc81..22baf8f91 100644 --- a/deploy/src/amb_erc677_to_erc677/initialize.js +++ b/deploy/src/amb_erc677_to_erc677/initialize.js @@ -2,8 +2,14 @@ const Web3Utils = require('web3-utils') const assert = require('assert') const { web3Home, HOME_RPC_URL, web3Foreign, FOREIGN_RPC_URL, deploymentPrivateKey } = require('../web3') const { - homeContracts: { EternalStorageProxy, HomeAMBErc677ToErc677 }, - foreignContracts: { EternalStorageProxy: ForeignEternalStorageProxy, ForeignAMBErc677ToErc677 } + homeContracts: { + EternalStorageProxy, + HomeAMBErc677ToErc677 + }, + foreignContracts: { + EternalStorageProxy: ForeignEternalStorageProxy, + ForeignAMBErc677ToErc677 + } } = require('../loadContracts') const { privateKeyToAddress, @@ -30,7 +36,10 @@ const { FOREIGN_MEDIATOR_REQUEST_GAS_LIMIT, ERC20_TOKEN_ADDRESS, DEPLOYMENT_ACCOUNT_PRIVATE_KEY, - FOREIGN_TO_HOME_DECIMAL_SHIFT + FOREIGN_TO_HOME_DECIMAL_SHIFT, + RELATIVE_DAILY_LIMIT, + TARGET_LIMIT, + THRESHOLD } = require('../loadEnv') const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) @@ -50,40 +59,74 @@ async function initialize({ minPerTx, executionDailyLimit, executionMaxPerTx, + executionMinPerTx, requestGasLimit, foreignToHomeDecimalShift, - owner + owner, + limitsContract }, upgradeableAdmin, - sendRawTx + sendRawTx, + isRelativeDailyLimitOnBridgeSide, }) { let nonce = await web3.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS) const contract = new web3.eth.Contract(abi, address) + + let RELATIVE_DAILY_LIMIT_PARAMS + if (RELATIVE_DAILY_LIMIT) { + RELATIVE_DAILY_LIMIT_PARAMS = `TARGET_LIMIT: ${TARGET_LIMIT} which is ${ + Web3Utils.fromWei(Web3Utils.toBN(TARGET_LIMIT).mul(Web3Utils.toBN(100))) + }%, + THRESHOLD: ${THRESHOLD} which is ${Web3Utils.fromWei(THRESHOLD)} in eth,` + } + console.log(` - AMB contract: ${bridgeContract}, - Mediator contract: ${mediatorContract}, + AMB contract: ${bridgeContract}, + Mediator contract: ${mediatorContract}, Token contract: ${erc677token}, - DAILY_LIMIT : ${dailyLimit} which is ${Web3Utils.fromWei(dailyLimit)} in eth, + ${ + RELATIVE_DAILY_LIMIT && isRelativeDailyLimitOnBridgeSide + ? RELATIVE_DAILY_LIMIT_PARAMS + : `DAILY_LIMIT : ${dailyLimit} which is ${Web3Utils.fromWei(dailyLimit)} in eth,` + } MAX_AMOUNT_PER_TX: ${maxPerTx} which is ${Web3Utils.fromWei(maxPerTx)} in eth, MIN_AMOUNT_PER_TX: ${minPerTx} which is ${Web3Utils.fromWei(minPerTx)} in eth, - EXECUTION_DAILY_LIMIT : ${executionDailyLimit} which is ${Web3Utils.fromWei(executionDailyLimit)} in eth, + ${ + RELATIVE_DAILY_LIMIT && !isRelativeDailyLimitOnBridgeSide + ? RELATIVE_DAILY_LIMIT_PARAMS + : `EXECUTION_DAILY_LIMIT : ${executionDailyLimit} which is ${Web3Utils.fromWei(executionDailyLimit)} in eth,` + } EXECUTION_MAX_AMOUNT_PER_TX: ${executionMaxPerTx} which is ${Web3Utils.fromWei(executionMaxPerTx)} in eth, + EXECUTION_MIN_AMOUNT_PER_TX: ${executionMinPerTx} which is ${Web3Utils.fromWei(executionMinPerTx)} in eth, FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift}, - MEDIATOR_REQUEST_GAS_LIMIT : ${requestGasLimit}, - OWNER: ${owner} + MEDIATOR_REQUEST_GAS_LIMIT : ${requestGasLimit}, + OWNER: ${owner}, + LIMITS_CONTRACT: ${limitsContract} `) + let requestLimitsArray = [dailyLimit, maxPerTx, minPerTx] + let executionLimitsArray = [executionDailyLimit, executionMaxPerTx, executionMinPerTx] + + if (RELATIVE_DAILY_LIMIT) { + if (isRelativeDailyLimitOnBridgeSide) { + requestLimitsArray = [TARGET_LIMIT, THRESHOLD, maxPerTx, minPerTx] + } else { + executionLimitsArray = [TARGET_LIMIT, THRESHOLD, executionMaxPerTx, executionMinPerTx] + } + } + const initializeData = await contract.methods .initialize( bridgeContract, mediatorContract, erc677token, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], + requestLimitsArray, + executionLimitsArray, requestGasLimit, foreignToHomeDecimalShift, - owner + owner, + limitsContract ) .encodeABI() const txInitialize = await sendRawTx({ @@ -111,7 +154,13 @@ async function initialize({ }) } -async function initializeBridges({ homeBridge, foreignBridge, homeErc677 }) { +async function initializeBridges({ + homeBridge, + foreignBridge, + homeErc677, + homeLimitsContract, + foreignLimitsContract +}) { const foreignToHomeDecimalShift = FOREIGN_TO_HOME_DECIMAL_SHIFT || 0 console.log('\n[Home] Initializing Bridge Mediator with following parameters:\n') @@ -130,12 +179,15 @@ async function initializeBridges({ homeBridge, foreignBridge, homeErc677 }) { minPerTx: HOME_MIN_AMOUNT_PER_TX, executionDailyLimit: FOREIGN_DAILY_LIMIT, executionMaxPerTx: FOREIGN_MAX_AMOUNT_PER_TX, + executionMinPerTx: FOREIGN_MIN_AMOUNT_PER_TX, requestGasLimit: HOME_MEDIATOR_REQUEST_GAS_LIMIT, foreignToHomeDecimalShift, - owner: HOME_BRIDGE_OWNER + owner: HOME_BRIDGE_OWNER, + limitsContract: homeLimitsContract }, upgradeableAdmin: HOME_UPGRADEABLE_ADMIN, - sendRawTx: sendRawTxHome + sendRawTx: sendRawTxHome, + isRelativeDailyLimitOnBridgeSide: true, }) console.log('\n[Foreign] Initializing Bridge Mediator with following parameters:\n') @@ -154,12 +206,15 @@ async function initializeBridges({ homeBridge, foreignBridge, homeErc677 }) { minPerTx: FOREIGN_MIN_AMOUNT_PER_TX, executionDailyLimit: HOME_DAILY_LIMIT, executionMaxPerTx: HOME_MAX_AMOUNT_PER_TX, + executionMinPerTx: HOME_MIN_AMOUNT_PER_TX, requestGasLimit: FOREIGN_MEDIATOR_REQUEST_GAS_LIMIT, foreignToHomeDecimalShift, - owner: FOREIGN_BRIDGE_OWNER + owner: FOREIGN_BRIDGE_OWNER, + limitsContract: foreignLimitsContract }, upgradeableAdmin: FOREIGN_UPGRADEABLE_ADMIN, - sendRawTx: sendRawTxForeign + sendRawTx: sendRawTxForeign, + isRelativeDailyLimitOnBridgeSide: false, }) } diff --git a/deploy/src/erc_to_erc/foreign.js b/deploy/src/erc_to_erc/foreign.js index d404c4d0f..fdb5a0f1b 100644 --- a/deploy/src/erc_to_erc/foreign.js +++ b/deploy/src/erc_to_erc/foreign.js @@ -16,8 +16,10 @@ const { foreignContracts: { EternalStorageProxy, BridgeValidators, - ForeignBridgeErcToErc: ForeignBridge, - ForeignBridgeErc677ToErc677 + ForeignBridgeErcToErc, + ForeignBridgeErc677ToErc677, + AbsoluteDailyLimit, + RelativeExecutionDailyLimit } } = require('../loadContracts') @@ -35,29 +37,44 @@ const { FOREIGN_MAX_AMOUNT_PER_TX, HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, + HOME_MIN_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX, FOREIGN_DAILY_LIMIT, ERC20_EXTENDED_BY_ERC677, - FOREIGN_TO_HOME_DECIMAL_SHIFT + FOREIGN_TO_HOME_DECIMAL_SHIFT, + RELATIVE_DAILY_LIMIT, + TARGET_LIMIT, + THRESHOLD, } = env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) const foreignToHomeDecimalShift = FOREIGN_TO_HOME_DECIMAL_SHIFT || 0 -async function initializeBridge({ validatorsBridge, bridge, nonce }) { +async function initializeBridge({ validatorsBridge, bridge, limitsContract, nonce }) { console.log(`Foreign Validators: ${validatorsBridge.options.address}, ERC20_TOKEN_ADDRESS: ${ERC20_TOKEN_ADDRESS}, FOREIGN_MAX_AMOUNT_PER_TX: ${FOREIGN_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( FOREIGN_MAX_AMOUNT_PER_TX )} in eth, FOREIGN_GAS_PRICE: ${FOREIGN_GAS_PRICE}, FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS : ${FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS}, - HOME_DAILY_LIMIT: ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, + ${ + RELATIVE_DAILY_LIMIT + ? `TARGET_LIMIT: ${TARGET_LIMIT} which is ${Web3Utils.fromWei(Web3Utils.toBN(TARGET_LIMIT).mul(Web3Utils.toBN(100)))}%, + THRESHOLD: ${THRESHOLD} which is ${Web3Utils.fromWei(THRESHOLD)} in eth,` + : `HOME_DAILY_LIMIT: ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth,` + } HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MAX_AMOUNT_PER_TX)} in eth, + HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MIN_AMOUNT_PER_TX)} in eth, FOREIGN_BRIDGE_OWNER: ${FOREIGN_BRIDGE_OWNER}, - FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift} + FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift}, + LIMITS_CONTRACT: ${limitsContract.options.address} `) + const executionLimitsArray = RELATIVE_DAILY_LIMIT + ? [TARGET_LIMIT, THRESHOLD, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX] + : [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX] + const initializeFBridgeData = await bridge.methods .initialize( validatorsBridge.options.address, @@ -65,9 +82,10 @@ async function initializeBridge({ validatorsBridge, bridge, nonce }) { FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS, FOREIGN_GAS_PRICE, [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX], - [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX], + executionLimitsArray, FOREIGN_BRIDGE_OWNER, - foreignToHomeDecimalShift + foreignToHomeDecimalShift, + limitsContract.options.address ) .encodeABI() @@ -145,6 +163,16 @@ async function deployForeign() { }) nonce++ + console.log('\ndeploying limits contract') + const LimitsContract = RELATIVE_DAILY_LIMIT ? RelativeExecutionDailyLimit : AbsoluteDailyLimit + const limitsContract = await deployContract(LimitsContract, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce + }) + nonce++ + console.log('[Foreign] Limits Contract: ', limitsContract.options.address) + console.log('\ndeploying foreignBridge storage\n') const foreignBridgeStorage = await deployContract(EternalStorageProxy, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, @@ -155,7 +183,7 @@ async function deployForeign() { console.log('[Foreign] ForeignBridge Storage: ', foreignBridgeStorage.options.address) console.log('\ndeploying foreignBridge implementation\n') - const bridgeContract = ERC20_EXTENDED_BY_ERC677 ? ForeignBridgeErc677ToErc677 : ForeignBridge + const bridgeContract = ERC20_EXTENDED_BY_ERC677 ? ForeignBridgeErc677ToErc677 : ForeignBridgeErcToErc const foreignBridgeImplementation = await deployContract(bridgeContract, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', @@ -179,6 +207,7 @@ async function deployForeign() { await initializeBridge({ validatorsBridge: storageValidatorsForeign, bridge: foreignBridgeImplementation, + limitsContract, nonce }) nonce++ diff --git a/deploy/src/erc_to_erc/home.js b/deploy/src/erc_to_erc/home.js index b57ec9117..985274498 100644 --- a/deploy/src/erc_to_erc/home.js +++ b/deploy/src/erc_to_erc/home.js @@ -22,10 +22,12 @@ const { BridgeValidators, RewardableValidators, FeeManagerErcToErcPOSDAO, - HomeBridgeErcToErc: HomeBridge, + HomeBridgeErcToErc, HomeBridgeErcToErcPOSDAO, ERC677BridgeToken, - ERC677BridgeTokenRewardable + ERC677BridgeTokenRewardable, + AbsoluteDailyLimit, + RelativeDailyLimit } } = require('../loadContracts') @@ -47,13 +49,17 @@ const { BRIDGEABLE_TOKEN_DECIMALS, FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, + FOREIGN_MIN_AMOUNT_PER_TX, DEPLOY_REWARDABLE_TOKEN, BLOCK_REWARD_ADDRESS, DPOS_STAKING_ADDRESS, HOME_REWARDABLE, HOME_TRANSACTIONS_FEE, FOREIGN_TRANSACTIONS_FEE, - FOREIGN_TO_HOME_DECIMAL_SHIFT + FOREIGN_TO_HOME_DECIMAL_SHIFT, + RELATIVE_DAILY_LIMIT, + TARGET_LIMIT, + THRESHOLD, } = env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) @@ -68,10 +74,22 @@ if (isRewardableBridge && BLOCK_REWARD_ADDRESS === ZERO_ADDRESS) { VALIDATORS_REWARD_ACCOUNTS = env.VALIDATORS_REWARD_ACCOUNTS.split(' ') } -async function initializeBridge({ validatorsBridge, bridge, erc677token, initialNonce }) { +async function initializeBridge({ validatorsBridge, bridge, erc677token, limitsContract, initialNonce }) { let nonce = initialNonce let initializeHomeBridgeData + const requestLimitsArray = RELATIVE_DAILY_LIMIT + ? [TARGET_LIMIT, THRESHOLD, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX] + : [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX] + + let RELATIVE_DAILY_LIMIT_PARAMS + if (RELATIVE_DAILY_LIMIT) { + RELATIVE_DAILY_LIMIT_PARAMS = `TARGET_LIMIT: ${TARGET_LIMIT} which is ${ + Web3Utils.fromWei(Web3Utils.toBN(TARGET_LIMIT).mul(Web3Utils.toBN(100))) + }%, + THRESHOLD: ${THRESHOLD} which is ${Web3Utils.fromWei(THRESHOLD)} in eth,` + } + if (isRewardableBridge && BLOCK_REWARD_ADDRESS !== ZERO_ADDRESS) { console.log('\ndeploying implementation for fee manager') const feeManager = await deployContract(FeeManagerErcToErcPOSDAO, [], { @@ -85,10 +103,15 @@ async function initializeBridge({ validatorsBridge, bridge, erc677token, initial const foreignFeeInWei = Web3Utils.toWei(FOREIGN_TRANSACTIONS_FEE.toString(), 'ether') console.log('\ninitializing Home Bridge with fee contract:\n') console.log(`Home Validators: ${validatorsBridge.options.address}, - HOME_DAILY_LIMIT : ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, + ${ + RELATIVE_DAILY_LIMIT + ? RELATIVE_DAILY_LIMIT_PARAMS + : `HOME_DAILY_LIMIT : ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth,` + } HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MAX_AMOUNT_PER_TX)} in eth, HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MIN_AMOUNT_PER_TX)} in eth, HOME_GAS_PRICE: ${HOME_GAS_PRICE}, HOME_REQUIRED_BLOCK_CONFIRMATIONS : ${HOME_REQUIRED_BLOCK_CONFIRMATIONS}, + LIMITS_CONTRACT: ${limitsContract.options.address}, Block Reward: ${BLOCK_REWARD_ADDRESS}, Fee Manager: ${feeManager.options.address}, Home Fee: ${homeFeeInWei} which is ${HOME_TRANSACTIONS_FEE * 100}% @@ -96,36 +119,43 @@ async function initializeBridge({ validatorsBridge, bridge, erc677token, initial initializeHomeBridgeData = await bridge.methods .rewardableInitialize( validatorsBridge.options.address, - [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX], + requestLimitsArray, HOME_GAS_PRICE, HOME_REQUIRED_BLOCK_CONFIRMATIONS, erc677token.options.address, - [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX], + [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX], HOME_BRIDGE_OWNER, feeManager.options.address, [homeFeeInWei, foreignFeeInWei], BLOCK_REWARD_ADDRESS, - foreignToHomeDecimalShift + foreignToHomeDecimalShift, + limitsContract.options.address ) .encodeABI() } else { console.log(`Home Validators: ${validatorsBridge.options.address}, - HOME_DAILY_LIMIT : ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, + ${ + RELATIVE_DAILY_LIMIT + ? RELATIVE_DAILY_LIMIT_PARAMS + : `HOME_DAILY_LIMIT : ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth,` + } HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MAX_AMOUNT_PER_TX)} in eth, HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MIN_AMOUNT_PER_TX)} in eth, HOME_GAS_PRICE: ${HOME_GAS_PRICE}, HOME_REQUIRED_BLOCK_CONFIRMATIONS : ${HOME_REQUIRED_BLOCK_CONFIRMATIONS}, - FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift} + FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift}, + LIMITS_CONTRACT: ${limitsContract.options.address} `) initializeHomeBridgeData = await bridge.methods .initialize( validatorsBridge.options.address, - [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX], + requestLimitsArray, HOME_GAS_PRICE, HOME_REQUIRED_BLOCK_CONFIRMATIONS, erc677token.options.address, - [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX], + [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX], HOME_BRIDGE_OWNER, - foreignToHomeDecimalShift + foreignToHomeDecimalShift, + limitsContract.options.address ) .encodeABI() } @@ -200,6 +230,15 @@ async function deployHome() { }) nonce++ + console.log('\ndeploying limits contract') + const LimitsContract = RELATIVE_DAILY_LIMIT ? RelativeDailyLimit : AbsoluteDailyLimit + const limitsContract = await deployContract(LimitsContract, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce + }) + nonce++ + console.log('[Home] Limits Contract: ', limitsContract.options.address) + console.log('\ndeploying homeBridge storage\n') const homeBridgeStorage = await deployContract(EternalStorageProxy, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, @@ -210,7 +249,7 @@ async function deployHome() { console.log('\ndeploying homeBridge implementation\n') const bridgeContract = - isRewardableBridge && BLOCK_REWARD_ADDRESS !== ZERO_ADDRESS ? HomeBridgeErcToErcPOSDAO : HomeBridge + isRewardableBridge && BLOCK_REWARD_ADDRESS !== ZERO_ADDRESS ? HomeBridgeErcToErcPOSDAO : HomeBridgeErcToErc const homeBridgeImplementation = await deployContract(bridgeContract, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, nonce @@ -298,6 +337,7 @@ async function deployHome() { validatorsBridge: storageValidatorsHome, bridge: homeBridgeImplementation, erc677token, + limitsContract, initialNonce: nonce }) diff --git a/deploy/src/erc_to_native/foreign.js b/deploy/src/erc_to_native/foreign.js index 088f6b378..3dd34d147 100644 --- a/deploy/src/erc_to_native/foreign.js +++ b/deploy/src/erc_to_native/foreign.js @@ -13,7 +13,13 @@ const { } = require('../deploymentUtils') const { web3Foreign, deploymentPrivateKey, FOREIGN_RPC_URL } = require('../web3') const { - foreignContracts: { EternalStorageProxy, BridgeValidators, ForeignBridgeErcToNative: ForeignBridge } + foreignContracts: { + EternalStorageProxy, + BridgeValidators, + ForeignBridgeErcToNative, + AbsoluteDailyLimit, + RelativeExecutionDailyLimit + } } = require('../loadContracts') const VALIDATORS = env.VALIDATORS.split(' ') @@ -32,14 +38,18 @@ const { FOREIGN_MIN_AMOUNT_PER_TX, HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, - FOREIGN_TO_HOME_DECIMAL_SHIFT + HOME_MIN_AMOUNT_PER_TX, + FOREIGN_TO_HOME_DECIMAL_SHIFT, + RELATIVE_DAILY_LIMIT, + TARGET_LIMIT, + THRESHOLD, } = env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) const foreignToHomeDecimalShift = FOREIGN_TO_HOME_DECIMAL_SHIFT || 0 -async function initializeBridge({ validatorsBridge, bridge, nonce, homeBridgeAddress }) { +async function initializeBridge({ validatorsBridge, bridge, limitsContract, nonce, homeBridgeAddress }) { console.log(`Foreign Validators: ${validatorsBridge.options.address}, ERC20_TOKEN_ADDRESS: ${ERC20_TOKEN_ADDRESS}, FOREIGN_DAILY_LIMIT: ${FOREIGN_DAILY_LIMIT} which is ${Web3Utils.fromWei(FOREIGN_DAILY_LIMIT)} in eth, @@ -50,12 +60,24 @@ async function initializeBridge({ validatorsBridge, bridge, nonce, homeBridgeAdd FOREIGN_MIN_AMOUNT_PER_TX )} in eth, FOREIGN_GAS_PRICE: ${FOREIGN_GAS_PRICE}, FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS : ${FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS}, - HOME_DAILY_LIMIT: ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, + ${ + RELATIVE_DAILY_LIMIT + ? `TARGET_LIMIT: ${TARGET_LIMIT} which is ${Web3Utils.fromWei(Web3Utils.toBN(TARGET_LIMIT).mul(Web3Utils.toBN(100)))}%, + THRESHOLD: ${THRESHOLD} which is ${Web3Utils.fromWei(THRESHOLD)} in eth,` + : `HOME_DAILY_LIMIT: ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth,` + } HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MAX_AMOUNT_PER_TX)} in eth, + HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MIN_AMOUNT_PER_TX)} in eth, FOREIGN_BRIDGE_OWNER: ${FOREIGN_BRIDGE_OWNER}, FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift}, + LIMITS_CONTRACT: ${limitsContract.options.address}, Home bridge Address: ${homeBridgeAddress} `) + + const executionLimitsArray = RELATIVE_DAILY_LIMIT + ? [TARGET_LIMIT, THRESHOLD, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX] + : [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX] + const initializeFBridgeData = await bridge.methods .initialize( validatorsBridge.options.address, @@ -63,10 +85,11 @@ async function initializeBridge({ validatorsBridge, bridge, nonce, homeBridgeAdd FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS, FOREIGN_GAS_PRICE, [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX], - [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX], + executionLimitsArray, FOREIGN_BRIDGE_OWNER, foreignToHomeDecimalShift, - homeBridgeAddress + homeBridgeAddress, + limitsContract.options.address ) .encodeABI() const txInitializeBridge = await sendRawTxForeign({ @@ -143,6 +166,16 @@ async function deployForeign(homeBridgeAddress) { }) nonce++ + console.log('\ndeploying limits contract') + const LimitsContract = RELATIVE_DAILY_LIMIT ? RelativeExecutionDailyLimit : AbsoluteDailyLimit + const limitsContract = await deployContract(LimitsContract, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce + }) + nonce++ + console.log('[Foreign] Limits Contract: ', limitsContract.options.address) + console.log('\ndeploying foreignBridge storage\n') const foreignBridgeStorage = await deployContract(EternalStorageProxy, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, @@ -153,7 +186,7 @@ async function deployForeign(homeBridgeAddress) { console.log('[Foreign] ForeignBridge Storage: ', foreignBridgeStorage.options.address) console.log('\ndeploying foreignBridge implementation\n') - const foreignBridgeImplementation = await deployContract(ForeignBridge, [], { + const foreignBridgeImplementation = await deployContract(ForeignBridgeErcToNative, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce @@ -176,8 +209,9 @@ async function deployForeign(homeBridgeAddress) { await initializeBridge({ validatorsBridge: storageValidatorsForeign, bridge: foreignBridgeImplementation, + limitsContract, nonce, - homeBridgeAddress + homeBridgeAddress, }) nonce++ diff --git a/deploy/src/erc_to_native/home.js b/deploy/src/erc_to_native/home.js index 253bf6aa4..63fac024e 100644 --- a/deploy/src/erc_to_native/home.js +++ b/deploy/src/erc_to_native/home.js @@ -18,8 +18,10 @@ const { BridgeValidators, RewardableValidators, FeeManagerErcToNative, - HomeBridgeErcToNative: HomeBridge, - FeeManagerErcToNativePOSDAO + HomeBridgeErcToNative, + FeeManagerErcToNativePOSDAO, + AbsoluteDailyLimit, + RelativeDailyLimit } } = require('../loadContracts') @@ -39,11 +41,15 @@ const { HOME_REQUIRED_BLOCK_CONFIRMATIONS, FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, + FOREIGN_MIN_AMOUNT_PER_TX, HOME_REWARDABLE, HOME_TRANSACTIONS_FEE, FOREIGN_TRANSACTIONS_FEE, HOME_FEE_MANAGER_TYPE, - FOREIGN_TO_HOME_DECIMAL_SHIFT + FOREIGN_TO_HOME_DECIMAL_SHIFT, + RELATIVE_DAILY_LIMIT, + TARGET_LIMIT, + THRESHOLD, } = env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) @@ -59,10 +65,22 @@ if (isRewardableBridge && !isFeeManagerPOSDAO) { VALIDATORS_REWARD_ACCOUNTS = env.VALIDATORS_REWARD_ACCOUNTS.split(' ') } -async function initializeBridge({ validatorsBridge, bridge, initialNonce }) { +async function initializeBridge({ validatorsBridge, bridge, limitsContract, initialNonce }) { let nonce = initialNonce let initializeHomeBridgeData + const requestLimitsArray = RELATIVE_DAILY_LIMIT + ? [TARGET_LIMIT, THRESHOLD, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX] + : [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX] + + let RELATIVE_DAILY_LIMIT_PARAMS + if (RELATIVE_DAILY_LIMIT) { + RELATIVE_DAILY_LIMIT_PARAMS = `TARGET_LIMIT: ${TARGET_LIMIT} which is ${ + Web3Utils.fromWei(Web3Utils.toBN(TARGET_LIMIT).mul(Web3Utils.toBN(100))) + }%, + THRESHOLD: ${THRESHOLD} which is ${Web3Utils.fromWei(THRESHOLD)} in eth,` + } + if (isRewardableBridge) { console.log('\ndeploying implementation for fee manager') const feeManagerContract = isFeeManagerPOSDAO ? FeeManagerErcToNativePOSDAO : FeeManagerErcToNative @@ -77,7 +95,11 @@ async function initializeBridge({ validatorsBridge, bridge, initialNonce }) { const foreignFeeInWei = Web3Utils.toWei(FOREIGN_TRANSACTIONS_FEE.toString(), 'ether') console.log('\ninitializing Home Bridge with fee contract:\n') console.log(`Home Validators: ${validatorsBridge.options.address}, - HOME_DAILY_LIMIT : ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, + ${ + RELATIVE_DAILY_LIMIT + ? RELATIVE_DAILY_LIMIT_PARAMS + : `HOME_DAILY_LIMIT : ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth,` + } HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MAX_AMOUNT_PER_TX)} in eth, HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MIN_AMOUNT_PER_TX)} in eth, HOME_GAS_PRICE: ${HOME_GAS_PRICE}, HOME_REQUIRED_BLOCK_CONFIRMATIONS : ${HOME_REQUIRED_BLOCK_CONFIRMATIONS}, @@ -86,29 +108,38 @@ async function initializeBridge({ validatorsBridge, bridge, initialNonce }) { FOREIGN_MAX_AMOUNT_PER_TX: ${FOREIGN_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( FOREIGN_MAX_AMOUNT_PER_TX )} in eth, + FOREIGN_MIN_AMOUNT_PER_TX: ${FOREIGN_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( + FOREIGN_MIN_AMOUNT_PER_TX + )} in eth,s HOME_BRIDGE_OWNER: ${HOME_BRIDGE_OWNER}, Fee Manager: ${feeManager.options.address}, Home Fee: ${homeFeeInWei} which is ${HOME_TRANSACTIONS_FEE * 100}% Foreign Fee: ${foreignFeeInWei} which is ${FOREIGN_TRANSACTIONS_FEE * 100}%, - FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift}`) + FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift}, + LIMITS_CONTRACT: ${limitsContract.options.address}`) initializeHomeBridgeData = await bridge.methods .rewardableInitialize( validatorsBridge.options.address, - [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX], + requestLimitsArray, HOME_GAS_PRICE, HOME_REQUIRED_BLOCK_CONFIRMATIONS, BLOCK_REWARD_ADDRESS, - [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX], + [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX], HOME_BRIDGE_OWNER, feeManager.options.address, [homeFeeInWei, foreignFeeInWei], - foreignToHomeDecimalShift + foreignToHomeDecimalShift, + limitsContract.options.address ) .encodeABI() } else { console.log('\ninitializing Home Bridge with following parameters:\n') console.log(`Home Validators: ${validatorsBridge.options.address}, - HOME_DAILY_LIMIT : ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, + ${ + RELATIVE_DAILY_LIMIT + ? RELATIVE_DAILY_LIMIT_PARAMS + : `HOME_DAILY_LIMIT : ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth,` + } HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MAX_AMOUNT_PER_TX)} in eth, HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MIN_AMOUNT_PER_TX)} in eth, HOME_GAS_PRICE: ${HOME_GAS_PRICE}, HOME_REQUIRED_BLOCK_CONFIRMATIONS : ${HOME_REQUIRED_BLOCK_CONFIRMATIONS}, @@ -117,19 +148,24 @@ async function initializeBridge({ validatorsBridge, bridge, initialNonce }) { FOREIGN_MAX_AMOUNT_PER_TX: ${FOREIGN_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( FOREIGN_MAX_AMOUNT_PER_TX )} in eth, + FOREIGN_MIN_AMOUNT_PER_TX: ${FOREIGN_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( + FOREIGN_MIN_AMOUNT_PER_TX + )} in eth, HOME_BRIDGE_OWNER: ${HOME_BRIDGE_OWNER}, - FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift} + FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift}, + LIMITS_CONTRACT: ${limitsContract.options.address} `) initializeHomeBridgeData = await bridge.methods .initialize( validatorsBridge.options.address, - [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX], + requestLimitsArray, HOME_GAS_PRICE, HOME_REQUIRED_BLOCK_CONFIRMATIONS, BLOCK_REWARD_ADDRESS, - [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX], + [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX], HOME_BRIDGE_OWNER, - foreignToHomeDecimalShift + foreignToHomeDecimalShift, + limitsContract.options.address ) .encodeABI() } @@ -203,6 +239,15 @@ async function deployHome() { }) nonce++ + console.log('\ndeploying limits contract') + const LimitsContract = RELATIVE_DAILY_LIMIT ? RelativeDailyLimit : AbsoluteDailyLimit + const limitsContract = await deployContract(LimitsContract, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce + }) + nonce++ + console.log('[Home] Limits Contract: ', limitsContract.options.address) + console.log('\ndeploying homeBridge storage\n') const homeBridgeStorage = await deployContract(EternalStorageProxy, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, @@ -210,9 +255,8 @@ async function deployHome() { }) nonce++ console.log('[Home] HomeBridge Storage: ', homeBridgeStorage.options.address) - console.log('\ndeploying homeBridge implementation\n') - const homeBridgeImplementation = await deployContract(HomeBridge, [], { + const homeBridgeImplementation = await deployContract(HomeBridgeErcToNative, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, nonce }) @@ -233,6 +277,7 @@ async function deployHome() { nonce = await initializeBridge({ validatorsBridge: storageValidatorsHome, bridge: homeBridgeImplementation, + limitsContract, initialNonce: nonce }) diff --git a/deploy/src/loadContracts.js b/deploy/src/loadContracts.js index 3b5766044..229367041 100644 --- a/deploy/src/loadContracts.js +++ b/deploy/src/loadContracts.js @@ -35,7 +35,10 @@ function getContracts(evmVersion) { HomeAMB: require(`../../build/${buildPath}/HomeAMB.json`), ForeignAMB: require(`../../build/${buildPath}/ForeignAMB`), HomeAMBErc677ToErc677: require(`../../build/${buildPath}/HomeAMBErc677ToErc677.json`), - ForeignAMBErc677ToErc677: require(`../../build/${buildPath}/ForeignAMBErc677ToErc677.json`) + ForeignAMBErc677ToErc677: require(`../../build/${buildPath}/ForeignAMBErc677ToErc677.json`), + AbsoluteDailyLimit: require(`../../build/${buildPath}/AbsoluteDailyLimit.json`), + RelativeDailyLimit: require(`../../build/${buildPath}/RelativeDailyLimit.json`), + RelativeExecutionDailyLimit: require(`../../build/${buildPath}/RelativeExecutionDailyLimit.json`) } } diff --git a/deploy/src/loadEnv.js b/deploy/src/loadEnv.js index 08458ad65..559542c6e 100644 --- a/deploy/src/loadEnv.js +++ b/deploy/src/loadEnv.js @@ -2,7 +2,7 @@ const path = require('path') require('dotenv').config({ path: path.join(__dirname, '..', '.env') }) -const { isAddress, toBN } = require('web3').utils +const { isAddress, toBN, toWei } = require('web3').utils const envalid = require('envalid') const { ZERO_ADDRESS, EVM_TYPES } = require('./constants') @@ -59,11 +59,19 @@ function checkBlockConfirmations(confirmations, prefix) { } } -function checkLimits(min, max, daily, prefix) { - if (min.isZero() || min.gte(max) || max.gte(daily)) { - throw new Error( - `Limit parameters should be defined as 0 < ${prefix}_MIN_AMOUNT_PER_TX < ${prefix}_MAX_AMOUNT_PER_TX < ${prefix}_DAILY_LIMIT` - ) +function checkLimits(min, max, daily, isRelativeDailyLimit, targetLimit, threshold, prefix) { + if (isRelativeDailyLimit) { + if (min.isZero() || min.gte(max) || min.gt(threshold) || targetLimit.gt(toBN(toWei('1', 'ether')))) { + throw new Error( + `Limit parameters should be defined as 0 < ${prefix}_MIN_AMOUNT_PER_TX < ${prefix}_MAX_AMOUNT_PER_TX and THRESHOLD >= ${prefix}_MIN_AMOUNT_PER_TX and TARGET_LIMIT <= 1 ether` + ) + } + } else { + if (min.isZero() || min.gte(max) || max.gte(daily)) { + throw new Error( + `Limit parameters should be defined as 0 < ${prefix}_MIN_AMOUNT_PER_TX < ${prefix}_MAX_AMOUNT_PER_TX < ${prefix}_DAILY_LIMIT` + ) + } } } @@ -76,7 +84,8 @@ const { DEPLOY_REWARDABLE_TOKEN, HOME_FEE_MANAGER_TYPE, HOME_EVM_VERSION, - FOREIGN_EVM_VERSION + FOREIGN_EVM_VERSION, + RELATIVE_DAILY_LIMIT, } = process.env // Types validations @@ -110,7 +119,7 @@ let validations = { FOREIGN_RPC_URL: envalid.str(), FOREIGN_BRIDGE_OWNER: addressValidator(), FOREIGN_UPGRADEABLE_ADMIN: addressValidator(), - FOREIGN_MAX_AMOUNT_PER_TX: bigNumValidator() + FOREIGN_MAX_AMOUNT_PER_TX: bigNumValidator(), } if (BRIDGE_MODE === 'AMB_ERC_TO_ERC') { @@ -126,7 +135,7 @@ if (BRIDGE_MODE === 'AMB_ERC_TO_ERC') { BRIDGEABLE_TOKEN_DECIMALS: envalid.num(), FOREIGN_MIN_AMOUNT_PER_TX: bigNumValidator(), FOREIGN_DAILY_LIMIT: bigNumValidator(), - DEPLOY_REWARDABLE_TOKEN: envalid.bool() + DEPLOY_REWARDABLE_TOKEN: envalid.bool(), } if (DEPLOY_REWARDABLE_TOKEN === 'true') { @@ -155,7 +164,15 @@ if (BRIDGE_MODE !== 'ARBITRARY_MESSAGE') { ...validations, HOME_DAILY_LIMIT: bigNumValidator(), HOME_MIN_AMOUNT_PER_TX: bigNumValidator(), - FOREIGN_DAILY_LIMIT: bigNumValidator() + FOREIGN_DAILY_LIMIT: bigNumValidator(), + RELATIVE_DAILY_LIMIT: envalid.bool() + } + if (RELATIVE_DAILY_LIMIT === 'true') { + validations = { + ...validations, + TARGET_LIMIT: bigNumValidator(), + THRESHOLD: bigNumValidator() + } } if (BRIDGE_MODE !== 'AMB_ERC_TO_ERC') { @@ -202,7 +219,7 @@ if (BRIDGE_MODE === 'NATIVE_TO_ERC') { BRIDGEABLE_TOKEN_SYMBOL: envalid.str(), BRIDGEABLE_TOKEN_DECIMALS: envalid.num(), FOREIGN_MIN_AMOUNT_PER_TX: bigNumValidator(), - DEPLOY_REWARDABLE_TOKEN: envalid.bool() + DEPLOY_REWARDABLE_TOKEN: envalid.bool(), } if (DEPLOY_REWARDABLE_TOKEN === 'true') { @@ -264,12 +281,28 @@ if (env.BRIDGE_MODE === 'ARBITRARY_MESSAGE') { throw new Error(`FOREIGN_MAX_AMOUNT_PER_TX should be greater than 0`) } } else { - checkLimits(env.HOME_MIN_AMOUNT_PER_TX, env.HOME_MAX_AMOUNT_PER_TX, env.HOME_DAILY_LIMIT, homePrefix) + checkLimits( + env.HOME_MIN_AMOUNT_PER_TX, + env.HOME_MAX_AMOUNT_PER_TX, + env.HOME_DAILY_LIMIT, + env.RELATIVE_DAILY_LIMIT, + env.TARGET_LIMIT, + env.THRESHOLD, + homePrefix + ) } if (env.BRIDGE_MODE === 'NATIVE_TO_ERC') { checkGasPrices(env.HOME_GAS_PRICE, homePrefix) - checkLimits(env.FOREIGN_MIN_AMOUNT_PER_TX, env.FOREIGN_MAX_AMOUNT_PER_TX, env.FOREIGN_DAILY_LIMIT, foreignPrefix) + checkLimits( + env.FOREIGN_MIN_AMOUNT_PER_TX, + env.FOREIGN_MAX_AMOUNT_PER_TX, + env.FOREIGN_DAILY_LIMIT, + env.RELATIVE_DAILY_LIMIT, + env.TARGET_LIMIT, + env.THRESHOLD, + foreignPrefix + ) if (env.FOREIGN_REWARDABLE === 'BOTH_DIRECTIONS') { throw new Error(`FOREIGN_REWARDABLE: ${env.FOREIGN_REWARDABLE} is not supported on ${env.BRIDGE_MODE} bridge mode`) } @@ -282,7 +315,15 @@ if (env.BRIDGE_MODE === 'NATIVE_TO_ERC') { } if (env.BRIDGE_MODE === 'ERC_TO_ERC') { - checkLimits(env.FOREIGN_MIN_AMOUNT_PER_TX, env.FOREIGN_MAX_AMOUNT_PER_TX, env.FOREIGN_DAILY_LIMIT, foreignPrefix) + checkLimits( + env.FOREIGN_MIN_AMOUNT_PER_TX, + env.FOREIGN_MAX_AMOUNT_PER_TX, + env.FOREIGN_DAILY_LIMIT, + env.RELATIVE_DAILY_LIMIT, + env.TARGET_LIMIT, + env.THRESHOLD, + foreignPrefix + ) if (env.HOME_REWARDABLE === 'BOTH_DIRECTIONS' && env.BLOCK_REWARD_ADDRESS === ZERO_ADDRESS) { throw new Error( @@ -296,7 +337,15 @@ if (env.BRIDGE_MODE === 'ERC_TO_ERC') { } if (env.BRIDGE_MODE === 'ERC_TO_NATIVE') { - checkLimits(env.FOREIGN_MIN_AMOUNT_PER_TX, env.FOREIGN_MAX_AMOUNT_PER_TX, env.FOREIGN_DAILY_LIMIT, foreignPrefix) + checkLimits( + env.FOREIGN_MIN_AMOUNT_PER_TX, + env.FOREIGN_MAX_AMOUNT_PER_TX, + env.FOREIGN_DAILY_LIMIT, + env.RELATIVE_DAILY_LIMIT, + env.TARGET_LIMIT, + env.THRESHOLD, + foreignPrefix + ) if (HOME_REWARDABLE === 'ONE_DIRECTION') { throw new Error( @@ -318,7 +367,15 @@ if (env.BRIDGE_MODE === 'ERC_TO_NATIVE') { } if (env.BRIDGE_MODE === 'AMB_ERC_TO_ERC') { - checkLimits(env.FOREIGN_MIN_AMOUNT_PER_TX, env.FOREIGN_MAX_AMOUNT_PER_TX, env.FOREIGN_DAILY_LIMIT, foreignPrefix) + checkLimits( + env.FOREIGN_MIN_AMOUNT_PER_TX, + env.FOREIGN_MAX_AMOUNT_PER_TX, + env.FOREIGN_DAILY_LIMIT, + env.RELATIVE_DAILY_LIMIT, + env.TARGET_LIMIT, + env.THRESHOLD, + foreignPrefix + ) } module.exports = env diff --git a/deploy/src/native_to_erc/foreign.js b/deploy/src/native_to_erc/foreign.js index 8bebde821..9a37a8f0e 100644 --- a/deploy/src/native_to_erc/foreign.js +++ b/deploy/src/native_to_erc/foreign.js @@ -19,10 +19,12 @@ const { EternalStorageProxy, BridgeValidators, RewardableValidators, - ForeignBridgeNativeToErc: ForeignBridge, + ForeignBridgeNativeToErc, ERC677BridgeToken, ERC677BridgeTokenRewardable, - FeeManagerNativeToErc + FeeManagerNativeToErc, + AbsoluteDailyLimit, + RelativeDailyLimit } } = require('../loadContracts') @@ -44,12 +46,16 @@ const { BRIDGEABLE_TOKEN_DECIMALS, HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, + HOME_MIN_AMOUNT_PER_TX, DEPLOY_REWARDABLE_TOKEN, BLOCK_REWARD_ADDRESS, DPOS_STAKING_ADDRESS, FOREIGN_REWARDABLE, HOME_TRANSACTIONS_FEE, - FOREIGN_TO_HOME_DECIMAL_SHIFT + FOREIGN_TO_HOME_DECIMAL_SHIFT, + RELATIVE_DAILY_LIMIT, + TARGET_LIMIT, + THRESHOLD, } = env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) @@ -64,10 +70,29 @@ if (isRewardableBridge) { VALIDATORS_REWARD_ACCOUNTS = env.VALIDATORS_REWARD_ACCOUNTS.split(' ') } -async function initializeBridge({ validatorsBridge, bridge, erc677bridgeToken, initialNonce, homeBridgeAddress }) { +async function initializeBridge({ + validatorsBridge, + bridge, + erc677bridgeToken, + limitsContract, + initialNonce, + homeBridgeAddress +}) { let nonce = initialNonce let initializeFBridgeData + const requestLimitsArray = RELATIVE_DAILY_LIMIT + ? [TARGET_LIMIT, THRESHOLD, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX] + : [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX] + + let RELATIVE_DAILY_LIMIT_PARAMS + if (RELATIVE_DAILY_LIMIT) { + RELATIVE_DAILY_LIMIT_PARAMS = `TARGET_LIMIT: ${TARGET_LIMIT} which is ${ + Web3Utils.fromWei(Web3Utils.toBN(TARGET_LIMIT).mul(Web3Utils.toBN(100))) + }%, + THRESHOLD: ${THRESHOLD} which is ${Web3Utils.fromWei(THRESHOLD)} in eth,` + } + if (isRewardableBridge) { console.log('\ndeploying implementation for fee manager') const feeManager = await deployContract(FeeManagerNativeToErc, [], { @@ -82,7 +107,11 @@ async function initializeBridge({ validatorsBridge, bridge, erc677bridgeToken, i console.log('\ninitializing Foreign Bridge with fee contract:\n') console.log(`Foreign Validators: ${validatorsBridge.options.address}, - FOREIGN_DAILY_LIMIT : ${FOREIGN_DAILY_LIMIT} which is ${Web3Utils.fromWei(FOREIGN_DAILY_LIMIT)} in eth, + ${ + RELATIVE_DAILY_LIMIT + ? RELATIVE_DAILY_LIMIT_PARAMS + : `FOREIGN_DAILY_LIMIT: ${FOREIGN_DAILY_LIMIT} which is ${Web3Utils.fromWei(FOREIGN_DAILY_LIMIT)} in eth,` + } FOREIGN_MAX_AMOUNT_PER_TX: ${FOREIGN_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( FOREIGN_MAX_AMOUNT_PER_TX )} in eth, @@ -90,33 +119,40 @@ async function initializeBridge({ validatorsBridge, bridge, erc677bridgeToken, i FOREIGN_MIN_AMOUNT_PER_TX )} in eth, FOREIGN_GAS_PRICE: ${FOREIGN_GAS_PRICE}, FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS : ${FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS}, - HOME_DAILY_LIMIT: ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, + HOME_DAILY_LIMIT: ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MAX_AMOUNT_PER_TX)} in eth, + HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MIN_AMOUNT_PER_TX)} in eth, FOREIGN_BRIDGE_OWNER: ${FOREIGN_BRIDGE_OWNER}, Fee Manager: ${feeManager.options.address}, Home Fee: ${homeFeeInWei} which is ${HOME_TRANSACTIONS_FEE * 100}%, - FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift} + FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift}, + LIMITS_CONTRACT: ${limitsContract.options.address}, Home bridge Address: ${homeBridgeAddress}`) initializeFBridgeData = await bridge.methods .rewardableInitialize( validatorsBridge.options.address, erc677bridgeToken.options.address, - [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX], + requestLimitsArray, FOREIGN_GAS_PRICE, FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS, - [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX], + [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX], FOREIGN_BRIDGE_OWNER, feeManager.options.address, homeFeeInWei, foreignToHomeDecimalShift, - homeBridgeAddress + homeBridgeAddress, + limitsContract.options.address ) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) } else { console.log('\ninitializing Foreign Bridge with following parameters:\n') console.log(`Foreign Validators: ${validatorsBridge.options.address}, - FOREIGN_DAILY_LIMIT : ${FOREIGN_DAILY_LIMIT} which is ${Web3Utils.fromWei(FOREIGN_DAILY_LIMIT)} in eth, + ${ + RELATIVE_DAILY_LIMIT + ? RELATIVE_DAILY_LIMIT_PARAMS + : `FOREIGN_DAILY_LIMIT : ${FOREIGN_DAILY_LIMIT} which is ${Web3Utils.fromWei(FOREIGN_DAILY_LIMIT)} in eth,` + } FOREIGN_MAX_AMOUNT_PER_TX: ${FOREIGN_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( FOREIGN_MAX_AMOUNT_PER_TX )} in eth, @@ -124,10 +160,12 @@ async function initializeBridge({ validatorsBridge, bridge, erc677bridgeToken, i FOREIGN_MIN_AMOUNT_PER_TX )} in eth, FOREIGN_GAS_PRICE: ${FOREIGN_GAS_PRICE}, FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS : ${FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS}, - HOME_DAILY_LIMIT: ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, + HOME_DAILY_LIMIT: ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MAX_AMOUNT_PER_TX)} in eth, + HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MIN_AMOUNT_PER_TX)} in eth, FOREIGN_BRIDGE_OWNER: ${FOREIGN_BRIDGE_OWNER}, - FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift} + FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift}, + LIMITS_CONTRACT: ${limitsContract.options.address}, Home bridge Address: ${homeBridgeAddress} `) @@ -135,13 +173,14 @@ async function initializeBridge({ validatorsBridge, bridge, erc677bridgeToken, i .initialize( validatorsBridge.options.address, erc677bridgeToken.options.address, - [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX], + requestLimitsArray, FOREIGN_GAS_PRICE, FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS, - [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX], + [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX], FOREIGN_BRIDGE_OWNER, foreignToHomeDecimalShift, - homeBridgeAddress + homeBridgeAddress, + limitsContract.options.address ) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) } @@ -230,6 +269,16 @@ async function deployForeign(homeBridgeAddress) { }) nonce++ + console.log('\ndeploying limits contract') + const LimitsContract = RELATIVE_DAILY_LIMIT ? RelativeDailyLimit : AbsoluteDailyLimit + const limitsContract = await deployContract(LimitsContract, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce + }) + nonce++ + console.log('[Foreign] Limits Contract: ', limitsContract.options.address) + console.log('\ndeploying foreignBridge storage\n') const foreignBridgeStorage = await deployContract(EternalStorageProxy, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, @@ -240,7 +289,7 @@ async function deployForeign(homeBridgeAddress) { console.log('[Foreign] ForeignBridge Storage: ', foreignBridgeStorage.options.address) console.log('\ndeploying foreignBridge implementation\n') - const foreignBridgeImplementation = await deployContract(ForeignBridge, [], { + const foreignBridgeImplementation = await deployContract(ForeignBridgeNativeToErc, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce @@ -263,6 +312,7 @@ async function deployForeign(homeBridgeAddress) { validatorsBridge: storageValidatorsForeign, bridge: foreignBridgeImplementation, erc677bridgeToken, + limitsContract, initialNonce: nonce, homeBridgeAddress }) diff --git a/deploy/src/native_to_erc/home.js b/deploy/src/native_to_erc/home.js index ab2cffef6..f9fe1ec5a 100644 --- a/deploy/src/native_to_erc/home.js +++ b/deploy/src/native_to_erc/home.js @@ -18,8 +18,10 @@ const { BridgeValidators, RewardableValidators, FeeManagerNativeToErc, - HomeBridgeNativeToErc: HomeBridge, - FeeManagerNativeToErcBothDirections + HomeBridgeNativeToErc, + FeeManagerNativeToErcBothDirections, + AbsoluteDailyLimit, + RelativeExecutionDailyLimit } } = require('../loadContracts') @@ -38,10 +40,14 @@ const { HOME_REQUIRED_BLOCK_CONFIRMATIONS, FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, + FOREIGN_MIN_AMOUNT_PER_TX, HOME_REWARDABLE, HOME_TRANSACTIONS_FEE, FOREIGN_TRANSACTIONS_FEE, - FOREIGN_TO_HOME_DECIMAL_SHIFT + FOREIGN_TO_HOME_DECIMAL_SHIFT, + RELATIVE_DAILY_LIMIT, + TARGET_LIMIT, + THRESHOLD, } = env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) @@ -57,10 +63,22 @@ if (isRewardableBridge) { VALIDATORS_REWARD_ACCOUNTS = env.VALIDATORS_REWARD_ACCOUNTS.split(' ') } -async function initializeBridge({ validatorsBridge, bridge, initialNonce }) { +async function initializeBridge({ validatorsBridge, bridge, limitsContract, initialNonce }) { let nonce = initialNonce let initializeHomeBridgeData + const executionLimitsArray = RELATIVE_DAILY_LIMIT + ? [TARGET_LIMIT, THRESHOLD, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX] + : [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX] + + let RELATIVE_DAILY_LIMIT_PARAMS + if (RELATIVE_DAILY_LIMIT) { + RELATIVE_DAILY_LIMIT_PARAMS = `TARGET_LIMIT: ${TARGET_LIMIT} which is ${ + Web3Utils.fromWei(Web3Utils.toBN(TARGET_LIMIT).mul(Web3Utils.toBN(100))) + }%, + THRESHOLD: ${THRESHOLD} which is ${Web3Utils.fromWei(THRESHOLD)} in eth,` + } + if (isRewardableBridge) { console.log('\ndeploying implementation for fee manager') const feeManagerContract = isBothDirectionsFeeManager ? FeeManagerNativeToErcBothDirections : FeeManagerNativeToErc @@ -81,15 +99,23 @@ async function initializeBridge({ validatorsBridge, bridge, initialNonce }) { HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MAX_AMOUNT_PER_TX)} in eth, HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MIN_AMOUNT_PER_TX)} in eth, HOME_GAS_PRICE: ${HOME_GAS_PRICE}, HOME_REQUIRED_BLOCK_CONFIRMATIONS : ${HOME_REQUIRED_BLOCK_CONFIRMATIONS}, - FOREIGN_DAILY_LIMIT: ${FOREIGN_DAILY_LIMIT} which is ${Web3Utils.fromWei(FOREIGN_DAILY_LIMIT)} in eth, + ${ + RELATIVE_DAILY_LIMIT + ? RELATIVE_DAILY_LIMIT_PARAMS + : `FOREIGN_DAILY_LIMIT: ${FOREIGN_DAILY_LIMIT} which is ${Web3Utils.fromWei(FOREIGN_DAILY_LIMIT)} in eth,` + } FOREIGN_MAX_AMOUNT_PER_TX: ${FOREIGN_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( FOREIGN_MAX_AMOUNT_PER_TX )} in eth, + FOREIGN_MIN_AMOUNT_PER_TX: ${FOREIGN_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( + FOREIGN_MIN_AMOUNT_PER_TX + )} in eth, HOME_BRIDGE_OWNER: ${HOME_BRIDGE_OWNER}, Fee Manager: ${feeManager.options.address}, Home Fee: ${homeFeeInWei} which is ${homeFee * 100}% Foreign Fee: ${foreignFeeInWei} which is ${FOREIGN_TRANSACTIONS_FEE * 100}%, - FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift}`) + FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift}, + LIMITS_CONTRACT: ${limitsContract.options.address}`) initializeHomeBridgeData = await bridge.methods .rewardableInitialize( @@ -97,11 +123,12 @@ async function initializeBridge({ validatorsBridge, bridge, initialNonce }) { [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX], HOME_GAS_PRICE, HOME_REQUIRED_BLOCK_CONFIRMATIONS, - [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX], + executionLimitsArray, HOME_BRIDGE_OWNER, feeManager.options.address, [homeFeeInWei, foreignFeeInWei], - foreignToHomeDecimalShift + foreignToHomeDecimalShift, + limitsContract.options.address ) .encodeABI() } else { @@ -111,12 +138,20 @@ async function initializeBridge({ validatorsBridge, bridge, initialNonce }) { HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MAX_AMOUNT_PER_TX)} in eth, HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MIN_AMOUNT_PER_TX)} in eth, HOME_GAS_PRICE: ${HOME_GAS_PRICE}, HOME_REQUIRED_BLOCK_CONFIRMATIONS : ${HOME_REQUIRED_BLOCK_CONFIRMATIONS}, - FOREIGN_DAILY_LIMIT: ${FOREIGN_DAILY_LIMIT} which is ${Web3Utils.fromWei(FOREIGN_DAILY_LIMIT)} in eth, + ${ + RELATIVE_DAILY_LIMIT + ? RELATIVE_DAILY_LIMIT_PARAMS + : `FOREIGN_DAILY_LIMIT: ${FOREIGN_DAILY_LIMIT} which is ${Web3Utils.fromWei(FOREIGN_DAILY_LIMIT)} in eth,` + } FOREIGN_MAX_AMOUNT_PER_TX: ${FOREIGN_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( FOREIGN_MAX_AMOUNT_PER_TX )} in eth, + FOREIGN_MIN_AMOUNT_PER_TX: ${FOREIGN_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( + FOREIGN_MIN_AMOUNT_PER_TX + )} in eth, HOME_BRIDGE_OWNER: ${HOME_BRIDGE_OWNER}, - FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift} + FOREIGN_TO_HOME_DECIMAL_SHIFT: ${foreignToHomeDecimalShift}, + LIMITS_CONTRACT: ${limitsContract.options.address} `) initializeHomeBridgeData = await bridge.methods .initialize( @@ -124,9 +159,10 @@ async function initializeBridge({ validatorsBridge, bridge, initialNonce }) { [HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX], HOME_GAS_PRICE, HOME_REQUIRED_BLOCK_CONFIRMATIONS, - [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX], + executionLimitsArray, HOME_BRIDGE_OWNER, - foreignToHomeDecimalShift + foreignToHomeDecimalShift, + limitsContract.options.address ) .encodeABI() } @@ -201,6 +237,15 @@ async function deployHome() { }) nonce++ + console.log('\ndeploying limits contract') + const LimitsContract = RELATIVE_DAILY_LIMIT ? RelativeExecutionDailyLimit : AbsoluteDailyLimit + const limitsContract = await deployContract(LimitsContract, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce + }) + nonce++ + console.log('[Home] Limits Contract: ', limitsContract.options.address) + console.log('\ndeploying homeBridge storage\n') const homeBridgeStorage = await deployContract(EternalStorageProxy, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, @@ -210,7 +255,7 @@ async function deployHome() { console.log('[Home] HomeBridge Storage: ', homeBridgeStorage.options.address) console.log('\ndeploying homeBridge implementation\n') - const homeBridgeImplementation = await deployContract(HomeBridge, [], { + const homeBridgeImplementation = await deployContract(HomeBridgeNativeToErc, [], { from: DEPLOYMENT_ACCOUNT_ADDRESS, nonce }) @@ -231,6 +276,7 @@ async function deployHome() { nonce = await initializeBridge({ validatorsBridge: storageValidatorsHome, bridge: homeBridgeImplementation, + limitsContract, initialNonce: nonce }) diff --git a/deploy/src/utils/verifier.js b/deploy/src/utils/verifier.js index 22d6a59a3..dbe08d261 100644 --- a/deploy/src/utils/verifier.js +++ b/deploy/src/utils/verifier.js @@ -7,15 +7,17 @@ const promiseRetry = require('promise-retry') const basePath = path.join(__dirname, '..', '..', '..', 'flats') -const isBridgeToken = (name) => name === 'ERC677BridgeToken.sol' || name === 'ERC677BridgeTokenRewardable.sol' -const isValidators = (name) => name === 'BridgeValidators.sol' || name === 'RewardableValidators.sol' +const isBridgeToken = name => name === 'ERC677BridgeToken.sol' || name === 'ERC677BridgeTokenRewardable.sol' +const isValidators = name => name === 'BridgeValidators.sol' || name === 'RewardableValidators.sol' +const isLimitContract = name => + name === 'AbsoluteDailyLimit.sol' || name === 'RelativeDailyLimit.sol' || name === 'RelativeExecutionDailyLimit.sol' const flat = async contractPath => { const pathArray = contractPath.split('/') const name = pathArray[pathArray.length - 1] let module = pathArray[pathArray.length - 2] - if (isBridgeToken(name)) { + if (isBridgeToken(name) || isLimitContract(name)) { module = '' } else if (isValidators(name)) { module = 'validators' diff --git a/flatten.sh b/flatten.sh index 2cb1976b3..6a352822f 100755 --- a/flatten.sh +++ b/flatten.sh @@ -21,6 +21,9 @@ ${FLATTENER} contracts/upgradeability/EternalStorageProxy.sol > flats/upgradeabi ${FLATTENER} contracts/upgradeability/ClassicEternalStorageProxy.sol > flats/upgradeability/ClassicEternalStorageProxy_flat.sol ${FLATTENER} contracts/ERC677BridgeToken.sol > flats/ERC677BridgeToken_flat.sol ${FLATTENER} contracts/ERC677BridgeTokenRewardable.sol > flats/ERC677BridgeTokenRewardable_flat.sol +${FLATTENER} contracts/upgradeable_contracts/AbsoluteDailyLimit.sol > flats/AbsoluteDailyLimit_flat.sol +${FLATTENER} contracts/upgradeable_contracts/RelativeDailyLimit.sol > flats/RelativeDailyLimit_flat.sol +${FLATTENER} contracts/upgradeable_contracts/RelativeExecutionDailyLimit.sol > flats/RelativeExecutionDailyLimit_flat.sol echo "Flattening bridge validators contracts" ${FLATTENER} ${VALIDATOR_CONTRACTS_DIR}/BridgeValidators.sol > flats/validators/BridgeValidators_flat.sol diff --git a/package-lock.json b/package-lock.json index a29e0543d..22d6f8eef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1163,6 +1163,71 @@ "resolved": "https://registry.npmjs.org/@ledgerhq/logs/-/logs-4.61.0.tgz", "integrity": "sha512-AObEnA+tgzKEwY306i6FOT/hlc+zjF817Bty/IxG3f2wPJFRK9cJuD3Ijl4pfJP2pt7KubN4YbRGXREXhEsknQ==" }, + "@openzeppelin/contract-loader": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/contract-loader/-/contract-loader-0.4.0.tgz", + "integrity": "sha512-K+Pl4tn0FbxMSP0H9sgi61ayCbecpqhQmuBshelC7A3q2MlpcqWRJan0xijpwdtv6TORNd5oZNe/+f3l+GD6tw==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "fs-extra": "^8.1.0", + "try-require": "^1.2.1" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + } + } + }, + "@openzeppelin/test-helpers": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@openzeppelin/test-helpers/-/test-helpers-0.5.4.tgz", + "integrity": "sha512-sSjft0CcmC6Pwsd/j1uakk2MLamEH4mmphVlF5hzUUVyoxL0KGCbxQgBoLoEpUbw2M9HtFAEMJJPGccEcb9Cog==", + "dev": true, + "requires": { + "@openzeppelin/contract-loader": "^0.4.0", + "@truffle/contract": "^4.0.35", + "ansi-colors": "^3.2.3", + "chai": "^4.2.0", + "chai-bn": "^0.2.0", + "ethjs-abi": "^0.2.1", + "lodash.flatten": "^4.4.0", + "semver": "^5.6.0", + "web3": "^1.2.1", + "web3-utils": "^1.2.1" + }, + "dependencies": { + "chai-bn": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/chai-bn/-/chai-bn-0.2.0.tgz", + "integrity": "sha512-h+XqIFikre13N3uiZSc50PZ0VztVjuD/Gytle07EUFkbd8z31tWp37DLAsR1dPozmOLA3yu4hi3IFjJDQ5CKBg==", + "dev": true + } + } + }, "@resolver-engine/core": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/@resolver-engine/core/-/core-0.2.1.tgz", @@ -1218,1042 +1283,962 @@ "defer-to-connect": "^1.0.1" } }, - "@types/bn.js": { - "version": "4.11.5", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.5.tgz", - "integrity": "sha512-AEAZcIZga0JgVMHNtl1CprA/hXX7/wPt79AgR4XqaDt7jyj3QWYw6LPoOiznPtugDmlubUnAahMs2PFxGcQrng==", - "requires": { - "@types/node": "*" - } - }, - "@types/concat-stream": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.0.tgz", - "integrity": "sha1-OU2+C7X+5Gs42JZzXoto7yOQ0A0=", + "@truffle/blockchain-utils": { + "version": "0.0.16", + "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.0.16.tgz", + "integrity": "sha512-OAADN8dAEEGmEb2PzevKhDMMWMEpdU2udk8bzXa69cLjXgHDlnzlZN7RwMkd4KtsSgubGWQegXDll2p0AS2WLA==", "dev": true, "requires": { - "@types/node": "*" + "@truffle/provider": "^0.2.3" } }, - "@types/ethereum-protocol": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/ethereum-protocol/-/ethereum-protocol-1.0.0.tgz", - "integrity": "sha512-3DiI3Zxf81CgX+VhxNNFJBv/sfr1BFBKQK2sQ85hU9FwWJJMWV5gRDV79OUNShiwj3tYYIezU94qpucsb3dThQ==", + "@truffle/contract": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.1.1.tgz", + "integrity": "sha512-jze+xqFkiFYlFles6aLGjlgKkqyRFMH7GYyEetmtzst4zbyA6pIJ1+gqlo+q39qsKtdppMe1wehvlray3J3CEg==", + "dev": true, "requires": { - "bignumber.js": "7.2.1" + "@truffle/blockchain-utils": "^0.0.16", + "@truffle/contract-schema": "^3.0.19", + "@truffle/error": "^0.0.8", + "@truffle/interface-adapter": "^0.4.0", + "bignumber.js": "^7.2.1", + "ethereum-ens": "^0.7.7", + "ethers": "^4.0.0-beta.1", + "web3": "1.2.2", + "web3-core-promievent": "1.2.2", + "web3-eth-abi": "1.2.2", + "web3-utils": "1.2.2" }, "dependencies": { + "@types/node": { + "version": "12.12.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.17.tgz", + "integrity": "sha512-Is+l3mcHvs47sKy+afn2O1rV4ldZFU7W8101cNlOd+MRbjM4Onida8jSZnJdTe/0Pcf25g9BNIUsuugmE6puHA==", + "dev": true + }, "bignumber.js": { "version": "7.2.1", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", - "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" + "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==", + "dev": true + }, + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true + }, + "scrypt-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", + "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=", + "dev": true + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", + "dev": true + }, + "web3": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.2.tgz", + "integrity": "sha512-/ChbmB6qZpfGx6eNpczt5YSUBHEA5V2+iUCbn85EVb3Zv6FVxrOo5Tv7Lw0gE2tW7EEjASbCyp3mZeiZaCCngg==", + "dev": true, + "requires": { + "@types/node": "^12.6.1", + "web3-bzz": "1.2.2", + "web3-core": "1.2.2", + "web3-eth": "1.2.2", + "web3-eth-personal": "1.2.2", + "web3-net": "1.2.2", + "web3-shh": "1.2.2", + "web3-utils": "1.2.2" + } + }, + "web3-eth-abi": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.2.tgz", + "integrity": "sha512-Yn/ZMgoOLxhTVxIYtPJ0eS6pnAnkTAaJgUJh1JhZS4ekzgswMfEYXOwpMaD5eiqPJLpuxmZFnXnBZlnQ1JMXsw==", + "dev": true, + "requires": { + "ethers": "4.0.0-beta.3", + "underscore": "1.9.1", + "web3-utils": "1.2.2" + }, + "dependencies": { + "@types/node": { + "version": "10.17.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.9.tgz", + "integrity": "sha512-+6VygF9LbG7Gaqeog2G7u1+RUcmo0q1rI+2ZxdIg2fAUngk5Vz9fOCHXdloNUOHEPd1EuuOpL5O0CdgN9Fx5UQ==", + "dev": true + }, + "ethers": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.3.tgz", + "integrity": "sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog==", + "dev": true, + "requires": { + "@types/node": "^10.3.2", + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.3.3", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.3", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + } + } + } + }, + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } } } }, - "@types/form-data": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", - "integrity": "sha1-yayFsqX9GENbjIXZ7LUObWyJP/g=", + "@truffle/contract-schema": { + "version": "3.0.19", + "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.0.19.tgz", + "integrity": "sha512-0fT3gBwJPCxO/B+k/xel8aKEGfvXm0nJ965KpCPEC6dpl+XHewJx6TZufiVmxuKTpOAytNfO/aDkQ8sjXs47Fw==", "dev": true, "requires": { - "@types/node": "*" - } - }, - "@types/hdkey": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@types/hdkey/-/hdkey-0.7.0.tgz", - "integrity": "sha512-hS/ueljJBb6i7r7VqhgmBVmDqGKMqQg2nlGIaf71CCG6+iGNE7yeaHgtBWR/wveD+o+K0ma0VE/XweUBHHTQFQ==", - "requires": { - "@types/node": "*" - } - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" - }, - "@types/node": { - "version": "10.14.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.4.tgz", - "integrity": "sha512-DT25xX/YgyPKiHFOpNuANIQIVvYEwCWXgK2jYYwqgaMrYE6+tq+DtmMwlD3drl6DJbUwtlIDnn0d7tIn/EbXBg==" - }, - "@types/prop-types": { - "version": "15.7.1", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.1.tgz", - "integrity": "sha512-CFzn9idOEpHrgdw8JsoTkaDDyRWk1jrzIV8djzcgpq0y9tG4B4lFT+Nxh52DVpDXV+n4+NPNv7M1Dj5uMp6XFg==" - }, - "@types/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-Jugo5V/1bS0fRhy2z8+cUAHEyWOATaz4rbyLVvcFs7+dXp5HfwpEwzF1Q11bB10ApUqHf+yTauxI0UXQDwGrbA==", - "dev": true - }, - "@types/react": { - "version": "16.8.20", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.8.20.tgz", - "integrity": "sha512-ZLmI+ubSJpfUIlQuULDDrdyuFQORBuGOvNnMue8HeA0GVrAJbWtZQhcBvnBPNRBI/GrfSfrKPFhthzC2SLEtLQ==", - "requires": { - "@types/prop-types": "*", - "csstype": "^2.2.0" - } - }, - "@types/solidity-parser-antlr": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@types/solidity-parser-antlr/-/solidity-parser-antlr-0.2.3.tgz", - "integrity": "sha512-FoSyZT+1TTaofbEtGW1oC9wHND1YshvVeHerME/Jh6gIdHbBAWFW8A97YYqO/dpHcFjIwEPEepX0Efl2ckJgwA==" - }, - "@types/web3-provider-engine": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@types/web3-provider-engine/-/web3-provider-engine-14.0.0.tgz", - "integrity": "sha512-yHr8mX2SoX3JNyfqdLXdO1UobsGhfiwSgtekbVxKLQrzD7vtpPkKbkIVsPFOhvekvNbPsCmDyeDCLkpeI9gSmA==", - "requires": { - "@types/ethereum-protocol": "*" - } - }, - "@types/yargs": { - "version": "11.1.2", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-11.1.2.tgz", - "integrity": "sha512-zG61PAp2OcoIBjRV44wftJj6AJgzJrOc32LCYOBqk9bdgcdzK5DCJHV9QZJ60+Fu+fOn79g8Ks3Gixm4CfkZ+w==" - }, - "JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" + "ajv": "^6.10.0", + "crypto-js": "^3.1.9-1", + "debug": "^4.1.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "@truffle/error": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.8.tgz", + "integrity": "sha512-x55rtRuNfRO1azmZ30iR0pf0OJ6flQqbax1hJz+Avk1K5fdmOv5cr22s9qFnwTWnS6Bw0jvJEoR0ITsM7cPKtQ==", "dev": true }, - "abi-decoder": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/abi-decoder/-/abi-decoder-2.2.0.tgz", - "integrity": "sha512-FVgkAvPRNa08E85Q+t52KlGto8XZeQITmCYdRIWHHth/t/pgdpAzZijy3LKUCBqmJjXnrosj4c6WGOB1q+KJ9w==", + "@truffle/interface-adapter": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.4.0.tgz", + "integrity": "sha512-3xCL38jOByT/CN/Sar9Yx0q3xXRzEYpd28eQfI/nTZk/+T1m+aYU7C4Dv2JSnqgB3mjQd++2rRnMYjE2uxYg5w==", "dev": true, "requires": { - "web3-eth-abi": "^1.2.1", - "web3-utils": "^1.2.1" - } - }, - "abortcontroller-polyfill": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.3.0.tgz", - "integrity": "sha512-lbWQgf+eRvku3va8poBlDBO12FigTQr9Zb7NIjXrePrhxWVKdCP2wbDl1tLDaYa18PWTom3UEWwdH13S46I+yA==" - }, - "abstract-leveldown": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", - "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", - "requires": { - "xtend": "~4.0.0" - } - }, - "acorn": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.0.0.tgz", - "integrity": "sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ==", - "dev": true - }, - "acorn-jsx": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.2.tgz", - "integrity": "sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw==", - "dev": true - }, - "aes-js": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" - }, - "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "requires": { - "es6-promisify": "^5.0.0" - } - }, - "agentkeepalive": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", - "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", - "requires": { - "humanize-ms": "^1.2.1" - } - }, - "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "optional": true - }, - "ansi-align": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", - "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", - "dev": true, - "requires": { - "string-width": "^2.0.0" + "bn.js": "^4.11.8", + "ethers": "^4.0.32", + "lodash": "^4.17.13", + "web3": "1.2.2" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "@types/node": { + "version": "12.12.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.17.tgz", + "integrity": "sha512-Is+l3mcHvs47sKy+afn2O1rV4ldZFU7W8101cNlOd+MRbjM4Onida8jSZnJdTe/0Pcf25g9BNIUsuugmE6puHA==", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "elliptic": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", + "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "ethers": { + "version": "4.0.40", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.40.tgz", + "integrity": "sha512-MC9BtV7Hpq4dgFONEfanx9aU9GhhoWU270F+/wegHZXA7FR+2KXFdt36YIQYLmVY5ykUWswDxd+f9EVkIa7JOA==", + "dev": true, + "requires": { + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.5.2", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.4", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", "dev": true }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", + "dev": true + }, + "web3": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.2.tgz", + "integrity": "sha512-/ChbmB6qZpfGx6eNpczt5YSUBHEA5V2+iUCbn85EVb3Zv6FVxrOo5Tv7Lw0gE2tW7EEjASbCyp3mZeiZaCCngg==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "@types/node": "^12.6.1", + "web3-bzz": "1.2.2", + "web3-core": "1.2.2", + "web3-eth": "1.2.2", + "web3-eth-personal": "1.2.2", + "web3-net": "1.2.2", + "web3-shh": "1.2.2", + "web3-utils": "1.2.2" } }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" } } } }, - "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "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.0" - } - }, - "ansicolors": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz", - "integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk=", - "dev": true - }, - "antlr4": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/antlr4/-/antlr4-4.7.1.tgz", - "integrity": "sha512-haHyTW7Y9joE5MVs37P2lNYfU2RWBLfcRDD8OWldcdZm5TiCE91B5Xl1oWSwiDUSd4rlExpt2pu1fksYQjRBYQ==", - "dev": true - }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "@truffle/provider": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.3.tgz", + "integrity": "sha512-EsAE7eiXMlTAQBNst12fuTKddMMtqB7d9jQmVvYvq+/G3ryZCf50dTiod0lhTIh0dIQ/tirFdvBRKDfc8c+hsQ==", "dev": true, "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" + "@truffle/error": "^0.0.8", + "@truffle/interface-adapter": "^0.4.0", + "web3": "1.2.2" }, "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "@types/node": { + "version": "12.12.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.17.tgz", + "integrity": "sha512-Is+l3mcHvs47sKy+afn2O1rV4ldZFU7W8101cNlOd+MRbjM4Onida8jSZnJdTe/0Pcf25g9BNIUsuugmE6puHA==", + "dev": true + }, + "web3": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.2.tgz", + "integrity": "sha512-/ChbmB6qZpfGx6eNpczt5YSUBHEA5V2+iUCbn85EVb3Zv6FVxrOo5Tv7Lw0gE2tW7EEjASbCyp3mZeiZaCCngg==", "dev": true, "requires": { - "remove-trailing-separator": "^1.0.1" + "@types/node": "^12.6.1", + "web3-bzz": "1.2.2", + "web3-core": "1.2.2", + "web3-eth": "1.2.2", + "web3-eth-personal": "1.2.2", + "web3-net": "1.2.2", + "web3-shh": "1.2.2", + "web3-utils": "1.2.2" + } + }, + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" } } } }, - "app-module-path": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/app-module-path/-/app-module-path-2.2.0.tgz", - "integrity": "sha1-ZBqlXft9am8KgUHEucCqULbCTdU=" - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" + "@types/bignumber.js": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/bignumber.js/-/bignumber.js-5.0.0.tgz", + "integrity": "sha512-0DH7aPGCClywOFaxxjE6UwpN2kQYe9LwuDQMv+zYA97j5GkOMo8e66LYT+a8JYU7jfmUFRZLa9KycxHDsKXJCA==", + "dev": true, + "requires": { + "bignumber.js": "*" + } }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "optional": true, + "@types/bn.js": { + "version": "4.11.5", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.5.tgz", + "integrity": "sha512-AEAZcIZga0JgVMHNtl1CprA/hXX7/wPt79AgR4XqaDt7jyj3QWYw6LPoOiznPtugDmlubUnAahMs2PFxGcQrng==", "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" + "@types/node": "*" } }, - "arg": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz", - "integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==", - "dev": true + "@types/concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-OU2+C7X+5Gs42JZzXoto7yOQ0A0=", + "dev": true, + "requires": { + "@types/node": "*" + } }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "@types/ethereum-protocol": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/ethereum-protocol/-/ethereum-protocol-1.0.0.tgz", + "integrity": "sha512-3DiI3Zxf81CgX+VhxNNFJBv/sfr1BFBKQK2sQ85hU9FwWJJMWV5gRDV79OUNShiwj3tYYIezU94qpucsb3dThQ==", "requires": { - "sprintf-js": "~1.0.2" + "bignumber.js": "7.2.1" + }, + "dependencies": { + "bignumber.js": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", + "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" + } } }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-includes": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", - "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "@types/form-data": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", + "integrity": "sha1-yayFsqX9GENbjIXZ7LUObWyJP/g=", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.7.0" + "@types/node": "*" } }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "asap": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "@types/hdkey": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@types/hdkey/-/hdkey-0.7.0.tgz", + "integrity": "sha512-hS/ueljJBb6i7r7VqhgmBVmDqGKMqQg2nlGIaf71CCG6+iGNE7yeaHgtBWR/wveD+o+K0ma0VE/XweUBHHTQFQ==", "requires": { - "safer-buffer": "~2.1.0" + "@types/node": "*" } }, - "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==" - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" }, - "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true + "@types/node": { + "version": "10.14.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.4.tgz", + "integrity": "sha512-DT25xX/YgyPKiHFOpNuANIQIVvYEwCWXgK2jYYwqgaMrYE6+tq+DtmMwlD3drl6DJbUwtlIDnn0d7tIn/EbXBg==" }, - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + "@types/prop-types": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.1.tgz", + "integrity": "sha512-CFzn9idOEpHrgdw8JsoTkaDDyRWk1jrzIV8djzcgpq0y9tG4B4lFT+Nxh52DVpDXV+n4+NPNv7M1Dj5uMp6XFg==" }, - "async-each": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.2.tgz", - "integrity": "sha512-6xrbvN0MOBKSJDdonmSSz2OwFSgxRaVtBDes26mj9KIGtDo+g9xosFRSC+i1gQh2oAN/tQ62AI/pGZGQjVOiRg==", + "@types/qs": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-Jugo5V/1bS0fRhy2z8+cUAHEyWOATaz4rbyLVvcFs7+dXp5HfwpEwzF1Q11bB10ApUqHf+yTauxI0UXQDwGrbA==", "dev": true }, - "async-eventemitter": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", + "@types/react": { + "version": "16.8.20", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.8.20.tgz", + "integrity": "sha512-ZLmI+ubSJpfUIlQuULDDrdyuFQORBuGOvNnMue8HeA0GVrAJbWtZQhcBvnBPNRBI/GrfSfrKPFhthzC2SLEtLQ==", "requires": { - "async": "^2.4.0" - }, - "dependencies": { - "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", - "requires": { - "lodash": "^4.17.11" - } - } + "@types/prop-types": "*", + "csstype": "^2.2.0" } }, - "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=" - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true + "@types/solidity-parser-antlr": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@types/solidity-parser-antlr/-/solidity-parser-antlr-0.2.3.tgz", + "integrity": "sha512-FoSyZT+1TTaofbEtGW1oC9wHND1YshvVeHerME/Jh6gIdHbBAWFW8A97YYqO/dpHcFjIwEPEepX0Efl2ckJgwA==" }, - "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=" + "@types/web3-provider-engine": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@types/web3-provider-engine/-/web3-provider-engine-14.0.0.tgz", + "integrity": "sha512-yHr8mX2SoX3JNyfqdLXdO1UobsGhfiwSgtekbVxKLQrzD7vtpPkKbkIVsPFOhvekvNbPsCmDyeDCLkpeI9gSmA==", + "requires": { + "@types/ethereum-protocol": "*" + } }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + "@types/yargs": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-11.1.2.tgz", + "integrity": "sha512-zG61PAp2OcoIBjRV44wftJj6AJgzJrOc32LCYOBqk9bdgcdzK5DCJHV9QZJ60+Fu+fOn79g8Ks3Gixm4CfkZ+w==" }, - "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=", + "@web3-js/scrypt-shim": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@web3-js/scrypt-shim/-/scrypt-shim-0.1.0.tgz", + "integrity": "sha512-ZtZeWCc/s0nMcdx/+rZwY1EcuRdemOK9ag21ty9UsHkFxsNb/AaoucUz0iPuyGe0Ku+PFuRmWZG7Z7462p9xPw==", + "dev": true, "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" + "scryptsy": "^2.1.0", + "semver": "^6.3.0" }, "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true } } }, - "babel-core": { - "version": "6.26.3", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "@web3-js/websocket": { + "version": "1.0.30", + "resolved": "https://registry.npmjs.org/@web3-js/websocket/-/websocket-1.0.30.tgz", + "integrity": "sha512-fDwrD47MiDrzcJdSeTLF75aCcxVVt8B1N74rA+vh2XCAvFy4tEWJjtnUtj2QG7/zlQ6g9cQ88bZFBxwd9/FmtA==", + "dev": true, "requires": { - "babel-code-frame": "^6.26.0", - "babel-generator": "^6.26.0", - "babel-helpers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "convert-source-map": "^1.5.1", - "debug": "^2.6.9", - "json5": "^0.5.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.4", - "path-is-absolute": "^1.0.1", - "private": "^0.1.8", - "slash": "^1.0.0", - "source-map": "^0.5.7" + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "nan": "^2.14.0", + "typedarray-to-buffer": "^3.1.5", + "yaeti": "^0.0.6" }, "dependencies": { "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, "requires": { "ms": "2.0.0" } + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true } } }, - "babel-generator": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" - }, - "dependencies": { - "jsesc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=" - } + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" } }, - "babel-helper-builder-binary-assignment-operator-visitor": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", - "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", - "requires": { - "babel-helper-explode-assignable-expression": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", - "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true }, - "babel-helper-define-map": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", - "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "abi-decoder": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/abi-decoder/-/abi-decoder-2.2.0.tgz", + "integrity": "sha512-FVgkAvPRNa08E85Q+t52KlGto8XZeQITmCYdRIWHHth/t/pgdpAzZijy3LKUCBqmJjXnrosj4c6WGOB1q+KJ9w==", + "dev": true, "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" + "web3-eth-abi": "^1.2.1", + "web3-utils": "^1.2.1" } }, - "babel-helper-explode-assignable-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", - "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } + "abortcontroller-polyfill": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.3.0.tgz", + "integrity": "sha512-lbWQgf+eRvku3va8poBlDBO12FigTQr9Zb7NIjXrePrhxWVKdCP2wbDl1tLDaYa18PWTom3UEWwdH13S46I+yA==" }, - "babel-helper-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", "requires": { - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" + "xtend": "~4.0.0" } }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + }, + "dependencies": { + "mime-db": { + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz", + "integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.25", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.25.tgz", + "integrity": "sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg==", + "dev": true, + "requires": { + "mime-db": "1.42.0" + } + } } }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } + "acorn": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.0.0.tgz", + "integrity": "sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ==", + "dev": true }, - "babel-helper-optimise-call-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", - "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } + "acorn-jsx": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.2.tgz", + "integrity": "sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw==", + "dev": true }, - "babel-helper-regex": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", - "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", - "requires": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } + "aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" }, - "babel-helper-remap-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", - "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" + "es6-promisify": "^5.0.0" } }, - "babel-helper-replace-supers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", - "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "agentkeepalive": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", + "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", "requires": { - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" + "humanize-ms": "^1.2.1" } }, - "babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "ajv": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "requires": { - "babel-runtime": "^6.22.0" - } + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "optional": true }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "ansi-align": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", + "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", + "dev": true, "requires": { - "babel-runtime": "^6.22.0" + "string-width": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, - "babel-plugin-syntax-async-functions": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", - "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=" + "ansi-colors": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", + "dev": true }, - "babel-plugin-syntax-exponentiation-operator": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", - "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=" + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true }, - "babel-plugin-syntax-trailing-function-commas": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", - "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=" + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, - "babel-plugin-transform-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", - "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "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": { - "babel-helper-remap-async-to-generator": "^6.24.1", - "babel-plugin-syntax-async-functions": "^6.8.0", - "babel-runtime": "^6.22.0" + "color-convert": "^1.9.0" } }, - "babel-plugin-transform-es2015-arrow-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", - "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", - "requires": { - "babel-runtime": "^6.22.0" - } + "ansicolors": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz", + "integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk=", + "dev": true }, - "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", - "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", - "requires": { - "babel-runtime": "^6.22.0" - } + "antlr4": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/antlr4/-/antlr4-4.7.1.tgz", + "integrity": "sha512-haHyTW7Y9joE5MVs37P2lNYfU2RWBLfcRDD8OWldcdZm5TiCE91B5Xl1oWSwiDUSd4rlExpt2pu1fksYQjRBYQ==", + "dev": true }, - "babel-plugin-transform-es2015-block-scoping": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", - "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", - "requires": { - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", + "dev": true }, - "babel-plugin-transform-es2015-classes": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", - "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, "requires": { - "babel-helper-define-map": "^6.24.1", - "babel-helper-function-name": "^6.24.1", - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-helper-replace-supers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } } }, - "babel-plugin-transform-es2015-computed-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", - "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } + "app-module-path": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/app-module-path/-/app-module-path-2.2.0.tgz", + "integrity": "sha1-ZBqlXft9am8KgUHEucCqULbCTdU=" }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", - "requires": { - "babel-runtime": "^6.22.0" - } + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" }, - "babel-plugin-transform-es2015-duplicate-keys": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", - "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "optional": true, "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" } }, - "babel-plugin-transform-es2015-for-of": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", - "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", - "requires": { - "babel-runtime": "^6.22.0" - } + "arg": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz", + "integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==", + "dev": true }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", - "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "sprintf-js": "~1.0.2" } }, - "babel-plugin-transform-es2015-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", - "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", - "requires": { - "babel-runtime": "^6.22.0" - } + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true }, - "babel-plugin-transform-es2015-modules-amd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", - "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", - "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", - "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", - "requires": { - "babel-plugin-transform-strict-mode": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-types": "^6.26.0" - } + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true }, - "babel-plugin-transform-es2015-modules-systemjs": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", - "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true }, - "babel-plugin-transform-es2015-modules-umd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", - "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "array-includes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "dev": true, "requires": { - "babel-plugin-transform-es2015-modules-amd": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" + "define-properties": "^1.1.2", + "es-abstract": "^1.7.0" } }, - "babel-plugin-transform-es2015-object-super": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", - "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", - "requires": { - "babel-helper-replace-supers": "^6.24.1", - "babel-runtime": "^6.22.0" - } + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", - "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", - "requires": { - "babel-helper-call-delegate": "^6.24.1", - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true }, - "babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", - "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "safer-buffer": "~2.1.0" } }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, "requires": { - "babel-runtime": "^6.22.0" + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" } }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", - "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, - "babel-plugin-transform-es2015-template-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", - "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-typeof-symbol": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", - "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", - "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "regexpu-core": "^2.0.0" - } + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" }, - "babel-plugin-transform-exponentiation-operator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", - "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", - "requires": { - "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", - "babel-plugin-syntax-exponentiation-operator": "^6.8.0", - "babel-runtime": "^6.22.0" - } + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true }, - "babel-plugin-transform-regenerator": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", - "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", - "requires": { - "regenerator-transform": "^0.10.0" - } + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", - "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" }, - "babel-preset-env": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", - "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", - "requires": { - "babel-plugin-check-es2015-constants": "^6.22.0", - "babel-plugin-syntax-trailing-function-commas": "^6.22.0", - "babel-plugin-transform-async-to-generator": "^6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoping": "^6.23.0", - "babel-plugin-transform-es2015-classes": "^6.23.0", - "babel-plugin-transform-es2015-computed-properties": "^6.22.0", - "babel-plugin-transform-es2015-destructuring": "^6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", - "babel-plugin-transform-es2015-for-of": "^6.23.0", - "babel-plugin-transform-es2015-function-name": "^6.22.0", - "babel-plugin-transform-es2015-literals": "^6.22.0", - "babel-plugin-transform-es2015-modules-amd": "^6.22.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-umd": "^6.23.0", - "babel-plugin-transform-es2015-object-super": "^6.22.0", - "babel-plugin-transform-es2015-parameters": "^6.23.0", - "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", - "babel-plugin-transform-es2015-spread": "^6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", - "babel-plugin-transform-es2015-template-literals": "^6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", - "babel-plugin-transform-exponentiation-operator": "^6.22.0", - "babel-plugin-transform-regenerator": "^6.22.0", - "browserslist": "^3.2.6", - "invariant": "^2.2.2", - "semver": "^5.3.0" - } + "async-each": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.2.tgz", + "integrity": "sha512-6xrbvN0MOBKSJDdonmSSz2OwFSgxRaVtBDes26mj9KIGtDo+g9xosFRSC+i1gQh2oAN/tQ62AI/pGZGQjVOiRg==", + "dev": true }, - "babel-register": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", - "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "async-eventemitter": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", + "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", "requires": { - "babel-core": "^6.26.0", - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "home-or-tmp": "^2.0.0", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "source-map-support": "^0.4.15" + "async": "^2.4.0" }, "dependencies": { - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", "requires": { - "source-map": "^0.5.6" + "lodash": "^4.17.11" } } } }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } + "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==" }, - "babel-template": { + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "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.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + }, + "babel-code-frame": { "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } } }, - "babel-traverse": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", "requires": { "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", "babel-types": "^6.26.0", "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" }, "dependencies": { "debug": { @@ -2263,671 +2248,1313 @@ "requires": { "ms": "2.0.0" } - }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" } } }, - "babel-types": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", "requires": { + "babel-messages": "^6.23.0", "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - } - }, - "babelify": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", - "integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=", - "requires": { - "babel-core": "^6.0.14", - "object-assign": "^4.0.0" + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=" + } } }, - "babylon": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "requires": { + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } }, - "backoff": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", - "integrity": "sha1-9hbtqdPktmuMp/ynn2lXIsX44m8=", + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", "requires": { - "precond": "0.2" + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "babel-helper-define-map": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", "requires": { - "tweetnacl": "^0.14.3" + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, - "bignumber.js": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-8.0.2.tgz", - "integrity": "sha512-EiuvFrnbv0jFixEQ9f58jo7X0qI2lNGIr/MxntmVzQc5JUweDSh8y8hbTCAomFtqwUPIOWcLXP0VEOSZTG7FFw==" + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", "requires": { - "file-uri-to-path": "1.0.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, - "bip39": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-2.6.0.tgz", - "integrity": "sha512-RrnQRG2EgEoqO24ea+Q/fftuPUZLmrEM3qNhhGsA3PbaXaCW791LTzPuVyx/VprXQcTbPJ3K3UeTna8ZnVl2sg==", + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", "requires": { - "create-hash": "^1.1.0", - "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1", - "safe-buffer": "^5.0.1", - "unorm": "^1.3.3" + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" } }, - "bip66": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", "requires": { - "safe-buffer": "^5.0.1" + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, - "bl": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", - "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", - "optional": true, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", "requires": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, - "bluebird": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", - "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==" + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } }, - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "requires": { + "babel-runtime": "^6.22.0" + } }, - "boxen": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", - "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", - "dev": true, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", "requires": { - "ansi-align": "^2.0.0", - "camelcase": "^4.0.0", - "chalk": "^2.0.1", - "cli-boxes": "^1.0.0", - "string-width": "^2.0.0", - "term-size": "^1.2.0", - "widest-line": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } + "babel-runtime": "^6.22.0" } }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=" + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=" + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=" + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" } }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "babel-runtime": "^6.22.0" } }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "requires": { + "babel-runtime": "^6.22.0" + } }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "requires": { + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "babel-helper-define-map": "^6.24.1", + "babel-helper-function-name": "^6.24.1", + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-helper-replace-supers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, - "browserslist": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", - "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", "requires": { - "caniuse-lite": "^1.0.30000844", - "electron-to-chromium": "^1.3.47" + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, - "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==", - "optional": true, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", "requires": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" + "babel-runtime": "^6.22.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==", - "optional": true + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } }, - "buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", - "optional": true + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "requires": { + "babel-runtime": "^6.22.0" + } }, - "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==" + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } }, - "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=" + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "requires": { + "babel-runtime": "^6.22.0" + } }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } }, - "builtins": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", - "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=" + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", + "requires": { + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" + } }, - "cacache": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.0.tgz", - "integrity": "sha512-0baf1FhCp16LhN+xDJsOrSiaPDCTD3JegZptVmLDoEbFcT5aT+BeFGt3wcDU3olCP5tpTCXU5sv0+TsKWT9WGQ==", + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", "requires": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - }, - "dependencies": { - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "requires": { - "yallist": "^3.0.2" - } - }, - "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==" - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" - } + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, - "cacheable-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", - "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", "requires": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "dependencies": { - "get-stream": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", - "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", - "requires": { - "pump": "^3.0.0" - } - }, - "http-cache-semantics": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz", - "integrity": "sha512-TcIMG3qeVLgDr1TEd2XvHaTnMPwYQUQMIBLy+5pLSDKYFc7UIqj39w8EGzZkaxoLv/l2K8HaI0t5AVA+YYgUew==" - }, - "lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==" - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.0" } }, - "caller-callsite": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", - "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", - "dev": true, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", "requires": { - "callsites": "^2.0.0" - }, - "dependencies": { - "callsites": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", - "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", - "dev": true - } + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, - "caller-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", - "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", - "dev": true, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", "requires": { - "caller-callsite": "^2.0.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" - }, - "caniuse-lite": { - "version": "1.0.30000974", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000974.tgz", - "integrity": "sha512-xc3rkNS/Zc3CmpMKuczWEdY2sZgx09BkAxfvkxlAEBTqcMHeL8QnPqhKse+5sRTi3nrw2pJwToD2WvKn1Uhvww==" + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "requires": { + "babel-runtime": "^6.22.0" + } }, - "capture-stack-trace": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", - "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", - "dev": true + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } }, - "cardinal": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/cardinal/-/cardinal-2.1.1.tgz", - "integrity": "sha1-fMEFXYItISlU0HsIXeolHMe8VQU=", - "dev": true, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", "requires": { - "ansicolors": "~0.3.2", - "redeyed": "~2.1.0" + "babel-runtime": "^6.22.0" } }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "requires": { + "babel-runtime": "^6.22.0" + } }, - "chai": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", - "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", "requires": { - "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.5" + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" } }, - "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==", - "dev": true, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", "requires": { - "check-error": "^1.0.2" + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" } }, - "chai-bn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/chai-bn/-/chai-bn-0.1.1.tgz", - "integrity": "sha512-e1npVXt3cQfZ6oQET9oP38vNj/4HeJ4ojeUpuC8YzhVbTJpIDqANVt7TKi7Dq9yKlHySk2FqbmiMih35iT4DYg==", - "dev": true + "babel-plugin-transform-regenerator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "requires": { + "regenerator-transform": "^0.10.0" + } }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-preset-env": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", + "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", + "requires": { + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-to-generator": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.23.0", + "babel-plugin-transform-es2015-classes": "^6.23.0", + "babel-plugin-transform-es2015-computed-properties": "^6.22.0", + "babel-plugin-transform-es2015-destructuring": "^6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", + "babel-plugin-transform-es2015-for-of": "^6.23.0", + "babel-plugin-transform-es2015-function-name": "^6.22.0", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.22.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-umd": "^6.23.0", + "babel-plugin-transform-es2015-object-super": "^6.22.0", + "babel-plugin-transform-es2015-parameters": "^6.23.0", + "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", + "babel-plugin-transform-exponentiation-operator": "^6.22.0", + "babel-plugin-transform-regenerator": "^6.22.0", + "browserslist": "^3.2.6", + "invariant": "^2.2.2", + "semver": "^5.3.0" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "requires": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" }, "dependencies": { - "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==", + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "requires": { - "has-flag": "^3.0.0" + "source-map": "^0.5.6" } } } }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } }, - "charenc": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", - "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", - "dev": true + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=" + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + }, + "dependencies": { + "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" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" + } + } }, - "checkpoint-store": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", - "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", "requires": { - "functional-red-black-tree": "^1.0.1" + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" } }, - "chokidar": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz", - "integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==", + "babelify": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", + "integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=", + "requires": { + "babel-core": "^6.0.14", + "object-assign": "^4.0.0" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" + }, + "backoff": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", + "integrity": "sha1-9hbtqdPktmuMp/ynn2lXIsX44m8=", + "requires": { + "precond": "0.2" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" }, "dependencies": { - "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, - "optional": true, "requires": { - "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bignumber.js": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-8.0.2.tgz", + "integrity": "sha512-EiuvFrnbv0jFixEQ9f58jo7X0qI2lNGIr/MxntmVzQc5JUweDSh8y8hbTCAomFtqwUPIOWcLXP0VEOSZTG7FFw==" + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bip39": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-2.6.0.tgz", + "integrity": "sha512-RrnQRG2EgEoqO24ea+Q/fftuPUZLmrEM3qNhhGsA3PbaXaCW791LTzPuVyx/VprXQcTbPJ3K3UeTna8ZnVl2sg==", + "requires": { + "create-hash": "^1.1.0", + "pbkdf2": "^3.0.9", + "randombytes": "^2.0.1", + "safe-buffer": "^5.0.1", + "unorm": "^1.3.3" + } + }, + "bip66": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", + "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "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.5", + "safe-buffer": "^5.1.1" + } + }, + "bluebird": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", + "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==" + }, + "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.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true + } + } + }, + "boxen": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", + "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", + "dev": true, + "requires": { + "ansi-align": "^2.0.0", + "camelcase": "^4.0.0", + "chalk": "^2.0.1", + "cli-boxes": "^1.0.0", + "string-width": "^2.0.0", + "term-size": "^1.2.0", + "widest-line": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "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" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "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.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" + }, + "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.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "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==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "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==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "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=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "browserslist": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", + "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", + "requires": { + "caniuse-lite": "^1.0.30000844", + "electron-to-chromium": "^1.3.47" + } + }, + "buffer": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz", + "integrity": "sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "buffer-alloc": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "requires": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, + "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=" + }, + "builtins": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", + "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=" + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + }, + "cacache": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.0.tgz", + "integrity": "sha512-0baf1FhCp16LhN+xDJsOrSiaPDCTD3JegZptVmLDoEbFcT5aT+BeFGt3wcDU3olCP5tpTCXU5sv0+TsKWT9WGQ==", + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + }, + "dependencies": { + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + }, + "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==" + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "dependencies": { + "get-stream": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", + "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "requires": { + "pump": "^3.0.0" + } + }, + "http-cache-semantics": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz", + "integrity": "sha512-TcIMG3qeVLgDr1TEd2XvHaTnMPwYQUQMIBLy+5pLSDKYFc7UIqj39w8EGzZkaxoLv/l2K8HaI0t5AVA+YYgUew==" + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==" + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "dev": true, + "requires": { + "callsites": "^2.0.0" + }, + "dependencies": { + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + } + } + }, + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "dev": true, + "requires": { + "caller-callsite": "^2.0.0" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "caniuse-lite": { + "version": "1.0.30000974", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000974.tgz", + "integrity": "sha512-xc3rkNS/Zc3CmpMKuczWEdY2sZgx09BkAxfvkxlAEBTqcMHeL8QnPqhKse+5sRTi3nrw2pJwToD2WvKn1Uhvww==" + }, + "capture-stack-trace": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", + "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", + "dev": true + }, + "cardinal": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/cardinal/-/cardinal-2.1.1.tgz", + "integrity": "sha1-fMEFXYItISlU0HsIXeolHMe8VQU=", + "dev": true, + "requires": { + "ansicolors": "~0.3.2", + "redeyed": "~2.1.0" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "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.5" + } + }, + "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==", + "dev": true, + "requires": { + "check-error": "^1.0.2" + } + }, + "chai-bn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/chai-bn/-/chai-bn-0.1.1.tgz", + "integrity": "sha512-e1npVXt3cQfZ6oQET9oP38vNj/4HeJ4ojeUpuC8YzhVbTJpIDqANVt7TKi7Dq9yKlHySk2FqbmiMih35iT4DYg==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "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.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", + "dev": true + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=" + }, + "checkpoint-store": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", + "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", + "requires": { + "functional-red-black-tree": "^1.0.1" + } + }, + "chokidar": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz", + "integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + }, + "dependencies": { + "fsevents": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { "version": "1.1.1", "bundled": true, "dev": true, @@ -3743,6 +4370,21 @@ "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "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==", + "dev": true + }, "convert-source-map": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", @@ -3751,6 +4393,24 @@ "safe-buffer": "~5.1.1" } }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "dev": true + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", + "dev": true + }, "copy-concurrently": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", @@ -3780,6 +4440,16 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, "cosmiconfig": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", @@ -3836,6 +4506,16 @@ } } }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, "create-error-class": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", @@ -3907,6 +4587,31 @@ "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", "dev": true }, + "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==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "crypto-js": { + "version": "3.1.9-1", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz", + "integrity": "sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg=", + "dev": true + }, "crypto-random-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", @@ -3922,6 +4627,16 @@ "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=" }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -3948,6 +4663,22 @@ "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=", + "dev": true, + "requires": { + "decompress-tar": "^4.0.0", + "decompress-tarbz2": "^4.0.0", + "decompress-targz": "^4.0.0", + "decompress-unzip": "^4.0.1", + "graceful-fs": "^4.1.10", + "make-dir": "^1.0.0", + "pify": "^2.3.0", + "strip-dirs": "^2.0.0" + } + }, "decompress-response": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", @@ -3956,6 +4687,79 @@ "mimic-response": "^1.0.0" } }, + "decompress-tar": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", + "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", + "dev": true, + "requires": { + "file-type": "^5.2.0", + "is-stream": "^1.1.0", + "tar-stream": "^1.5.2" + } + }, + "decompress-tarbz2": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", + "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", + "dev": true, + "requires": { + "decompress-tar": "^4.1.0", + "file-type": "^6.1.0", + "is-stream": "^1.1.0", + "seek-bzip": "^1.0.5", + "unbzip2-stream": "^1.0.9" + }, + "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==", + "dev": true + } + } + }, + "decompress-targz": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", + "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", + "dev": true, + "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=", + "dev": true, + "requires": { + "file-type": "^3.8.0", + "get-stream": "^2.2.0", + "pify": "^2.3.0", + "yauzl": "^2.4.2" + }, + "dependencies": { + "file-type": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", + "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=", + "dev": true + }, + "get-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", + "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" + } + } + } + }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -4057,6 +4861,28 @@ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "optional": true }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, "detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", @@ -4081,6 +4907,17 @@ "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, "dir-to-object": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dir-to-object/-/dir-to-object-2.0.0.tgz", @@ -4144,6 +4981,12 @@ "safer-buffer": "^2.1.0" } }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, "electron-to-chromium": { "version": "1.3.159", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.159.tgz", @@ -4168,6 +5011,12 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, "encoding": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", @@ -4229,6 +5078,28 @@ "is-symbol": "^1.0.2" } }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "dev": true, + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -4242,6 +5113,22 @@ "es6-promise": "^4.0.3" } }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dev": true, + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -4688,6 +5575,12 @@ "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=", + "dev": true + }, "eth-block-tracker": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/eth-block-tracker/-/eth-block-tracker-3.0.1.tgz", @@ -4702,6 +5595,24 @@ "tape": "^4.6.3" } }, + "eth-ens-namehash": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", + "integrity": "sha1-IprEbsqG1S4MmR58sq74P/D2i88=", + "dev": true, + "requires": { + "idna-uts46-hx": "^2.3.1", + "js-sha3": "^0.5.7" + }, + "dependencies": { + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true + } + } + }, "eth-gas-reporter": { "version": "0.2.11", "resolved": "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.2.11.tgz", @@ -4821,11 +5732,50 @@ } } }, + "ethereum-bloom-filters": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.6.tgz", + "integrity": "sha512-dE9CGNzgOOsdh7msZirvv8qjHtnHpvBlKe2647kM8v+yeF71IRso55jpojemvHV+jMjr48irPWxMRaHuOWzAFA==", + "dev": true, + "requires": { + "js-sha3": "^0.8.0" + }, + "dependencies": { + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true + } + } + }, "ethereum-common": { "version": "0.0.18", "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", "integrity": "sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=" }, + "ethereum-ens": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/ethereum-ens/-/ethereum-ens-0.7.8.tgz", + "integrity": "sha512-HJBDmF5/abP/IIM6N7rGHmmlQ4yCKIVK4kzT/Mu05+eZn0i5ZlR25LTAE47SVZ7oyTBvOkNJhxhSkWRvjh7srg==", + "dev": true, + "requires": { + "bluebird": "^3.4.7", + "eth-ens-namehash": "^2.0.0", + "js-sha3": "^0.5.7", + "pako": "^1.0.4", + "underscore": "^1.8.3", + "web3": "^1.0.0-beta.34" + }, + "dependencies": { + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true + } + } + }, "ethereum-types": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/ethereum-types/-/ethereum-types-2.1.5.tgz", @@ -5043,6 +5993,31 @@ } } }, + "ethjs-abi": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ethjs-abi/-/ethjs-abi-0.2.1.tgz", + "integrity": "sha1-4KepOn6BFjqUR3utVu3lJKtt5TM=", + "dev": true, + "requires": { + "bn.js": "4.11.6", + "js-sha3": "0.5.5", + "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=", + "dev": true + }, + "js-sha3": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.5.tgz", + "integrity": "sha1-uvDA6MVK1ZA0R9+Wreekobynmko=", + "dev": true + } + } + }, "ethjs-unit": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", @@ -5068,6 +6043,12 @@ "strip-hex-prefix": "1.0.0" } }, + "eventemitter3": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", + "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==", + "dev": true + }, "events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", @@ -5146,6 +6127,78 @@ "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", "optional": true }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "dev": true, + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "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.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true + } + } + }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==", + "dev": true + } + } + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -5291,6 +6344,15 @@ "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=", + "dev": true, + "requires": { + "pend": "~1.2.0" + } + }, "fetch-ponyfill": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz", @@ -5322,6 +6384,12 @@ "flat-cache": "^2.0.1" } }, + "file-type": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", + "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=", + "dev": true + }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -5350,6 +6418,32 @@ } } }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -5445,6 +6539,12 @@ "mime-types": "^2.1.12" } }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "dev": true + }, "fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", @@ -5454,6 +6554,12 @@ "map-cache": "^0.2.2" } }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, "from2": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", @@ -5466,8 +6572,7 @@ "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==", - "optional": true + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, "fs-extra": { "version": "0.30.0", @@ -12081,6 +13186,17 @@ "glogg": "^1.0.0" } }, + "handlebars": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", + "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "requires": { + "neo-async": "^2.6.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + } + }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -17688,6 +18804,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", + "optional": true, "requires": { "commander": "~2.20.0", "source-map": "~0.6.1" @@ -19146,1748 +20263,2531 @@ "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", "optional": true, "requires": { - "buffer-to-arraybuffer": "^0.0.5", - "object-assign": "^4.1.1", - "query-string": "^5.0.1", - "simple-get": "^2.7.0", - "timed-out": "^4.0.1", - "url-set-query": "^1.0.0", - "xhr": "^2.0.4" + "buffer-to-arraybuffer": "^0.0.5", + "object-assign": "^4.1.1", + "query-string": "^5.0.1", + "simple-get": "^2.7.0", + "timed-out": "^4.0.1", + "url-set-query": "^1.0.0", + "xhr": "^2.0.4" + } + }, + "xhr-request-promise": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.2.tgz", + "integrity": "sha1-NDxE0e53JrhkgGloLQ+EDIO0Jh0=", + "optional": true, + "requires": { + "xhr-request": "^1.0.1" + } + }, + "xhr2-cookies": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz", + "integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=", + "optional": true, + "requires": { + "cookiejar": "^2.1.1" + } + }, + "xmlhttprequest": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, + "yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "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", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.0" + } + }, + "yargs-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", + "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "requires": { + "camelcase": "^3.0.0" + } + }, + "yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "optional": true, + "requires": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "yup": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/yup/-/yup-0.27.0.tgz", + "integrity": "sha512-v1yFnE4+u9za42gG/b/081E7uNW9mUj3qtkmelLbW5YPROZzSH/KUUyJu9Wt8vxFJcT9otL/eZopS0YK1L5yPQ==", + "requires": { + "@babel/runtime": "^7.0.0", + "fn-name": "~2.0.1", + "lodash": "^4.17.11", + "property-expr": "^1.5.0", + "synchronous-promise": "^2.0.6", + "toposort": "^2.0.2" + } + } + } + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "genfun": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz", + "integrity": "sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==" + }, + "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-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", + "dev": true + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "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" + } + }, + "github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=", + "optional": true + }, + "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.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.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=", - "optional": true, + } + } + }, + "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.1" + } + }, + "global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "requires": { + "ini": "^1.3.4" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "got": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", + "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", + "dev": true, + "requires": { + "create-error-class": "^3.0.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-redirect": "^1.0.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "lowercase-keys": "^1.0.0", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "unzip-response": "^2.0.1", + "url-parse-lax": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" + }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "handlebars": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", + "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", + "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==" + } + } + }, + "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.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "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.0.0" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "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==", + "dev": true + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" + }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "dev": true, + "requires": { + "has-symbol-support-x": "^1.4.1" + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "optional": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, "requires": { - "xhr-request": "^1.0.1" + "is-buffer": "^1.1.5" } + } + } + }, + "has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==" + }, + "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.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hdkey": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-0.7.1.tgz", + "integrity": "sha1-yu5L6BqneSHpCbjSKN0PKayu5jI=", + "requires": { + "coinstring": "^2.0.0", + "secp256k1": "^3.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.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^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-basic": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-8.1.3.tgz", + "integrity": "sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==", + "dev": true, + "requires": { + "caseless": "^0.12.0", + "concat-stream": "^1.6.2", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + } + }, + "http-cache-semantics": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", + "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==" + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "http-https": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", + "integrity": "sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs=", + "dev": true + }, + "http-proxy-agent": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", + "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "requires": { + "agent-base": "4", + "debug": "3.1.0" + } + }, + "http-response-object": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", + "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", + "dev": true, + "requires": { + "@types/node": "^10.0.3" + } + }, + "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.2.2", + "sshpk": "^1.7.0" + } + }, + "https-proxy-agent": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", + "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==", + "requires": { + "agent-base": "^4.3.0", + "debug": "^3.1.0" + } + }, + "humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "requires": { + "ms": "^2.0.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "idna-uts46-hx": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz", + "integrity": "sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==", + "dev": true, + "requires": { + "punycode": "2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", + "integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0=", + "dev": true + } + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=" + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "dev": true + }, + "ignore-walk": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "requires": { + "minimatch": "^3.0.4" + } + }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + }, + "import-fresh": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", + "integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } + } + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=" + }, + "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.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, + "inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true }, - "xhr2-cookies": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz", - "integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=", - "optional": true, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, "requires": { - "cookiejar": "^2.1.1" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, - "xmlhttprequest": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", - "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" - }, - "yaeti": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" - }, - "yargs": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, "requires": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "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", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" + "ansi-regex": "^4.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + } } - }, - "yargs-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", - "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + } + } + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "requires": { + "loose-envify": "^1.0.0" + } + }, + "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=" + }, + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" + }, + "ipaddr.js": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { - "camelcase": "^3.0.0" + "is-buffer": "^1.1.5" } - }, - "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", - "optional": true, + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" + }, + "is-ci": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", + "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", + "dev": true, + "requires": { + "ci-info": "^1.5.0" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" + "is-buffer": "^1.1.5" } - }, - "yup": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/yup/-/yup-0.27.0.tgz", - "integrity": "sha512-v1yFnE4+u9za42gG/b/081E7uNW9mUj3qtkmelLbW5YPROZzSH/KUUyJu9Wt8vxFJcT9otL/eZopS0YK1L5yPQ==", + } + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-fn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fn/-/is-fn-1.0.0.tgz", + "integrity": "sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw=" + }, + "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.0" + } + }, + "is-function": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", + "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=" + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "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-installed-globally": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", + "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", + "requires": { + "global-dirs": "^0.1.0", + "is-path-inside": "^1.0.0" + } + }, + "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=", + "dev": true + }, + "is-npm": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", + "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { - "@babel/runtime": "^7.0.0", - "fn-name": "~2.0.1", - "lodash": "^4.17.11", - "property-expr": "^1.5.0", - "synchronous-promise": "^2.0.6", - "toposort": "^2.0.2" + "is-buffer": "^1.1.5" } } } }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "optional": true, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" + }, + "is-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", + "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", + "dev": true + }, + "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": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" + "path-is-inside": "^1.0.1" } }, - "genfun": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz", - "integrity": "sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==" - }, - "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==" + "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=", + "dev": true }, - "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=" + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } }, - "get-port": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", - "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, - "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "is-redirect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", "dev": true }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "requires": { + "has": "^1.0.1" + } }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "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=", "dev": true }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", "requires": { - "assert-plus": "^1.0.0" + "has-symbols": "^1.0.0" } }, - "github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=", - "optional": true + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==" + }, + "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=" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "node-fetch": "^1.0.1", + "whatwg-fetch": ">=0.10.0" } }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, + "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": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" + }, + "dependencies": { + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=" + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", "requires": { - "is-extglob": "^2.1.0" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=" + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "requires": { + "abbrev": "1" + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" + }, + "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" } } } }, - "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.1" - } - }, - "global-dirs": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", - "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", - "requires": { - "ini": "^1.3.4" - } - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "got": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", - "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", + "isurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", "dev": true, "requires": { - "create-error-class": "^3.0.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-redirect": "^1.0.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "lowercase-keys": "^1.0.0", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "unzip-response": "^2.0.1", - "url-parse-lax": "^1.0.0" + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" } }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" + "jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=" }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true + "js-sha3": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.7.0.tgz", + "integrity": "sha512-Wpks3yBDm0UcL5qlVhwW9Jr9n9i4FfeWBFOOXP5puDS/SiudJGhw7DPyBqn3487qD4F0lsC0q3zxink37f7zeA==" }, - "handlebars": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", - "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "requires": { - "neo-async": "^2.6.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" + "argparse": "^1.0.7", + "esprima": "^4.0.0" }, "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" } } }, - "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.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "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.0.0" - } + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "optional": true + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, + "json-parse-helpfulerror": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", + "integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=", "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" + "jju": "^1.1.0" } }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, + "json-rpc-engine": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz", + "integrity": "sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA==", "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" + "async": "^2.0.1", + "babel-preset-env": "^1.7.0", + "babelify": "^7.3.0", + "json-rpc-error": "^2.0.0", + "promise-to-callback": "^1.0.0", + "safe-event-emitter": "^1.0.1" }, "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, + "async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", "requires": { - "is-buffer": "^1.1.5" + "lodash": "^4.17.11" } } } }, - "has-yarn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", - "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==" - }, - "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.1", - "safe-buffer": "^5.0.1" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hdkey": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-0.7.1.tgz", - "integrity": "sha1-yu5L6BqneSHpCbjSKN0PKayu5jI=", - "requires": { - "coinstring": "^2.0.0", - "secp256k1": "^3.0.1" + "json-rpc-error": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/json-rpc-error/-/json-rpc-error-2.0.0.tgz", + "integrity": "sha1-p6+cICg4tekFxyUOVH8a/3cligI=", + "requires": { + "inherits": "^2.0.1" } }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=" + "json-rpc-random-id": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz", + "integrity": "sha1-uknZat7RRE27jaPSA3SKy7zeyMg=" }, - "hmac-drbg": { + "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.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stable-stringify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" + "jsonify": "~0.0.0" } }, - "home-or-tmp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", - "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.1" - } + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true }, - "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==" + "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=" }, - "http-basic": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-8.1.3.tgz", - "integrity": "sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==", - "dev": true, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "requires": { - "caseless": "^0.12.0", - "concat-stream": "^1.6.2", - "http-response-object": "^3.0.1", - "parse-cache-control": "^1.0.1" + "graceful-fs": "^4.1.6" } }, - "http-cache-semantics": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", - "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==" + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" }, - "http-proxy-agent": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", - "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" + }, + "jsonschema": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.4.tgz", + "integrity": "sha512-lz1nOH69GbsVHeVgEdvyavc/33oymY1AZwtePMiMj4HZPMbP5OIKK3zT9INMWjwua/V4Z4yq7wSlBbSG+g4AEw==" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", "requires": { - "agent-base": "4", - "debug": "3.1.0" + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" } }, - "http-response-object": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", - "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", - "dev": true, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "requires": { - "@types/node": "^10.0.3" + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" } }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" + "json-buffer": "3.0.0" } }, - "https-proxy-agent": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", - "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==", + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", "requires": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" + "graceful-fs": "^4.1.9" } }, - "humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==" + }, + "latest-version": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", + "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", + "dev": true, "requires": { - "ms": "^2.0.0" + "package-json": "^4.0.0" } }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "invert-kv": "^1.0.0" } }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=" - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "lcov-parse": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", + "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", "dev": true }, - "ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", - "dev": true + "level-codec": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" }, - "ignore-walk": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", "requires": { - "minimatch": "^3.0.4" + "errno": "~0.1.1" } }, - "immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" - }, - "import-fresh": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", - "integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==", - "dev": true, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" }, "dependencies": { - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - } - } - }, - "import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=" - }, - "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.3.0", - "wrappy": "1" + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } } }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" - }, - "inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", - "dev": true, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", "requires": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" } }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", "requires": { - "ansi-regex": "^4.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - } + "object-keys": "~0.4.0" } } } }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "requires": { - "loose-envify": "^1.0.0" - } - }, - "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=" - }, - "ip": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", "requires": { - "kind-of": "^3.0.2" + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" }, "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" } } }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "requires": { - "binary-extensions": "^1.0.0" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" - }, - "is-ci": { + "libnpmconfig": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", - "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", - "dev": true, - "requires": { - "ci-info": "^1.5.0" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, + "resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz", + "integrity": "sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==", "requires": { - "kind-of": "^3.0.2" + "figgy-pudding": "^3.5.1", + "find-up": "^3.0.0", + "ini": "^1.3.5" }, "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, + "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": { - "is-buffer": "^1.1.5" + "locate-path": "^3.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" + } + }, + "p-limit": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "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-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" } } }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" }, "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" } } }, - "is-directory": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", - "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", "dev": true }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "lodash.toarray": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz", + "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=", "dev": true }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + "lodash.values": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-4.3.0.tgz", + "integrity": "sha1-o6bCsOvsxcLLocF+bmIP6BtT00c=" }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "requires": { - "number-is-nan": "^1.0.0" - } + "log-driver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", + "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", + "dev": true }, - "is-fn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fn/-/is-fn-1.0.0.tgz", - "integrity": "sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw=" + "loglevel": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.4.tgz", + "integrity": "sha512-p0b6mOGKcGa+7nnmKbpzR6qloPbrgLcnio++E+14Vo/XffOGwZtRpUhr8dTH/x2oCMmEoIU0Zwm3ZauhvYD17g==" }, - "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=", + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "requires": { - "number-is-nan": "^1.0.0" + "js-tokens": "^3.0.0 || ^4.0.0" } }, - "is-function": { + "lowercase-keys": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", - "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=" + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "requires": { - "is-extglob": "^2.1.1" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, - "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=" + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" }, - "is-installed-globally": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", - "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "requires": { - "global-dirs": "^0.1.0", - "is-path-inside": "^1.0.0" + "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=" + } } }, - "is-npm": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", - "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", + "make-error": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", + "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", "dev": true }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, + "make-fetch-happen": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.0.tgz", + "integrity": "sha512-nFr/vpL1Jc60etMVKeaLOqfGjMMb3tAHFVJWxHOFCFS04Zmd7kGlMxo0l1tzfhoQje0/UPnd0X8OeGUiXXnfPA==", "requires": { - "kind-of": "^3.0.2" + "agentkeepalive": "^3.4.1", + "cacache": "^12.0.0", + "http-cache-semantics": "^3.8.1", + "http-proxy-agent": "^2.1.0", + "https-proxy-agent": "^2.2.1", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "node-fetch-npm": "^2.0.2", + "promise-retry": "^1.1.1", + "socks-proxy-agent": "^4.0.0", + "ssri": "^6.0.0" }, "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "requires": { - "is-buffer": "^1.1.5" + "yallist": "^3.0.2" } + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" } } }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" - }, - "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.1" - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, - "is-redirect": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", - "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", - "dev": true - }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "requires": { - "has": "^1.0.1" - } - }, - "is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, - "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", - "requires": { - "has-symbols": "^1.0.0" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, - "is-yarn-global": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", - "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==" - }, - "isarray": { + "map-visit": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "markdown-table": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.3.tgz", + "integrity": "sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==", + "dev": true }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "marked": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", + "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==", "dev": true }, - "isomorphic-fetch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", - "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", + "marked-terminal": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-3.3.0.tgz", + "integrity": "sha512-+IUQJ5VlZoAFsM5MHNT7g3RHSkA3eETqhRCdXv4niUMAKHQ7lb1yvAcuGPmm4soxhmtX13u4Li6ZToXtvSEH+A==", + "dev": true, "requires": { - "node-fetch": "^1.0.1", - "whatwg-fetch": ">=0.10.0" + "ansi-escapes": "^3.1.0", + "cardinal": "^2.1.1", + "chalk": "^2.4.1", + "cli-table": "^0.3.1", + "node-emoji": "^1.4.1", + "supports-hyperlinks": "^1.0.1" } }, - "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=", + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "requires": { - "abbrev": "1.0.x", - "async": "1.x", - "escodegen": "1.8.x", - "esprima": "2.7.x", - "glob": "^5.0.15", - "handlebars": "^4.0.1", - "js-yaml": "3.x", - "mkdirp": "0.5.x", - "nopt": "3.x", - "once": "1.x", - "resolve": "1.1.x", - "supports-color": "^3.1.0", - "which": "^1.1.1", - "wordwrap": "^1.0.0" - }, - "dependencies": { - "abbrev": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=" - }, - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=" - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "requires": { - "abbrev": "1" - } - }, - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" - }, - "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" - } - } + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" } }, - "jju": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", - "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=" - }, - "js-sha3": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.7.0.tgz", - "integrity": "sha512-Wpks3yBDm0UcL5qlVhwW9Jr9n9i4FfeWBFOOXP5puDS/SiudJGhw7DPyBqn3487qD4F0lsC0q3zxink37f7zeA==" + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "requires": { + "mimic-fn": "^1.0.0" + } }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.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==" + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "requires": { + "xtend": "~4.0.0" + } } } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" - }, - "json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=" }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true }, - "json-parse-helpfulerror": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", - "integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=", + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", "requires": { - "jju": "^1.1.0" + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" } }, - "json-rpc-engine": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz", - "integrity": "sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA==", + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, "requires": { - "async": "^2.0.1", - "babel-preset-env": "^1.7.0", - "babelify": "^7.3.0", - "json-rpc-error": "^2.0.0", - "promise-to-callback": "^1.0.0", - "safe-event-emitter": "^1.0.1" - }, - "dependencies": { - "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", - "requires": { - "lodash": "^4.17.11" - } - } + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" } }, - "json-rpc-error": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/json-rpc-error/-/json-rpc-error-2.0.0.tgz", - "integrity": "sha1-p6+cICg4tekFxyUOVH8a/3cligI=", + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, "requires": { - "inherits": "^2.0.1" + "bn.js": "^4.0.0", + "brorand": "^1.0.1" } }, - "json-rpc-random-id": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz", - "integrity": "sha1-uknZat7RRE27jaPSA3SKy7zeyMg=" + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + "mime-db": { + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", + "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "mime-types": { + "version": "2.1.22", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", + "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "requires": { + "mime-db": "~1.38.0" + } }, - "json-stable-stringify": { + "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/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "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": { - "jsonify": "~0.0.0" + "dom-walk": "^0.1.0" } }, - "json-stable-stringify-without-jsonify": { + "minimalistic-assert": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" }, - "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=" + "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=" }, - "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" + "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.7" + } }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "minipass": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", + "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "requires": { - "graceful-fs": "^4.1.6" + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + }, + "dependencies": { + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + } } }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" + "minizlib": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", + "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "requires": { + "minipass": "^2.2.1" + } }, - "jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" + "mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } }, - "jsonschema": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.4.tgz", - "integrity": "sha512-lz1nOH69GbsVHeVgEdvyavc/33oymY1AZwtePMiMj4HZPMbP5OIKK3zT9INMWjwua/V4Z4yq7wSlBbSG+g4AEw==" + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" + "minimist": "0.0.8" } }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "mkdirp-promise": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", + "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", + "dev": true, "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" + "mkdirp": "*" } }, - "keyv": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", - "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", "requires": { - "json-buffer": "3.0.0" + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==" + } } }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "mock-fs": { + "version": "4.10.4", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.4.tgz", + "integrity": "sha512-gDfZDLaPIvtOusbusLinfx6YSe2YpQsDT8qdP41P47dQ/NQggtkHukz7hwqgt8QvMBmAv+Z6DGmXPyb5BWX2nQ==", "dev": true }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", "requires": { - "graceful-fs": "^4.1.9" + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" } }, - "kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==" + "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=", + "dev": true + }, + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" }, - "latest-version": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", - "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", + "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=", + "dev": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", "dev": true, "requires": { - "package-json": "^4.0.0" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" } }, - "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" - } + "napi-build-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.1.tgz", + "integrity": "sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==", + "optional": true }, - "lcov-parse": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", - "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "level-codec": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", - "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true }, - "level-errors": { + "nested-error-stacks": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.0.1.tgz", + "integrity": "sha512-SrQrok4CATudVzBS7coSz26QRSmlK9TzzoFbeKfcPBUFPjcQM9Rqvr/DlJkOrwI/0KcgvMub1n1g5Jt9EgRn4A==" + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "nice-try": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", - "requires": { - "errno": "~0.1.1" - } + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true }, - "level-iterator-stream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", - "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "node-abi": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.8.0.tgz", + "integrity": "sha512-1/aa2clS0pue0HjckL62CsbhWWU35HARvBDXcJtYKbYR7LnIutmpxmXbuDMV9kEviD2lP/wACOgWmmwljghHyQ==", + "optional": true, "requires": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - } + "semver": "^5.4.1" } }, - "level-ws": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", - "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "node-alias": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/node-alias/-/node-alias-1.0.4.tgz", + "integrity": "sha1-HxuRa1a56iQcATX5fO1pQPVW8pI=", "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" + "chalk": "^1.1.1", + "lodash": "^4.2.0" }, "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "xtend": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", - "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", - "requires": { - "object-keys": "~0.4.0" - } + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" } } }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "node-emoji": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.10.0.tgz", + "integrity": "sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw==", + "dev": true, "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - }, - "dependencies": { - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" - } + "lodash.toarray": "^4.4.0" } }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "encoding": "^0.1.11", + "is-stream": "^1.0.1" } }, - "libnpmconfig": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz", - "integrity": "sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==", + "node-fetch-npm": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz", + "integrity": "sha512-nJIxm1QmAj4v3nfCvEeCrYSoVwXyxLnaPBK5W1W5DGEJwjlKuC2VEUycGw5oxk+4zZahRrB84PUJJgEmhFTDFw==", "requires": { - "figgy-pudding": "^3.5.1", - "find-up": "^3.0.0", - "ini": "^1.3.5" - }, - "dependencies": { - "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" - } - }, - "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" - } - }, - "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", - "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-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" - } + "encoding": "^0.1.11", + "json-parse-better-errors": "^1.0.0", + "safe-buffer": "^5.1.1" } }, - "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "dev": true, + "node-hid": { + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-0.7.9.tgz", + "integrity": "sha512-vJnonTqmq3frCyTumJqG4g2IZcny3ynkfmbfDfQ90P3ZhRzcWYS/Um1ux6HFmAxmkaQnrZqIYHcGpL7kdqY8jA==", + "optional": true, "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" + "bindings": "^1.5.0", + "nan": "^2.13.2", + "prebuild-install": "^5.3.0" + }, + "dependencies": { + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "optional": true + } } }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "nodemon": { + "version": "1.18.10", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.18.10.tgz", + "integrity": "sha512-we51yBb1TfEvZamFchRgcfLbVYgg0xlGbyXmOtbBzDwxwgewYS/YbZ5tnlnsH51+AoSTTsT3A2E/FloUbtH8cQ==", + "dev": true, "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "chokidar": "^2.1.0", + "debug": "^3.1.0", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.0.4", + "pstree.remy": "^1.1.6", + "semver": "^5.5.0", + "supports-color": "^5.2.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.2", + "update-notifier": "^2.5.0" }, "dependencies": { - "path-exists": { + "has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" - }, - "lodash.toarray": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz", - "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=", - "dev": true - }, - "lodash.values": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-4.3.0.tgz", - "integrity": "sha1-o6bCsOvsxcLLocF+bmIP6BtT00c=" - }, - "log-driver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", - "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", - "dev": true - }, - "loglevel": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.4.tgz", - "integrity": "sha512-p0b6mOGKcGa+7nnmKbpzR6qloPbrgLcnio++E+14Vo/XffOGwZtRpUhr8dTH/x2oCMmEoIU0Zwm3ZauhvYD17g==" + "noop-logger": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", + "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=", + "optional": true }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "dev": true, "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" + "abbrev": "1" } }, - "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.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, - "ltgt": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "normalize-url": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.3.0.tgz", + "integrity": "sha512-0NLtR71o4k6GLP+mr6Ty34c5GA6CMoEsncKJxvQd8NzPxaHRJNnb5gZE8R1XF4CPIS7QPHLJ74IFszwtNVAHVQ==" + }, + "npm-bundled": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", + "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==" + }, + "npm-check-updates": { + "version": "3.1.20", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-3.1.20.tgz", + "integrity": "sha512-mc9BAoOYSTwP/IvoA+ofdkWSipwRvhgC0qop1PvlMZojgzi7N/dykdxOIWrw0OlZPnEKvXkKFEuPk97LrvXE1A==", "requires": { - "pify": "^3.0.0" + "chalk": "^2.4.2", + "cint": "^8.2.1", + "cli-table": "^0.3.1", + "commander": "^2.20.0", + "fast-diff": "^1.2.0", + "find-up": "4.1.0", + "get-stdin": "^7.0.0", + "json-parse-helpfulerror": "^1.0.3", + "libnpmconfig": "^1.2.1", + "lodash": "^4.17.13", + "node-alias": "^1.0.4", + "pacote": "^9.5.1", + "progress": "^2.0.3", + "prompts": "^2.1.0", + "rc-config-loader": "^2.0.4", + "requireg": "^0.2.2", + "semver": "^6.2.0", + "semver-utils": "^1.1.4", + "spawn-please": "^0.3.0", + "update-notifier": "^3.0.1" }, "dependencies": { - "pify": { + "ansi-align": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", + "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", + "requires": { + "string-width": "^3.0.0" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "boxen": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-3.2.0.tgz", + "integrity": "sha512-cU4J/+NodM3IHdSL2yN8bqYqnmlBTidDR4RC7nJs61ZmtGz8VZzM3HLQX0zY5mrSmPtR3xWwsq2jOUQqFZN8+A==", + "requires": { + "ansi-align": "^3.0.0", + "camelcase": "^5.3.1", + "chalk": "^2.4.2", + "cli-boxes": "^2.2.0", + "string-width": "^3.0.0", + "term-size": "^1.2.0", + "type-fest": "^0.3.0", + "widest-line": "^2.0.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" + }, + "cli-boxes": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.0.tgz", + "integrity": "sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w==" + }, + "commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==" + }, + "configstore": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-4.0.0.tgz", + "integrity": "sha512-CmquAXFBocrzaSM8mtGPMM/HiWmyIpr4CcJl/rgY2uCObZ/S7cKU0silxslqJejl+t/T9HS8E0PUNQD81JGUEQ==", + "requires": { + "dot-prop": "^4.1.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "unique-string": "^1.0.0", + "write-file-atomic": "^2.0.0", + "xdg-basedir": "^3.0.0" + } + }, + "get-stdin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", + "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==" + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "requires": { + "pump": "^3.0.0" + } + }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + } + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "requires": { + "ci-info": "^2.0.0" + } + }, + "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-npm": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - } - } - }, - "make-error": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", - "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", - "dev": true - }, - "make-fetch-happen": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.0.tgz", - "integrity": "sha512-nFr/vpL1Jc60etMVKeaLOqfGjMMb3tAHFVJWxHOFCFS04Zmd7kGlMxo0l1tzfhoQje0/UPnd0X8OeGUiXXnfPA==", - "requires": { - "agentkeepalive": "^3.4.1", - "cacache": "^12.0.0", - "http-cache-semantics": "^3.8.1", - "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^2.2.1", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "node-fetch-npm": "^2.0.2", - "promise-retry": "^1.1.1", - "socks-proxy-agent": "^4.0.0", - "ssri": "^6.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-3.0.0.tgz", + "integrity": "sha512-wsigDr1Kkschp2opC4G3yA6r9EgVA6NjRpWzIi9axXqeIaAATPRJc4uLujXe3Nd9uO8KoDyA4MD6aZSeXTADhA==" + }, + "latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", "requires": { - "yallist": "^3.0.2" + "package-json": "^6.3.0" } }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" - } - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "markdown-table": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.3.tgz", - "integrity": "sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==", - "dev": true - }, - "marked": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", - "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==", - "dev": true - }, - "marked-terminal": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-3.3.0.tgz", - "integrity": "sha512-+IUQJ5VlZoAFsM5MHNT7g3RHSkA3eETqhRCdXv4niUMAKHQ7lb1yvAcuGPmm4soxhmtX13u4Li6ZToXtvSEH+A==", - "dev": true, - "requires": { - "ansi-escapes": "^3.1.0", - "cardinal": "^2.1.1", - "chalk": "^2.4.1", - "cli-table": "^0.3.1", - "node-emoji": "^1.4.1", - "supports-hyperlinks": "^1.0.1" - } - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "memdown": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", - "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", - "requires": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", - "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "package-json": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.4.0.tgz", + "integrity": "sha512-bd1T8OBG7hcvMd9c/udgv6u5v9wISP3Oyl9Cm7Weop8EFwrtcQDnS2sb6zhwqus2WslSr5wSTIPiTTpxxmPm7Q==", "requires": { - "xtend": "~4.0.0" + "got": "^9.6.0", + "registry-auth-token": "^3.4.0", + "registry-url": "^5.0.0", + "semver": "^6.1.1" } - } - } - }, - "memorystream": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=" - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "requires": { + "rc": "^1.2.8" + } + }, + "semver": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", + "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "update-notifier": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-3.0.1.tgz", + "integrity": "sha512-grrmrB6Zb8DUiyDIaeRTBCkgISYUgETNe7NglEbVsrLWXeESnlCSP50WfRSj/GmzMPl6Uchj24S/p80nP/ZQrQ==", + "requires": { + "boxen": "^3.0.0", + "chalk": "^2.0.1", + "configstore": "^4.0.0", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.1.0", + "is-npm": "^3.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.0.0", + "semver-diff": "^2.0.0", + "xdg-basedir": "^3.0.0" + } + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "requires": { + "prepend-http": "^2.0.0" + } + } } }, - "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" - }, - "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "npm-package-arg": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.0.tgz", + "integrity": "sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA==", "requires": { - "mime-db": "~1.38.0" + "hosted-git-info": "^2.6.0", + "osenv": "^0.1.5", + "semver": "^5.5.0", + "validate-npm-package-name": "^3.0.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=", + "npm-packlist": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.4.tgz", + "integrity": "sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw==", "requires": { - "dom-walk": "^0.1.0" + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.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==", + "npm-pick-manifest": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-2.2.3.tgz", + "integrity": "sha512-+IluBC5K201+gRU85vFlUwX3PFShZAbAgDNp2ewJdWMVSppdo/Zih0ul2Ecky/X7b51J7LrrUAP+XOmOCvYZqA==", "requires": { - "brace-expansion": "^1.1.7" + "figgy-pudding": "^3.5.1", + "npm-package-arg": "^6.0.0", + "semver": "^5.4.1" } }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - }, - "minipass": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", + "npm-registry-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.0.tgz", + "integrity": "sha512-Jllq35Jag8dtv0M17ue74XtdQTyqKzuAYGiX9mAjOhkmNjib3bBUgK6mUY61+AHnXeSRobQkpY3/xIOS/omptw==", "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" + "JSONStream": "^1.3.4", + "bluebird": "^3.5.1", + "figgy-pudding": "^3.4.1", + "lru-cache": "^5.1.1", + "make-fetch-happen": "^5.0.0", + "npm-package-arg": "^6.1.0" }, "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + }, "yallist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", @@ -20895,502 +22795,397 @@ } } }, - "minizlib": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "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": { - "minipass": "^2.2.1" + "path-key": "^2.0.0" } }, - "mississippi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "optional": true, "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" } }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, + "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": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" + "bn.js": "4.11.6", + "strip-hex-prefix": "1.0.0" }, "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" } } }, - "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" - } + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" }, - "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" }, "dependencies": { - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==" + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } } } }, - "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "requires": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - } - }, - "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=", - "dev": true + "object-inspect": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", + "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==" }, - "nan": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" + "isobject": "^3.0.0" } }, - "napi-build-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.1.tgz", - "integrity": "sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==", - "optional": true - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "neo-async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", - "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==" - }, - "nested-error-stacks": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.0.1.tgz", - "integrity": "sha512-SrQrok4CATudVzBS7coSz26QRSmlK9TzzoFbeKfcPBUFPjcQM9Rqvr/DlJkOrwI/0KcgvMub1n1g5Jt9EgRn4A==" + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true + "object.entries": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.0.tgz", + "integrity": "sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.12.0", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } }, - "node-abi": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.8.0.tgz", - "integrity": "sha512-1/aa2clS0pue0HjckL62CsbhWWU35HARvBDXcJtYKbYR7LnIutmpxmXbuDMV9kEviD2lP/wACOgWmmwljghHyQ==", - "optional": true, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, "requires": { - "semver": "^5.4.1" + "isobject": "^3.0.1" } }, - "node-alias": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/node-alias/-/node-alias-1.0.4.tgz", - "integrity": "sha1-HxuRa1a56iQcATX5fO1pQPVW8pI=", + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "dev": true, "requires": { - "chalk": "^1.1.1", - "lodash": "^4.2.0" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" }, "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + "es-abstract": { + "version": "1.17.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0-next.1.tgz", + "integrity": "sha512-7MmGr03N7Rnuid6+wyhD9sHNE2n4tFSwExnU2lQl3lIo2ShXWGePY80zYaoMOmILWv57H0amMjZGHNzzGG70Rw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.0", + "string.prototype.trimright": "^2.1.0" + } }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" } }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true } } }, - "node-emoji": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.10.0.tgz", - "integrity": "sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw==", + "oboe": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.4.tgz", + "integrity": "sha1-IMiM2wwVNxuwQRklfU/dNLCqSfY=", "dev": true, "requires": { - "lodash.toarray": "^4.4.0" + "http-https": "^1.0.0" } }, - "node-fetch": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", - "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" + "ee-first": "1.1.1" } }, - "node-fetch-npm": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz", - "integrity": "sha512-nJIxm1QmAj4v3nfCvEeCrYSoVwXyxLnaPBK5W1W5DGEJwjlKuC2VEUycGw5oxk+4zZahRrB84PUJJgEmhFTDFw==", + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "encoding": "^0.1.11", - "json-parse-better-errors": "^1.0.0", - "safe-buffer": "^5.1.1" + "wrappy": "1" } }, - "node-hid": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-0.7.9.tgz", - "integrity": "sha512-vJnonTqmq3frCyTumJqG4g2IZcny3ynkfmbfDfQ90P3ZhRzcWYS/Um1ux6HFmAxmkaQnrZqIYHcGpL7kdqY8jA==", - "optional": true, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, "requires": { - "bindings": "^1.5.0", - "nan": "^2.13.2", - "prebuild-install": "^5.3.0" - }, - "dependencies": { - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", - "optional": true - } + "mimic-fn": "^1.0.0" } }, - "nodemon": { - "version": "1.18.10", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.18.10.tgz", - "integrity": "sha512-we51yBb1TfEvZamFchRgcfLbVYgg0xlGbyXmOtbBzDwxwgewYS/YbZ5tnlnsH51+AoSTTsT3A2E/FloUbtH8cQ==", - "dev": true, + "openzeppelin-solidity": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-1.12.0.tgz", + "integrity": "sha512-WlorzMXIIurugiSdw121RVD5qA3EfSI7GybTn+/Du0mPNgairjt29NpVTAaH8eLjAeAwlw46y7uQKy0NYem/gA==" + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "requires": { - "chokidar": "^2.1.0", - "debug": "^3.1.0", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.0.4", - "pstree.remy": "^1.1.6", - "semver": "^5.5.0", - "supports-color": "^5.2.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.2", - "update-notifier": "^2.5.0" - }, - "dependencies": { - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, + "original-require": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/original-require/-/original-require-1.0.1.tgz", + "integrity": "sha1-DxMEcVhM0zURxew4yNWSE/msXiA=" + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" } }, - "noop-logger": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", - "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=", - "optional": true + "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=" }, - "nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", - "dev": true, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "requires": { - "abbrev": "1" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" } }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==" + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "p-try": "^1.0.0" } }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "requires": { + "p-limit": "^1.1.0" + } }, - "normalize-url": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.3.0.tgz", - "integrity": "sha512-0NLtR71o4k6GLP+mr6Ty34c5GA6CMoEsncKJxvQd8NzPxaHRJNnb5gZE8R1XF4CPIS7QPHLJ74IFszwtNVAHVQ==" + "p-timeout": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", + "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", + "dev": true, + "requires": { + "p-finally": "^1.0.0" + } }, - "npm-bundled": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", - "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==" + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" }, - "npm-check-updates": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-3.1.20.tgz", - "integrity": "sha512-mc9BAoOYSTwP/IvoA+ofdkWSipwRvhgC0qop1PvlMZojgzi7N/dykdxOIWrw0OlZPnEKvXkKFEuPk97LrvXE1A==", + "package-json": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", + "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", + "dev": true, "requires": { - "chalk": "^2.4.2", - "cint": "^8.2.1", - "cli-table": "^0.3.1", - "commander": "^2.20.0", - "fast-diff": "^1.2.0", - "find-up": "4.1.0", - "get-stdin": "^7.0.0", - "json-parse-helpfulerror": "^1.0.3", - "libnpmconfig": "^1.2.1", - "lodash": "^4.17.13", - "node-alias": "^1.0.4", - "pacote": "^9.5.1", - "progress": "^2.0.3", - "prompts": "^2.1.0", - "rc-config-loader": "^2.0.4", - "requireg": "^0.2.2", - "semver": "^6.2.0", - "semver-utils": "^1.1.4", - "spawn-please": "^0.3.0", - "update-notifier": "^3.0.1" - }, - "dependencies": { - "ansi-align": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", - "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", - "requires": { - "string-width": "^3.0.0" - } - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" - }, - "boxen": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-3.2.0.tgz", - "integrity": "sha512-cU4J/+NodM3IHdSL2yN8bqYqnmlBTidDR4RC7nJs61ZmtGz8VZzM3HLQX0zY5mrSmPtR3xWwsq2jOUQqFZN8+A==", - "requires": { - "ansi-align": "^3.0.0", - "camelcase": "^5.3.1", - "chalk": "^2.4.2", - "cli-boxes": "^2.2.0", - "string-width": "^3.0.0", - "term-size": "^1.2.0", - "type-fest": "^0.3.0", - "widest-line": "^2.0.0" - } - }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" - }, - "cli-boxes": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.0.tgz", - "integrity": "sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w==" - }, - "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==" - }, - "configstore": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-4.0.0.tgz", - "integrity": "sha512-CmquAXFBocrzaSM8mtGPMM/HiWmyIpr4CcJl/rgY2uCObZ/S7cKU0silxslqJejl+t/T9HS8E0PUNQD81JGUEQ==", - "requires": { - "dot-prop": "^4.1.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "unique-string": "^1.0.0", - "write-file-atomic": "^2.0.0", - "xdg-basedir": "^3.0.0" - } - }, - "get-stdin": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", - "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==" - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "requires": { - "pump": "^3.0.0" - } - }, - "got": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", - "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", - "requires": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" - } - }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "requires": { - "ci-info": "^2.0.0" - } - }, - "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-npm": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-3.0.0.tgz", - "integrity": "sha512-wsigDr1Kkschp2opC4G3yA6r9EgVA6NjRpWzIi9axXqeIaAATPRJc4uLujXe3Nd9uO8KoDyA4MD6aZSeXTADhA==" - }, - "latest-version": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", - "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "got": "^6.7.1", + "registry-auth-token": "^3.0.1", + "registry-url": "^3.0.3", + "semver": "^5.1.0" + } + }, + "pacote": { + "version": "9.5.4", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.4.tgz", + "integrity": "sha512-nWr0ari6E+apbdoN0hToTKZElO5h4y8DGFa2pyNA5GQIdcP0imC96bA0bbPw1gpeguVIiUgHHaAlq/6xfPp8Qw==", + "requires": { + "bluebird": "^3.5.3", + "cacache": "^12.0.0", + "figgy-pudding": "^3.5.1", + "get-stream": "^4.1.0", + "glob": "^7.1.3", + "lru-cache": "^5.1.1", + "make-fetch-happen": "^5.0.0", + "minimatch": "^3.0.4", + "minipass": "^2.3.5", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "normalize-package-data": "^2.4.0", + "npm-package-arg": "^6.1.0", + "npm-packlist": "^1.1.12", + "npm-pick-manifest": "^2.2.3", + "npm-registry-fetch": "^4.0.0", + "osenv": "^0.1.5", + "promise-inflight": "^1.0.1", + "promise-retry": "^1.1.1", + "protoduck": "^5.0.1", + "rimraf": "^2.6.2", + "safe-buffer": "^5.1.2", + "semver": "^5.6.0", + "ssri": "^6.0.1", + "tar": "^4.4.8", + "unique-filename": "^1.1.1", + "which": "^1.3.1" + }, + "dependencies": { + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "requires": { - "package-json": "^6.3.0" + "pump": "^3.0.0" } }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" - }, - "package-json": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.4.0.tgz", - "integrity": "sha512-bd1T8OBG7hcvMd9c/udgv6u5v9wISP3Oyl9Cm7Weop8EFwrtcQDnS2sb6zhwqus2WslSr5wSTIPiTTpxxmPm7Q==", + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "requires": { - "got": "^9.6.0", - "registry-auth-token": "^3.4.0", - "registry-url": "^5.0.0", - "semver": "^6.1.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, - "prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } }, "pump": { "version": "3.0.0", @@ -21401,1342 +23196,1659 @@ "once": "^1.3.1" } }, - "registry-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", - "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", - "requires": { - "rc": "^1.2.8" - } - }, - "semver": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", - "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==" - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "update-notifier": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-3.0.1.tgz", - "integrity": "sha512-grrmrB6Zb8DUiyDIaeRTBCkgISYUgETNe7NglEbVsrLWXeESnlCSP50WfRSj/GmzMPl6Uchj24S/p80nP/ZQrQ==", - "requires": { - "boxen": "^3.0.0", - "chalk": "^2.0.1", - "configstore": "^4.0.0", - "has-yarn": "^2.1.0", - "import-lazy": "^2.1.0", - "is-ci": "^2.0.0", - "is-installed-globally": "^0.1.0", - "is-npm": "^3.0.0", - "is-yarn-global": "^0.3.0", - "latest-version": "^5.0.0", - "semver-diff": "^2.0.0", - "xdg-basedir": "^3.0.0" - } - }, - "url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", - "requires": { - "prepend-http": "^2.0.0" - } + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" } } }, - "npm-package-arg": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.0.tgz", - "integrity": "sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA==", + "pako": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", + "dev": true + }, + "parallel-transform": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", + "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", "requires": { - "hosted-git-info": "^2.6.0", - "osenv": "^0.1.5", - "semver": "^5.5.0", - "validate-npm-package-name": "^3.0.0" + "cyclist": "~0.2.2", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" } }, - "npm-packlist": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.4.tgz", - "integrity": "sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw==", + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" + "callsites": "^3.0.0" + } + }, + "parse-asn1": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", + "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", + "dev": true, + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha1-juqz5U+laSD+Fro493+iGqzC104=", + "dev": true + }, + "parse-code-context": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-code-context/-/parse-code-context-1.0.0.tgz", + "integrity": "sha512-OZQaqKaQnR21iqhlnPfVisFjBWjhnMl5J9MgbP8xC+EwoVqbXrq78lp+9Zb3ahmLzrIX5Us/qbvBnaS3hkH6OA==", + "dev": true + }, + "parse-headers": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.2.tgz", + "integrity": "sha512-/LypJhzFmyBIDYP9aDVgeyEb5sQfbfY5mnDq4hVhlQ69js87wXfmEI5V3xI6vvXasqebp0oCytYFLxsBVfCzSg==", + "requires": { + "for-each": "^0.3.3", + "string.prototype.trim": "^1.1.2" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "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-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=" + }, + "pbkdf2": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" } }, - "npm-pick-manifest": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-2.2.3.tgz", - "integrity": "sha512-+IluBC5K201+gRU85vFlUwX3PFShZAbAgDNp2ewJdWMVSppdo/Zih0ul2Ecky/X7b51J7LrrUAP+XOmOCvYZqA==", + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "picomatch": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", + "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==" + }, + "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=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, "requires": { - "figgy-pudding": "^3.5.1", - "npm-package-arg": "^6.0.0", - "semver": "^5.4.1" + "pinkie": "^2.0.0" } }, - "npm-registry-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.0.tgz", - "integrity": "sha512-Jllq35Jag8dtv0M17ue74XtdQTyqKzuAYGiX9mAjOhkmNjib3bBUgK6mUY61+AHnXeSRobQkpY3/xIOS/omptw==", + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, "requires": { - "JSONStream": "^1.3.4", - "bluebird": "^3.5.1", - "figgy-pudding": "^3.4.1", - "lru-cache": "^5.1.1", - "make-fetch-happen": "^5.0.0", - "npm-package-arg": "^6.1.0" + "find-up": "^2.1.0" }, "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, "requires": { - "yallist": "^3.0.2" + "locate-path": "^2.0.0" } - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" } } }, - "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.0" - } + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==" }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } + "popper.js": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.14.3.tgz", + "integrity": "sha1-FDj5jQRqz3tNeM1QK/QYrGTU8JU=" }, - "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=" + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true }, - "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=", + "prebuild-install": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.0.tgz", + "integrity": "sha512-aaLVANlj4HgZweKttFNUVNRxDukytuIuxeK2boIMHjagNJCiVKWFsKF4tCE3ql3GbrD2tExPQ7/pwtEJcHNZeg==", + "optional": true, "requires": { - "bn.js": "4.11.6", - "strip-hex-prefix": "1.0.0" + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.7.0", + "noop-logger": "^0.1.1", + "npmlog": "^4.0.1", + "os-homedir": "^1.0.1", + "pump": "^2.0.1", + "rc": "^1.2.7", + "simple-get": "^2.7.0", + "tar-fs": "^1.13.0", + "tunnel-agent": "^0.6.0", + "which-pm-runs": "^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=" + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "optional": true } } }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "precond": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", + "integrity": "sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw=" }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "prettier": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", + "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", + "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", "dev": true, "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" + "fast-diff": "^1.1.2" + } + }, + "prettier-plugin-solidity": { + "version": "1.0.0-alpha.32", + "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-alpha.32.tgz", + "integrity": "sha512-3gwIeiHyYUzPw9uLGrRTdYNd/3lmF8hUJtl7Dxygx6zHQ4NLP+uKE79MeCg49THFkLBcyJ+jYK1Wsk5fp+i2mA==", + "dev": true, + "requires": { + "dir-to-object": "^2.0.0", + "emoji-regex": "^8.0.0", + "escape-string-regexp": "^2.0.0", + "extract-comments": "^1.1.0", + "prettier": "^1.15.3", + "semver": "^6.3.0", + "solidity-parser-antlr": "^0.4.11", + "string-width": "^4.1.0" }, "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "solidity-parser-antlr": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/solidity-parser-antlr/-/solidity-parser-antlr-0.4.11.tgz", + "integrity": "sha512-4jtxasNGmyC0midtjH/lTFPZYvTTUMy6agYcF+HoMnzW8+cqo3piFrINb4ZCzpPW+7tTVFCGa5ubP34zOzeuMg==", + "dev": true + }, + "string-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.1.0.tgz", + "integrity": "sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ==", "dev": true, "requires": { - "is-descriptor": "^0.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^5.2.0" } }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "is-buffer": "^1.1.5" + "ansi-regex": "^4.1.0" } } } }, - "object-inspect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", - "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==" + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" + }, + "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.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" + }, + "promise": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.0.3.tgz", + "integrity": "sha512-HeRDUL1RJiLhyA0/grn+PTShlBAcLuh/1BJGtrvjwbvRDCTLLMEz9rOGCV+R3vHY4MixIuoMEd9Yq/XvsTPcjw==", + "dev": true, + "requires": { + "asap": "~2.0.6" + } + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=" }, - "object-keys": { + "promise-retry": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz", + "integrity": "sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0=", + "requires": { + "err-code": "^1.0.0", + "retry": "^0.10.0" + } }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, + "promise-to-callback": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/promise-to-callback/-/promise-to-callback-1.0.0.tgz", + "integrity": "sha1-XSp0kBC/tn2WNZj805YHRqaP7vc=", "requires": { - "isobject": "^3.0.0" + "is-fn": "^1.0.0", + "set-immediate-shim": "^1.0.1" } }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, + "prompts": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.1.0.tgz", + "integrity": "sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg==", "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "kleur": "^3.0.2", + "sisteransi": "^1.0.0" } }, - "object.entries": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.0.tgz", - "integrity": "sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==", - "dev": true, + "protoduck": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz", + "integrity": "sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==", "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.12.0", - "function-bind": "^1.1.1", - "has": "^1.0.3" + "genfun": "^5.0.0" } }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "proxy-addr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", + "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", "dev": true, "requires": { - "isobject": "^3.0.1" + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.0" } }, - "object.values": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.0.tgz", - "integrity": "sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==", + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "psl": { + "version": "1.1.31", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" + }, + "pstree.remy": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.6.tgz", + "integrity": "sha512-NdF35+QsqD7EgNEI5mkI/X+UwaxVEbQaz9f4IooEmMUv6ZPmlTQYGjBPJGgrlzNdjSvIy4MWMg6Q6vCgBO2K+w==", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", "dev": true, "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.12.0", - "function-bind": "^1.1.1", - "has": "^1.0.3" + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" } }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", "requires": { - "wrappy": "1" + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", "requires": { - "mimic-fn": "^1.0.0" + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.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==" + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "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": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" - } + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" } }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" + "safe-buffer": "^5.1.0" } }, - "original-require": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/original-require/-/original-require-1.0.1.tgz", - "integrity": "sha1-DxMEcVhM0zURxew4yNWSE/msXiA=" + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + "randomhex": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/randomhex/-/randomhex-0.1.5.tgz", + "integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU=" }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "dev": true, "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.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=" + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + } + } }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "rc-config-loader": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/rc-config-loader/-/rc-config-loader-2.0.4.tgz", + "integrity": "sha512-k06UzRbYDWgF4Mc/YrsZsmzSpDLuHoThJxep+vq5H09hiX8rbA5Ue/Ra0dwWm5MQvWYW4YBXgA186inNxuxidQ==", "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" + "debug": "^4.1.1", + "js-yaml": "^3.12.0", + "json5": "^2.1.0", + "object-assign": "^4.1.0", + "object-keys": "^1.0.12", + "path-exists": "^3.0.0", + "require-from-string": "^2.0.2" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "json5": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", + "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", + "requires": { + "minimist": "^1.2.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + } } }, - "p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==" - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, "requires": { - "p-try": "^1.0.0" + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" } }, - "p-locate": { + "read-pkg-up": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, "requires": { - "p-limit": "^1.1.0" + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + } } }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" + "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.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } }, - "package-json": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", - "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", "dev": true, "requires": { - "got": "^6.7.1", - "registry-auth-token": "^3.0.1", - "registry-url": "^3.0.3", - "semver": "^5.1.0" + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" } }, - "pacote": { - "version": "9.5.4", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.4.tgz", - "integrity": "sha512-nWr0ari6E+apbdoN0hToTKZElO5h4y8DGFa2pyNA5GQIdcP0imC96bA0bbPw1gpeguVIiUgHHaAlq/6xfPp8Qw==", + "redeyed": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-2.1.1.tgz", + "integrity": "sha1-iYS1gV2ZyyIEacme7v/jiRPmzAs=", + "dev": true, "requires": { - "bluebird": "^3.5.3", - "cacache": "^12.0.0", - "figgy-pudding": "^3.5.1", - "get-stream": "^4.1.0", - "glob": "^7.1.3", - "lru-cache": "^5.1.1", - "make-fetch-happen": "^5.0.0", - "minimatch": "^3.0.4", - "minipass": "^2.3.5", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "normalize-package-data": "^2.4.0", - "npm-package-arg": "^6.1.0", - "npm-packlist": "^1.1.12", - "npm-pick-manifest": "^2.2.3", - "npm-registry-fetch": "^4.0.0", - "osenv": "^0.1.5", - "promise-inflight": "^1.0.1", - "promise-retry": "^1.1.1", - "protoduck": "^5.0.1", - "rimraf": "^2.6.2", - "safe-buffer": "^5.1.2", - "semver": "^5.6.0", - "ssri": "^6.0.1", - "tar": "^4.4.8", - "unique-filename": "^1.1.1", - "which": "^1.3.1" + "esprima": "~4.0.0" }, "dependencies": { - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "requires": { - "pump": "^3.0.0" - } - }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "requires": { - "yallist": "^3.0.2" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true } } }, - "parallel-transform": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", - "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==" + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, + "regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", "requires": { - "cyclist": "~0.2.2", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" } }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, "requires": { - "callsites": "^3.0.0" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" } }, - "parse-cache-control": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", - "integrity": "sha1-juqz5U+laSD+Fro493+iGqzC104=", + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, - "parse-code-context": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-code-context/-/parse-code-context-1.0.0.tgz", - "integrity": "sha512-OZQaqKaQnR21iqhlnPfVisFjBWjhnMl5J9MgbP8xC+EwoVqbXrq78lp+9Zb3ahmLzrIX5Us/qbvBnaS3hkH6OA==", - "dev": true + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } }, - "parse-headers": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.2.tgz", - "integrity": "sha512-/LypJhzFmyBIDYP9aDVgeyEb5sQfbfY5mnDq4hVhlQ69js87wXfmEI5V3xI6vvXasqebp0oCytYFLxsBVfCzSg==", + "registry-auth-token": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz", + "integrity": "sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A==", "requires": { - "for-each": "^0.3.3", - "string.prototype.trim": "^1.1.2" + "rc": "^1.1.6", + "safe-buffer": "^5.0.1" } }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "registry-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", "dev": true, "requires": { - "error-ex": "^1.2.0" + "rc": "^1.0.1" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=" + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "requires": { + "jsesc": "~0.5.0" } }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", "dev": true }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", "dev": true }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - }, - "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=" + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true }, - "path-key": { + "repeating": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" - }, - "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "dev": true, + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", "requires": { - "pify": "^2.0.0" + "is-finite": "^1.0.0" } }, - "pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=" - }, - "pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "req-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-2.0.0.tgz", + "integrity": "sha1-1AgrTURZgDZkD7c93qAe1T20nrw=", + "dev": true, "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" + "req-from": "^2.0.0" } }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "picomatch": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", - "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==" - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - }, - "pkg-dir": { + "req-from": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "resolved": "https://registry.npmjs.org/req-from/-/req-from-2.0.0.tgz", + "integrity": "sha1-10GI5H+TeW9Kpx327jWuaJ8+DnA=", "dev": true, "requires": { - "find-up": "^2.1.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - } + "resolve-from": "^3.0.0" } }, - "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==" - }, - "popper.js": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.14.3.tgz", - "integrity": "sha1-FDj5jQRqz3tNeM1QK/QYrGTU8JU=" - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "prebuild-install": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.0.tgz", - "integrity": "sha512-aaLVANlj4HgZweKttFNUVNRxDukytuIuxeK2boIMHjagNJCiVKWFsKF4tCE3ql3GbrD2tExPQ7/pwtEJcHNZeg==", - "optional": true, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", "requires": { - "detect-libc": "^1.0.3", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", - "napi-build-utils": "^1.0.1", - "node-abi": "^2.7.0", - "noop-logger": "^0.1.1", - "npmlog": "^4.0.1", - "os-homedir": "^1.0.1", - "pump": "^2.0.1", - "rc": "^1.2.7", - "simple-get": "^2.7.0", - "tar-fs": "^1.13.0", + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", "tunnel-agent": "^0.6.0", - "which-pm-runs": "^1.0.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "optional": true - } + "uuid": "^3.3.2" } }, - "precond": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", - "integrity": "sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw=" + "request-promise": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.4.tgz", + "integrity": "sha512-8wgMrvE546PzbR5WbYxUQogUnUDfM0S7QIFZMID+J73vdFARkFy+HElj4T+MWYhpXwlLp0EQ8Zoj8xUA0he4Vg==", + "dev": true, + "requires": { + "bluebird": "^3.5.0", + "request-promise-core": "1.1.2", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + } }, - "prelude-ls": { + "request-promise-core": { "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=", - "dev": true - }, - "prettier": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", - "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", - "dev": true - }, - "prettier-linter-helpers": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", - "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", + "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", "dev": true, "requires": { - "fast-diff": "^1.1.2" + "lodash": "^4.17.11" } }, - "prettier-plugin-solidity": { - "version": "1.0.0-alpha.32", - "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-alpha.32.tgz", - "integrity": "sha512-3gwIeiHyYUzPw9uLGrRTdYNd/3lmF8hUJtl7Dxygx6zHQ4NLP+uKE79MeCg49THFkLBcyJ+jYK1Wsk5fp+i2mA==", + "request-promise-native": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz", + "integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==", "dev": true, "requires": { - "dir-to-object": "^2.0.0", - "emoji-regex": "^8.0.0", - "escape-string-regexp": "^2.0.0", - "extract-comments": "^1.1.0", - "prettier": "^1.15.3", - "semver": "^6.3.0", - "solidity-parser-antlr": "^0.4.11", - "string-width": "^4.1.0" + "request-promise-core": "1.1.2", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + } + }, + "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": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, + "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=" + }, + "requireg": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/requireg/-/requireg-0.2.2.tgz", + "integrity": "sha512-nYzyjnFcPNGR3lx9lwPPPnuQxv6JWEZd2Ci0u9opN7N5zUEPIhY/GbL3vMGOr2UXwEg9WwSyV9X9Y/kLFgPsOg==", + "requires": { + "nested-error-stacks": "~2.0.1", + "rc": "~1.2.7", + "resolve": "~1.7.1" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "solidity-parser-antlr": { - "version": "0.4.11", - "resolved": "https://registry.npmjs.org/solidity-parser-antlr/-/solidity-parser-antlr-0.4.11.tgz", - "integrity": "sha512-4jtxasNGmyC0midtjH/lTFPZYvTTUMy6agYcF+HoMnzW8+cqo3piFrINb4ZCzpPW+7tTVFCGa5ubP34zOzeuMg==", - "dev": true - }, - "string-width": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.1.0.tgz", - "integrity": "sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^5.2.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, + "resolve": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", + "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", "requires": { - "ansi-regex": "^4.1.0" + "path-parse": "^1.0.5" } } } }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" + "resolve": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", + "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "requires": { + "path-parse": "^1.0.6" + } }, - "process": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", - "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=" + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true }, - "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==" + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "requires": { + "lowercase-keys": "^1.0.0" + } }, - "promise": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/promise/-/promise-8.0.3.tgz", - "integrity": "sha512-HeRDUL1RJiLhyA0/grn+PTShlBAcLuh/1BJGtrvjwbvRDCTLLMEz9rOGCV+R3vHY4MixIuoMEd9Yq/XvsTPcjw==", + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "dev": true, "requires": { - "asap": "~2.0.6" + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" } }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=" + "resumer": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", + "requires": { + "through": "~2.3.4" + } }, - "promise-retry": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz", - "integrity": "sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0=", + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "retry": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", + "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=" + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "requires": { - "err-code": "^1.0.0", - "retry": "^0.10.0" + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, - "promise-to-callback": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/promise-to-callback/-/promise-to-callback-1.0.0.tgz", - "integrity": "sha1-XSp0kBC/tn2WNZj805YHRqaP7vc=", + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "requires": { - "is-fn": "^1.0.0", - "set-immediate-shim": "^1.0.1" + "hash-base": "^3.0.0", + "inherits": "^2.0.1" } }, - "prompts": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.1.0.tgz", - "integrity": "sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg==", + "rlp": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz", + "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", "requires": { - "kleur": "^3.0.2", - "sisteransi": "^1.0.0" + "bn.js": "^4.11.1", + "safe-buffer": "^5.1.1" } }, - "protoduck": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz", - "integrity": "sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==", + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, "requires": { - "genfun": "^5.0.0" + "is-promise": "^2.1.0" } }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "requires": { + "aproba": "^1.1.1" + } }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + "rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" }, - "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" + "rxjs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", + "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", + "requires": { + "tslib": "^1.9.0" + } }, - "pstree.remy": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.6.tgz", - "integrity": "sha512-NdF35+QsqD7EgNEI5mkI/X+UwaxVEbQaz9f4IooEmMUv6ZPmlTQYGjBPJGgrlzNdjSvIy4MWMg6Q6vCgBO2K+w==", - "dev": true + "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==" }, - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "safe-event-emitter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz", + "integrity": "sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg==", "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "events": "^3.0.0" } }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" + "ret": "~0.1.10" } }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "scrypt-js": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", + "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==" }, - "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==", + "scrypt-shim": { + "version": "github:web3-js/scrypt-shim#be5e616323a8b5e568788bf94d03c1b8410eac54", + "from": "github:web3-js/scrypt-shim", + "dev": true, "requires": { - "decode-uri-component": "^0.2.0", - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" + "scryptsy": "^2.1.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, - "randombytes": { + "scryptsy": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomhex": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/randomhex/-/randomhex-0.1.5.tgz", - "integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU=" + "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz", + "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==", + "dev": true }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "secp256k1": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", + "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.4.1", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" }, "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" } } }, - "rc-config-loader": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/rc-config-loader/-/rc-config-loader-2.0.4.tgz", - "integrity": "sha512-k06UzRbYDWgF4Mc/YrsZsmzSpDLuHoThJxep+vq5H09hiX8rbA5Ue/Ra0dwWm5MQvWYW4YBXgA186inNxuxidQ==", + "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=", + "dev": true, "requires": { - "debug": "^4.1.1", - "js-yaml": "^3.12.0", - "json5": "^2.1.0", - "object-assign": "^4.1.0", - "object-keys": "^1.0.12", - "path-exists": "^3.0.0", - "require-from-string": "^2.0.2" + "commander": "~2.8.1" }, "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "json5": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", + "commander": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", + "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", + "dev": true, "requires": { - "minimist": "^1.2.0" + "graceful-readlink": ">= 1.0.0" } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" } } }, - "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "dev": true, + "semaphore": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", + "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" + }, + "semaphore-async-await": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz", + "integrity": "sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo=" + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + }, + "semver-diff": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", + "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", "requires": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" + "semver": "^5.0.3" } }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "semver-utils": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/semver-utils/-/semver-utils-1.1.4.tgz", + "integrity": "sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA==" + }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", "dev": true, "requires": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" + "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.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" }, "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { - "locate-path": "^2.0.0" + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true } } }, - "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.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", "dev": true, "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" } }, - "redeyed": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-2.1.1.tgz", - "integrity": "sha1-iYS1gV2ZyyIEacme7v/jiRPmzAs=", + "servify": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", + "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", "dev": true, "requires": { - "esprima": "~4.0.0" - }, - "dependencies": { - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - } + "body-parser": "^1.16.0", + "cors": "^2.8.1", + "express": "^4.14.0", + "request": "^2.79.0", + "xhr": "^2.3.3" } }, - "regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==" + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" }, - "regenerator-transform": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, "requires": { - "babel-runtime": "^6.18.0", - "babel-types": "^6.19.0", - "private": "^0.1.6" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } + "setimmediate": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" }, - "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, - "regexpu-core": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", - "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", - "requires": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" - } - }, - "registry-auth-token": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz", - "integrity": "sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A==", + "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": { - "rc": "^1.1.6", + "inherits": "^2.0.1", "safe-buffer": "^5.0.1" } }, - "registry-url": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", - "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "sha1": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz", + "integrity": "sha1-rdqnqTFo85PxnrKxUJFhjicA+Eg=", "dev": true, "requires": { - "rc": "^1.0.1" + "charenc": ">= 0.0.1", + "crypt": ">= 0.0.1" } }, - "regjsgen": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=" - }, - "regjsparser": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", - "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "requires": { - "jsesc": "~0.5.0" + "shebang-regex": "^1.0.0" } }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true + "simple-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", + "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=" }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "simple-get": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", + "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", "requires": { - "is-finite": "^1.0.0" + "decompress-response": "^3.3.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" } }, - "req-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-2.0.0.tgz", - "integrity": "sha1-1AgrTURZgDZkD7c93qAe1T20nrw=", - "dev": true, - "requires": { - "req-from": "^2.0.0" - } + "sisteransi": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.2.tgz", + "integrity": "sha512-ZcYcZcT69nSLAR2oLN2JwNmLkJEKGooFMCdvOkFrToUt/WfcRWqhIg4P4KwY4dmLbuyXIx4o4YmPsvMRJYJd/w==" }, - "req-from": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/req-from/-/req-from-2.0.0.tgz", - "integrity": "sha1-10GI5H+TeW9Kpx327jWuaJ8+DnA=", + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { - "resolve-from": "^3.0.0" + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } } }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } + "smart-buffer": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.0.2.tgz", + "integrity": "sha512-JDhEpTKzXusOqXZ0BUIdH+CjFdO/CR3tLlf5CN34IypI+xMmXW1uB16OOY8z3cICbJlDAVJzNbwBhNO0wt9OAw==" }, - "request-promise": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.4.tgz", - "integrity": "sha512-8wgMrvE546PzbR5WbYxUQogUnUDfM0S7QIFZMID+J73vdFARkFy+HElj4T+MWYhpXwlLp0EQ8Zoj8xUA0he4Vg==", + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", "dev": true, "requires": { - "bluebird": "^3.5.0", - "request-promise-core": "1.1.2", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, - "request-promise-core": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", - "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "dev": true, "requires": { - "lodash": "^4.17.11" + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } } }, - "request-promise-native": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz", - "integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==", + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, "requires": { - "request-promise-core": "1.1.2", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - } - }, - "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": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" - }, - "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=" - }, - "requireg": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/requireg/-/requireg-0.2.2.tgz", - "integrity": "sha512-nYzyjnFcPNGR3lx9lwPPPnuQxv6JWEZd2Ci0u9opN7N5zUEPIhY/GbL3vMGOr2UXwEg9WwSyV9X9Y/kLFgPsOg==", - "requires": { - "nested-error-stacks": "~2.0.1", - "rc": "~1.2.7", - "resolve": "~1.7.1" + "kind-of": "^3.2.0" }, "dependencies": { - "resolve": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", - "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { - "path-parse": "^1.0.5" + "is-buffer": "^1.1.5" } } } }, - "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "socks": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.3.2.tgz", + "integrity": "sha512-pCpjxQgOByDHLlNqlnh/mNSAxIUkyBBuwwhTcV+enZGbDaClPvHdvm6uvOwZfFJkam7cGhBNbb4JxiP8UZkRvQ==", "requires": { - "path-parse": "^1.0.6" + "ip": "^1.1.5", + "smart-buffer": "4.0.2" } }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "socks-proxy-agent": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz", + "integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==", "requires": { - "lowercase-keys": "^1.0.0" + "agent-base": "~4.2.1", + "socks": "~2.3.2" + }, + "dependencies": { + "agent-base": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", + "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "requires": { + "es6-promisify": "^5.0.0" + } + } } }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "solhint": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/solhint/-/solhint-2.2.0.tgz", + "integrity": "sha512-KNi9qGu17XNV75q9eFftrWIpDVHbejyZ5vaDuNQwet0e9+k8Xw0BdckyVUjYRfFQXAQA3nBTafxUVUtkM4cfIA==", "dev": true, "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, - "resumer": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", - "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", - "requires": { - "through": "~2.3.4" - } - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "retry": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", - "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=" - }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "requires": { - "glob": "^7.1.3" + "ajv": "^6.6.1", + "antlr4": "4.7.1", + "chalk": "^2.4.2", + "commander": "2.18.0", + "cosmiconfig": "^5.0.7", + "eslint": "^5.6.0", + "fast-diff": "^1.1.2", + "glob": "^7.1.3", + "ignore": "^4.0.6", + "js-yaml": "^3.12.0", + "lodash": "^4.17.11", + "prettier": "^1.14.3", + "semver": "^6.0.0" }, "dependencies": { + "acorn": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", + "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "dev": true, + "requires": { + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, "glob": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -22745,366 +24857,695 @@ "once": "^1.3.0", "path-is-absolute": "^1.0.0" } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } } } }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "solhint-plugin-prettier": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/solhint-plugin-prettier/-/solhint-plugin-prettier-0.0.3.tgz", + "integrity": "sha512-kdg1c7d5/X/RKTBS9AskwAKOZLpFhwUBelwjrUq43EQXOLd2HR81WvENZWcVNmzewiPTEOoZo3CqqE/Hy/84WQ==", + "dev": true, "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" + "prettier-linter-helpers": "^1.0.0" } }, - "rlp": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz", - "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", + "solidity-parser-antlr": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/solidity-parser-antlr/-/solidity-parser-antlr-0.4.8.tgz", + "integrity": "sha512-HkAAvzLfw2OPmkuGLcy8M5yVaO4PWagmV4t7DSKYi3pXQZG7TPQ2dWl1c0QTp56snX08FeKsBAsPhXY43yjZUQ==", "requires": { - "bn.js": "^4.11.1", - "safe-buffer": "^5.1.1" + "npm-check-updates": "^3.1.11" } }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", "dev": true, "requires": { - "is-promise": "^2.1.0" + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" } }, - "run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "source-map-support": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "requires": { - "aproba": "^1.1.1" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } } }, - "rustbn.js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", - "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" - }, - "rxjs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", - "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", - "requires": { - "tslib": "^1.9.0" - } + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true }, - "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==" + "spawn-please": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/spawn-please/-/spawn-please-0.3.0.tgz", + "integrity": "sha1-2zOOxM/2Orxp8dDgjO6euL69nRE=" }, - "safe-event-emitter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz", - "integrity": "sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg==", + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", "requires": { - "events": "^3.0.0" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" + }, + "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": { - "ret": "~0.1.10" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "scrypt-js": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", - "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==" + "spdx-license-ids": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", + "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==" }, - "secp256k1": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", - "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.4.1", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" - } + "extend-shallow": "^3.0.0" } }, - "semaphore": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", - "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" - }, - "semaphore-async-await": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz", - "integrity": "sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo=" - }, - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, - "semver-diff": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", - "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "requires": { - "semver": "^5.0.3" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" } }, - "semver-utils": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/semver-utils/-/semver-utils-1.1.4.tgz", - "integrity": "sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA==" - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + "ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "requires": { + "figgy-pudding": "^3.5.1" + } }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "dev": true, "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" + "define-property": "^0.2.5", + "object-copy": "^0.1.0" }, "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-extendable": "^0.1.0" + "is-descriptor": "^0.1.0" } } } }, - "setimmediate": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true + }, + "stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" } }, - "sha1": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz", - "integrity": "sha1-rdqnqTFo85PxnrKxUJFhjicA+Eg=", + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + }, + "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": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string.prototype.trim": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", + "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.0", + "function-bind": "^1.0.2" + } + }, + "string.prototype.trimleft": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", "dev": true, "requires": { - "charenc": ">= 0.0.1", - "crypt": ">= 0.0.1" + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" } }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "string.prototype.trimright": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" } }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "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.0" + } }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + "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.0.0" + } }, - "simple-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", - "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=" + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true }, - "simple-get": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", - "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", + "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==", + "dev": true, "requires": { - "decompress-response": "^3.3.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" + "is-natural-number": "^4.0.1" } }, - "sisteransi": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.2.tgz", - "integrity": "sha512-ZcYcZcT69nSLAR2oLN2JwNmLkJEKGooFMCdvOkFrToUt/WfcRWqhIg4P4KwY4dmLbuyXIx4o4YmPsvMRJYJd/w==" + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, - "slash": { + "strip-hex-prefix": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" + "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" + } }, - "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "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": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "requires": { + "has-flag": "^3.0.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + } + } + }, + "supports-hyperlinks": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-1.0.1.tgz", + "integrity": "sha512-HHi5kVSefKaJkGYXbDuKbUGRVxqnWGn3J2e39CYcNJEfWciGq2zYtOhXLTlvrOZW1QU7VX67w7fMmWafHX9Pfw==", + "dev": true, + "requires": { + "has-flag": "^2.0.0", + "supports-color": "^5.0.0" + } + }, + "swarm-js": { + "version": "0.1.39", + "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.39.tgz", + "integrity": "sha512-QLMqL2rzF6n5s50BptyD6Oi0R1aWlJC5Y17SRIVXRj6OR1DRIPM7nepvrxxkjA1zNzFz6mUOMjfeqeDaWB7OOg==", + "dev": true, + "requires": { + "bluebird": "^3.5.0", + "buffer": "^5.0.5", + "decompress": "^4.0.0", + "eth-lib": "^0.1.26", + "fs-extra": "^4.0.2", + "got": "^7.1.0", + "mime-types": "^2.1.16", + "mkdirp-promise": "^5.0.1", + "mock-fs": "^4.1.0", + "setimmediate": "^1.0.5", + "tar": "^4.0.2", + "xhr-request-promise": "^0.1.2" + }, + "dependencies": { + "eth-lib": { + "version": "0.1.29", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.29.tgz", + "integrity": "sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "nano-json-stream-parser": "^0.1.2", + "servify": "^0.1.12", + "ws": "^3.0.0", + "xhr-request-promise": "^0.1.2" + } + }, + "fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "got": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "dev": true, + "requires": { + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "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==", + "dev": true + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "ws": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", + "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" + } + } + } + }, + "sync-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.1.0.tgz", + "integrity": "sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==", "dev": true, "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - } + "http-response-object": "^3.0.1", + "sync-rpc": "^1.2.1", + "then-request": "^6.0.0" } }, - "smart-buffer": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.0.2.tgz", - "integrity": "sha512-JDhEpTKzXusOqXZ0BUIdH+CjFdO/CR3tLlf5CN34IypI+xMmXW1uB16OOY8z3cICbJlDAVJzNbwBhNO0wt9OAw==" + "sync-rpc": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.6.tgz", + "integrity": "sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==", + "dev": true, + "requires": { + "get-port": "^3.1.0" + } }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" }, "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "ajv": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", "dev": true, "requires": { - "ms": "2.0.0" + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { - "is-descriptor": "^0.1.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" } }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "is-extendable": "^0.1.0" + "ansi-regex": "^4.1.0" } } } }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, + "tape": { + "version": "4.10.2", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.10.2.tgz", + "integrity": "sha512-mgl23h7W2yuk3N85FOYrin2OvThTYWdwbk6XQ1pr2PMJieyW2FM/4Bu/+kD/wecb3aZ0Enm+Syinyq467OPq2w==", "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" + "deep-equal": "~1.0.1", + "defined": "~1.0.0", + "for-each": "~0.3.3", + "function-bind": "~1.1.1", + "glob": "~7.1.4", + "has": "~1.0.3", + "inherits": "~2.0.3", + "minimist": "~1.2.0", + "object-inspect": "~1.6.0", + "resolve": "~1.10.1", + "resumer": "~0.0.0", + "string.prototype.trim": "~1.1.2", + "through": "~2.3.8" }, "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "requires": { - "is-descriptor": "^1.0.0" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, + "resolve": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", + "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", "requires": { - "kind-of": "^6.0.0" + "path-parse": "^1.0.6" } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, + } + } + }, + "tar": { + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz", + "integrity": "sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==", + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.5", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + }, + "dependencies": { + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + } + } + }, + "tar-fs": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz", + "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==", + "optional": true, + "requires": { + "chownr": "^1.0.1", + "mkdirp": "^0.5.1", + "pump": "^1.0.0", + "tar-stream": "^1.1.2" + }, + "dependencies": { + "pump": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", + "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", + "optional": true, "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } } } }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "tar-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", + "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", + "requires": { + "bl": "^1.0.0", + "buffer-alloc": "^1.2.0", + "end-of-stream": "^1.0.0", + "fs-constants": "^1.0.0", + "readable-stream": "^2.3.0", + "to-buffer": "^1.1.1", + "xtend": "^4.0.0" + } + }, + "term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "requires": { + "execa": "^0.7.0" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "then-request": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.2.tgz", + "integrity": "sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==", + "dev": true, + "requires": { + "@types/concat-stream": "^1.6.0", + "@types/form-data": "0.0.33", + "@types/node": "^8.0.0", + "@types/qs": "^6.2.31", + "caseless": "~0.12.0", + "concat-stream": "^1.6.0", + "form-data": "^2.2.0", + "http-basic": "^8.1.1", + "http-response-object": "^3.0.1", + "promise": "^8.0.0", + "qs": "^6.4.0" + }, + "dependencies": { + "@types/node": { + "version": "8.10.53", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.53.tgz", + "integrity": "sha512-aOmXdv1a1/vYUn1OT1CED8ftbkmmYbKhKGSyMDeJiidLvKRKvZUQOdXwG/wcNY7T1Qb0XTlVdiYjIq00U7pLrQ==", + "dev": true + } + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "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==" + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=" + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, "requires": { - "kind-of": "^3.2.0" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -23118,1209 +25559,1751 @@ } } }, - "socks": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.3.2.tgz", - "integrity": "sha512-pCpjxQgOByDHLlNqlnh/mNSAxIUkyBBuwwhTcV+enZGbDaClPvHdvm6uvOwZfFJkam7cGhBNbb4JxiP8UZkRvQ==", + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==" + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, "requires": { - "ip": "^1.1.5", - "smart-buffer": "4.0.2" + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" } }, - "socks-proxy-agent": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz", - "integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==", + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, "requires": { - "agent-base": "~4.2.1", - "socks": "~2.3.2" - }, - "dependencies": { - "agent-base": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", - "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", - "requires": { - "es6-promisify": "^5.0.0" - } - } + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } }, - "solhint": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/solhint/-/solhint-2.2.0.tgz", - "integrity": "sha512-KNi9qGu17XNV75q9eFftrWIpDVHbejyZ5vaDuNQwet0e9+k8Xw0BdckyVUjYRfFQXAQA3nBTafxUVUtkM4cfIA==", + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "dev": true + }, + "touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", "dev": true, "requires": { - "ajv": "^6.6.1", - "antlr4": "4.7.1", - "chalk": "^2.4.2", - "commander": "2.18.0", - "cosmiconfig": "^5.0.7", - "eslint": "^5.6.0", - "fast-diff": "^1.1.2", - "glob": "^7.1.3", - "ignore": "^4.0.6", - "js-yaml": "^3.12.0", - "lodash": "^4.17.11", - "prettier": "^1.14.3", - "semver": "^6.0.0" + "nopt": "~1.0.10" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" }, "dependencies": { - "acorn": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", - "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", - "dev": true - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "eslint": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", - "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "ajv": "^6.9.1", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "eslint-scope": "^4.0.3", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.1", - "esquery": "^1.0.1", - "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", - "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "inquirer": "^6.2.2", - "js-yaml": "^3.13.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.11", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^5.5.1", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", - "table": "^5.2.3", - "text-table": "^0.2.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "espree": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", - "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + } + } + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" + }, + "truffle": { + "version": "5.0.35", + "resolved": "https://registry.npmjs.org/truffle/-/truffle-5.0.35.tgz", + "integrity": "sha512-ewJPaeHyYgRpuVSvlzhlnalJkeLN0sz7c/P/8WLWpXC966M2o4vL5ov6MNdSHQFYiYQsDrCetrothzsYsg4HWQ==", + "requires": { + "app-module-path": "^2.2.0", + "mocha": "5.2.0", + "original-require": "1.0.1" + } + }, + "truffle-flattener": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/truffle-flattener/-/truffle-flattener-1.4.2.tgz", + "integrity": "sha512-7qUIzaW8a4vI4nui14wsytht2oaqvqnZ1Iet2wRq2T0bCJ0wb6HByMKQhZKpU46R+n5BMTY4K5n+0ITyeNlmuQ==", + "dev": true, + "requires": { + "@resolver-engine/imports-fs": "^0.2.2", + "find-up": "^2.1.0", + "mkdirp": "^0.5.1", + "solidity-parser-antlr": "^0.4.11", + "tsort": "0.0.1" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "acorn": "^6.0.7", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" + "locate-path": "^2.0.0" } }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dev": true, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "solidity-parser-antlr": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/solidity-parser-antlr/-/solidity-parser-antlr-0.4.11.tgz", + "integrity": "sha512-4jtxasNGmyC0midtjH/lTFPZYvTTUMy6agYcF+HoMnzW8+cqo3piFrINb4ZCzpPW+7tTVFCGa5ubP34zOzeuMg==", "dev": true }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", "requires": { - "ansi-regex": "^3.0.0" + "prepend-http": "^2.0.0" } } } }, - "solhint-plugin-prettier": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/solhint-plugin-prettier/-/solhint-plugin-prettier-0.0.3.tgz", - "integrity": "sha512-kdg1c7d5/X/RKTBS9AskwAKOZLpFhwUBelwjrUq43EQXOLd2HR81WvENZWcVNmzewiPTEOoZo3CqqE/Hy/84WQ==", + "try-require": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/try-require/-/try-require-1.2.1.tgz", + "integrity": "sha1-NEiaLKwMCcHMEO2RugEVlNQzO+I=", + "dev": true + }, + "ts-essentials": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-1.0.4.tgz", + "integrity": "sha512-q3N1xS4vZpRouhYHDPwO0bDW3EZ6SK9CrrDHxi/D6BPReSjpVgWIOpLS2o0gSBZm+7q/wyKp6RVM1AeeW7uyfQ==", + "dev": true + }, + "ts-node": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz", + "integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==", "dev": true, "requires": { - "prettier-linter-helpers": "^1.0.0" + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.6", + "yn": "^3.0.0" + }, + "dependencies": { + "diff": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", + "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", + "dev": true + } } }, - "solidity-parser-antlr": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/solidity-parser-antlr/-/solidity-parser-antlr-0.4.8.tgz", - "integrity": "sha512-HkAAvzLfw2OPmkuGLcy8M5yVaO4PWagmV4t7DSKYi3pXQZG7TPQ2dWl1c0QTp56snX08FeKsBAsPhXY43yjZUQ==", + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" + }, + "tsort": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", + "integrity": "sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { - "npm-check-updates": "^3.1.11" + "safe-buffer": "^5.0.1" } }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "dev": true, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" + "prelude-ls": "~1.1.2" } }, - "source-map-support": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", - "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "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-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "media-typer": "0.3.0", + "mime-types": "~2.1.24" }, "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + "mime-db": { + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz", + "integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.25", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.25.tgz", + "integrity": "sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg==", + "dev": true, + "requires": { + "mime-db": "1.42.0" + } } } }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "spawn-please": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/spawn-please/-/spawn-please-0.3.0.tgz", - "integrity": "sha1-2zOOxM/2Orxp8dDgjO6euL69nRE=" + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "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==", + "dev": true, "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" + "is-typedarray": "^1.0.0" } }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" + "u2f-api": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/u2f-api/-/u2f-api-0.2.7.tgz", + "integrity": "sha512-fqLNg8vpvLOD5J/z4B6wpPg4Lvowz1nJ9xdHcCzdUPKcFE/qNCceV2gNZxSJd5vhAZemHr/K/hbzVA0zxB5mkg==" }, - "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==", + "ultron": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", + "dev": true + }, + "unbzip2-stream": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz", + "integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==", + "dev": true, "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "buffer": "^5.2.1", + "through": "^2.3.8" } }, - "spdx-license-ids": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", - "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==" + "undefsafe": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.2.tgz", + "integrity": "sha1-Il9rngM3Zj4Njnz9aG/Cg2zKznY=", + "dev": true, + "requires": { + "debug": "^2.2.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "requires": { - "extend-shallow": "^3.0.0" + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" } }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "requires": { + "unique-slug": "^2.0.0" + } }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" + "imurmurhash": "^0.1.4" } }, - "ssri": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "unique-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", + "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", "requires": { - "figgy-pudding": "^3.5.1" + "crypto-random-string": "^1.0.0" } }, - "static-extend": { + "universalify": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unorm": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.5.0.tgz", + "integrity": "sha512-sMfSWoiRaXXeDZSXC+YRZ23H4xchQpwxjpw1tmfR+kgbBCaOgln4NI0LXejJIhnBuKINrB3WRn+ZI8IWssirVw==" + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" + "has-value": "^0.3.1", + "isobject": "^3.0.0" }, "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "dev": true, "requires": { - "is-descriptor": "^0.1.0" + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true } } }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "unzip-response": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", + "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", "dev": true }, - "stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "upath": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "dev": true + }, + "update-notifier": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", + "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", + "dev": true, "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" + "boxen": "^1.2.1", + "chalk": "^2.0.1", + "configstore": "^3.0.0", + "import-lazy": "^2.1.0", + "is-ci": "^1.0.10", + "is-installed-globally": "^0.1.0", + "is-npm": "^1.0.0", + "latest-version": "^3.0.0", + "semver-diff": "^2.0.0", + "xdg-basedir": "^3.0.0" } }, - "stream-shift": { + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url-join": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", + "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", + "dev": true + }, + "url-parse-lax": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "requires": { + "prepend-http": "^1.0.1" + } }, - "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=" + "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=" }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "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=", + "dev": true + }, + "usb": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/usb/-/usb-1.6.2.tgz", + "integrity": "sha512-KcovLXRQuH63iEtnqXyDQGOi5dXHpLM5lZBIUsqSJQToua8nL2sVCieQTkzQBfLe5mCuvk40MgKciI61lgevWw==", + "optional": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "bindings": "^1.4.0", + "nan": "2.13.2", + "prebuild-install": "^5.3.3" + }, + "dependencies": { + "bl": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-3.0.0.tgz", + "integrity": "sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A==", + "optional": true, + "requires": { + "readable-stream": "^3.0.1" + } + }, + "decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "optional": true, + "requires": { + "mimic-response": "^2.0.0" + } + }, + "mimic-response": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.0.0.tgz", + "integrity": "sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ==", + "optional": true + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "optional": true + }, + "nan": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", + "optional": true + }, + "prebuild-install": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.3.tgz", + "integrity": "sha512-GV+nsUXuPW2p8Zy7SarF/2W/oiK8bFQgJcncoJ0d7kRpekEA0ftChjfEaF9/Y+QJEc/wFR7RAEa8lYByuUIe2g==", + "optional": true, + "requires": { + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.7.0", + "noop-logger": "^0.1.1", + "npmlog": "^4.0.1", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^3.0.3", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0", + "which-pm-runs": "^1.0.0" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "optional": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "readable-stream": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "optional": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "simple-get": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", + "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", + "optional": true, + "requires": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "tar-fs": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.0.tgz", + "integrity": "sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA==", + "optional": true, + "requires": { + "chownr": "^1.1.1", + "mkdirp": "^0.5.1", + "pump": "^3.0.0", + "tar-stream": "^2.0.0" + } + }, + "tar-stream": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.0.tgz", + "integrity": "sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw==", + "optional": true, + "requires": { + "bl": "^3.0.0", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + } + } } }, - "string.prototype.trim": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", - "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.0", - "function-bind": "^1.0.2" - } + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true }, - "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.0" - } + "utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", + "dev": true }, - "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.0.0" - } + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "dev": true }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, - "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" - } + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "dev": true }, - "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=" + "valid-url": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/valid-url/-/valid-url-1.0.9.tgz", + "integrity": "sha1-HBRHm0DxOXp1eC8RXkCGRHQzogA=" }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "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": { - "has-flag": "^3.0.0" - }, - "dependencies": { - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - } + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, - "supports-hyperlinks": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-1.0.1.tgz", - "integrity": "sha512-HHi5kVSefKaJkGYXbDuKbUGRVxqnWGn3J2e39CYcNJEfWciGq2zYtOhXLTlvrOZW1QU7VX67w7fMmWafHX9Pfw==", - "dev": true, + "validate-npm-package-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", + "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", "requires": { - "has-flag": "^2.0.0", - "supports-color": "^5.0.0" + "builtins": "^1.0.3" } }, - "sync-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.1.0.tgz", - "integrity": "sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==", - "dev": true, - "requires": { - "http-response-object": "^3.0.1", - "sync-rpc": "^1.2.1", - "then-request": "^6.0.0" - } + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true }, - "sync-rpc": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.6.tgz", - "integrity": "sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==", - "dev": true, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { - "get-port": "^3.1.0" + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" } }, - "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "web3": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.4.tgz", + "integrity": "sha512-xPXGe+w0x0t88Wj+s/dmAdASr3O9wmA9mpZRtixGZxmBexAF0MjfqYM+MS4tVl5s11hMTN3AZb8cDD4VLfC57A==", "dev": true, "requires": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" + "@types/node": "^12.6.1", + "web3-bzz": "1.2.4", + "web3-core": "1.2.4", + "web3-eth": "1.2.4", + "web3-eth-personal": "1.2.4", + "web3-net": "1.2.4", + "web3-shh": "1.2.4", + "web3-utils": "1.2.4" }, "dependencies": { - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "@types/node": { + "version": "12.12.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.17.tgz", + "integrity": "sha512-Is+l3mcHvs47sKy+afn2O1rV4ldZFU7W8101cNlOd+MRbjM4Onida8jSZnJdTe/0Pcf25g9BNIUsuugmE6puHA==", + "dev": true + }, + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", "dev": true, "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "ethereumjs-common": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.4.0.tgz", + "integrity": "sha512-ser2SAplX/YI5W2AnzU8wmSjKRy4KQd4uxInJ36BzjS3m18E/B9QedPUIresZN1CSEQb/RgNQ2gN7C/XbpTafA==", + "dev": true + }, + "ethereumjs-tx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.1.tgz", + "integrity": "sha512-QtVriNqowCFA19X9BCRPMgdVNJ0/gMBS91TQb1DfrhsbR748g4STwxZptFAwfqehMyrF8rDwB23w87PQwru0wA==", + "dev": true, + "requires": { + "ethereumjs-common": "^1.3.1", + "ethereumjs-util": "^6.0.0" + } + }, + "ethereumjs-util": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", + "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "0.1.6", + "keccak": "^2.0.0", + "rlp": "^2.2.3", + "secp256k1": "^3.0.1" + } + }, + "ethers": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.3.tgz", + "integrity": "sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog==", + "dev": true, + "requires": { + "@types/node": "^10.3.2", + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.3.3", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.3", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + }, + "dependencies": { + "@types/node": { + "version": "10.17.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.9.tgz", + "integrity": "sha512-+6VygF9LbG7Gaqeog2G7u1+RUcmo0q1rI+2ZxdIg2fAUngk5Vz9fOCHXdloNUOHEPd1EuuOpL5O0CdgN9Fx5UQ==", + "dev": true + } + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true + }, + "keccak": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", + "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", + "dev": true, + "requires": { + "bindings": "^1.5.0", + "inherits": "^2.0.4", + "nan": "^2.14.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + } } }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", "dev": true }, - "is-fullwidth-code-point": { + "prepend-http": { "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=", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } }, - "strip-ansi": { + "safe-buffer": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", + "dev": true + }, + "scrypt-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", + "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=", + "dev": true + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "prepend-http": "^2.0.0" } - } - } - }, - "tape": { - "version": "4.10.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.10.2.tgz", - "integrity": "sha512-mgl23h7W2yuk3N85FOYrin2OvThTYWdwbk6XQ1pr2PMJieyW2FM/4Bu/+kD/wecb3aZ0Enm+Syinyq467OPq2w==", - "requires": { - "deep-equal": "~1.0.1", - "defined": "~1.0.0", - "for-each": "~0.3.3", - "function-bind": "~1.1.1", - "glob": "~7.1.4", - "has": "~1.0.3", - "inherits": "~2.0.3", - "minimist": "~1.2.0", - "object-inspect": "~1.6.0", - "resolve": "~1.10.1", - "resumer": "~0.0.0", - "string.prototype.trim": "~1.1.2", - "through": "~2.3.8" - }, - "dependencies": { - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", + "dev": true + }, + "web3-bzz": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.4.tgz", + "integrity": "sha512-MqhAo/+0iQSMBtt3/QI1rU83uvF08sYq8r25+OUZ+4VtihnYsmkkca+rdU0QbRyrXY2/yGIpI46PFdh0khD53A==", + "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "@types/node": "^10.12.18", + "got": "9.6.0", + "swarm-js": "0.1.39", + "underscore": "1.9.1" + }, + "dependencies": { + "@types/node": { + "version": "10.17.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.9.tgz", + "integrity": "sha512-+6VygF9LbG7Gaqeog2G7u1+RUcmo0q1rI+2ZxdIg2fAUngk5Vz9fOCHXdloNUOHEPd1EuuOpL5O0CdgN9Fx5UQ==", + "dev": true + } } }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + "web3-core": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.4.tgz", + "integrity": "sha512-CHc27sMuET2cs1IKrkz7xzmTdMfZpYswe7f0HcuyneTwS1yTlTnHyqjAaTy0ZygAb/x4iaVox+Gvr4oSAqSI+A==", + "dev": true, + "requires": { + "@types/bignumber.js": "^5.0.0", + "@types/bn.js": "^4.11.4", + "@types/node": "^12.6.1", + "web3-core-helpers": "1.2.4", + "web3-core-method": "1.2.4", + "web3-core-requestmanager": "1.2.4", + "web3-utils": "1.2.4" + } }, - "resolve": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", - "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", + "web3-core-helpers": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.4.tgz", + "integrity": "sha512-U7wbsK8IbZvF3B7S+QMSNP0tni/6VipnJkB0tZVEpHEIV2WWeBHYmZDnULWcsS/x/jn9yKhJlXIxWGsEAMkjiw==", + "dev": true, "requires": { - "path-parse": "^1.0.6" + "underscore": "1.9.1", + "web3-eth-iban": "1.2.4", + "web3-utils": "1.2.4" } - } - } - }, - "tar": { - "version": "4.4.10", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz", - "integrity": "sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==", - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.5", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - }, - "dependencies": { - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" - } - } - }, - "tar-fs": { - "version": "1.16.3", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz", - "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==", - "optional": true, - "requires": { - "chownr": "^1.0.1", - "mkdirp": "^0.5.1", - "pump": "^1.0.0", - "tar-stream": "^1.1.2" - }, - "dependencies": { - "pump": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", - "optional": true, + }, + "web3-core-method": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.4.tgz", + "integrity": "sha512-8p9kpL7di2qOVPWgcM08kb+yKom0rxRCMv6m/K+H+yLSxev9TgMbCgMSbPWAHlyiF3SJHw7APFKahK5Z+8XT5A==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.4", + "web3-core-promievent": "1.2.4", + "web3-core-subscriptions": "1.2.4", + "web3-utils": "1.2.4" + } + }, + "web3-core-promievent": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.4.tgz", + "integrity": "sha512-gEUlm27DewUsfUgC3T8AxkKi8Ecx+e+ZCaunB7X4Qk3i9F4C+5PSMGguolrShZ7Zb6717k79Y86f3A00O0VAZw==", + "dev": true, + "requires": { + "any-promise": "1.3.0", + "eventemitter3": "3.1.2" + } + }, + "web3-core-requestmanager": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.4.tgz", + "integrity": "sha512-eZJDjyNTDtmSmzd3S488nR/SMJtNnn/GuwxnMh3AzYCqG3ZMfOylqTad2eYJPvc2PM5/Gj1wAMQcRpwOjjLuPg==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.4", + "web3-providers-http": "1.2.4", + "web3-providers-ipc": "1.2.4", + "web3-providers-ws": "1.2.4" + } + }, + "web3-core-subscriptions": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.4.tgz", + "integrity": "sha512-3D607J2M8ymY9V+/WZq4MLlBulwCkwEjjC2U+cXqgVO1rCyVqbxZNCmHyNYHjDDCxSEbks9Ju5xqJxDSxnyXEw==", + "dev": true, + "requires": { + "eventemitter3": "3.1.2", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.4" + } + }, + "web3-eth": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.4.tgz", + "integrity": "sha512-+j+kbfmZsbc3+KJpvHM16j1xRFHe2jBAniMo1BHKc3lho6A8Sn9Buyut6odubguX2AxoRArCdIDCkT9hjUERpA==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core": "1.2.4", + "web3-core-helpers": "1.2.4", + "web3-core-method": "1.2.4", + "web3-core-subscriptions": "1.2.4", + "web3-eth-abi": "1.2.4", + "web3-eth-accounts": "1.2.4", + "web3-eth-contract": "1.2.4", + "web3-eth-ens": "1.2.4", + "web3-eth-iban": "1.2.4", + "web3-eth-personal": "1.2.4", + "web3-net": "1.2.4", + "web3-utils": "1.2.4" + } + }, + "web3-eth-abi": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.4.tgz", + "integrity": "sha512-8eLIY4xZKoU3DSVu1pORluAw9Ru0/v4CGdw5so31nn+7fR8zgHMgwbFe0aOqWQ5VU42PzMMXeIJwt4AEi2buFg==", + "dev": true, + "requires": { + "ethers": "4.0.0-beta.3", + "underscore": "1.9.1", + "web3-utils": "1.2.4" + } + }, + "web3-eth-accounts": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.4.tgz", + "integrity": "sha512-04LzT/UtWmRFmi4hHRewP5Zz43fWhuHiK5XimP86sUQodk/ByOkXQ3RoXyGXFMNoRxdcAeRNxSfA2DpIBc9xUw==", + "dev": true, + "requires": { + "@web3-js/scrypt-shim": "^0.1.0", + "any-promise": "1.3.0", + "crypto-browserify": "3.12.0", + "eth-lib": "0.2.7", + "ethereumjs-common": "^1.3.2", + "ethereumjs-tx": "^2.1.1", + "underscore": "1.9.1", + "uuid": "3.3.2", + "web3-core": "1.2.4", + "web3-core-helpers": "1.2.4", + "web3-core-method": "1.2.4", + "web3-utils": "1.2.4" + }, + "dependencies": { + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + } + } + }, + "web3-eth-contract": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.4.tgz", + "integrity": "sha512-b/9zC0qjVetEYnzRA1oZ8gF1OSSUkwSYi5LGr4GeckLkzXP7osEnp9lkO/AQcE4GpG+l+STnKPnASXJGZPgBRQ==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.4", + "underscore": "1.9.1", + "web3-core": "1.2.4", + "web3-core-helpers": "1.2.4", + "web3-core-method": "1.2.4", + "web3-core-promievent": "1.2.4", + "web3-core-subscriptions": "1.2.4", + "web3-eth-abi": "1.2.4", + "web3-utils": "1.2.4" + } + }, + "web3-eth-ens": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.4.tgz", + "integrity": "sha512-g8+JxnZlhdsCzCS38Zm6R/ngXhXzvc3h7bXlxgKU4coTzLLoMpgOAEz71GxyIJinWTFbLXk/WjNY0dazi9NwVw==", + "dev": true, + "requires": { + "eth-ens-namehash": "2.0.8", + "underscore": "1.9.1", + "web3-core": "1.2.4", + "web3-core-helpers": "1.2.4", + "web3-core-promievent": "1.2.4", + "web3-eth-abi": "1.2.4", + "web3-eth-contract": "1.2.4", + "web3-utils": "1.2.4" + } + }, + "web3-eth-iban": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.4.tgz", + "integrity": "sha512-D9HIyctru/FLRpXakRwmwdjb5bWU2O6UE/3AXvRm6DCOf2e+7Ve11qQrPtaubHfpdW3KWjDKvlxV9iaFv/oTMQ==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "web3-utils": "1.2.4" + } + }, + "web3-eth-personal": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.4.tgz", + "integrity": "sha512-5Russ7ZECwHaZXcN3DLuLS7390Vzgrzepl4D87SD6Sn1DHsCZtvfdPIYwoTmKNp69LG3mORl7U23Ga5YxqkICw==", + "dev": true, + "requires": { + "@types/node": "^12.6.1", + "web3-core": "1.2.4", + "web3-core-helpers": "1.2.4", + "web3-core-method": "1.2.4", + "web3-net": "1.2.4", + "web3-utils": "1.2.4" + } + }, + "web3-net": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.4.tgz", + "integrity": "sha512-wKOsqhyXWPSYTGbp7ofVvni17yfRptpqoUdp3SC8RAhDmGkX6irsiT9pON79m6b3HUHfLoBilFQyt/fTUZOf7A==", + "dev": true, + "requires": { + "web3-core": "1.2.4", + "web3-core-method": "1.2.4", + "web3-utils": "1.2.4" + } + }, + "web3-providers-http": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.4.tgz", + "integrity": "sha512-dzVCkRrR/cqlIrcrWNiPt9gyt0AZTE0J+MfAu9rR6CyIgtnm1wFUVVGaxYRxuTGQRO4Dlo49gtoGwaGcyxqiTw==", + "dev": true, + "requires": { + "web3-core-helpers": "1.2.4", + "xhr2-cookies": "1.1.0" + } + }, + "web3-providers-ipc": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.4.tgz", + "integrity": "sha512-8J3Dguffin51gckTaNrO3oMBo7g+j0UNk6hXmdmQMMNEtrYqw4ctT6t06YOf9GgtOMjSAc1YEh3LPrvgIsR7og==", + "dev": true, + "requires": { + "oboe": "2.1.4", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.4" + } + }, + "web3-providers-ws": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.4.tgz", + "integrity": "sha512-F/vQpDzeK+++oeeNROl1IVTufFCwCR2hpWe5yRXN0ApLwHqXrMI7UwQNdJ9iyibcWjJf/ECbauEEQ8CHgE+MYQ==", + "dev": true, + "requires": { + "@web3-js/websocket": "^1.0.29", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.4" + } + }, + "web3-shh": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.4.tgz", + "integrity": "sha512-z+9SCw0dE+69Z/Hv8809XDbLj7lTfEv9Sgu8eKEIdGntZf4v7ewj5rzN5bZZSz8aCvfK7Y6ovz1PBAu4QzS4IQ==", + "dev": true, "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "web3-core": "1.2.4", + "web3-core-method": "1.2.4", + "web3-core-subscriptions": "1.2.4", + "web3-net": "1.2.4" } - } - } - }, - "tar-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", - "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", - "optional": true, - "requires": { - "bl": "^1.0.0", - "buffer-alloc": "^1.2.0", - "end-of-stream": "^1.0.0", - "fs-constants": "^1.0.0", - "readable-stream": "^2.3.0", - "to-buffer": "^1.1.1", - "xtend": "^4.0.0" - } - }, - "term-size": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "requires": { - "execa": "^0.7.0" - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "then-request": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.2.tgz", - "integrity": "sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==", - "dev": true, - "requires": { - "@types/concat-stream": "^1.6.0", - "@types/form-data": "0.0.33", - "@types/node": "^8.0.0", - "@types/qs": "^6.2.31", - "caseless": "~0.12.0", - "concat-stream": "^1.6.0", - "form-data": "^2.2.0", - "http-basic": "^8.1.1", - "http-response-object": "^3.0.1", - "promise": "^8.0.0", - "qs": "^6.4.0" - }, - "dependencies": { - "@types/node": { - "version": "8.10.53", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.53.tgz", - "integrity": "sha512-aOmXdv1a1/vYUn1OT1CED8ftbkmmYbKhKGSyMDeJiidLvKRKvZUQOdXwG/wcNY7T1Qb0XTlVdiYjIq00U7pLrQ==", - "dev": true - } - } - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "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==", - "optional": true - }, - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=" - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + }, + "web3-utils": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.4.tgz", + "integrity": "sha512-+S86Ip+jqfIPQWvw2N/xBQq5JNqCO0dyvukGdJm8fEWHZbckT4WxSpHbx+9KLEWY4H4x9pUwnoRkK87pYyHfgQ==", "dev": true, "requires": { - "is-buffer": "^1.1.5" + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" } } } }, - "to-readable-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", - "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==" - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "touch": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", - "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", - "dev": true, - "requires": { - "nopt": "~1.0.10" - } - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - } - } - }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" - }, - "truffle": { - "version": "5.0.35", - "resolved": "https://registry.npmjs.org/truffle/-/truffle-5.0.35.tgz", - "integrity": "sha512-ewJPaeHyYgRpuVSvlzhlnalJkeLN0sz7c/P/8WLWpXC966M2o4vL5ov6MNdSHQFYiYQsDrCetrothzsYsg4HWQ==", - "requires": { - "app-module-path": "^2.2.0", - "mocha": "5.2.0", - "original-require": "1.0.1" - } - }, - "truffle-flattener": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/truffle-flattener/-/truffle-flattener-1.4.2.tgz", - "integrity": "sha512-7qUIzaW8a4vI4nui14wsytht2oaqvqnZ1Iet2wRq2T0bCJ0wb6HByMKQhZKpU46R+n5BMTY4K5n+0ITyeNlmuQ==", + "web3-bzz": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.2.tgz", + "integrity": "sha512-b1O2ObsqUN1lJxmFSjvnEC4TsaCbmh7Owj3IAIWTKqL9qhVgx7Qsu5O9cD13pBiSPNZJ68uJPaKq380QB4NWeA==", "dev": true, "requires": { - "@resolver-engine/imports-fs": "^0.2.2", - "find-up": "^2.1.0", - "mkdirp": "^0.5.1", - "solidity-parser-antlr": "^0.4.11", - "tsort": "0.0.1" + "@types/node": "^10.12.18", + "got": "9.6.0", + "swarm-js": "0.1.39", + "underscore": "1.9.1" }, "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "dev": true, "requires": { - "locate-path": "^2.0.0" + "pump": "^3.0.0" } }, - "solidity-parser-antlr": { - "version": "0.4.11", - "resolved": "https://registry.npmjs.org/solidity-parser-antlr/-/solidity-parser-antlr-0.4.11.tgz", - "integrity": "sha512-4jtxasNGmyC0midtjH/lTFPZYvTTUMy6agYcF+HoMnzW8+cqo3piFrINb4ZCzpPW+7tTVFCGa5ubP34zOzeuMg==", + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + } + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } } } }, - "ts-essentials": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-1.0.4.tgz", - "integrity": "sha512-q3N1xS4vZpRouhYHDPwO0bDW3EZ6SK9CrrDHxi/D6BPReSjpVgWIOpLS2o0gSBZm+7q/wyKp6RVM1AeeW7uyfQ==", - "dev": true - }, - "ts-node": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz", - "integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==", + "web3-core": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.2.tgz", + "integrity": "sha512-miHAX3qUgxV+KYfaOY93Hlc3kLW2j5fH8FJy6kSxAv+d4d5aH0wwrU2IIoJylQdT+FeenQ38sgsCnFu9iZ1hCQ==", "dev": true, "requires": { - "arg": "^4.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.6", - "yn": "^3.0.0" + "@types/bn.js": "^4.11.4", + "@types/node": "^12.6.1", + "web3-core-helpers": "1.2.2", + "web3-core-method": "1.2.2", + "web3-core-requestmanager": "1.2.2", + "web3-utils": "1.2.2" }, "dependencies": { - "diff": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", - "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", + "@types/node": { + "version": "12.12.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.17.tgz", + "integrity": "sha512-Is+l3mcHvs47sKy+afn2O1rV4ldZFU7W8101cNlOd+MRbjM4Onida8jSZnJdTe/0Pcf25g9BNIUsuugmE6puHA==", "dev": true + }, + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } } } }, - "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" - }, - "tsort": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", - "integrity": "sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y=", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, - "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-fest": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", - "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==" - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" - }, - "u2f-api": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/u2f-api/-/u2f-api-0.2.7.tgz", - "integrity": "sha512-fqLNg8vpvLOD5J/z4B6wpPg4Lvowz1nJ9xdHcCzdUPKcFE/qNCceV2gNZxSJd5vhAZemHr/K/hbzVA0zxB5mkg==" - }, - "uglify-js": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", - "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", - "optional": true, + "web3-core-helpers": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.2.tgz", + "integrity": "sha512-HJrRsIGgZa1jGUIhvGz4S5Yh6wtOIo/TMIsSLe+Xay+KVnbseJpPprDI5W3s7H2ODhMQTbogmmUFquZweW2ImQ==", + "dev": true, "requires": { - "commander": "~2.20.0", - "source-map": "~0.6.1" + "underscore": "1.9.1", + "web3-eth-iban": "1.2.2", + "web3-utils": "1.2.2" }, "dependencies": { - "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", - "optional": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } } } }, - "undefsafe": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.2.tgz", - "integrity": "sha1-Il9rngM3Zj4Njnz9aG/Cg2zKznY=", + "web3-core-method": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.2.tgz", + "integrity": "sha512-szR4fDSBxNHaF1DFqE+j6sFR/afv9Aa36OW93saHZnrh+iXSrYeUUDfugeNcRlugEKeUCkd4CZylfgbK2SKYJA==", "dev": true, "requires": { - "debug": "^2.2.0" + "underscore": "1.9.1", + "web3-core-helpers": "1.2.2", + "web3-core-promievent": "1.2.2", + "web3-core-subscriptions": "1.2.2", + "web3-utils": "1.2.2" }, "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", "dev": true, "requires": { - "ms": "2.0.0" + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" } } } }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "web3-core-promievent": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.2.tgz", + "integrity": "sha512-tKvYeT8bkUfKABcQswK6/X79blKTKYGk949urZKcLvLDEaWrM3uuzDwdQT3BNKzQ3vIvTggFPX9BwYh0F1WwqQ==", "dev": true, "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" + "any-promise": "1.3.0", + "eventemitter3": "3.1.2" } }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "web3-core-requestmanager": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.2.tgz", + "integrity": "sha512-a+gSbiBRHtHvkp78U2bsntMGYGF2eCb6219aMufuZWeAZGXJ63Wc2321PCbA8hF9cQrZI4EoZ4kVLRI4OF15Hw==", + "dev": true, "requires": { - "unique-slug": "^2.0.0" + "underscore": "1.9.1", + "web3-core-helpers": "1.2.2", + "web3-providers-http": "1.2.2", + "web3-providers-ipc": "1.2.2", + "web3-providers-ws": "1.2.2" } }, - "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "web3-core-subscriptions": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.2.tgz", + "integrity": "sha512-QbTgigNuT4eicAWWr7ahVpJyM8GbICsR1Ys9mJqzBEwpqS+RXTRVSkwZ2IsxO+iqv6liMNwGregbJLq4urMFcQ==", + "dev": true, "requires": { - "imurmurhash": "^0.1.4" + "eventemitter3": "3.1.2", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.2" } }, - "unique-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", - "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", + "web3-eth": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.2.tgz", + "integrity": "sha512-UXpC74mBQvZzd4b+baD4Ocp7g+BlwxhBHumy9seyE/LMIcMlePXwCKzxve9yReNpjaU16Mmyya6ZYlyiKKV8UA==", + "dev": true, "requires": { - "crypto-random-string": "^1.0.0" + "underscore": "1.9.1", + "web3-core": "1.2.2", + "web3-core-helpers": "1.2.2", + "web3-core-method": "1.2.2", + "web3-core-subscriptions": "1.2.2", + "web3-eth-abi": "1.2.2", + "web3-eth-accounts": "1.2.2", + "web3-eth-contract": "1.2.2", + "web3-eth-ens": "1.2.2", + "web3-eth-iban": "1.2.2", + "web3-eth-personal": "1.2.2", + "web3-net": "1.2.2", + "web3-utils": "1.2.2" + }, + "dependencies": { + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "ethers": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.3.tgz", + "integrity": "sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog==", + "dev": true, + "requires": { + "@types/node": "^10.3.2", + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.3.3", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.3", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true + }, + "scrypt-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", + "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=", + "dev": true + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", + "dev": true + }, + "web3-eth-abi": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.2.tgz", + "integrity": "sha512-Yn/ZMgoOLxhTVxIYtPJ0eS6pnAnkTAaJgUJh1JhZS4ekzgswMfEYXOwpMaD5eiqPJLpuxmZFnXnBZlnQ1JMXsw==", + "dev": true, + "requires": { + "ethers": "4.0.0-beta.3", + "underscore": "1.9.1", + "web3-utils": "1.2.2" + } + }, + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, - "unorm": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.5.0.tgz", - "integrity": "sha512-sMfSWoiRaXXeDZSXC+YRZ23H4xchQpwxjpw1tmfR+kgbBCaOgln4NI0LXejJIhnBuKINrB3WRn+ZI8IWssirVw==" - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, + "web3-eth-abi": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.1.tgz", + "integrity": "sha512-jI/KhU2a/DQPZXHjo2GW0myEljzfiKOn+h1qxK1+Y9OQfTcBMxrQJyH5AP89O6l6NZ1QvNdq99ThAxBFoy5L+g==", "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" + "ethers": "4.0.0-beta.3", + "underscore": "1.9.1", + "web3-utils": "1.2.1" }, "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" } }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true + "ethers": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.3.tgz", + "integrity": "sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog==", + "requires": { + "@types/node": "^10.3.2", + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.3.3", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.3", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + }, + "scrypt-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", + "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=" + }, + "underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" } } }, - "unzip-response": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", - "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", - "dev": true - }, - "upath": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", - "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", - "dev": true - }, - "update-notifier": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", - "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", - "dev": true, - "requires": { - "boxen": "^1.2.1", - "chalk": "^2.0.1", - "configstore": "^3.0.0", - "import-lazy": "^2.1.0", - "is-ci": "^1.0.10", - "is-installed-globally": "^0.1.0", - "is-npm": "^1.0.0", - "latest-version": "^3.0.0", - "semver-diff": "^2.0.0", - "xdg-basedir": "^3.0.0" - } - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url-join": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", - "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", - "dev": true - }, - "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "web3-eth-accounts": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.2.tgz", + "integrity": "sha512-KzHOEyXOEZ13ZOkWN3skZKqSo5f4Z1ogPFNn9uZbKCz+kSp+gCAEKxyfbOsB/JMAp5h7o7pb6eYsPCUBJmFFiA==", "dev": true, "requires": { - "prepend-http": "^1.0.1" - } - }, - "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=" - }, - "usb": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/usb/-/usb-1.6.0.tgz", - "integrity": "sha512-52DyWlCk9K+iw3LnvY95WXSnpHjxJoI++aGkV8HiMNPc4zmvDQlYvWAzrkbJ2JH3oUcx26XfU5sZcG4RAcVkMg==", - "optional": true, - "requires": { - "bindings": "^1.4.0", - "nan": "2.13.2", - "prebuild-install": "^5.2.4" + "any-promise": "1.3.0", + "crypto-browserify": "3.12.0", + "eth-lib": "0.2.7", + "ethereumjs-common": "^1.3.2", + "ethereumjs-tx": "^2.1.1", + "scrypt-shim": "github:web3-js/scrypt-shim", + "underscore": "1.9.1", + "uuid": "3.3.2", + "web3-core": "1.2.2", + "web3-core-helpers": "1.2.2", + "web3-core-method": "1.2.2", + "web3-utils": "1.2.2" }, "dependencies": { + "ethereumjs-common": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.4.0.tgz", + "integrity": "sha512-ser2SAplX/YI5W2AnzU8wmSjKRy4KQd4uxInJ36BzjS3m18E/B9QedPUIresZN1CSEQb/RgNQ2gN7C/XbpTafA==", + "dev": true + }, + "ethereumjs-tx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.1.tgz", + "integrity": "sha512-QtVriNqowCFA19X9BCRPMgdVNJ0/gMBS91TQb1DfrhsbR748g4STwxZptFAwfqehMyrF8rDwB23w87PQwru0wA==", + "dev": true, + "requires": { + "ethereumjs-common": "^1.3.1", + "ethereumjs-util": "^6.0.0" + } + }, + "ethereumjs-util": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", + "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "0.1.6", + "keccak": "^2.0.0", + "rlp": "^2.2.3", + "secp256k1": "^3.0.1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "keccak": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", + "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", + "dev": true, + "requires": { + "bindings": "^1.5.0", + "inherits": "^2.0.4", + "nan": "^2.14.0", + "safe-buffer": "^5.2.0" + } + }, "nan": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", - "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", - "optional": true - } - } - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - }, - "v8-compile-cache": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", - "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", - "dev": true - }, - "valid-url": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/valid-url/-/valid-url-1.0.9.tgz", - "integrity": "sha1-HBRHm0DxOXp1eC8RXkCGRHQzogA=" - }, - "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" - } - }, - "validate-npm-package-name": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", - "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", - "requires": { - "builtins": "^1.0.3" + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", + "dev": true + }, + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "web3-eth-contract": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.2.tgz", + "integrity": "sha512-EKT2yVFws3FEdotDQoNsXTYL798+ogJqR2//CaGwx3p0/RvQIgfzEwp8nbgA6dMxCsn9KOQi7OtklzpnJMkjtA==", + "dev": true, "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" + "@types/bn.js": "^4.11.4", + "underscore": "1.9.1", + "web3-core": "1.2.2", + "web3-core-helpers": "1.2.2", + "web3-core-method": "1.2.2", + "web3-core-promievent": "1.2.2", + "web3-core-subscriptions": "1.2.2", + "web3-eth-abi": "1.2.2", + "web3-utils": "1.2.2" + }, + "dependencies": { + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "ethers": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.3.tgz", + "integrity": "sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog==", + "dev": true, + "requires": { + "@types/node": "^10.3.2", + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.3.3", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.3", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true + }, + "scrypt-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", + "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=", + "dev": true + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", + "dev": true + }, + "web3-eth-abi": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.2.tgz", + "integrity": "sha512-Yn/ZMgoOLxhTVxIYtPJ0eS6pnAnkTAaJgUJh1JhZS4ekzgswMfEYXOwpMaD5eiqPJLpuxmZFnXnBZlnQ1JMXsw==", + "dev": true, + "requires": { + "ethers": "4.0.0-beta.3", + "underscore": "1.9.1", + "web3-utils": "1.2.2" + } + }, + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, - "web3-eth-abi": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.1.tgz", - "integrity": "sha512-jI/KhU2a/DQPZXHjo2GW0myEljzfiKOn+h1qxK1+Y9OQfTcBMxrQJyH5AP89O6l6NZ1QvNdq99ThAxBFoy5L+g==", + "web3-eth-ens": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.2.tgz", + "integrity": "sha512-CFjkr2HnuyMoMFBoNUWojyguD4Ef+NkyovcnUc/iAb9GP4LHohKrODG4pl76R5u61TkJGobC2ij6TyibtsyVYg==", + "dev": true, "requires": { - "ethers": "4.0.0-beta.3", + "eth-ens-namehash": "2.0.8", "underscore": "1.9.1", - "web3-utils": "1.2.1" + "web3-core": "1.2.2", + "web3-core-helpers": "1.2.2", + "web3-core-promievent": "1.2.2", + "web3-eth-abi": "1.2.2", + "web3-eth-contract": "1.2.2", + "web3-utils": "1.2.2" }, "dependencies": { "elliptic": { "version": "6.3.3", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "dev": true, "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -24332,6 +27315,7 @@ "version": "4.0.0-beta.3", "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.3.tgz", "integrity": "sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog==", + "dev": true, "requires": { "@types/node": "^10.3.2", "aes-js": "3.0.0", @@ -24349,6 +27333,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, "requires": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.0" @@ -24357,22 +27342,142 @@ "js-sha3": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true }, "scrypt-js": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", - "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=" - }, - "underscore": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", - "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" + "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=", + "dev": true }, "uuid": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", + "dev": true + }, + "web3-eth-abi": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.2.tgz", + "integrity": "sha512-Yn/ZMgoOLxhTVxIYtPJ0eS6pnAnkTAaJgUJh1JhZS4ekzgswMfEYXOwpMaD5eiqPJLpuxmZFnXnBZlnQ1JMXsw==", + "dev": true, + "requires": { + "ethers": "4.0.0-beta.3", + "underscore": "1.9.1", + "web3-utils": "1.2.2" + } + }, + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } + } + }, + "web3-eth-iban": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.2.tgz", + "integrity": "sha512-gxKXBoUhaTFHr0vJB/5sd4i8ejF/7gIsbM/VvemHT3tF5smnmY6hcwSMmn7sl5Gs+83XVb/BngnnGkf+I/rsrQ==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "web3-utils": "1.2.2" + }, + "dependencies": { + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } + } + }, + "web3-eth-personal": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.2.tgz", + "integrity": "sha512-4w+GLvTlFqW3+q4xDUXvCEMU7kRZ+xm/iJC8gm1Li1nXxwwFbs+Y+KBK6ZYtoN1qqAnHR+plYpIoVo27ixI5Rg==", + "dev": true, + "requires": { + "@types/node": "^12.6.1", + "web3-core": "1.2.2", + "web3-core-helpers": "1.2.2", + "web3-core-method": "1.2.2", + "web3-net": "1.2.2", + "web3-utils": "1.2.2" + }, + "dependencies": { + "@types/node": { + "version": "12.12.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.17.tgz", + "integrity": "sha512-Is+l3mcHvs47sKy+afn2O1rV4ldZFU7W8101cNlOd+MRbjM4Onida8jSZnJdTe/0Pcf25g9BNIUsuugmE6puHA==", + "dev": true + }, + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } + } + }, + "web3-net": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.2.tgz", + "integrity": "sha512-K07j2DXq0x4UOJgae65rWZKraOznhk8v5EGSTdFqASTx7vWE/m+NqBijBYGEsQY1lSMlVaAY9UEQlcXK5HzXTw==", + "dev": true, + "requires": { + "web3-core": "1.2.2", + "web3-core-method": "1.2.2", + "web3-utils": "1.2.2" + }, + "dependencies": { + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } } } }, @@ -24414,6 +27519,50 @@ } } }, + "web3-providers-http": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.2.tgz", + "integrity": "sha512-BNZ7Hguy3eBszsarH5gqr9SIZNvqk9eKwqwmGH1LQS1FL3NdoOn7tgPPdddrXec4fL94CwgNk4rCU+OjjZRNDg==", + "dev": true, + "requires": { + "web3-core-helpers": "1.2.2", + "xhr2-cookies": "1.1.0" + } + }, + "web3-providers-ipc": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.2.tgz", + "integrity": "sha512-t97w3zi5Kn/LEWGA6D9qxoO0LBOG+lK2FjlEdCwDQatffB/+vYrzZ/CLYVQSoyFZAlsDoBasVoYSWZK1n39aHA==", + "dev": true, + "requires": { + "oboe": "2.1.4", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.2" + } + }, + "web3-providers-ws": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.2.tgz", + "integrity": "sha512-Wb1mrWTGMTXOpJkL0yGvL/WYLt8fUIXx8k/l52QB2IiKzvyd42dTWn4+j8IKXGSYYzOm7NMqv6nhA5VDk12VfA==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.2", + "websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis" + } + }, + "web3-shh": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.2.tgz", + "integrity": "sha512-og258NPhlBn8yYrDWjoWBBb6zo1OlBgoWGT+LL5/LPqRbjPe09hlOYHgscAAr9zZGtohTOty7RrxYw6Z6oDWCg==", + "dev": true, + "requires": { + "web3-core": "1.2.2", + "web3-core-method": "1.2.2", + "web3-core-subscriptions": "1.2.2", + "web3-net": "1.2.2" + } + }, "web3-utils": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", @@ -24440,6 +27589,35 @@ } } }, + "websocket": { + "version": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e", + "from": "github:web3-js/WebSocket-Node#polyfill/globalThis", + "dev": true, + "requires": { + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "nan": "^2.14.0", + "typedarray-to-buffer": "^3.1.5", + "yaeti": "^0.0.6" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true + } + } + }, "whatwg-fetch": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", @@ -24594,6 +27772,15 @@ "xhr-request": "^1.0.1" } }, + "xhr2-cookies": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz", + "integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=", + "dev": true, + "requires": { + "cookiejar": "^2.1.1" + } + }, "xmlhttprequest": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", @@ -24609,6 +27796,12 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" }, + "yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=", + "dev": true + }, "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", @@ -24702,6 +27895,16 @@ "decamelize": "^1.2.0" } }, + "yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "dev": true, + "requires": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", diff --git a/package.json b/package.json index e1bafb67c..71c83d9b8 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ }, "devDependencies": { "@codechecks/client": "^0.1.9", + "@openzeppelin/test-helpers": "^0.5.4", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "chai-bn": "^0.1.1", diff --git a/test/amb_erc677_to_erc677/AMBErc677ToErc677Behavior.test.js b/test/amb_erc677_to_erc677/AMBErc677ToErc677Behavior.test.js index 3efe70d60..54f277140 100644 --- a/test/amb_erc677_to_erc677/AMBErc677ToErc677Behavior.test.js +++ b/test/amb_erc677_to_erc677/AMBErc677ToErc677Behavior.test.js @@ -1,10 +1,14 @@ const ERC677BridgeToken = artifacts.require('ERC677BridgeToken.sol') const ERC20Mock = artifacts.require('ERC20Mock.sol') const AMBMock = artifacts.require('AMBMock.sol') +const AbsoluteDailyLimit = artifacts.require('AbsoluteDailyLimit.sol') +const RelativeDailyLimit = artifacts.require('RelativeDailyLimit.sol') +const RelativeExecutionDailyLimit = artifacts.require('RelativeExecutionDailyLimit.sol') const { expect } = require('chai') +const { expectEvent } = require('@openzeppelin/test-helpers') const { ZERO_ADDRESS, toBN, ERROR_MSG } = require('../setup') -const { getEvents, expectEventInLogs, ether, strip0x } = require('../helpers/helpers') +const { getEvents, expectEventInLogs, ether, strip0x, calculateDailyLimit } = require('../helpers/helpers') const ZERO = toBN(0) const oneEther = ether('1') @@ -16,175 +20,303 @@ const maxPerTx = oneEther const minPerTx = ether('0.01') const executionDailyLimit = dailyLimit const executionMaxPerTx = maxPerTx +const executionMinPerTx = minPerTx const exampleTxHash = '0xf308b922ab9f8a7128d9d7bc9bce22cd88b2c05c8213f0e2d8104d78e0a9ecbb' const decimalShiftZero = 0 +const targetLimit = ether('0.05') +const threshold = ether('10000') -function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accounts) { +function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accounts, isRelativeDailyLimitOnBridgeSide) { let bridgeContract let mediatorContract let erc677Token + let contract + let limitsContract const owner = accounts[0] const user = accounts[1] + + const limitsArray = [dailyLimit, maxPerTx, minPerTx] + const executionLimitsArray = [executionDailyLimit, executionMaxPerTx, executionMinPerTx] + const LimitsContract = AbsoluteDailyLimit + + function getRequestLimits(isRelativeDailyLimit) { + if (!isRelativeDailyLimit || !isRelativeDailyLimitOnBridgeSide) { + return [dailyLimit, maxPerTx, minPerTx] + } + return [targetLimit, threshold, maxPerTx, minPerTx] + } + + function getExecutionLimits(isRelativeDailyLimit) { + if (!isRelativeDailyLimit || isRelativeDailyLimitOnBridgeSide) { + return [executionDailyLimit, executionMaxPerTx, executionMinPerTx] + } + return [targetLimit, threshold, executionMaxPerTx, executionMinPerTx] + } + + function getLimitsContract(isRelativeDailyLimit) { + if (!isRelativeDailyLimit) return AbsoluteDailyLimit + if (!isRelativeDailyLimitOnBridgeSide) return RelativeExecutionDailyLimit + return RelativeDailyLimit + } + + function initialize(tokenAddress, limits = limitsArray, executionLimits = executionLimitsArray) { + return contract.initialize( + bridgeContract.address, + mediatorContract.address, + tokenAddress, + limits, + executionLimits, + maxGasPerTx, + decimalShiftZero, + owner, + limitsContract.address + ).should.be.fulfilled + } + describe('initialize', () => { beforeEach(async () => { bridgeContract = await AMBMock.new() await bridgeContract.setMaxGasPerTx(maxGasPerTx) mediatorContract = await otherSideMediatorContract.new() erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + limitsContract = await AbsoluteDailyLimit.new() }) - it('should initialize', async function() { - const contract = this.bridge - expect(await contract.isInitialized()).to.be.equal(false) - expect(await contract.bridgeContract()).to.be.equal(ZERO_ADDRESS) - expect(await contract.mediatorContractOnOtherSide()).to.be.equal(ZERO_ADDRESS) - expect(await contract.erc677token()).to.be.equal(ZERO_ADDRESS) - expect(await contract.dailyLimit()).to.be.bignumber.equal(ZERO) - expect(await contract.maxPerTx()).to.be.bignumber.equal(ZERO) - expect(await contract.minPerTx()).to.be.bignumber.equal(ZERO) - expect(await contract.executionDailyLimit()).to.be.bignumber.equal(ZERO) - expect(await contract.executionMaxPerTx()).to.be.bignumber.equal(ZERO) - expect(await contract.requestGasLimit()).to.be.bignumber.equal(ZERO) - expect(await contract.owner()).to.be.equal(ZERO_ADDRESS) - - // not valid bridge contract - await contract - .initialize( - ZERO_ADDRESS, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ) - .should.be.rejectedWith(ERROR_MSG) - - // not valid erc677 contract - await contract - .initialize( - bridgeContract.address, - mediatorContract.address, - ZERO_ADDRESS, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ) - .should.be.rejectedWith(ERROR_MSG) - - // dailyLimit > maxPerTx - await contract - .initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [maxPerTx, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ) - .should.be.rejectedWith(ERROR_MSG) - - // maxPerTx > minPerTx - await contract - .initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, minPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ) - .should.be.rejectedWith(ERROR_MSG) - - // executionDailyLimit > executionMaxPerTx - await contract - .initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionMaxPerTx, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ) - .should.be.rejectedWith(ERROR_MSG) - - // maxGasPerTx > bridge maxGasPerTx - await contract - .initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - dailyLimit, - decimalShiftZero, - owner - ) - .should.be.rejectedWith(ERROR_MSG) - - const { logs } = await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled - - // already initialized - await contract - .initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ) - .should.be.rejectedWith(ERROR_MSG) - - expect(await contract.isInitialized()).to.be.equal(true) - expect(await contract.bridgeContract()).to.be.equal(bridgeContract.address) - expect(await contract.mediatorContractOnOtherSide()).to.be.equal(mediatorContract.address) - expect(await contract.erc677token()).to.be.equal(erc677Token.address) - expect(await contract.dailyLimit()).to.be.bignumber.equal(dailyLimit) - expect(await contract.maxPerTx()).to.be.bignumber.equal(maxPerTx) - expect(await contract.minPerTx()).to.be.bignumber.equal(minPerTx) - expect(await contract.executionDailyLimit()).to.be.bignumber.equal(executionDailyLimit) - expect(await contract.executionMaxPerTx()).to.be.bignumber.equal(executionMaxPerTx) - expect(await contract.requestGasLimit()).to.be.bignumber.equal(maxGasPerTx) - expect(await contract.owner()).to.be.equal(owner) - - expectEventInLogs(logs, 'ExecutionDailyLimitChanged', { newLimit: executionDailyLimit }) - expectEventInLogs(logs, 'DailyLimitChanged', { newLimit: dailyLimit }) - }) + const shouldInitialize = isRelativeDailyLimit => + async function() { + contract = this.bridge + expect(await contract.isInitialized()).to.be.equal(false) + expect(await contract.bridgeContract()).to.be.equal(ZERO_ADDRESS) + expect(await contract.mediatorContractOnOtherSide()).to.be.equal(ZERO_ADDRESS) + expect(await contract.erc677token()).to.be.equal(ZERO_ADDRESS) + expect(await contract.requestGasLimit()).to.be.bignumber.equal(ZERO) + expect(await contract.owner()).to.be.equal(ZERO_ADDRESS) + expect(await contract.limitsContract()).to.be.equal(ZERO_ADDRESS) + + const limitsArray = getRequestLimits(isRelativeDailyLimit) + const executionLimitsArray = getExecutionLimits(isRelativeDailyLimit) + const LimitsContract = getLimitsContract(isRelativeDailyLimit) + limitsContract = await LimitsContract.new() + + // not valid bridge contract + await contract + .initialize( + ZERO_ADDRESS, + mediatorContract.address, + erc677Token.address, + limitsArray, + executionLimitsArray, + maxGasPerTx, + decimalShiftZero, + owner, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + + // not valid erc677 contract + await contract + .initialize( + bridgeContract.address, + mediatorContract.address, + ZERO_ADDRESS, + limitsArray, + executionLimitsArray, + maxGasPerTx, + decimalShiftZero, + owner, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + // not valid limits contract + await contract + .initialize( + bridgeContract.address, + mediatorContract.address, + erc677Token.address, + limitsArray, + executionLimitsArray, + maxGasPerTx, + decimalShiftZero, + owner, + ZERO_ADDRESS + ) + .should.be.rejectedWith(ERROR_MSG) + + // dailyLimit > maxPerTx + let limits = [maxPerTx, maxPerTx, minPerTx] + let executionLimits = [executionDailyLimit, executionMaxPerTx, executionMinPerTx] + let relativeDailyLimit = [targetLimit, threshold, executionMaxPerTx, executionMinPerTx] + if (isRelativeDailyLimit) { + limits = isRelativeDailyLimitOnBridgeSide ? relativeDailyLimit : limits + executionLimits = isRelativeDailyLimitOnBridgeSide ? limits : relativeDailyLimit + } + await contract + .initialize( + bridgeContract.address, + mediatorContract.address, + erc677Token.address, + limits, + executionLimits, + maxGasPerTx, + decimalShiftZero, + owner, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + + // maxPerTx > minPerTx + limits = [dailyLimit, minPerTx, minPerTx] + executionLimits = [executionDailyLimit, executionMaxPerTx, executionMinPerTx] + relativeDailyLimit = [targetLimit, threshold, executionMaxPerTx, executionMinPerTx] + if (isRelativeDailyLimit) { + limits = isRelativeDailyLimitOnBridgeSide ? relativeDailyLimit : limits + executionLimits = isRelativeDailyLimitOnBridgeSide ? limits : relativeDailyLimit + } + await contract + .initialize( + bridgeContract.address, + mediatorContract.address, + erc677Token.address, + limits, + executionLimits, + maxGasPerTx, + decimalShiftZero, + owner, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + + // threshold <= 1 ether + if (isRelativeDailyLimit) { + limits = [dailyLimit, maxPerTx, minPerTx] + relativeDailyLimit = [ether('1.1'), threshold, executionMaxPerTx, executionMinPerTx] + await contract + .initialize( + bridgeContract.address, + mediatorContract.address, + erc677Token.address, + isRelativeDailyLimitOnBridgeSide ? relativeDailyLimit : limits, + isRelativeDailyLimitOnBridgeSide ? limits : relativeDailyLimit, + maxGasPerTx, + decimalShiftZero, + owner, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + + // threshold >= executionMinPerTx + limits = [dailyLimit, maxPerTx, minPerTx] + relativeDailyLimit = [targetLimit, ether('0.009'), executionMaxPerTx, executionMinPerTx] + await contract + .initialize( + bridgeContract.address, + mediatorContract.address, + erc677Token.address, + isRelativeDailyLimitOnBridgeSide ? relativeDailyLimit : limits, + isRelativeDailyLimitOnBridgeSide ? limits : relativeDailyLimit, + maxGasPerTx, + decimalShiftZero, + owner, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + } + + // executionMaxPerTx > executionMinPerTx + limits = [dailyLimit, maxPerTx, minPerTx] + executionLimits = [executionDailyLimit, executionMinPerTx, executionMinPerTx] + relativeDailyLimit = [targetLimit, threshold, executionMinPerTx, executionMinPerTx] + if (isRelativeDailyLimit) { + limits = isRelativeDailyLimitOnBridgeSide ? relativeDailyLimit : limits + executionLimits = isRelativeDailyLimitOnBridgeSide ? limits : relativeDailyLimit + } + await contract + .initialize( + bridgeContract.address, + mediatorContract.address, + erc677Token.address, + limits, + executionLimits, + maxGasPerTx, + decimalShiftZero, + owner, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + + // maxGasPerTx > bridge maxGasPerTx + await contract + .initialize( + bridgeContract.address, + mediatorContract.address, + erc677Token.address, + limitsArray, + executionLimitsArray, + dailyLimit, + decimalShiftZero, + owner, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + + const { tx } = await initialize(erc677Token.address, limitsArray, executionLimitsArray).should.be.fulfilled + + // already initialized + await contract + .initialize( + bridgeContract.address, + mediatorContract.address, + erc677Token.address, + limitsArray, + executionLimitsArray, + maxGasPerTx, + decimalShiftZero, + owner, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + + expect(await contract.isInitialized()).to.be.equal(true) + expect(await contract.bridgeContract()).to.be.equal(bridgeContract.address) + expect(await contract.mediatorContractOnOtherSide()).to.be.equal(mediatorContract.address) + expect(await contract.erc677token()).to.be.equal(erc677Token.address) + expect(await contract.maxPerTx()).to.be.bignumber.equal(maxPerTx) + expect(await contract.minPerTx()).to.be.bignumber.equal(minPerTx) + expect(await contract.executionMaxPerTx()).to.be.bignumber.equal(executionMaxPerTx) + expect(await contract.executionMinPerTx()).to.be.bignumber.equal(executionMinPerTx) + expect(await contract.requestGasLimit()).to.be.bignumber.equal(maxGasPerTx) + expect(await contract.owner()).to.be.equal(owner) + + if (isRelativeDailyLimit) { + expect(await contract.targetLimit()).to.be.bignumber.equal(targetLimit) + expect(await contract.threshold()).to.be.bignumber.equal(threshold) + if (isRelativeDailyLimitOnBridgeSide) { + expect(await contract.executionDailyLimit()).to.be.bignumber.equal(executionDailyLimit) + await expectEvent.inTransaction(tx, limitsContract, 'ExecutionDailyLimitChanged', { + newLimit: executionDailyLimit.toString() + }) + } else { + expect(await contract.dailyLimit()).to.be.bignumber.equal(dailyLimit) + await expectEvent.inTransaction(tx, limitsContract, 'DailyLimitChanged', { + newLimit: dailyLimit.toString() + }) + } + } else { + expect(await contract.executionDailyLimit()).to.be.bignumber.equal(executionDailyLimit) + expect(await contract.dailyLimit()).to.be.bignumber.equal(dailyLimit) + await expectEvent.inTransaction(tx, limitsContract, 'ExecutionDailyLimitChanged', { + newLimit: executionDailyLimit.toString() + }) + await expectEvent.inTransaction(tx, limitsContract, 'DailyLimitChanged', { newLimit: dailyLimit.toString() }) + } + } + it('should initialize', shouldInitialize(false)) + it('should initialize (relative limits)', shouldInitialize(true)) it('only owner can set bridge contract', async function() { - const contract = this.bridge + contract = this.bridge const user = accounts[1] const notAContractAddress = accounts[2] - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc677Token.address) expect(await contract.bridgeContract()).to.be.equal(bridgeContract.address) @@ -197,19 +329,10 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou expect(await contract.bridgeContract()).to.be.equal(newBridgeContract.address) }) it('only owner can set mediator contract', async function() { - const contract = this.bridge + contract = this.bridge const user = accounts[1] - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc677Token.address) expect(await contract.bridgeContract()).to.be.equal(bridgeContract.address) @@ -223,19 +346,10 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou expect(await contract.mediatorContractOnOtherSide()).to.be.equal(newMediatorContract.address) }) it('only owner can set request Gas Limit', async function() { - const contract = this.bridge + contract = this.bridge const user = accounts[1] - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc677Token.address) expect(await contract.requestGasLimit()).to.be.bignumber.equal(maxGasPerTx) @@ -251,78 +365,137 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou expect(await contract.requestGasLimit()).to.be.bignumber.equal(newMaxGasPerTx) }) }) - describe('set limits', () => { - let contract - beforeEach(async function() { - bridgeContract = await AMBMock.new() - await bridgeContract.setMaxGasPerTx(maxGasPerTx) - mediatorContract = await otherSideMediatorContract.new() - erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + const setLimits = isRelativeDailyLimit => + function() { + beforeEach(async function() { + bridgeContract = await AMBMock.new() + await bridgeContract.setMaxGasPerTx(maxGasPerTx) + mediatorContract = await otherSideMediatorContract.new() + erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + const LimitsContract = getLimitsContract(isRelativeDailyLimit) + limitsContract = await LimitsContract.new() + + contract = this.bridge + + let limits = [3, 2, 1] + let executionLimits = [3, 2, 1] + + if (isRelativeDailyLimit) { + if (isRelativeDailyLimitOnBridgeSide) { + limits = [ether('0.05'), 3, 2, 1] + } else { + executionLimits = [ether('0.05'), 3, 2, 1] + } + } + + await contract.initialize( + bridgeContract.address, + mediatorContract.address, + erc677Token.address, + limits, + executionLimits, + maxGasPerTx, + decimalShiftZero, + owner, + limitsContract.address + ).should.be.fulfilled + }) + it('setMaxPerTx allows to set only to owner and cannot be more than daily limit', async () => { + await contract.setMaxPerTx(2, { from: user }).should.be.rejectedWith(ERROR_MSG) + await contract.setMaxPerTx(2, { from: owner }).should.be.fulfilled + expect(await contract.maxPerTx()).to.be.bignumber.equal('2') + + if (isRelativeDailyLimit && isRelativeDailyLimitOnBridgeSide) { + await contract.setMaxPerTx(0, { from: owner }).should.be.fulfilled + expect(await contract.maxPerTx()).to.be.bignumber.equal('0') + } + + if (!isRelativeDailyLimit || (isRelativeDailyLimit && !isRelativeDailyLimitOnBridgeSide)) { + await contract.setMaxPerTx(3, { from: owner }).should.be.rejectedWith(ERROR_MSG) + } + }) + it('setMinPerTx allows to set only to owner and cannot be more than daily limit and should be less than maxPerTx', async () => { + await contract.setMinPerTx(1, { from: user }).should.be.rejectedWith(ERROR_MSG) + await contract.setMinPerTx(1, { from: owner }).should.be.fulfilled + expect(await contract.minPerTx()).to.be.bignumber.equal('1') - contract = this.bridge + await contract.setMinPerTx(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) + }) + if (!isRelativeDailyLimit || (isRelativeDailyLimit && !isRelativeDailyLimitOnBridgeSide)) { + it('setDailyLimit allow to set by owner and should be greater than maxPerTx or zero', async () => { + await contract.setDailyLimit(4, { from: user }).should.be.rejectedWith(ERROR_MSG) + await contract.setDailyLimit(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [3, 2, 1], - [3, 2], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled - }) - it('setMaxPerTx allows to set only to owner and cannot be more than daily limit', async () => { - await contract.setMaxPerTx(2, { from: user }).should.be.rejectedWith(ERROR_MSG) - await contract.setMaxPerTx(2, { from: owner }).should.be.fulfilled - expect(await contract.maxPerTx()).to.be.bignumber.equal('2') + await contract.setDailyLimit(4, { from: owner }).should.be.fulfilled + expect(await contract.dailyLimit()).to.be.bignumber.equal('4') - await contract.setMaxPerTx(3, { from: owner }).should.be.rejectedWith(ERROR_MSG) - }) - it('setMinPerTx allows to set only to owner and cannot be more than daily limit and should be less than maxPerTx', async () => { - await contract.setMinPerTx(1, { from: user }).should.be.rejectedWith(ERROR_MSG) - await contract.setMinPerTx(1, { from: owner }).should.be.fulfilled - expect(await contract.minPerTx()).to.be.bignumber.equal('1') + await contract.setDailyLimit(0, { from: owner }).should.be.fulfilled + expect(await contract.dailyLimit()).to.be.bignumber.equal(ZERO) - await contract.setMinPerTx(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) - }) - it('setDailyLimit allow to set by owner and should be greater than maxPerTx or zero', async () => { - await contract.setDailyLimit(4, { from: user }).should.be.rejectedWith(ERROR_MSG) - await contract.setDailyLimit(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) + await contract.setDailyLimit(4, { from: owner }).should.be.fulfilled + expect(await contract.dailyLimit()).to.be.bignumber.equal('4') + }) + } + it('setExecutionMaxPerTx allows to set only to owner and cannot be more than daily limit', async () => { + await contract.setExecutionMaxPerTx(2, { from: user }).should.be.rejectedWith(ERROR_MSG) + await contract.setExecutionMaxPerTx(2, { from: owner }).should.be.fulfilled + expect(await contract.executionMaxPerTx()).to.be.bignumber.equal('2') + + if (isRelativeDailyLimit && !isRelativeDailyLimitOnBridgeSide) { + await contract.setExecutionMaxPerTx(0, { from: owner }).should.be.fulfilled + expect(await contract.executionMaxPerTx()).to.be.bignumber.equal('0') + } + + if (!isRelativeDailyLimit || (isRelativeDailyLimit && isRelativeDailyLimitOnBridgeSide)) { + await contract.setExecutionMaxPerTx(3, { from: owner }).should.be.rejectedWith(ERROR_MSG) + } + }) + it('setExecutionMinPerTx allows to set only to owner and cannot be more than execution daily limit and should be less than executionMaxPerTx', async () => { + await contract.setExecutionMinPerTx(1, { from: user }).should.be.rejectedWith(ERROR_MSG) + await contract.setExecutionMinPerTx(1, { from: owner }).should.be.fulfilled + expect(await contract.executionMinPerTx()).to.be.bignumber.equal('1') - await contract.setDailyLimit(4, { from: owner }).should.be.fulfilled - expect(await contract.dailyLimit()).to.be.bignumber.equal('4') + await contract.setExecutionMinPerTx(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) + }) + if (!isRelativeDailyLimit || (isRelativeDailyLimit && isRelativeDailyLimitOnBridgeSide)) { + it('setExecutionDailyLimit allow to set by owner and should be greater than maxPerTx or zero', async () => { + await contract.setExecutionDailyLimit(4, { from: user }).should.be.rejectedWith(ERROR_MSG) + await contract.setExecutionDailyLimit(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) - await contract.setDailyLimit(0, { from: owner }).should.be.fulfilled - expect(await contract.dailyLimit()).to.be.bignumber.equal(ZERO) + await contract.setExecutionDailyLimit(4, { from: owner }).should.be.fulfilled + expect(await contract.executionDailyLimit()).to.be.bignumber.equal('4') - await contract.setDailyLimit(4, { from: owner }).should.be.fulfilled - expect(await contract.dailyLimit()).to.be.bignumber.equal('4') - }) - it('setExecutionMaxPerTx allows to set only to owner and cannot be more than daily limit', async () => { - await contract.setExecutionMaxPerTx(2, { from: user }).should.be.rejectedWith(ERROR_MSG) - await contract.setExecutionMaxPerTx(2, { from: owner }).should.be.fulfilled - expect(await contract.executionMaxPerTx()).to.be.bignumber.equal('2') + await contract.setExecutionDailyLimit(0, { from: owner }).should.be.fulfilled + expect(await contract.executionDailyLimit()).to.be.bignumber.equal(ZERO) - await contract.setExecutionMaxPerTx(3, { from: owner }).should.be.rejectedWith(ERROR_MSG) - }) - it('setExecutionDailyLimit allow to set by owner and should be greater than maxPerTx or zero', async () => { - await contract.setExecutionDailyLimit(4, { from: user }).should.be.rejectedWith(ERROR_MSG) - await contract.setExecutionDailyLimit(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) + await contract.setExecutionDailyLimit(4, { from: owner }).should.be.fulfilled + expect(await contract.executionDailyLimit()).to.be.bignumber.equal('4') + }) + } + if (isRelativeDailyLimit) { + it('setThreshold allow to set by owner and should be greater than or equal to mixPerTx', async () => { + await contract.setThreshold('1', { from: user }).should.be.rejectedWith(ERROR_MSG) + await contract.setThreshold('1', { from: owner }).should.be.fulfilled - await contract.setExecutionDailyLimit(4, { from: owner }).should.be.fulfilled - expect(await contract.executionDailyLimit()).to.be.bignumber.equal('4') + expect(await contract.threshold()).to.be.bignumber.equal('1') - await contract.setExecutionDailyLimit(0, { from: owner }).should.be.fulfilled - expect(await contract.executionDailyLimit()).to.be.bignumber.equal(ZERO) + await contract.setThreshold('0', { from: owner }).should.be.rejectedWith(ERROR_MSG) + }) + it('setTargetLimit allow to set by owner and should be less than or equal to 1 ether', async () => { + await contract.setTargetLimit(ether('0.5'), { from: user }).should.be.rejectedWith(ERROR_MSG) + await contract.setTargetLimit(ether('0.5'), { from: owner }).should.be.fulfilled - await contract.setExecutionDailyLimit(4, { from: owner }).should.be.fulfilled - expect(await contract.executionDailyLimit()).to.be.bignumber.equal('4') - }) - }) + expect(await contract.targetLimit()).to.be.bignumber.equal(ether('0.5')) + + await contract.setTargetLimit(ether('1.001'), { from: owner }).should.be.rejectedWith(ERROR_MSG) + }) + } + } + describe('set limits', setLimits(false)) + describe('set limits (relative)', setLimits(true)) describe('getBridgeMode', () => { it('should return arbitrary message bridging mode and interface', async function() { - const contract = this.bridge + contract = this.bridge const bridgeModeHash = '0x76595b56' // 4 bytes of keccak256('erc-to-erc-amb') expect(await contract.getBridgeMode()).to.be.equal(bridgeModeHash) @@ -333,26 +506,17 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou }) }) describe('fixAssetsAboveLimits', () => { - let contract const nonce = '0x96b6af865cdaa107ede916e237afbedffa5ed36bea84c0e77a33cc28fc2e9c01' beforeEach(async function() { bridgeContract = await AMBMock.new() await bridgeContract.setMaxGasPerTx(maxGasPerTx) mediatorContract = await otherSideMediatorContract.new() erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + limitsContract = await LimitsContract.new() contract = this.proxyContract - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc677Token.address) const outOfLimitValueData = await contract.contract.methods .handleBridgedTokens(user, twoEthers.toString(), nonce) @@ -496,7 +660,6 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou }) }) describe('relayTokens', () => { - let contract let erc20Token const user2 = accounts[2] beforeEach(async function() { @@ -505,49 +668,41 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou mediatorContract = await otherSideMediatorContract.new() erc20Token = await ERC20Mock.new('test', 'TST', 18) await erc20Token.mint(user, twoEthers, { from: owner }).should.be.fulfilled + limitsContract = await LimitsContract.new() contract = this.bridge }) - it('should allow to bridge tokens using approve and transferFrom', async () => { - // Given - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc20Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + const shouldAllowToBridgeTokens = isRelativeDailyLimit => + async function() { + // Given + const LimitsContract = getLimitsContract(isRelativeDailyLimit) + limitsContract = await LimitsContract.new() + await initialize( + erc20Token.address, + getRequestLimits(isRelativeDailyLimit), + getExecutionLimits(isRelativeDailyLimit) + ) - const currentDay = await contract.getCurrentDay() - expect(await contract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) + const currentDay = await contract.getCurrentDay() + expect(await contract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - const value = oneEther - await erc20Token.approve(contract.address, value, { from: user }).should.be.fulfilled - expect(await erc20Token.allowance(user, contract.address)).to.be.bignumber.equal(value) + const value = oneEther + await erc20Token.approve(contract.address, value, { from: user }).should.be.fulfilled + expect(await erc20Token.allowance(user, contract.address)).to.be.bignumber.equal(value) - // When - await contract.relayTokens(user, value, { from: user }).should.be.fulfilled + // When + await contract.relayTokens(user, value, { from: user }).should.be.fulfilled - // Then - const events = await getEvents(bridgeContract, { event: 'MockedEvent' }) - expect(events.length).to.be.equal(1) - expect(await contract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(value) - }) + // Then + const events = await getEvents(bridgeContract, { event: 'MockedEvent' }) + expect(events.length).to.be.equal(1) + expect(await contract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(value) + } + it('should allow to bridge tokens using approve and transferFrom', shouldAllowToBridgeTokens(false)) + it('should allow to bridge tokens using approve and transferFrom (relative limit)', shouldAllowToBridgeTokens(true)) it('should allow user to specify a itself as receiver', async () => { // Given - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc20Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc20Token.address) const currentDay = await contract.getCurrentDay() expect(await contract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) @@ -568,16 +723,7 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou }) it('should allow to specify a different receiver', async () => { // Given - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc20Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc20Token.address) const currentDay = await contract.getCurrentDay() expect(await contract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) @@ -598,16 +744,7 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou }) it('should allow to specify a different receiver without specifying sender', async () => { // Given - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc20Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc20Token.address) const currentDay = await contract.getCurrentDay() expect(await contract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) @@ -627,16 +764,7 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou }) it('should allow to complete a transfer approved by other user', async () => { // Given - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc20Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc20Token.address) const currentDay = await contract.getCurrentDay() expect(await contract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) @@ -659,30 +787,12 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou expect(await contract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(value) }) it('should fail if user did not approve the transfer', async () => { - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc20Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc20Token.address) await contract.relayTokens(user, oneEther, { from: user }).should.be.rejectedWith(ERROR_MSG) }) it('should fail if value is not within limits', async () => { - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc20Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc20Token.address) const value = twoEthers await erc20Token.approve(contract.address, value, { from: user }).should.be.fulfilled @@ -690,25 +800,34 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou await contract.relayTokens(user, value, { from: user }).should.be.rejectedWith(ERROR_MSG) }) + const shouldFailIfValueIsNotWithinLimits = isRelativeDailyLimit => + async function() { + const LimitsContract = getLimitsContract(isRelativeDailyLimit) + limitsContract = await LimitsContract.new() + await initialize( + erc20Token.address, + getRequestLimits(isRelativeDailyLimit), + getExecutionLimits(isRelativeDailyLimit) + ) + + const value = twoEthers + await erc20Token.approve(contract.address, value, { from: user }).should.be.fulfilled + expect(await erc20Token.allowance(user, contract.address)).to.be.bignumber.equal(value) + + await contract.relayTokens(user, value, { from: user }).should.be.rejectedWith(ERROR_MSG) + } + it('should fail if value is not within limits', shouldFailIfValueIsNotWithinLimits(false)) + it('should fail if value is not within limits (relative)', shouldFailIfValueIsNotWithinLimits(true)) it('should prevent emitting the event twice when ERC677 used by relayTokens and ERC677 is owned by token manager', async function() { // Given - const erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) await erc677Token.mint(user, twoEthers, { from: owner }).should.be.fulfilled await erc677Token.setBridgeContract(contract.address, { from: owner }).should.be.fulfilled await erc677Token.transferOwnership(contract.address, { from: owner }).should.be.fulfilled contract = this.bridge - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc677Token.address) const currentDay = await contract.getCurrentDay() expect(await contract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) @@ -732,16 +851,7 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou contract = this.bridge - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc677Token.address) const currentDay = await contract.getCurrentDay() expect(await contract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) @@ -760,26 +870,17 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou }) }) describe('requestFailedMessageFix', () => { - let contract const nonce = '0x96b6af865cdaa107ede916e237afbedffa5ed36bea84c0e77a33cc28fc2e9c01' beforeEach(async function() { bridgeContract = await AMBMock.new() await bridgeContract.setMaxGasPerTx(maxGasPerTx) mediatorContract = await otherSideMediatorContract.new() erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + limitsContract = await LimitsContract.new() contract = this.proxyContract - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc677Token.address) }) it('should allow to request a failed message fix', async () => { // Given @@ -870,26 +971,17 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou }) describe('fixFailedMessage', () => { let dataHash - let contract beforeEach(async function() { + contract = this.bridge + bridgeContract = await AMBMock.new() await bridgeContract.setMaxGasPerTx(maxGasPerTx) mediatorContract = await otherSideMediatorContract.new() erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) await erc677Token.mint(user, twoEthers, { from: owner }).should.be.fulfilled + limitsContract = await LimitsContract.new() - contract = this.bridge - - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + await initialize(erc677Token.address) await erc677Token.transferOwnership(contract.address) expect(await erc677Token.balanceOf(user)).to.be.bignumber.equal(twoEthers) @@ -993,37 +1085,185 @@ function shouldBehaveLikeBasicAMBErc677ToErc677(otherSideMediatorContract, accou }) }) describe('#claimTokens', () => { - it('should be able to claim tokens', async function() { - const contract = this.proxyContract + const shouldBeAbleToClaimTokens = isRelativeDailyLimit => + async function() { + const LimitsContract = getLimitsContract(isRelativeDailyLimit) + limitsContract = await LimitsContract.new() + contract = this.proxyContract + erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + await erc677Token.mint(user, twoEthers, { from: owner }).should.be.fulfilled + + await initialize( + erc677Token.address, + getRequestLimits(isRelativeDailyLimit), + getExecutionLimits(isRelativeDailyLimit) + ) - await contract.initialize( - bridgeContract.address, - mediatorContract.address, - erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], - maxGasPerTx, - decimalShiftZero, - owner - ).should.be.fulfilled + const tokenSecond = await ERC677BridgeToken.new('Test Token', 'TST', 18) - const tokenSecond = await ERC677BridgeToken.new('Test Token', 'TST', 18) + await tokenSecond.mint(accounts[0], halfEther).should.be.fulfilled + expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(halfEther) - await tokenSecond.mint(accounts[0], halfEther).should.be.fulfilled - expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(halfEther) + await tokenSecond.transfer(contract.address, halfEther) + expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(ZERO) + expect(await tokenSecond.balanceOf(contract.address)).to.be.bignumber.equal(halfEther) - await tokenSecond.transfer(contract.address, halfEther) - expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(ZERO) - expect(await tokenSecond.balanceOf(contract.address)).to.be.bignumber.equal(halfEther) + await contract + .claimTokens(tokenSecond.address, accounts[3], { from: accounts[3] }) + .should.be.rejectedWith(ERROR_MSG) + await contract.claimTokens(tokenSecond.address, accounts[3], { from: owner }).should.be.fulfilled + expect(await tokenSecond.balanceOf(contract.address)).to.be.bignumber.equal(ZERO) + expect(await tokenSecond.balanceOf(accounts[3])).to.be.bignumber.equal(halfEther) + } + it('should be able to claim tokens', shouldBeAbleToClaimTokens(false)) + it('should be able to claim tokens (relative limit)', shouldBeAbleToClaimTokens(true)) + }) + function initializeWithCustomLimits(customLimits) { + return contract.initialize( + bridgeContract.address, + mediatorContract.address, + erc677Token.address, + isRelativeDailyLimitOnBridgeSide ? customLimits : limitsArray, + isRelativeDailyLimitOnBridgeSide ? executionLimitsArray : customLimits, + maxGasPerTx, + decimalShiftZero, + owner, + limitsContract.address + ).should.be.fulfilled + } + if (isRelativeDailyLimitOnBridgeSide) { + describe('#dailyLimit (relative)', () => { + beforeEach(async function() { + contract = this.bridge + bridgeContract = await AMBMock.new() + await bridgeContract.setMaxGasPerTx(maxGasPerTx) + mediatorContract = await otherSideMediatorContract.new() + erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + limitsContract = await RelativeDailyLimit.new() + }) + it('should be calculated correctly - 1', async function() { + await initializeWithCustomLimits([targetLimit, threshold, maxPerTx, minPerTx]) - await contract - .claimTokens(tokenSecond.address, accounts[3], { from: accounts[3] }) - .should.be.rejectedWith(ERROR_MSG) - await contract.claimTokens(tokenSecond.address, accounts[3], { from: owner }).should.be.fulfilled - expect(await tokenSecond.balanceOf(contract.address)).to.be.bignumber.equal(ZERO) - expect(await tokenSecond.balanceOf(accounts[3])).to.be.bignumber.equal(halfEther) + await erc677Token.mint(accounts[0], halfEther).should.be.fulfilled + await erc677Token.mint(contract.address, halfEther).should.be.fulfilled + expect(await erc677Token.balanceOf(contract.address)).to.be.bignumber.equal(halfEther) + expect(await erc677Token.totalSupply()).to.be.bignumber.equal(oneEther) + + const limit = await contract.dailyLimit() + const expectedLimit = calculateDailyLimit(oneEther, targetLimit, threshold, minPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + it('should be calculated correctly - 2', async function() { + await initializeWithCustomLimits([targetLimit, threshold, maxPerTx, minPerTx]) + + await erc677Token.mint(contract.address, halfEther).should.be.fulfilled + expect(await erc677Token.totalSupply()).to.be.bignumber.equal(halfEther) + + const limit = await contract.dailyLimit() + const expectedLimit = calculateDailyLimit(halfEther, targetLimit, threshold, minPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + it('should be calculated correctly - 3', async function() { + await initializeWithCustomLimits([targetLimit, threshold, maxPerTx, minPerTx]) + + await erc677Token.mint(contract.address, minPerTx).should.be.fulfilled + expect(await erc677Token.totalSupply()).to.be.bignumber.equal(minPerTx) + + const limit = await contract.dailyLimit() + expect(limit).to.be.bignumber.equal(minPerTx) + }) + it('should be calculated correctly - 4', async function() { + await initializeWithCustomLimits([targetLimit, threshold, maxPerTx, minPerTx]) + + await erc677Token.mint(contract.address, threshold).should.be.fulfilled + expect(await erc677Token.totalSupply()).to.be.bignumber.equal(threshold) + + const limit = await contract.dailyLimit() + expect(limit).to.be.bignumber.equal(threshold.mul(targetLimit).div(oneEther)) + }) + it('should be calculated correctly - 5', async function() { + const amountToMint = ether('5') + const targetLimit = ether('0.06') + const threshold = ether('100') + const minPerTx = ether('0.1') + + await initializeWithCustomLimits([targetLimit, threshold, maxPerTx, minPerTx]) + + await erc677Token.mint(accounts[0], amountToMint).should.be.fulfilled + expect(await erc677Token.totalSupply()).to.be.bignumber.equal(amountToMint) + + const limit = await contract.dailyLimit() + const expectedLimit = calculateDailyLimit(amountToMint, targetLimit, threshold, minPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) }) - }) + } else { + describe('#executionDailyLimit (relative)', () => { + beforeEach(async function() { + contract = this.bridge + bridgeContract = await AMBMock.new() + await bridgeContract.setMaxGasPerTx(maxGasPerTx) + mediatorContract = await otherSideMediatorContract.new() + erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + limitsContract = await RelativeExecutionDailyLimit.new() + }) + it('should be calculated correctly - 1', async function() { + await initializeWithCustomLimits([targetLimit, threshold, maxPerTx, minPerTx]) + + await erc677Token.mint(accounts[0], halfEther).should.be.fulfilled + await erc677Token.mint(contract.address, halfEther).should.be.fulfilled + expect(await erc677Token.balanceOf(contract.address)).to.be.bignumber.equal(halfEther) + expect(await erc677Token.totalSupply()).to.be.bignumber.equal(oneEther) + + const limit = await contract.executionDailyLimit() + const expectedLimit = calculateDailyLimit(halfEther, targetLimit, threshold, minPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + it('should be calculated correctly - 2', async function() { + await initializeWithCustomLimits([targetLimit, threshold, maxPerTx, minPerTx]) + + await erc677Token.mint(accounts[0], halfEther).should.be.fulfilled + expect(await erc677Token.balanceOf(contract.address)).to.be.bignumber.equal(ZERO) + expect(await erc677Token.totalSupply()).to.be.bignumber.equal(halfEther) + + const limit = await contract.executionDailyLimit() + expect(limit).to.be.bignumber.equal(ZERO) + }) + it('should be calculated correctly - 3', async function() { + await initializeWithCustomLimits([targetLimit, threshold, maxPerTx, minPerTx]) + + await erc677Token.mint(contract.address, minPerTx).should.be.fulfilled + expect(await erc677Token.balanceOf(contract.address)).to.be.bignumber.equal(minPerTx) + + const limit = await contract.executionDailyLimit() + expect(limit).to.be.bignumber.equal(minPerTx) + }) + it('should be calculated correctly - 4', async function() { + await initializeWithCustomLimits([targetLimit, threshold, maxPerTx, minPerTx]) + + await erc677Token.mint(contract.address, threshold).should.be.fulfilled + expect(await erc677Token.balanceOf(contract.address)).to.be.bignumber.equal(threshold) + + const limit = await contract.executionDailyLimit() + expect(limit).to.be.bignumber.equal(threshold.mul(targetLimit).div(oneEther)) + }) + it('should be calculated correctly - 5', async function() { + const amountToMint = ether('5') + const targetLimit = ether('0.06') + const threshold = ether('100') + const minPerTx = ether('0.1') + + await initializeWithCustomLimits([targetLimit, threshold, maxPerTx, minPerTx]) + + await erc677Token.mint(contract.address, amountToMint).should.be.fulfilled + expect(await erc677Token.balanceOf(contract.address)).to.be.bignumber.equal(amountToMint) + + const limit = await contract.executionDailyLimit() + const expectedLimit = calculateDailyLimit(amountToMint, targetLimit, threshold, minPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + }) + } } module.exports = { diff --git a/test/amb_erc677_to_erc677/foreign_bridge.test.js b/test/amb_erc677_to_erc677/foreign_bridge.test.js index f4547e383..e02a1f0f7 100644 --- a/test/amb_erc677_to_erc677/foreign_bridge.test.js +++ b/test/amb_erc677_to_erc677/foreign_bridge.test.js @@ -5,6 +5,8 @@ const ERC677BridgeToken = artifacts.require('ERC677BridgeToken.sol') const ForeignAMB = artifacts.require('ForeignAMB.sol') const BridgeValidators = artifacts.require('BridgeValidators.sol') const AMBMock = artifacts.require('AMBMock.sol') +const AbsoluteDailyLimit = artifacts.require('AbsoluteDailyLimit.sol') +const RelativeExecutionDailyLimit = artifacts.require('RelativeExecutionDailyLimit.sol') const { expect } = require('chai') const { shouldBehaveLikeBasicAMBErc677ToErc677 } = require('./AMBErc677ToErc677Behavior.test') @@ -22,23 +24,30 @@ const maxPerTx = oneEther const minPerTx = ether('0.01') const executionDailyLimit = dailyLimit const executionMaxPerTx = maxPerTx +const executionMinPerTx = minPerTx const exampleTxHash = '0xf308b922ab9f8a7128d9d7bc9bce22cd88b2c05c8213f0e2d8104d78e0a9ecbb' const decimalShiftZero = 0 +const targetLimit = ether('0.05') +const threshold = ether('10000') -contract('ForeignAMBErc677ToErc677', async accounts => { +contract('ForeignAMBErc677ToErc677', accounts => { const owner = accounts[0] const user = accounts[1] let ambBridgeContract let mediatorContract let erc677Token let foreignBridge + let limitsContract + + const limitsArray = [executionDailyLimit, executionMaxPerTx, executionMinPerTx] + beforeEach(async function() { this.bridge = await ForeignAMBErc677ToErc677.new() const storageProxy = await EternalStorageProxy.new().should.be.fulfilled await storageProxy.upgradeTo('1', this.bridge.address).should.be.fulfilled this.proxyContract = await ForeignAMBErc677ToErc677.at(storageProxy.address) }) - shouldBehaveLikeBasicAMBErc677ToErc677(HomeAMBErc677ToErc677, accounts) + shouldBehaveLikeBasicAMBErc677ToErc677(HomeAMBErc677ToErc677, accounts, false) describe('onTokenTransfer', () => { beforeEach(async () => { const validatorContract = await BridgeValidators.new() @@ -49,6 +58,7 @@ contract('ForeignAMBErc677ToErc677', async accounts => { mediatorContract = await HomeAMBErc677ToErc677.new() erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) await erc677Token.mint(user, twoEthers, { from: owner }).should.be.fulfilled + limitsContract = await AbsoluteDailyLimit.new() foreignBridge = await ForeignAMBErc677ToErc677.new() await foreignBridge.initialize( @@ -56,10 +66,11 @@ contract('ForeignAMBErc677ToErc677', async accounts => { mediatorContract.address, erc677Token.address, [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], + limitsArray, maxGasPerTx, decimalShiftZero, - owner + owner, + limitsContract.address ).should.be.fulfilled }) it('should emit UserRequestForAffirmation in AMB bridge', async () => { @@ -122,6 +133,7 @@ contract('ForeignAMBErc677ToErc677', async accounts => { await ambBridgeContract.setMaxGasPerTx(maxGasPerTx) mediatorContract = await HomeAMBErc677ToErc677.new() erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + limitsContract = await AbsoluteDailyLimit.new() foreignBridge = await ForeignAMBErc677ToErc677.new() await foreignBridge.initialize( @@ -129,10 +141,11 @@ contract('ForeignAMBErc677ToErc677', async accounts => { mediatorContract.address, erc677Token.address, [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], + limitsArray, maxGasPerTx, decimalShiftZero, - owner + owner, + limitsContract.address ).should.be.fulfilled await erc677Token.mint(foreignBridge.address, twoEthers, { from: owner }).should.be.fulfilled await erc677Token.transferOwnership(foreignBridge.address) @@ -182,6 +195,7 @@ contract('ForeignAMBErc677ToErc677', async accounts => { // Given const decimalShiftTwo = 2 erc677Token = await ERC677BridgeToken.new('test', 'TST', 16) + limitsContract = await AbsoluteDailyLimit.new() foreignBridge = await ForeignAMBErc677ToErc677.new() await foreignBridge.initialize( @@ -189,10 +203,11 @@ contract('ForeignAMBErc677ToErc677', async accounts => { mediatorContract.address, erc677Token.address, [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], + limitsArray, maxGasPerTx, decimalShiftTwo, - owner + owner, + limitsContract.address ).should.be.fulfilled await erc677Token.mint(foreignBridge.address, twoEthers, { from: owner }).should.be.fulfilled await erc677Token.transferOwnership(foreignBridge.address) @@ -233,41 +248,71 @@ contract('ForeignAMBErc677ToErc677', async accounts => { expect(await erc677Token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(twoEthers.sub(valueOnForeign)) expect(await erc677Token.balanceOf(user)).to.be.bignumber.equal(valueOnForeign) }) - it('should emit AmountLimitExceeded and not transfer tokens when out of execution limits', async () => { - // Given - const currentDay = await foreignBridge.getCurrentDay() - expect(await foreignBridge.totalExecutedPerDay(currentDay)).to.be.bignumber.equal(ZERO) - const initialEvents = await getEvents(erc677Token, { event: 'Transfer' }) - expect(initialEvents.length).to.be.equal(0) - expect(await erc677Token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(twoEthers) - expect(await erc677Token.balanceOf(user)).to.be.bignumber.equal(ZERO) - - const outOfLimitValueData = await foreignBridge.contract.methods - .handleBridgedTokens(user, twoEthers.toString(), nonce) - .encodeABI() - - // When - await ambBridgeContract.executeMessageCall( - foreignBridge.address, - mediatorContract.address, - outOfLimitValueData, - exampleTxHash, - 1000000 - ).should.be.fulfilled - - expect(await ambBridgeContract.messageCallStatus(exampleTxHash)).to.be.equal(true) - - // Then - expect(await foreignBridge.totalExecutedPerDay(currentDay)).to.be.bignumber.equal(ZERO) - expect(await erc677Token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(twoEthers) - expect(await erc677Token.balanceOf(user)).to.be.bignumber.equal(ZERO) - - expect(await foreignBridge.outOfLimitAmount()).to.be.bignumber.equal(twoEthers) - const outOfLimitEvent = await getEvents(foreignBridge, { event: 'AmountLimitExceeded' }) - expect(outOfLimitEvent.length).to.be.equal(1) - expect(outOfLimitEvent[0].returnValues.recipient).to.be.equal(user) - expect(outOfLimitEvent[0].returnValues.value).to.be.equal(twoEthers.toString()) - expect(outOfLimitEvent[0].returnValues.transactionHash).to.be.equal(exampleTxHash) - }) + const shouldEmitAmountLimitExceededAndNotTransferTokens = isRelativeDailyLimit => + async function() { + erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + const LimitsContract = isRelativeDailyLimit ? RelativeExecutionDailyLimit : AbsoluteDailyLimit + limitsContract = await LimitsContract.new() + + foreignBridge = await ForeignAMBErc677ToErc677.new() + await foreignBridge.initialize( + ambBridgeContract.address, + mediatorContract.address, + erc677Token.address, + [dailyLimit, maxPerTx, minPerTx], + isRelativeDailyLimit + ? [targetLimit, threshold, executionMaxPerTx, executionMinPerTx] + : [executionDailyLimit, executionMaxPerTx, executionMinPerTx], + maxGasPerTx, + decimalShiftZero, + owner, + limitsContract.address + ).should.be.fulfilled + await erc677Token.mint(foreignBridge.address, twoEthers, { from: owner }).should.be.fulfilled + await erc677Token.transferOwnership(foreignBridge.address) + + // Given + const currentDay = await foreignBridge.getCurrentDay() + expect(await foreignBridge.totalExecutedPerDay(currentDay)).to.be.bignumber.equal(ZERO) + const initialEvents = await getEvents(erc677Token, { event: 'Transfer' }) + expect(initialEvents.length).to.be.equal(0) + expect(await erc677Token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(twoEthers) + expect(await erc677Token.balanceOf(user)).to.be.bignumber.equal(ZERO) + + const outOfLimitValueData = await foreignBridge.contract.methods + .handleBridgedTokens(user, twoEthers.toString(), nonce) + .encodeABI() + + // When + await ambBridgeContract.executeMessageCall( + foreignBridge.address, + mediatorContract.address, + outOfLimitValueData, + exampleTxHash, + 1000000 + ).should.be.fulfilled + + expect(await ambBridgeContract.messageCallStatus(exampleTxHash)).to.be.equal(true) + + // Then + expect(await foreignBridge.totalExecutedPerDay(currentDay)).to.be.bignumber.equal(ZERO) + expect(await erc677Token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(twoEthers) + expect(await erc677Token.balanceOf(user)).to.be.bignumber.equal(ZERO) + + expect(await foreignBridge.outOfLimitAmount()).to.be.bignumber.equal(twoEthers) + const outOfLimitEvent = await getEvents(foreignBridge, { event: 'AmountLimitExceeded' }) + expect(outOfLimitEvent.length).to.be.equal(1) + expect(outOfLimitEvent[0].returnValues.recipient).to.be.equal(user) + expect(outOfLimitEvent[0].returnValues.value).to.be.equal(twoEthers.toString()) + expect(outOfLimitEvent[0].returnValues.transactionHash).to.be.equal(exampleTxHash) + } + it( + 'should emit AmountLimitExceeded and not transfer tokens when out of execution limits', + shouldEmitAmountLimitExceededAndNotTransferTokens(false) + ) + it( + 'should emit AmountLimitExceeded and not transfer tokens when out of execution limits (relative limit)', + shouldEmitAmountLimitExceededAndNotTransferTokens(true) + ) }) }) diff --git a/test/amb_erc677_to_erc677/home_bridge.test.js b/test/amb_erc677_to_erc677/home_bridge.test.js index 187f2588c..11af3aabc 100644 --- a/test/amb_erc677_to_erc677/home_bridge.test.js +++ b/test/amb_erc677_to_erc677/home_bridge.test.js @@ -5,6 +5,8 @@ const ERC677BridgeToken = artifacts.require('ERC677BridgeToken.sol') const HomeAMB = artifacts.require('HomeAMB.sol') const AMBMock = artifacts.require('AMBMock.sol') const BridgeValidators = artifacts.require('BridgeValidators.sol') +const AbsoluteDailyLimit = artifacts.require('AbsoluteDailyLimit.sol') +const RelativeDailyLimit = artifacts.require('RelativeDailyLimit.sol') const { expect } = require('chai') const { shouldBehaveLikeBasicAMBErc677ToErc677 } = require('./AMBErc677ToErc677Behavior.test') @@ -22,8 +24,11 @@ const maxPerTx = oneEther const minPerTx = ether('0.01') const executionDailyLimit = dailyLimit const executionMaxPerTx = maxPerTx +const executionMinPerTx = minPerTx const exampleTxHash = '0xf308b922ab9f8a7128d9d7bc9bce22cd88b2c05c8213f0e2d8104d78e0a9ecbb' const decimalShiftZero = 0 +const targetLimit = ether('0.05') +const threshold = ether('10000') contract('HomeAMBErc677ToErc677', async accounts => { const owner = accounts[0] @@ -32,13 +37,17 @@ contract('HomeAMBErc677ToErc677', async accounts => { let mediatorContract let erc677Token let homeBridge + let limitsContract + + const limitsArray = [dailyLimit, maxPerTx, minPerTx] + beforeEach(async function() { this.bridge = await HomeAMBErc677ToErc677.new() const storageProxy = await EternalStorageProxy.new().should.be.fulfilled await storageProxy.upgradeTo('1', this.bridge.address).should.be.fulfilled this.proxyContract = await HomeAMBErc677ToErc677.at(storageProxy.address) }) - shouldBehaveLikeBasicAMBErc677ToErc677(ForeignAMBErc677ToErc677, accounts) + shouldBehaveLikeBasicAMBErc677ToErc677(HomeAMBErc677ToErc677, accounts, true) describe('onTokenTransfer', () => { beforeEach(async () => { const validatorContract = await BridgeValidators.new() @@ -49,17 +58,19 @@ contract('HomeAMBErc677ToErc677', async accounts => { mediatorContract = await ForeignAMBErc677ToErc677.new() erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) await erc677Token.mint(user, twoEthers, { from: owner }).should.be.fulfilled + limitsContract = await AbsoluteDailyLimit.new() homeBridge = await HomeAMBErc677ToErc677.new() await homeBridge.initialize( ambBridgeContract.address, mediatorContract.address, erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], + limitsArray, + [executionDailyLimit, executionMaxPerTx, executionMinPerTx], maxGasPerTx, decimalShiftZero, - owner + owner, + limitsContract.address ).should.be.fulfilled }) it('should emit UserRequestForSignature in AMB bridge and burn transferred tokens', async () => { @@ -128,17 +139,19 @@ contract('HomeAMBErc677ToErc677', async accounts => { await ambBridgeContract.setMaxGasPerTx(maxGasPerTx) mediatorContract = await ForeignAMBErc677ToErc677.new() erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + limitsContract = await AbsoluteDailyLimit.new() homeBridge = await HomeAMBErc677ToErc677.new() await homeBridge.initialize( ambBridgeContract.address, mediatorContract.address, erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], + limitsArray, + [executionDailyLimit, executionMaxPerTx, executionMinPerTx], maxGasPerTx, decimalShiftZero, - owner + owner, + limitsContract.address ).should.be.fulfilled await erc677Token.transferOwnership(homeBridge.address) }) @@ -188,17 +201,19 @@ contract('HomeAMBErc677ToErc677', async accounts => { // Given const decimalShiftTwo = 2 erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + limitsContract = await AbsoluteDailyLimit.new() homeBridge = await HomeAMBErc677ToErc677.new() await homeBridge.initialize( ambBridgeContract.address, mediatorContract.address, erc677Token.address, - [dailyLimit, maxPerTx, minPerTx], - [executionDailyLimit, executionMaxPerTx], + limitsArray, + [executionDailyLimit, executionMaxPerTx, executionMinPerTx], maxGasPerTx, decimalShiftTwo, - owner + owner, + limitsContract.address ).should.be.fulfilled await erc677Token.transferOwnership(homeBridge.address) @@ -242,42 +257,68 @@ contract('HomeAMBErc677ToErc677', async accounts => { expect(await erc677Token.totalSupply()).to.be.bignumber.equal(valueOnHome) expect(await erc677Token.balanceOf(user)).to.be.bignumber.equal(valueOnHome) }) - it('should emit AmountLimitExceeded and not mint tokens when out of execution limits', async () => { - // Given - const currentDay = await homeBridge.getCurrentDay() - expect(await homeBridge.totalExecutedPerDay(currentDay)).to.be.bignumber.equal(ZERO) - const initialEvents = await getEvents(erc677Token, { event: 'Mint' }) - expect(initialEvents.length).to.be.equal(0) - expect(await erc677Token.totalSupply()).to.be.bignumber.equal(ZERO) - - const outOfLimitValueData = await homeBridge.contract.methods - .handleBridgedTokens(user, twoEthers.toString(), nonce) - .encodeABI() - - // when - await ambBridgeContract.executeMessageCall( - homeBridge.address, - mediatorContract.address, - outOfLimitValueData, - exampleTxHash, - 1000000 - ).should.be.fulfilled - - expect(await ambBridgeContract.messageCallStatus(exampleTxHash)).to.be.equal(true) - - // Then - expect(await homeBridge.totalExecutedPerDay(currentDay)).to.be.bignumber.equal(ZERO) - const events = await getEvents(erc677Token, { event: 'Mint' }) - expect(events.length).to.be.equal(0) - expect(await erc677Token.totalSupply()).to.be.bignumber.equal(ZERO) - expect(await erc677Token.balanceOf(user)).to.be.bignumber.equal(ZERO) - - expect(await homeBridge.outOfLimitAmount()).to.be.bignumber.equal(twoEthers) - const outOfLimitEvent = await getEvents(homeBridge, { event: 'AmountLimitExceeded' }) - expect(outOfLimitEvent.length).to.be.equal(1) - expect(outOfLimitEvent[0].returnValues.recipient).to.be.equal(user) - expect(outOfLimitEvent[0].returnValues.value).to.be.equal(twoEthers.toString()) - expect(outOfLimitEvent[0].returnValues.transactionHash).to.be.equal(exampleTxHash) - }) + const shouldEmitAmountLimitExceededAndNotMintTokens = isRelativeDailyLimit => + async function() { + erc677Token = await ERC677BridgeToken.new('test', 'TST', 18) + const LimitsContract = isRelativeDailyLimit ? RelativeDailyLimit : AbsoluteDailyLimit + limitsContract = await LimitsContract.new() + + homeBridge = await HomeAMBErc677ToErc677.new() + await homeBridge.initialize( + ambBridgeContract.address, + mediatorContract.address, + erc677Token.address, + isRelativeDailyLimit ? [targetLimit, threshold, maxPerTx, minPerTx] : [dailyLimit, maxPerTx, minPerTx], + [executionDailyLimit, executionMaxPerTx, executionMinPerTx], + maxGasPerTx, + decimalShiftZero, + owner, + limitsContract.address + ).should.be.fulfilled + await erc677Token.transferOwnership(homeBridge.address) + // Given + const currentDay = await homeBridge.getCurrentDay() + expect(await homeBridge.totalExecutedPerDay(currentDay)).to.be.bignumber.equal(ZERO) + const initialEvents = await getEvents(erc677Token, { event: 'Mint' }) + expect(initialEvents.length).to.be.equal(0) + expect(await erc677Token.totalSupply()).to.be.bignumber.equal(ZERO) + + const outOfLimitValueData = await homeBridge.contract.methods + .handleBridgedTokens(user, twoEthers.toString(), nonce) + .encodeABI() + + // when + await ambBridgeContract.executeMessageCall( + homeBridge.address, + mediatorContract.address, + outOfLimitValueData, + exampleTxHash, + 1000000 + ).should.be.fulfilled + + expect(await ambBridgeContract.messageCallStatus(exampleTxHash)).to.be.equal(true) + + // Then + expect(await homeBridge.totalExecutedPerDay(currentDay)).to.be.bignumber.equal(ZERO) + const events = await getEvents(erc677Token, { event: 'Mint' }) + expect(events.length).to.be.equal(0) + expect(await erc677Token.totalSupply()).to.be.bignumber.equal(ZERO) + expect(await erc677Token.balanceOf(user)).to.be.bignumber.equal(ZERO) + + expect(await homeBridge.outOfLimitAmount()).to.be.bignumber.equal(twoEthers) + const outOfLimitEvent = await getEvents(homeBridge, { event: 'AmountLimitExceeded' }) + expect(outOfLimitEvent.length).to.be.equal(1) + expect(outOfLimitEvent[0].returnValues.recipient).to.be.equal(user) + expect(outOfLimitEvent[0].returnValues.value).to.be.equal(twoEthers.toString()) + expect(outOfLimitEvent[0].returnValues.transactionHash).to.be.equal(exampleTxHash) + } + it( + 'should emit AmountLimitExceeded and not mint tokens when out of execution limits', + shouldEmitAmountLimitExceededAndNotMintTokens(false) + ) + it( + 'should emit AmountLimitExceeded and not mint tokens when out of execution limits (relative limit)', + shouldEmitAmountLimitExceededAndNotMintTokens(true) + ) }) }) diff --git a/test/erc_to_erc/foreign_bridge.test.js b/test/erc_to_erc/foreign_bridge.test.js index 7553bee16..3147557e3 100644 --- a/test/erc_to_erc/foreign_bridge.test.js +++ b/test/erc_to_erc/foreign_bridge.test.js @@ -4,8 +4,11 @@ const ForeignBridgeV2 = artifacts.require('ForeignBridgeV2.sol') const BridgeValidators = artifacts.require('BridgeValidators.sol') const EternalStorageProxy = artifacts.require('EternalStorageProxy.sol') const ERC677BridgeToken = artifacts.require('ERC677BridgeToken.sol') +const AbsoluteDailyLimit = artifacts.require('AbsoluteDailyLimit.sol') +const RelativeExecutionDailyLimit = artifacts.require('RelativeExecutionDailyLimit.sol') const { expect } = require('chai') +const { expectEvent } = require('@openzeppelin/test-helpers') const { ERROR_MSG, ZERO_ADDRESS, toBN } = require('../setup') const { createMessage, @@ -14,6 +17,7 @@ const { ether, getEvents, expectEventInLogs, + calculateDailyLimit, createFullAccounts } = require('../helpers/helpers') @@ -23,6 +27,7 @@ const requireBlockConfirmations = 8 const gasPrice = web3.utils.toWei('1', 'gwei') const homeDailyLimit = oneEther const homeMaxPerTx = halfEther +const homeMinPerTx = ether('0.01') const maxPerTx = halfEther const minPerTx = ether('0.01') const dailyLimit = oneEther @@ -31,289 +36,312 @@ const MAX_VALIDATORS = 50 const MAX_SIGNATURES = MAX_VALIDATORS const MAX_GAS = 8000000 const decimalShiftZero = 0 +const targetLimit = ether('0.05') +const threshold = ether('10000') contract('ForeignBridge_ERC20_to_ERC20', async accounts => { + const requestLimitsArray = [dailyLimit, maxPerTx, minPerTx] + const executionLimitsArray = [homeDailyLimit, homeMaxPerTx, homeMinPerTx] + const relativeExecutionLimitsArray = [targetLimit, threshold, homeMaxPerTx, homeMinPerTx] + let validatorContract let authorities let owner let token + let absoluteLimitsContract + let relativeLimitsContract + before(async () => { validatorContract = await BridgeValidators.new() authorities = [accounts[1], accounts[2]] owner = accounts[0] await validatorContract.initialize(1, authorities, owner) + absoluteLimitsContract = await AbsoluteDailyLimit.new() + relativeLimitsContract = await RelativeExecutionDailyLimit.new() }) describe('#initialize', async () => { - it('should initialize', async () => { - token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) - const foreignBridge = await ForeignBridge.new() - - expect(await foreignBridge.erc20token()).to.be.equal(ZERO_ADDRESS) - expect(await foreignBridge.validatorContract()).to.be.equal(ZERO_ADDRESS) - expect(await foreignBridge.deployedAtBlock()).to.be.bignumber.equal(ZERO) - expect(await foreignBridge.isInitialized()).to.be.equal(false) - expect(await foreignBridge.decimalShift()).to.be.bignumber.equal(ZERO) - expect(await foreignBridge.requiredBlockConfirmations()).to.be.bignumber.equal(ZERO) - - await foreignBridge - .initialize( - ZERO_ADDRESS, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) - await foreignBridge - .initialize( - validatorContract.address, - ZERO_ADDRESS, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) - await foreignBridge - .initialize( - validatorContract.address, - owner, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) - await foreignBridge - .initialize( - validatorContract.address, - token.address, - 0, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) - await foreignBridge - .initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - 0, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) - await foreignBridge - .initialize( - owner, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) - - await foreignBridge - .initialize( + const shouldInitialize = isRelativeDailyLimit => + async function() { + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + const foreignBridge = await ForeignBridge.new() + const executionLimits = isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray + const limitsContract = isRelativeDailyLimit ? relativeLimitsContract : absoluteLimitsContract + + expect(await foreignBridge.erc20token()).to.be.equal(ZERO_ADDRESS) + expect(await foreignBridge.validatorContract()).to.be.equal(ZERO_ADDRESS) + expect(await foreignBridge.deployedAtBlock()).to.be.bignumber.equal(ZERO) + expect(await foreignBridge.isInitialized()).to.be.equal(false) + expect(await foreignBridge.decimalShift()).to.be.bignumber.equal(ZERO) + expect(await foreignBridge.requiredBlockConfirmations()).to.be.bignumber.equal(ZERO) + expect(await foreignBridge.limitsContract()).to.be.equal(ZERO_ADDRESS) + + await foreignBridge + .initialize( + ZERO_ADDRESS, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + executionLimits, + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge + .initialize( + validatorContract.address, + ZERO_ADDRESS, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + executionLimits, + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge + .initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + executionLimits, + owner, + decimalShiftZero, + ZERO_ADDRESS + ) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge + .initialize( + validatorContract.address, + owner, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + executionLimits, + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge + .initialize( + validatorContract.address, + token.address, + 0, // requireBlockConfirmations + gasPrice, + requestLimitsArray, + executionLimits, + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge + .initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + 0, + requestLimitsArray, + executionLimits, + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge + .initialize( + owner, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + executionLimits, + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + + const { logs, tx } = await foreignBridge.initialize( validatorContract.address, token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, maxPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimits, owner, - decimalShiftZero + '9', + limitsContract.address + ).should.be.fulfilled + + expect(await foreignBridge.erc20token()).to.be.equal(token.address) + expect(await foreignBridge.limitsContract()).to.be.equal(limitsContract.address) + expect(await foreignBridge.isInitialized()).to.be.equal(true) + expect(await foreignBridge.validatorContract()).to.be.equal(validatorContract.address) + expect(await foreignBridge.deployedAtBlock()).to.be.bignumber.above(ZERO) + expect(await foreignBridge.requiredBlockConfirmations()).to.be.bignumber.equal( + requireBlockConfirmations.toString() ) - .should.be.rejectedWith(ERROR_MSG) - await foreignBridge - .initialize( + expect(await foreignBridge.dailyLimit()).to.be.bignumber.equal(dailyLimit) + expect(await foreignBridge.maxPerTx()).to.be.bignumber.equal(maxPerTx) + expect(await foreignBridge.minPerTx()).to.be.bignumber.equal(minPerTx) + expect(await foreignBridge.decimalShift()).to.be.bignumber.equal('9') + expect(await foreignBridge.gasPrice()).to.be.bignumber.equal(gasPrice) + const bridgeMode = '0xba4690f5' // 4 bytes of keccak256('erc-to-erc-core') + expect(await foreignBridge.getBridgeMode()).to.be.equal(bridgeMode) + const { major, minor, patch } = await foreignBridge.getBridgeInterfacesVersion() + expect(major).to.be.bignumber.gte(ZERO) + expect(minor).to.be.bignumber.gte(ZERO) + expect(patch).to.be.bignumber.gte(ZERO) + + expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { + requiredBlockConfirmations: toBN(requireBlockConfirmations) + }) + expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) + await expectEvent.inTransaction(tx, limitsContract, 'DailyLimitChanged', { newLimit: dailyLimit.toString() }) + if (!isRelativeDailyLimit) { + await expectEvent.inTransaction(tx, limitsContract, 'ExecutionDailyLimitChanged', { + newLimit: homeDailyLimit.toString() + }) + } + } + it('should initialize', shouldInitialize(false)) + it('should initialize (relative limit)', shouldInitialize(true)) + }) + const executeSignatures = isRelativeDailyLimit => + function() { + const value = ether('0.25') + let foreignBridge + beforeEach(async () => { + foreignBridge = await ForeignBridge.new() + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + await foreignBridge.initialize( validatorContract.address, token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, dailyLimit, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address ) - .should.be.rejectedWith(ERROR_MSG) - - const { logs } = await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - '9' - ) - - expect(await foreignBridge.erc20token()).to.be.equal(token.address) - expect(await foreignBridge.isInitialized()).to.be.equal(true) - expect(await foreignBridge.validatorContract()).to.be.equal(validatorContract.address) - expect(await foreignBridge.deployedAtBlock()).to.be.bignumber.above(ZERO) - expect(await foreignBridge.requiredBlockConfirmations()).to.be.bignumber.equal( - requireBlockConfirmations.toString() - ) - expect(await foreignBridge.dailyLimit()).to.be.bignumber.equal(dailyLimit) - expect(await foreignBridge.maxPerTx()).to.be.bignumber.equal(maxPerTx) - expect(await foreignBridge.minPerTx()).to.be.bignumber.equal(minPerTx) - expect(await foreignBridge.decimalShift()).to.be.bignumber.equal('9') - expect(await foreignBridge.gasPrice()).to.be.bignumber.equal(gasPrice) - const bridgeMode = '0xba4690f5' // 4 bytes of keccak256('erc-to-erc-core') - expect(await foreignBridge.getBridgeMode()).to.be.equal(bridgeMode) - const { major, minor, patch } = await foreignBridge.getBridgeInterfacesVersion() - expect(major).to.be.bignumber.gte(ZERO) - expect(minor).to.be.bignumber.gte(ZERO) - expect(patch).to.be.bignumber.gte(ZERO) - - expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { - requiredBlockConfirmations: toBN(requireBlockConfirmations) + await token.mint(foreignBridge.address, oneEther) + }) + it('should allow to executeSignatures', async () => { + const recipientAccount = accounts[3] + const balanceBefore = await token.balanceOf(recipientAccount) + const balanceBridgeBefore = await token.balanceOf(foreignBridge.address) + + const transactionHash = '0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80' + const message = createMessage(recipientAccount, value, transactionHash, foreignBridge.address) + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature) + false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + const { logs } = await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipientAccount) + event.args.value.should.be.bignumber.equal(value) + + const balanceAfter = await token.balanceOf(recipientAccount) + const balanceBridgeAfter = await token.balanceOf(foreignBridge.address) + balanceAfter.should.be.bignumber.equal(balanceBefore.add(value)) + balanceBridgeAfter.should.be.bignumber.equal(balanceBridgeBefore.sub(value)) + true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + }) + it('should allow second withdrawal with different transactionHash but same recipient and value', async () => { + const recipientAccount = accounts[3] + const balanceBefore = await token.balanceOf(recipientAccount) + // tx 1 + const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' + const message = createMessage(recipientAccount, value, transactionHash, foreignBridge.address) + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature) + false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled + // tx 2 + await token.mint(foreignBridge.address, value) + const transactionHash2 = '0x77a496628a776a03d58d7e6059a5937f04bebd8ba4ff89f76dd4bb8ba7e291ee' + const message2 = createMessage(recipientAccount, value, transactionHash2, foreignBridge.address) + const signature2 = await sign(authorities[0], message2) + const vrs2 = signatureToVRS(signature2) + false.should.be.equal(await foreignBridge.relayedMessages(transactionHash2)) + const { logs } = await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be + .fulfilled + + logs[0].event.should.be.equal('RelayedMessage') + logs[0].args.recipient.should.be.equal(recipientAccount) + logs[0].args.value.should.be.bignumber.equal(value) + const balanceAfter = await token.balanceOf(recipientAccount) + balanceAfter.should.be.bignumber.equal(balanceBefore.add(value.mul(toBN(2)))) + true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + true.should.be.equal(await foreignBridge.relayedMessages(transactionHash2)) }) - expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) - expectEventInLogs(logs, 'DailyLimitChanged', { newLimit: dailyLimit }) - expectEventInLogs(logs, 'ExecutionDailyLimitChanged', { newLimit: homeDailyLimit }) - }) - }) - describe('#executeSignatures', async () => { - const value = ether('0.25') - let foreignBridge - beforeEach(async () => { - foreignBridge = await ForeignBridge.new() - token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) - await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) - await token.mint(foreignBridge.address, value) - }) - it('should allow to executeSignatures', async () => { - const recipientAccount = accounts[3] - const balanceBefore = await token.balanceOf(recipientAccount) - - const transactionHash = '0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80' - const message = createMessage(recipientAccount, value, transactionHash, foreignBridge.address) - const signature = await sign(authorities[0], message) - const vrs = signatureToVRS(signature) - false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) - const { logs } = await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipientAccount) - logs[0].args.value.should.be.bignumber.equal(value) - - const balanceAfter = await token.balanceOf(recipientAccount) - const balanceAfterBridge = await token.balanceOf(foreignBridge.address) - balanceAfter.should.be.bignumber.equal(balanceBefore.add(value)) - balanceAfterBridge.should.be.bignumber.equal(ZERO) - true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) - }) - it('should allow second withdrawal with different transactionHash but same recipient and value', async () => { - const recipientAccount = accounts[3] - const balanceBefore = await token.balanceOf(recipientAccount) - // tx 1 - const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' - const message = createMessage(recipientAccount, value, transactionHash, foreignBridge.address) - const signature = await sign(authorities[0], message) - const vrs = signatureToVRS(signature) - false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) - await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled - // tx 2 - await token.mint(foreignBridge.address, value) - const transactionHash2 = '0x77a496628a776a03d58d7e6059a5937f04bebd8ba4ff89f76dd4bb8ba7e291ee' - const message2 = createMessage(recipientAccount, value, transactionHash2, foreignBridge.address) - const signature2 = await sign(authorities[0], message2) - const vrs2 = signatureToVRS(signature2) - false.should.be.equal(await foreignBridge.relayedMessages(transactionHash2)) - const { logs } = await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.fulfilled - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipientAccount) - logs[0].args.value.should.be.bignumber.equal(value) - const balanceAfter = await token.balanceOf(recipientAccount) - balanceAfter.should.be.bignumber.equal(balanceBefore.add(value.mul(toBN(2)))) - true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) - true.should.be.equal(await foreignBridge.relayedMessages(transactionHash2)) - }) + it('should not allow second withdraw (replay attack) with same transactionHash but different recipient', async () => { + const recipientAccount = accounts[3] + // tx 1 + const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' + const message = createMessage(recipientAccount, value, transactionHash, foreignBridge.address) + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature) + false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled + // tx 2 + await token.mint(foreignBridge.address, value) + const message2 = createMessage(accounts[4], value, transactionHash, foreignBridge.address) + const signature2 = await sign(authorities[0], message2) + const vrs2 = signatureToVRS(signature2) + true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.rejectedWith(ERROR_MSG) + }) - it('should not allow second withdraw (replay attack) with same transactionHash but different recipient', async () => { - const recipientAccount = accounts[3] - // tx 1 - const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' - const message = createMessage(recipientAccount, value, transactionHash, foreignBridge.address) - const signature = await sign(authorities[0], message) - const vrs = signatureToVRS(signature) - false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) - await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled - // tx 2 - await token.mint(foreignBridge.address, value) - const message2 = createMessage(accounts[4], value, transactionHash, foreignBridge.address) - const signature2 = await sign(authorities[0], message2) - const vrs2 = signatureToVRS(signature2) - true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) - await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.rejectedWith(ERROR_MSG) - }) + it('should not allow withdraw over home max tx limit', async () => { + const recipientAccount = accounts[3] + const invalidValue = ether('0.75') + await token.mint(foreignBridge.address, ether('5')) - it('should not allow withdraw over home max tx limit', async () => { - const recipientAccount = accounts[3] - const invalidValue = ether('0.75') - await token.mint(foreignBridge.address, ether('5')) + const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' + const message = createMessage(recipientAccount, invalidValue, transactionHash, foreignBridge.address) + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature) - const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' - const message = createMessage(recipientAccount, invalidValue, transactionHash, foreignBridge.address) - const signature = await sign(authorities[0], message) - const vrs = signatureToVRS(signature) - - await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.rejectedWith(ERROR_MSG) - }) + await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.rejectedWith(ERROR_MSG) + }) - it('should not allow withdraw over daily home limit', async () => { - const recipientAccount = accounts[3] - await token.mint(foreignBridge.address, ether('5')) + it('should not allow withdraw over daily home limit', async () => { + const recipientAccount = accounts[3] + await token.mint(foreignBridge.address, halfEther) - const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' - const message = createMessage(recipientAccount, halfEther, transactionHash, foreignBridge.address) - const signature = await sign(authorities[0], message) - const vrs = signatureToVRS(signature) + const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' + const message = createMessage(recipientAccount, halfEther, transactionHash, foreignBridge.address) + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature) - await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled + await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled - const transactionHash2 = '0x69debd8fd1923c9cb3cd8ef6461e2740b2d037943b941729d5a47671a2bb8712' - const message2 = createMessage(recipientAccount, halfEther, transactionHash2, foreignBridge.address) - const signature2 = await sign(authorities[0], message2) - const vrs2 = signatureToVRS(signature2) + const transactionHash2 = '0x69debd8fd1923c9cb3cd8ef6461e2740b2d037943b941729d5a47671a2bb8712' + const message2 = createMessage(recipientAccount, halfEther, transactionHash2, foreignBridge.address) + const signature2 = await sign(authorities[0], message2) + const vrs2 = signatureToVRS(signature2) - await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.fulfilled + await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.fulfilled - const transactionHash3 = '0x022695428093bb292db8e48bd1417c5e1b84c0bf673bd0fff23ed0fb6495b872' - const message3 = createMessage(recipientAccount, halfEther, transactionHash3, foreignBridge.address) - const signature3 = await sign(authorities[0], message3) - const vrs3 = signatureToVRS(signature3) + const transactionHash3 = '0x022695428093bb292db8e48bd1417c5e1b84c0bf673bd0fff23ed0fb6495b872' + const message3 = createMessage(recipientAccount, halfEther, transactionHash3, foreignBridge.address) + const signature3 = await sign(authorities[0], message3) + const vrs3 = signatureToVRS(signature3) - await foreignBridge.executeSignatures([vrs3.v], [vrs3.r], [vrs3.s], message3).should.be.rejectedWith(ERROR_MSG) - }) - }) + await foreignBridge.executeSignatures([vrs3.v], [vrs3.r], [vrs3.s], message3).should.be.rejectedWith(ERROR_MSG) + }) + } + describe('#executeSignatures', executeSignatures(false)) + describe('#executeSignatures (relative limit)', executeSignatures(true)) describe('#withdraw with 2 minimum signatures', async () => { let multisigValidatorContract let twoAuthorities @@ -334,13 +362,13 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, decimalShiftZero, - { from: ownerOfValidatorContract } + absoluteLimitsContract.address ) - await token.mint(foreignBridgeWithMultiSignatures.address, value) + await token.mint(foreignBridgeWithMultiSignatures.address, oneEther) }) it('withdraw should fail if not enough signatures are provided', async () => { const recipientAccount = accounts[4] @@ -363,9 +391,9 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { message ).should.be.fulfilled - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipientAccount) - logs[0].args.value.should.be.bignumber.equal(value) + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipientAccount) + event.args.value.should.be.bignumber.equal(value) true.should.be.equal(await foreignBridgeWithMultiSignatures.relayedMessages(transactionHash)) }) it('withdraw should fail if duplicate signature is provided', async () => { @@ -395,12 +423,13 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { erc20Token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) - await erc20Token.mint(foreignBridgeWithThreeSigs.address, value) + await erc20Token.mint(foreignBridgeWithThreeSigs.address, oneEther) const txHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' const message = createMessage(recipient, value, txHash, foreignBridgeWithThreeSigs.address) @@ -423,9 +452,9 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { [vrs.s, vrs2.s, vrs3.s], message ).should.be.fulfilled - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipient) - logs[0].args.value.should.be.bignumber.equal(value) + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipient) + event.args.value.should.be.bignumber.equal(value) true.should.be.equal(await foreignBridgeWithThreeSigs.relayedMessages(txHash)) }) @@ -446,10 +475,11 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { erc20Token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) await erc20Token.mint(foreignBridgeWithMaxSigs.address, value) @@ -498,10 +528,11 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) // Deploy V2 @@ -516,6 +547,7 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { ;(await foreignBridgeV2Proxy.something()).should.be.equal(accounts[2]) }) it('can be deployed via upgradeToAndCall', async () => { + const token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) const tokenAddress = token.address const validatorsAddress = validatorContract.address @@ -528,9 +560,10 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { requireBlockConfirmations, gasPrice, ['3', '2', '1'], - ['3', '2'], + ['3', '2', '1'], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .encodeABI() await storageProxy.upgradeToAndCall('1', foreignBridge.address, data).should.be.fulfilled @@ -540,237 +573,262 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { }) }) describe('#claimTokens', async () => { - it('can send erc20', async () => { - const owner = accounts[0] - token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) - const foreignBridgeImpl = await ForeignBridge.new() - const storageProxy = await EternalStorageProxy.new().should.be.fulfilled - await storageProxy.upgradeTo('1', foreignBridgeImpl.address).should.be.fulfilled - const foreignBridge = await ForeignBridge.at(storageProxy.address) - await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) + const claim = isRelativeDailyLimit => + async function() { + const owner = accounts[0] + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + const foreignBridgeImpl = await ForeignBridge.new() + const storageProxy = await EternalStorageProxy.new().should.be.fulfilled + await storageProxy.upgradeTo('1', foreignBridgeImpl.address).should.be.fulfilled + const foreignBridge = await ForeignBridge.at(storageProxy.address) + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) - const tokenSecond = await ERC677BridgeToken.new('Roman Token', 'RST', 18) + const tokenSecond = await ERC677BridgeToken.new('Roman Token', 'RST', 18) - await tokenSecond.mint(accounts[0], halfEther).should.be.fulfilled - expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(halfEther) + await tokenSecond.mint(accounts[0], halfEther).should.be.fulfilled + expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(halfEther) - await tokenSecond.transfer(foreignBridge.address, halfEther) - expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(ZERO) - expect(await tokenSecond.balanceOf(foreignBridge.address)).to.be.bignumber.equal(halfEther) + await tokenSecond.transfer(foreignBridge.address, halfEther) + expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(ZERO) + expect(await tokenSecond.balanceOf(foreignBridge.address)).to.be.bignumber.equal(halfEther) - await foreignBridge - .claimTokens(tokenSecond.address, accounts[3], { from: accounts[3] }) - .should.be.rejectedWith(ERROR_MSG) - await foreignBridge.claimTokens(tokenSecond.address, accounts[3], { from: owner }) - expect(await tokenSecond.balanceOf(foreignBridge.address)).to.be.bignumber.equal(ZERO) - expect(await tokenSecond.balanceOf(accounts[3])).to.be.bignumber.equal(halfEther) - }) + await foreignBridge + .claimTokens(tokenSecond.address, accounts[3], { from: accounts[3] }) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge.claimTokens(tokenSecond.address, accounts[3], { from: owner }) + expect(await tokenSecond.balanceOf(foreignBridge.address)).to.be.bignumber.equal(ZERO) + expect(await tokenSecond.balanceOf(accounts[3])).to.be.bignumber.equal(halfEther) + } + it('can send erc20', claim(false)) + it('can send erc20 (relative limit)', claim(true)) }) - describe('#ForeignBridgeErc677ToErc677_onTokenTransfer', async () => { - it('should emit correct events on initialize', async () => { - const owner = accounts[3] - token = await ERC677BridgeToken.new('TEST', 'TST', 18, { from: owner }) - const foreignBridge = await ForeignBridgeErc677ToErc677.new() - const { logs } = await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) + const onTokenTransferTests = isRelativeDailyLimit => + function() { + it('should emit correct events on initialize', async () => { + const owner = accounts[3] + token = await ERC677BridgeToken.new('TEST', 'TST', 18, { from: owner }) + const foreignBridge = await ForeignBridgeErc677ToErc677.new() + const limitsContract = isRelativeDailyLimit ? relativeLimitsContract : absoluteLimitsContract + const { logs, tx } = await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + limitsContract.address, + { from: owner } + ) - expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { - requiredBlockConfirmations: toBN(requireBlockConfirmations) + expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { + requiredBlockConfirmations: toBN(requireBlockConfirmations) + }) + expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) + + await expectEvent.inTransaction(tx, limitsContract, 'DailyLimitChanged', { newLimit: dailyLimit.toString() }) + if (!isRelativeDailyLimit) { + await expectEvent.inTransaction(tx, limitsContract, 'ExecutionDailyLimitChanged', { + newLimit: homeDailyLimit.toString() + }) + } }) - expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) - expectEventInLogs(logs, 'ExecutionDailyLimitChanged', { newLimit: homeDailyLimit }) - expectEventInLogs(logs, 'DailyLimitChanged', { newLimit: dailyLimit }) - }) - it('can only be called from token contract', async () => { - const owner = accounts[3] - const user = accounts[4] - token = await ERC677BridgeToken.new('TEST', 'TST', 18, { from: owner }) - const foreignBridge = await ForeignBridgeErc677ToErc677.new() - await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) - - await token.mint(user, halfEther, { from: owner }).should.be.fulfilled - await token.transferOwnership(foreignBridge.address, { from: owner }) - await foreignBridge.onTokenTransfer(user, halfEther, '0x', { from: owner }).should.be.rejectedWith(ERROR_MSG) + it('can only be called from token contract', async () => { + const owner = accounts[3] + const user = accounts[4] + token = await ERC677BridgeToken.new('TEST', 'TST', 18, { from: owner }) + const foreignBridge = await ForeignBridgeErc677ToErc677.new() + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address, + { from: owner } + ) - await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled - expect(await token.totalSupply()).to.be.bignumber.equal(halfEther) - expect(await token.balanceOf(user)).to.be.bignumber.equal(ZERO) - expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(halfEther) + await token.mint(user, halfEther, { from: owner }).should.be.fulfilled + await token.transferOwnership(foreignBridge.address, { from: owner }) + await foreignBridge.onTokenTransfer(user, halfEther, '0x', { from: owner }).should.be.rejectedWith(ERROR_MSG) - const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) - expect(events[0].returnValues.recipient).to.be.equal(user) - expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(halfEther) - }) - it('should not allow to transfer more than maxPerTx limit', async () => { - const owner = accounts[3] - const user = accounts[4] - const valueMoreThanLimit = halfEther.add(toBN(1)) - token = await ERC677BridgeToken.new('TEST', 'TST', 18, { from: owner }) - const foreignBridge = await ForeignBridgeErc677ToErc677.new() - await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) + await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled + expect(await token.totalSupply()).to.be.bignumber.equal(halfEther) + expect(await token.balanceOf(user)).to.be.bignumber.equal(ZERO) + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(halfEther) - await token.mint(user, valueMoreThanLimit, { from: owner }).should.be.fulfilled - await token.transferOwnership(foreignBridge.address, { from: owner }) + const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) + expect(events[0].returnValues.recipient).to.be.equal(user) + expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(halfEther) + }) + it('should not allow to transfer more than maxPerTx limit', async () => { + const owner = accounts[3] + const user = accounts[4] + const valueMoreThanLimit = halfEther.add(toBN(1)) + token = await ERC677BridgeToken.new('TEST', 'TST', 18, { from: owner }) + const foreignBridge = await ForeignBridgeErc677ToErc677.new() + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address, + { from: owner } + ) - await token - .transferAndCall(foreignBridge.address, valueMoreThanLimit, '0x', { from: user }) - .should.be.rejectedWith(ERROR_MSG) - valueMoreThanLimit.should.be.bignumber.equal(await token.totalSupply()) - valueMoreThanLimit.should.be.bignumber.equal(await token.balanceOf(user)) + await token.mint(user, valueMoreThanLimit, { from: owner }).should.be.fulfilled + await token.transferOwnership(foreignBridge.address, { from: owner }) - await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled + await token + .transferAndCall(foreignBridge.address, valueMoreThanLimit, '0x', { from: user }) + .should.be.rejectedWith(ERROR_MSG) + valueMoreThanLimit.should.be.bignumber.equal(await token.totalSupply()) + valueMoreThanLimit.should.be.bignumber.equal(await token.balanceOf(user)) - expect(await token.totalSupply()).to.be.bignumber.equal(valueMoreThanLimit) - expect(await token.balanceOf(user)).to.be.bignumber.equal('1') - expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(halfEther) - const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) - expect(events[0].returnValues.recipient).to.be.equal(user) - expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(halfEther) - }) - it('should only let to transfer within daily limit', async () => { - const owner = accounts[3] - const user = accounts[4] - const valueMoreThanLimit = halfEther.add(toBN(1)) - token = await ERC677BridgeToken.new('TEST', 'TST', 18, { from: owner }) - const foreignBridge = await ForeignBridgeErc677ToErc677.new() - await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) + await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled - await token.mint(user, oneEther.add(toBN(1)), { from: owner }).should.be.fulfilled - await token.transferOwnership(foreignBridge.address, { from: owner }) + expect(await token.totalSupply()).to.be.bignumber.equal(valueMoreThanLimit) + expect(await token.balanceOf(user)).to.be.bignumber.equal('1') + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(halfEther) + const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) + expect(events[0].returnValues.recipient).to.be.equal(user) + expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(halfEther) + }) + it('should only let to transfer within daily limit', async () => { + const owner = accounts[3] + const user = accounts[4] + const valueMoreThanLimit = halfEther.add(toBN(1)) + token = await ERC677BridgeToken.new('TEST', 'TST', 18, { from: owner }) + const foreignBridge = await ForeignBridgeErc677ToErc677.new() + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address, + { from: owner } + ) - await token - .transferAndCall(foreignBridge.address, valueMoreThanLimit, '0x', { from: user }) - .should.be.rejectedWith(ERROR_MSG) - oneEther.add(toBN(1)).should.be.bignumber.equal(await token.totalSupply()) - oneEther.add(toBN(1)).should.be.bignumber.equal(await token.balanceOf(user)) + await token.mint(user, oneEther.add(toBN(1)), { from: owner }).should.be.fulfilled + await token.transferOwnership(foreignBridge.address, { from: owner }) - await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled - oneEther.add(toBN(1)).should.be.bignumber.equal(await token.totalSupply()) - valueMoreThanLimit.should.be.bignumber.equal(await token.balanceOf(user)) - const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) - expect(events[0].returnValues.recipient).to.be.equal(user) - expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(halfEther) + await token + .transferAndCall(foreignBridge.address, valueMoreThanLimit, '0x', { from: user }) + .should.be.rejectedWith(ERROR_MSG) + oneEther.add(toBN(1)).should.be.bignumber.equal(await token.totalSupply()) + oneEther.add(toBN(1)).should.be.bignumber.equal(await token.balanceOf(user)) - await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled + await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled + oneEther.add(toBN(1)).should.be.bignumber.equal(await token.totalSupply()) + valueMoreThanLimit.should.be.bignumber.equal(await token.balanceOf(user)) + const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) + expect(events[0].returnValues.recipient).to.be.equal(user) + expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(halfEther) - expect(await token.totalSupply()).to.be.bignumber.equal(oneEther.add(toBN(1))) - expect(await token.balanceOf(user)).to.be.bignumber.equal('1') - expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(oneEther) + await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled - await token.transferAndCall(foreignBridge.address, '1', '0x', { from: user }).should.be.rejectedWith(ERROR_MSG) - }) - it('should not let to transfer less than minPerTx', async () => { - const owner = accounts[3] - const user = accounts[4] - const valueLessThanMinPerTx = minPerTx.sub(toBN(1)) - token = await ERC677BridgeToken.new('TEST', 'TST', 18, { from: owner }) - const foreignBridge = await ForeignBridgeErc677ToErc677.new() - await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) + expect(await token.totalSupply()).to.be.bignumber.equal(oneEther.add(toBN(1))) + expect(await token.balanceOf(user)).to.be.bignumber.equal('1') + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(oneEther) - await token.mint(user, oneEther, { from: owner }).should.be.fulfilled - await token.transferOwnership(foreignBridge.address, { from: owner }) + await token.transferAndCall(foreignBridge.address, '1', '0x', { from: user }).should.be.rejectedWith(ERROR_MSG) + }) + it('should not let to transfer less than minPerTx', async () => { + const owner = accounts[3] + const user = accounts[4] + const valueLessThanMinPerTx = minPerTx.sub(toBN(1)) + token = await ERC677BridgeToken.new('TEST', 'TST', 18, { from: owner }) + const foreignBridge = await ForeignBridgeErc677ToErc677.new() + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address, + { from: owner } + ) - await token - .transferAndCall(foreignBridge.address, valueLessThanMinPerTx, '0x', { from: user }) - .should.be.rejectedWith(ERROR_MSG) - expect(await token.totalSupply()).to.be.bignumber.equal(oneEther) - expect(await token.balanceOf(user)).to.be.bignumber.equal(oneEther) + await token.mint(user, oneEther, { from: owner }).should.be.fulfilled + await token.transferOwnership(foreignBridge.address, { from: owner }) - await token.transferAndCall(foreignBridge.address, minPerTx, '0x', { from: user }).should.be.fulfilled + await token + .transferAndCall(foreignBridge.address, valueLessThanMinPerTx, '0x', { from: user }) + .should.be.rejectedWith(ERROR_MSG) + expect(await token.totalSupply()).to.be.bignumber.equal(oneEther) + expect(await token.balanceOf(user)).to.be.bignumber.equal(oneEther) - expect(await token.totalSupply()).to.be.bignumber.equal(oneEther) - expect(await token.balanceOf(user)).to.be.bignumber.equal(oneEther.sub(minPerTx)) - expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(minPerTx) + await token.transferAndCall(foreignBridge.address, minPerTx, '0x', { from: user }).should.be.fulfilled - const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) - expect(events[0].returnValues.recipient).to.be.equal(user) - expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(minPerTx) - }) - it('should be able to specify a different receiver', async () => { - const owner = accounts[3] - const user = accounts[4] - const user2 = accounts[5] - token = await ERC677BridgeToken.new('TEST', 'TST', 18, { from: owner }) - const foreignBridge = await ForeignBridgeErc677ToErc677.new() - await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero - ) - await token.mint(user, halfEther, { from: owner }).should.be.fulfilled - await token.transferOwnership(foreignBridge.address, { from: owner }) - await token - .transferAndCall(foreignBridge.address, halfEther, ZERO_ADDRESS, { from: user }) - .should.be.rejectedWith(ERROR_MSG) - await token - .transferAndCall(foreignBridge.address, halfEther, '0x0000', { from: user }) - .should.be.rejectedWith(ERROR_MSG) - await token.transferAndCall(foreignBridge.address, halfEther, user2, { from: user }).should.be.fulfilled + expect(await token.totalSupply()).to.be.bignumber.equal(oneEther) + expect(await token.balanceOf(user)).to.be.bignumber.equal(oneEther.sub(minPerTx)) + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(minPerTx) - expect(await token.balanceOf(user)).to.be.bignumber.equal(ZERO) - const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) - expect(events[0].returnValues.recipient).to.be.equal(user2) - expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(halfEther) - }) - }) + const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) + expect(events[0].returnValues.recipient).to.be.equal(user) + expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(minPerTx) + }) + it('should be able to specify a different receiver', async () => { + const owner = accounts[3] + const user = accounts[4] + const user2 = accounts[5] + token = await ERC677BridgeToken.new('TEST', 'TST', 18, { from: owner }) + const foreignBridge = await ForeignBridgeErc677ToErc677.new() + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address, + { from: owner } + ) + await token.mint(user, halfEther, { from: owner }).should.be.fulfilled + await token.transferOwnership(foreignBridge.address, { from: owner }) + await token + .transferAndCall(foreignBridge.address, halfEther, ZERO_ADDRESS, { from: user }) + .should.be.rejectedWith(ERROR_MSG) + await token + .transferAndCall(foreignBridge.address, halfEther, '0x0000', { from: user }) + .should.be.rejectedWith(ERROR_MSG) + await token.transferAndCall(foreignBridge.address, halfEther, user2, { from: user }).should.be.fulfilled + + expect(await token.balanceOf(user)).to.be.bignumber.equal(ZERO) + const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) + expect(events[0].returnValues.recipient).to.be.equal(user2) + expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(halfEther) + }) + } + describe('#ForeignBridgeErc677ToErc677_onTokenTransfer', onTokenTransferTests(false)) + describe('#ForeignBridgeErc677ToErc677_onTokenTransfer (relative limit)', onTokenTransferTests(true)) describe('#decimalShift', async () => { const decimalShiftTwo = 2 it('Home to Foreign: withdraw with 1 signature with a decimalShift of 2', async () => { @@ -784,15 +842,17 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, - decimalShiftTwo + decimalShiftTwo, + absoluteLimitsContract.address ) - await token.mint(foreignBridge.address, valueOnForeign) + await token.mint(foreignBridge.address, valueOnHome.mul(toBN('2'))) const recipientAccount = accounts[3] const balanceBefore = await token.balanceOf(recipientAccount) + const balanceBridgeBefore = await token.balanceOf(foreignBridge.address) const transactionHash = '0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80' const message = createMessage(recipientAccount, valueOnHome, transactionHash, foreignBridge.address) @@ -800,14 +860,14 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { const vrs = signatureToVRS(signature) false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) const { logs } = await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipientAccount) - logs[0].args.value.should.be.bignumber.equal(valueOnHome) + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipientAccount) + event.args.value.should.be.bignumber.equal(valueOnHome) const balanceAfter = await token.balanceOf(recipientAccount) - const balanceAfterBridge = await token.balanceOf(foreignBridge.address) + const balanceBridgeAfter = await token.balanceOf(foreignBridge.address) balanceAfter.should.be.bignumber.equal(balanceBefore.add(valueOnForeign)) - balanceAfterBridge.should.be.bignumber.equal(ZERO) + balanceBridgeAfter.should.be.bignumber.equal(balanceBridgeBefore.sub(valueOnForeign)) true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) }) it('Home to Foreign : withdraw works with 5 validators and 3 required signatures with a decimalShift of 2', async () => { @@ -828,12 +888,13 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { erc20Token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, - decimalShiftTwo + decimalShiftTwo, + absoluteLimitsContract.address ) - await erc20Token.mint(foreignBridgeWithThreeSigs.address, valueOnForeign) + await erc20Token.mint(foreignBridgeWithThreeSigs.address, valueOnHome.mul(toBN('2'))) const balanceBeforeRecipient = await erc20Token.balanceOf(recipient) const balanceBeforeBridge = await erc20Token.balanceOf(foreignBridgeWithThreeSigs.address) @@ -859,9 +920,9 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { [vrs.s, vrs2.s, vrs3.s], message ).should.be.fulfilled - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipient) - logs[0].args.value.should.be.bignumber.equal(valueOnHome) + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipient) + event.args.value.should.be.bignumber.equal(valueOnHome) true.should.be.equal(await foreignBridgeWithThreeSigs.relayedMessages(txHash)) const balanceAfterRecipient = await erc20Token.balanceOf(recipient) balanceAfterRecipient.should.be.bignumber.equal(balanceBeforeRecipient.add(valueOnForeign)) @@ -873,16 +934,18 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { const owner = accounts[3] const user = accounts[4] token = await ERC677BridgeToken.new('TEST', 'TST', 16, { from: owner }) - const foreignBridge = await ForeignBridgeErc677ToErc677.new() + const foreignBridge = await ForeignBridgeErc677ToErc677.new({ from: owner }) await foreignBridge.initialize( validatorContract.address, token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, - decimalShiftTwo + decimalShiftTwo, + absoluteLimitsContract.address, + { from: owner } ) await token.mint(user, value, { from: owner }).should.be.fulfilled @@ -912,44 +975,60 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) await token.mint(user, ether('2')) }) - it('should allow to bridge tokens using approve tranferFrom', async () => { - // Given - const currentDay = await foreignBridge.getCurrentDay() - expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, value, { - from: user - }).should.be.rejectedWith(ERROR_MSG) - - await token.approve(foreignBridge.address, value, { from: user }).should.be.fulfilled - - // When - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, ZERO_ADDRESS, value, { - from: user - }).should.be.rejectedWith(ERROR_MSG) - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, foreignBridge.address, value, { - from: user - }).should.be.rejectedWith(ERROR_MSG) - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, 0, { - from: user - }).should.be.rejectedWith(ERROR_MSG) - const { logs } = await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, value, { - from: user - }).should.be.fulfilled - - // Then - expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(value) - expectEventInLogs(logs, 'UserRequestForAffirmation', { - recipient, - value - }) - }) + const shouldAllowToBridgeTokens = isRelativeDailyLimit => + async function() { + foreignBridge = await ForeignBridge.new() + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + // Given + const currentDay = await foreignBridge.getCurrentDay() + expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, value, { + from: user + }).should.be.rejectedWith(ERROR_MSG) + + await token.approve(foreignBridge.address, value, { from: user }).should.be.fulfilled + + // When + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, ZERO_ADDRESS, value, { + from: user + }).should.be.rejectedWith(ERROR_MSG) + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, foreignBridge.address, value, { + from: user + }).should.be.rejectedWith(ERROR_MSG) + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, 0, { + from: user + }).should.be.rejectedWith(ERROR_MSG) + const { logs } = await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, value, { + from: user + }).should.be.fulfilled + + // Then + expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(value) + expectEventInLogs(logs, 'UserRequestForAffirmation', { + recipient, + value + }) + } + it('should allow to bridge tokens using approve tranferFrom', shouldAllowToBridgeTokens(false)) + it('should allow to bridge tokens using approve tranferFrom (relative limit)', shouldAllowToBridgeTokens(true)) it('should allow to call relayTokens without specifying the sender', async () => { // Given await foreignBridge.methods['relayTokens(address,uint256)'](recipient, value, { @@ -977,38 +1056,53 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { value }) }) - it('should not be able to transfer more than limit', async () => { - // Given - const userSupply = ether('2') - const bigValue = oneEther - const smallValue = ether('0.001') - const currentDay = await foreignBridge.getCurrentDay() - expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - - await token.approve(foreignBridge.address, userSupply, { from: user }).should.be.fulfilled - - // When - // value < minPerTx - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, smallValue, { - from: user - }).should.be.rejectedWith(ERROR_MSG) - // value > maxPerTx - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, bigValue, { - from: user - }).should.be.rejectedWith(ERROR_MSG) - - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, halfEther, { from: user }) - .should.be.fulfilled - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, halfEther, { from: user }) - .should.be.fulfilled - // totalSpentPerDay > dailyLimit - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, halfEther, { - from: user - }).should.be.rejectedWith(ERROR_MSG) - - // Then - expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(oneEther) - }) + const shouldNotBeAbleToTransferMoreThanLimit = isRelativeDailyLimit => + async function() { + foreignBridge = await ForeignBridge.new() + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + // Given + const userSupply = ether('2') + const bigValue = oneEther + const smallValue = ether('0.001') + const currentDay = await foreignBridge.getCurrentDay() + expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) + + await token.approve(foreignBridge.address, userSupply, { from: user }).should.be.fulfilled + + // When + // value < minPerTx + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, smallValue, { + from: user + }).should.be.rejectedWith(ERROR_MSG) + // value > maxPerTx + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, bigValue, { + from: user + }).should.be.rejectedWith(ERROR_MSG) + + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, halfEther, { from: user }) + .should.be.fulfilled + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, halfEther, { from: user }) + .should.be.fulfilled + // totalSpentPerDay > dailyLimit + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, halfEther, { + from: user + }).should.be.rejectedWith(ERROR_MSG) + + // Then + expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(oneEther) + } + it('should not be able to transfer more than limit', shouldNotBeAbleToTransferMoreThanLimit(false)) + it('should not be able to transfer more than limit (relative limit)', shouldNotBeAbleToTransferMoreThanLimit(true)) it('should allow only sender to specify a different receiver', async () => { // Given const currentDay = await foreignBridge.getCurrentDay() @@ -1056,4 +1150,82 @@ contract('ForeignBridge_ERC20_to_ERC20', async accounts => { }) }) }) + describe('#executionDailyLimit (relative)', () => { + let token + let foreignBridge + + function initialize(customExecutionLimitsArray) { + return foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + customExecutionLimitsArray, + owner, + decimalShiftZero, + relativeLimitsContract.address + ).should.be.fulfilled + } + + beforeEach(async () => { + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + foreignBridge = await ForeignBridge.new() + }) + it('should be calculated correctly - 1', async () => { + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(accounts[0], halfEther).should.be.fulfilled + await token.mint(foreignBridge.address, halfEther).should.be.fulfilled + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(halfEther) + expect(await token.totalSupply()).to.be.bignumber.equal(oneEther) + + const limit = await foreignBridge.executionDailyLimit() + const expectedLimit = calculateDailyLimit(halfEther, targetLimit, threshold, homeMinPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + it('should be calculated correctly - 2', async function() { + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(accounts[0], halfEther).should.be.fulfilled + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(ZERO) + expect(await token.totalSupply()).to.be.bignumber.equal(halfEther) + + const limit = await foreignBridge.executionDailyLimit() + expect(limit).to.be.bignumber.equal(ZERO) + }) + it('should be calculated correctly - 3', async function() { + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(foreignBridge.address, homeMinPerTx).should.be.fulfilled + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(homeMinPerTx) + + const limit = await foreignBridge.executionDailyLimit() + expect(limit).to.be.bignumber.equal(homeMinPerTx) + }) + it('should be calculated correctly - 4', async function() { + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(foreignBridge.address, threshold).should.be.fulfilled + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(threshold) + + const limit = await foreignBridge.executionDailyLimit() + expect(limit).to.be.bignumber.equal(threshold.mul(targetLimit).div(oneEther)) + }) + it('should be calculated correctly - 5', async function() { + const amountToMint = ether('5') + const targetLimit = ether('0.06') + const threshold = ether('100') + const homeMinPerTx = ether('0.1') + + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(foreignBridge.address, amountToMint).should.be.fulfilled + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(amountToMint) + + const limit = await foreignBridge.executionDailyLimit() + const expectedLimit = calculateDailyLimit(amountToMint, targetLimit, threshold, homeMinPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + }) }) diff --git a/test/erc_to_erc/home_bridge.test.js b/test/erc_to_erc/home_bridge.test.js index 2ae024f8d..e9c48b2c9 100644 --- a/test/erc_to_erc/home_bridge.test.js +++ b/test/erc_to_erc/home_bridge.test.js @@ -8,19 +8,32 @@ const FeeManagerErcToErcPOSDAO = artifacts.require('FeeManagerErcToErcPOSDAO.sol const RewardableValidators = artifacts.require('RewardableValidators.sol') const BlockReward = artifacts.require('BlockReward') const OldBlockReward = artifacts.require('OldBlockReward') +const AbsoluteDailyLimit = artifacts.require('AbsoluteDailyLimit.sol') +const RelativeDailyLimit = artifacts.require('RelativeDailyLimit.sol') const { expect } = require('chai') +const { expectEvent } = require('@openzeppelin/test-helpers') const { ERROR_MSG, ZERO_ADDRESS, toBN } = require('../setup') -const { createMessage, sign, getEvents, ether, expectEventInLogs, createAccounts } = require('../helpers/helpers') +const { + createMessage, + sign, + getEvents, + ether, + expectEventInLogs, + calculateDailyLimit, + createAccounts +} = require('../helpers/helpers') -const minPerTx = ether('0.01') const requireBlockConfirmations = 8 const gasPrice = web3.utils.toWei('1', 'gwei') const quarterEther = ether('0.25') const oneEther = ether('1') const halfEther = ether('0.5') +const minPerTx = ether('0.01') +const maxPerTx = halfEther const foreignDailyLimit = oneEther const foreignMaxPerTx = halfEther +const foreignMinPerTx = minPerTx const ZERO = toBN(0) const MAX_GAS = 8000000 const MAX_VALIDATORS = 50 @@ -28,107 +41,174 @@ const decimalShiftZero = 0 const markedAsProcessed = toBN(2) .pow(toBN(255)) .add(toBN(1)) +const targetLimit = ether('0.05') +const threshold = ether('10000') contract('HomeBridge_ERC20_to_ERC20', async accounts => { + const limitsArray = [oneEther, halfEther, minPerTx] + let homeContract let validatorContract let authorities let owner let token + let absoluteLimitsContract + let relativeLimitsContract + before(async () => { validatorContract = await BridgeValidators.new() authorities = [accounts[1]] owner = accounts[0] await validatorContract.initialize(1, authorities, owner) + absoluteLimitsContract = await AbsoluteDailyLimit.new() + relativeLimitsContract = await RelativeDailyLimit.new() }) describe('#initialize', async () => { + const limitsArray = ['3', '2', '1'] + beforeEach(async () => { homeContract = await HomeBridge.new() token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) }) - it('sets variables', async () => { - expect(await homeContract.validatorContract()).to.be.equal(ZERO_ADDRESS) - expect(await homeContract.deployedAtBlock()).to.be.bignumber.equal(ZERO) - expect(await homeContract.dailyLimit()).to.be.bignumber.equal(ZERO) - expect(await homeContract.maxPerTx()).to.be.bignumber.equal(ZERO) - expect(await homeContract.decimalShift()).to.be.bignumber.equal(ZERO) - expect(await homeContract.isInitialized()).to.be.equal(false) + const setVariables = isRelativeDailyLimit => + async function() { + const limitsArray = isRelativeDailyLimit ? ['1', '3', '2', '1'] : ['3', '2', '1'] - const { logs } = await homeContract.initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - token.address, - [foreignDailyLimit, foreignMaxPerTx], - owner, - '9' - ).should.be.fulfilled + expect(await homeContract.validatorContract()).to.be.equal(ZERO_ADDRESS) + expect(await homeContract.deployedAtBlock()).to.be.bignumber.equal(ZERO) + expect(await homeContract.decimalShift()).to.be.bignumber.equal(ZERO) + expect(await homeContract.isInitialized()).to.be.equal(false) - expect(await homeContract.isInitialized()).to.be.equal(true) - expect(await homeContract.validatorContract()).to.be.equal(validatorContract.address) - expect(await homeContract.deployedAtBlock()).to.be.bignumber.above(ZERO) - expect(await homeContract.dailyLimit()).to.be.bignumber.equal('3') - expect(await homeContract.maxPerTx()).to.be.bignumber.equal('2') - expect(await homeContract.minPerTx()).to.be.bignumber.equal('1') - expect(await homeContract.decimalShift()).to.be.bignumber.equal('9') - const bridgeMode = '0xba4690f5' // 4 bytes of keccak256('erc-to-erc-core') - expect(await homeContract.getBridgeMode()).to.be.equal(bridgeMode) - const { major, minor, patch } = await homeContract.getBridgeInterfacesVersion() - expect(major).to.be.bignumber.gte(ZERO) - expect(minor).to.be.bignumber.gte(ZERO) - expect(patch).to.be.bignumber.gte(ZERO) - - expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { - requiredBlockConfirmations: toBN(requireBlockConfirmations) - }) - expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) - expectEventInLogs(logs, 'DailyLimitChanged', { newLimit: '3' }) - expectEventInLogs(logs, 'ExecutionDailyLimitChanged', { newLimit: foreignDailyLimit }) - }) - it('cant set maxPerTx > dailyLimit', async () => { - expect(await homeContract.isInitialized()).to.be.equal(false) - - await homeContract - .initialize( - validatorContract.address, - ['1', '2', '1'], - gasPrice, - requireBlockConfirmations, - token.address, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) - await homeContract - .initialize( + const limitsContract = isRelativeDailyLimit ? relativeLimitsContract : absoluteLimitsContract + const { logs, tx } = await homeContract.initialize( validatorContract.address, - ['3', '2', '2'], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) + '9', + limitsContract.address + ).should.be.fulfilled + + expect(await homeContract.isInitialized()).to.be.equal(true) + expect(await homeContract.validatorContract()).to.be.equal(validatorContract.address) + expect(await homeContract.deployedAtBlock()).to.be.bignumber.above(ZERO) + expect(await homeContract.maxPerTx()).to.be.bignumber.equal('2') + expect(await homeContract.minPerTx()).to.be.bignumber.equal('1') + expect(await homeContract.decimalShift()).to.be.bignumber.equal('9') + const bridgeMode = '0xba4690f5' // 4 bytes of keccak256('erc-to-erc-core') + expect(await homeContract.getBridgeMode()).to.be.equal(bridgeMode) + const { major, minor, patch } = await homeContract.getBridgeInterfacesVersion() + expect(major).to.be.bignumber.gte(ZERO) + expect(minor).to.be.bignumber.gte(ZERO) + expect(patch).to.be.bignumber.gte(ZERO) + if (!isRelativeDailyLimit) { + expect(await homeContract.dailyLimit()).to.be.bignumber.equal('3') + } + + expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { + requiredBlockConfirmations: toBN(requireBlockConfirmations) + }) + expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) - expect(await homeContract.isInitialized()).to.be.equal(false) - }) + await expectEvent.inTransaction(tx, limitsContract, 'ExecutionDailyLimitChanged', { + newLimit: foreignDailyLimit.toString() + }) + if (!isRelativeDailyLimit) { + await expectEvent.inTransaction(tx, limitsContract, 'DailyLimitChanged', { newLimit: '3' }) + } + } + it('sets variables', setVariables(false)) + it('sets variables (relative limit)', setVariables(true)) + const cantSetWrongValues = isRelativeDailyLimit => + async function() { + expect(await homeContract.isInitialized()).to.be.equal(false) + + const limitsContract = isRelativeDailyLimit ? relativeLimitsContract : absoluteLimitsContract + + if (!isRelativeDailyLimit) { + // dailyLimit > maxPerTx + await homeContract + .initialize( + validatorContract.address, + ['1', '2', '1'], + gasPrice, + requireBlockConfirmations, + token.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + } + // maxPerTx > minPerTx + await homeContract + .initialize( + validatorContract.address, + isRelativeDailyLimit ? ['1', '3', '2', '2'] : ['3', '2', '2'], + gasPrice, + requireBlockConfirmations, + token.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + + if (isRelativeDailyLimit) { + // threshold >= minPerTx + await homeContract + .initialize( + validatorContract.address, + ['1', '1', '3', '2'], + gasPrice, + requireBlockConfirmations, + token.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + + // targetLimit <= 1 ether + await homeContract + .initialize( + validatorContract.address, + [ether('2'), '3', '2', '1'], + gasPrice, + requireBlockConfirmations, + token.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + } + + expect(await homeContract.isInitialized()).to.be.equal(false) + } + it('cant set wrong values', cantSetWrongValues(false)) + it('cant set wrong values (relative limit)', cantSetWrongValues(true)) it('can be deployed via upgradeToAndCall', async () => { const storageProxy = await EternalStorageProxy.new().should.be.fulfilled const data = homeContract.contract.methods .initialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - ['3', '2'], + ['3', '2', '1'], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .encodeABI() await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled @@ -136,9 +216,9 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { expect(await finalContract.isInitialized()).to.be.equal(true) expect(await finalContract.validatorContract()).to.be.equal(validatorContract.address) - expect(await finalContract.dailyLimit()).to.be.bignumber.equal('3') expect(await finalContract.maxPerTx()).to.be.bignumber.equal('2') expect(await finalContract.minPerTx()).to.be.bignumber.equal('1') + expect(await finalContract.dailyLimit()).to.be.bignumber.equal('3') }) it('cant initialize with invalid arguments', async () => { @@ -147,84 +227,117 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { await homeContract .initialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, 0, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract .initialize( owner, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract .initialize( ZERO_ADDRESS, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract .initialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, ZERO_ADDRESS, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract .initialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, + gasPrice, + requireBlockConfirmations, + token.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + ZERO_ADDRESS + ) + .should.be.rejectedWith(ERROR_MSG) + await homeContract + .initialize( + validatorContract.address, + limitsArray, gasPrice, requireBlockConfirmations, owner, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract .initialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, + gasPrice, + requireBlockConfirmations, + token.address, + [halfEther, oneEther, quarterEther], + owner, + decimalShiftZero, + absoluteLimitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await homeContract + .initialize( + validatorContract.address, + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [halfEther, oneEther], + [oneEther, halfEther, halfEther], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract.initialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled expect(await homeContract.isInitialized()).to.be.equal(true) @@ -236,13 +349,14 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { // When await homeContract.initialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, 0, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // Then @@ -260,9 +374,10 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) }) it('reverts', async () => { @@ -275,36 +390,45 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { }) }) - describe('#setting limits', async () => { - let homeContract - beforeEach(async () => { - homeContract = await HomeBridge.new() - token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) - await homeContract.initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - token.address, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ) - }) - it('#setMaxPerTx allows to set only to owner and cannot be more than daily limit', async () => { - await homeContract.setMaxPerTx(2, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) - await homeContract.setMaxPerTx(2, { from: owner }).should.be.fulfilled + const settingLimits = isRelativeDailyLimit => + async function() { + let homeContract + beforeEach(async () => { + homeContract = await HomeBridge.new() + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + const limitsContract = isRelativeDailyLimit ? relativeLimitsContract : absoluteLimitsContract + await homeContract.initialize( + validatorContract.address, + isRelativeDailyLimit ? ['1', '3', '2', '1'] : ['3', '2', '1'], + gasPrice, + requireBlockConfirmations, + token.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + limitsContract.address + ) + }) + it('#setMaxPerTx allows to set only to owner and cannot be more than daily limit', async () => { + await homeContract.setMaxPerTx(2, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) + await homeContract.setMaxPerTx(2, { from: owner }).should.be.fulfilled + + // in implementation with relative daily limit, maxPerTx can be more than current dailyLimit + if (!isRelativeDailyLimit) { + await homeContract.setMaxPerTx(3, { from: owner }).should.be.rejectedWith(ERROR_MSG) + } + }) - await homeContract.setMaxPerTx(3, { from: owner }).should.be.rejectedWith(ERROR_MSG) - }) + it('#setMinPerTx allows to set only to owner and cannot be more than daily limit and should be less than maxPerTx', async () => { + await homeContract.setMinPerTx(1, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) + await homeContract.setMinPerTx(1, { from: owner }).should.be.fulfilled - it('#setMinPerTx allows to set only to owner and cannot be more than daily limit and should be less than maxPerTx', async () => { - await homeContract.setMinPerTx(1, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) - await homeContract.setMinPerTx(1, { from: owner }).should.be.fulfilled + await homeContract.setMinPerTx(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) + }) + } - await homeContract.setMinPerTx(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) - }) - }) + describe('#setting limits', settingLimits(false)) + describe('#setting limits (relative limit)', settingLimits(true)) describe('#executeAffirmation', async () => { let homeBridge @@ -313,13 +437,14 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) await homeBridge.initialize( validatorContract.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) await token.transferOwnership(homeBridge.address) }) @@ -398,13 +523,14 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { const homeBridgeWithTwoSigs = await HomeBridge.new() await homeBridgeWithTwoSigs.initialize( validatorContractWith2Signatures.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token2sig.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) await token2sig.transferOwnership(homeBridgeWithTwoSigs.address) const recipient = accounts[5] @@ -483,13 +609,14 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { const homeBridgeWithTwoSigs = await HomeBridge.new() await homeBridgeWithTwoSigs.initialize( validatorContractWith2Signatures.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token2sig.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) await token2sig.transferOwnership(homeBridgeWithTwoSigs.address) const recipient = accounts[5] @@ -525,13 +652,14 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { const homeBridgeWithThreeSigs = await HomeBridge.new() await homeBridgeWithThreeSigs.initialize( validatorContractWith3Signatures.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) await token.transferOwnership(homeBridgeWithThreeSigs.address) @@ -681,13 +809,14 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { homeBridgeWithTwoSigs = await HomeBridge.new() await homeBridgeWithTwoSigs.initialize( validatorContractWith2Signatures.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token2sig.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) await token2sig.transferOwnership(homeBridgeWithTwoSigs.address) }) @@ -751,13 +880,14 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { const homeBridgeWithThreeSigs = await HomeBridge.new() await homeBridgeWithThreeSigs.initialize( validatorContractWith3Signatures.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) const value = ether('0.5') @@ -858,13 +988,14 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { homeBridge = await HomeBridge.at(storageProxy.address) await homeBridge.initialize( validatorContract.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled }) it('Should revert if value to unlock is bigger than max per transaction', async () => { @@ -1130,13 +1261,14 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { const homeBridge = await HomeBridge.at(storageProxy.address) await homeBridge.initialize( validatorContract.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await token.transferOwnership(homeBridge.address).should.be.fulfilled @@ -1180,26 +1312,25 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { const feeManager = await FeeManagerErcToErcPOSDAO.new() expect(await homeBridge.validatorContract()).to.be.equal(ZERO_ADDRESS) expect(await homeBridge.deployedAtBlock()).to.be.bignumber.equal(ZERO) - expect(await homeBridge.dailyLimit()).to.be.bignumber.equal(ZERO) - expect(await homeBridge.maxPerTx()).to.be.bignumber.equal(ZERO) expect(await homeBridge.isInitialized()).to.be.equal(false) await homeBridge.rewardableInitialize( ZERO_ADDRESS, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], blockRewardContract.address, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.rejected await homeBridge.rewardableInitialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, [0, foreignDailyLimit], token.address, @@ -1208,39 +1339,41 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { feeManager.address, [homeFee, foreignFee], blockRewardContract.address, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.rejected await homeBridge.rewardableInitialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, ZERO_ADDRESS, [homeFee, foreignFee], blockRewardContract.address, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.rejected - const { logs } = await homeBridge.rewardableInitialize( + const { logs, tx } = await homeBridge.rewardableInitialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], blockRewardContract.address, - '9' + '9', + absoluteLimitsContract.address ).should.be.fulfilled expect(await homeBridge.isInitialized()).to.be.equal(true) expect(await homeBridge.validatorContract()).to.be.equal(rewardableValidators.address) expect(await homeBridge.deployedAtBlock()).to.be.bignumber.above(ZERO) - expect(await homeBridge.dailyLimit()).to.be.bignumber.equal(oneEther) expect(await homeBridge.maxPerTx()).to.be.bignumber.equal(halfEther) expect(await homeBridge.minPerTx()).to.be.bignumber.equal(minPerTx) expect(await homeBridge.decimalShift()).to.be.bignumber.equal('9') @@ -1250,6 +1383,7 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { expect(major).to.be.bignumber.gte(ZERO) expect(minor).to.be.bignumber.gte(ZERO) expect(patch).to.be.bignumber.gte(ZERO) + expect(await homeBridge.dailyLimit()).to.be.bignumber.equal(oneEther) const feeManagerContract = await homeBridge.feeManagerContract() feeManagerContract.should.be.equals(feeManager.address) @@ -1264,23 +1398,28 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { requiredBlockConfirmations: toBN(requireBlockConfirmations) }) expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) - expectEventInLogs(logs, 'DailyLimitChanged', { newLimit: oneEther }) - expectEventInLogs(logs, 'ExecutionDailyLimitChanged', { newLimit: foreignDailyLimit }) + await expectEvent.inTransaction(tx, absoluteLimitsContract, 'ExecutionDailyLimitChanged', { + newLimit: foreignDailyLimit.toString() + }) + await expectEvent.inTransaction(tx, absoluteLimitsContract, 'DailyLimitChanged', { + newLimit: oneEther.toString() + }) }) it('can update fee contract', async () => { const feeManager = await FeeManagerErcToErcPOSDAO.new() await homeBridge.rewardableInitialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], blockRewardContract.address, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // Given @@ -1297,16 +1436,17 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { const feeManager = await FeeManagerErcToErcPOSDAO.new() await homeBridge.rewardableInitialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], blockRewardContract.address, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // Given @@ -1327,16 +1467,17 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { const feeManager = await FeeManagerErcToErcPOSDAO.new() await homeBridge.rewardableInitialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], blockRewardContract.address, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // Given @@ -1367,16 +1508,17 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { // When await homeBridge.rewardableInitialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], blockRewardContract.address, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // Then @@ -1389,16 +1531,17 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { await homeBridge.rewardableInitialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], blockRewardContract.address, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled const blockReward = await homeBridge.blockRewardContract() @@ -1429,15 +1572,17 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { const user = accounts[4] await homeBridge.initialize( validatorContract.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled const value = halfEther + await token.mint(homeBridge.address, oneEther, { from: owner }).should.be.fulfilled await token.mint(user, value, { from: owner }).should.be.fulfilled // When @@ -1455,15 +1600,17 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { const user2 = accounts[5] await homeBridge.initialize( validatorContract.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled const value = halfEther + await token.mint(homeBridge.address, oneEther, { from: owner }).should.be.fulfilled await token.mint(user, value, { from: owner }).should.be.fulfilled // When @@ -1495,20 +1642,22 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { await homeBridge.rewardableInitialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], blockRewardContract.address, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled const value = halfEther const finalValueCalc = 0.5 * (1 - fee) const finalValue = ether(finalValueCalc.toString()) + await token.mint(homeBridge.address, oneEther, { from: owner }).should.be.fulfilled await token.mint(user, value, { from: owner }).should.be.fulfilled // When @@ -1539,16 +1688,17 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { blockRewardContract = await BlockReward.new() await homeBridge.rewardableInitialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], blockRewardContract.address, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled }) it('should distribute fee to one validator', async () => { @@ -1762,16 +1912,17 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { blockRewardContract = await BlockReward.new() await homeBridge.rewardableInitialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], blockRewardContract.address, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled }) it('should distribute fee to one validator', async () => { @@ -1993,13 +2144,14 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { const homeBridgeWithThreeSigs = await HomeBridge.new() await homeBridgeWithThreeSigs.initialize( validatorContractWith3Signatures.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftTwo + decimalShiftTwo, + absoluteLimitsContract.address ) await token.transferOwnership(homeBridgeWithThreeSigs.address) @@ -2043,15 +2195,17 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { const user = accounts[4] await homeBridge.initialize( validatorContract.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, token.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftTwo + decimalShiftTwo, + absoluteLimitsContract.address ).should.be.fulfilled const value = halfEther + await token.mint(homeBridge.address, oneEther, { from: owner }).should.be.fulfilled await token.mint(user, value, { from: owner }).should.be.fulfilled // When @@ -2063,4 +2217,82 @@ contract('HomeBridge_ERC20_to_ERC20', async accounts => { expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(value) }) }) + describe('#dailyLimit (relative)', () => { + let token + let homeBridge + + function initialize(customLimitsArray) { + return homeBridge.initialize( + validatorContract.address, + customLimitsArray, + gasPrice, + requireBlockConfirmations, + token.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + relativeLimitsContract.address + ).should.be.fulfilled + } + + beforeEach(async () => { + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + homeBridge = await HomeBridge.new() + }) + it('should be calculated correctly - 1', async () => { + await initialize([targetLimit, threshold, maxPerTx, minPerTx]) + + await token.mint(accounts[0], halfEther).should.be.fulfilled + await token.mint(homeBridge.address, halfEther).should.be.fulfilled + expect(await token.balanceOf(homeBridge.address)).to.be.bignumber.equal(halfEther) + expect(await token.totalSupply()).to.be.bignumber.equal(oneEther) + + const limit = await homeBridge.dailyLimit() + const expectedLimit = calculateDailyLimit(oneEther, targetLimit, threshold, minPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + it('should be calculated correctly - 2', async function() { + await initialize([targetLimit, threshold, maxPerTx, minPerTx]) + + await token.mint(accounts[0], halfEther).should.be.fulfilled + expect(await token.totalSupply()).to.be.bignumber.equal(halfEther) + + const limit = await homeBridge.dailyLimit() + const expectedLimit = calculateDailyLimit(halfEther, targetLimit, threshold, minPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + it('should be calculated correctly - 3', async function() { + await initialize([targetLimit, threshold, maxPerTx, minPerTx]) + + await token.mint(homeBridge.address, minPerTx).should.be.fulfilled + expect(await token.totalSupply()).to.be.bignumber.equal(minPerTx) + + const limit = await homeBridge.dailyLimit() + expect(limit).to.be.bignumber.equal(minPerTx) + }) + it('should be calculated correctly - 4', async function() { + await initialize([targetLimit, threshold, maxPerTx, minPerTx]) + + await token.mint(homeBridge.address, threshold).should.be.fulfilled + expect(await token.totalSupply()).to.be.bignumber.equal(threshold) + + const limit = await homeBridge.dailyLimit() + expect(limit).to.be.bignumber.equal(threshold.mul(targetLimit).div(oneEther)) + }) + it('should be calculated correctly - 5', async function() { + const amountToMint = ether('5') + const targetLimit = ether('0.06') + const threshold = ether('100') + const minPerTx = ether('0.1') + + await initialize([targetLimit, threshold, maxPerTx, minPerTx]) + + await token.mint(accounts[0], amountToMint).should.be.fulfilled + expect(await token.totalSupply()).to.be.bignumber.equal(amountToMint) + + const limit = await homeBridge.dailyLimit() + const expectedLimit = calculateDailyLimit(amountToMint, targetLimit, threshold, minPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + }) }) diff --git a/test/erc_to_native/foreign_bridge.test.js b/test/erc_to_native/foreign_bridge.test.js index f8f2b6260..efdecaee2 100644 --- a/test/erc_to_native/foreign_bridge.test.js +++ b/test/erc_to_native/foreign_bridge.test.js @@ -6,10 +6,13 @@ const ERC677BridgeToken = artifacts.require('ERC677BridgeToken.sol') const ERC20Mock = artifacts.require('ERC20Mock.sol') const ScdMcdMigrationMock = artifacts.require('ScdMcdMigrationMock.sol') const DaiAdapterMock = artifacts.require('DaiAdapterMock.sol') +const AbsoluteDailyLimit = artifacts.require('AbsoluteDailyLimit.sol') +const RelativeExecutionDailyLimit = artifacts.require('RelativeExecutionDailyLimit.sol') const SaiTopMock = artifacts.require('SaiTopMock.sol') const ForeignBridgeErcToNativeMock = artifacts.require('ForeignBridgeErcToNativeMock.sol') const { expect } = require('chai') +const { expectEvent } = require('@openzeppelin/test-helpers') const { ERROR_MSG, ZERO_ADDRESS, toBN } = require('../setup') const { createMessage, @@ -18,9 +21,11 @@ const { ether, expectEventInLogs, getEvents, + calculateDailyLimit, createFullAccounts } = require('../helpers/helpers') +const quarterEther = ether('0.25') const halfEther = ether('0.5') const requireBlockConfirmations = 8 const gasPrice = web3.utils.toWei('1', 'gwei') @@ -28,6 +33,7 @@ const oneEther = ether('1') const twoEthers = ether('2') const homeDailyLimit = oneEther const homeMaxPerTx = halfEther +const homeMinPerTx = quarterEther const dailyLimit = oneEther const maxPerTx = halfEther const minPerTx = ether('0.01') @@ -36,13 +42,21 @@ const MAX_VALIDATORS = 50 const MAX_SIGNATURES = MAX_VALIDATORS const MAX_GAS = 8000000 const decimalShiftZero = 0 +const targetLimit = ether('0.05') +const threshold = ether('10000') contract('ForeignBridge_ERC20_to_Native', async accounts => { + const requestLimitsArray = [dailyLimit, maxPerTx, minPerTx] + const executionLimitsArray = [homeDailyLimit, homeMaxPerTx, homeMinPerTx] + const relativeExecutionLimitsArray = [targetLimit, threshold, homeMaxPerTx, homeMinPerTx] + let validatorContract let authorities let owner let token let otherSideBridge + let absoluteLimitsContract + let relativeLimitsContract let sai let dai let migrationContract @@ -54,6 +68,8 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { owner = accounts[0] await validatorContract.initialize(1, authorities, owner) otherSideBridge = await ForeignBridge.new() + absoluteLimitsContract = await AbsoluteDailyLimit.new() + relativeLimitsContract = await RelativeExecutionDailyLimit.new() // Used account 11 to deploy contracts. The contract addresses will be hardcoded in ForeignBridgeErcToNativeMock const deployAccount = accounts[10] @@ -70,147 +86,182 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { await dai.transferOwnership(migrationContract.address) }) describe('#initialize', async () => { - it('should initialize', async () => { - token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) - const foreignBridge = await ForeignBridge.new() + const shouldInitialize = isRelativeDailyLimit => + async function() { + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + const foreignBridge = await ForeignBridge.new() + const limitsContract = isRelativeDailyLimit ? relativeLimitsContract : absoluteLimitsContract + const executionLimits = isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray + + expect(await foreignBridge.erc20token()).to.be.equal(ZERO_ADDRESS) + expect(await foreignBridge.validatorContract()).to.be.equal(ZERO_ADDRESS) + expect(await foreignBridge.deployedAtBlock()).to.be.bignumber.equal(ZERO) + expect(await foreignBridge.isInitialized()).to.be.equal(false) + expect(await foreignBridge.requiredBlockConfirmations()).to.be.bignumber.equal(ZERO) + expect(await foreignBridge.decimalShift()).to.be.bignumber.equal(ZERO) - expect(await foreignBridge.erc20token()).to.be.equal(ZERO_ADDRESS) - expect(await foreignBridge.validatorContract()).to.be.equal(ZERO_ADDRESS) - expect(await foreignBridge.deployedAtBlock()).to.be.bignumber.equal(ZERO) - expect(await foreignBridge.isInitialized()).to.be.equal(false) - expect(await foreignBridge.requiredBlockConfirmations()).to.be.bignumber.equal(ZERO) - expect(await foreignBridge.decimalShift()).to.be.bignumber.equal(ZERO) + await foreignBridge.initialize( + ZERO_ADDRESS, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + executionLimits, + owner, + decimalShiftZero, + otherSideBridge.address, + limitsContract.address + ).should.be.rejected + await foreignBridge.initialize( + validatorContract.address, + ZERO_ADDRESS, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + executionLimits, + owner, + decimalShiftZero, + otherSideBridge.address, + limitsContract.address + ).should.be.rejected + await foreignBridge.initialize( + validatorContract.address, + token.address, + 0, + gasPrice, + requestLimitsArray, + executionLimits, + owner, + decimalShiftZero, + otherSideBridge.address, + limitsContract.address + ).should.be.rejected + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + 0, + requestLimitsArray, + executionLimits, + owner, + decimalShiftZero, + otherSideBridge.address, + limitsContract.address + ).should.be.rejected + await foreignBridge.initialize( + validatorContract.address, + owner, + requireBlockConfirmations, + gasPrice, + [maxPerTx, maxPerTx, minPerTx], + executionLimits, + owner, + decimalShiftZero, + otherSideBridge.address, + limitsContract.address + ).should.be.rejected + await foreignBridge.initialize( + owner, + token.address, + requireBlockConfirmations, + gasPrice, + [dailyLimit, minPerTx, minPerTx], + executionLimits, + owner, + decimalShiftZero, + otherSideBridge.address, + limitsContract.address + ).should.be.rejected + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit + ? [targetLimit, threshold, homeMaxPerTx, homeMaxPerTx] + : [homeDailyLimit, homeMaxPerTx, homeMaxPerTx], + owner, + decimalShiftZero, + otherSideBridge.address, + limitsContract.address + ).should.be.rejected - await foreignBridge.initialize( - ZERO_ADDRESS, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridge.address - ).should.be.rejected - await foreignBridge.initialize( - validatorContract.address, - ZERO_ADDRESS, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridge.address - ).should.be.rejected - await foreignBridge.initialize( - validatorContract.address, - token.address, - 0, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridge.address - ).should.be.rejected - await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - 0, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridge.address - ).should.be.rejected - await foreignBridge.initialize( - validatorContract.address, - owner, - requireBlockConfirmations, - gasPrice, - [maxPerTx, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridge.address - ).should.be.rejected - await foreignBridge.initialize( - owner, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, minPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridge.address - ).should.be.rejected - await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeMaxPerTx, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridge.address - ).should.be.rejected + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + executionLimits, + owner, + '9', + ZERO_ADDRESS, + limitsContract.address + ).should.be.rejected - await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - '9', - ZERO_ADDRESS - ).should.be.rejected + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + executionLimits, + owner, + '9', + otherSideBridge.address, + ZERO_ADDRESS + ).should.be.rejected - const { logs } = await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - '9', - otherSideBridge.address - ) + const { logs, tx } = await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + executionLimits, + owner, + '9', + otherSideBridge.address, + limitsContract.address + ) - expect(await foreignBridge.erc20token()).to.be.equal(token.address) - expect(await foreignBridge.isInitialized()).to.be.equal(true) - expect(await foreignBridge.validatorContract()).to.be.equal(validatorContract.address) - expect(await foreignBridge.deployedAtBlock()).to.be.bignumber.above(ZERO) - expect(await foreignBridge.requiredBlockConfirmations()).to.be.bignumber.equal( - requireBlockConfirmations.toString() - ) - expect(await foreignBridge.dailyLimit()).to.be.bignumber.equal(dailyLimit) - expect(await foreignBridge.maxPerTx()).to.be.bignumber.equal(maxPerTx) - expect(await foreignBridge.minPerTx()).to.be.bignumber.equal(minPerTx) - expect(await foreignBridge.executionDailyLimit()).to.be.bignumber.equal(homeDailyLimit) - expect(await foreignBridge.executionMaxPerTx()).to.be.bignumber.equal(homeMaxPerTx) - expect(await foreignBridge.decimalShift()).to.be.bignumber.equal('9') - expect(await foreignBridge.gasPrice()).to.be.bignumber.equal(gasPrice) - const bridgeMode = '0x18762d46' // 4 bytes of keccak256('erc-to-native-core') - expect(await foreignBridge.getBridgeMode()).to.be.equal(bridgeMode) - const { major, minor, patch } = await foreignBridge.getBridgeInterfacesVersion() - expect(major).to.be.bignumber.gte(ZERO) - expect(minor).to.be.bignumber.gte(ZERO) - expect(patch).to.be.bignumber.gte(ZERO) - - expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { - requiredBlockConfirmations: toBN(requireBlockConfirmations) - }) - expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) - expectEventInLogs(logs, 'DailyLimitChanged', { newLimit: dailyLimit }) - expectEventInLogs(logs, 'ExecutionDailyLimitChanged', { newLimit: homeDailyLimit }) - }) + expect(await foreignBridge.erc20token()).to.be.equal(token.address) + expect(await foreignBridge.isInitialized()).to.be.equal(true) + expect(await foreignBridge.validatorContract()).to.be.equal(validatorContract.address) + expect(await foreignBridge.deployedAtBlock()).to.be.bignumber.above(ZERO) + expect(await foreignBridge.requiredBlockConfirmations()).to.be.bignumber.equal( + requireBlockConfirmations.toString() + ) + expect(await foreignBridge.dailyLimit()).to.be.bignumber.equal(dailyLimit) + expect(await foreignBridge.maxPerTx()).to.be.bignumber.equal(maxPerTx) + expect(await foreignBridge.minPerTx()).to.be.bignumber.equal(minPerTx) + if (!isRelativeDailyLimit) { + expect(await foreignBridge.executionDailyLimit()).to.be.bignumber.equal(homeDailyLimit) + } + expect(await foreignBridge.executionMaxPerTx()).to.be.bignumber.equal(homeMaxPerTx) + expect(await foreignBridge.decimalShift()).to.be.bignumber.equal('9') + expect(await foreignBridge.gasPrice()).to.be.bignumber.equal(gasPrice) + const bridgeMode = '0x18762d46' // 4 bytes of keccak256('erc-to-native-core') + expect(await foreignBridge.getBridgeMode()).to.be.equal(bridgeMode) + const { major, minor, patch } = await foreignBridge.getBridgeInterfacesVersion() + expect(major).to.be.bignumber.gte(ZERO) + expect(minor).to.be.bignumber.gte(ZERO) + expect(patch).to.be.bignumber.gte(ZERO) + + expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { + requiredBlockConfirmations: toBN(requireBlockConfirmations) + }) + expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) + await expectEvent.inTransaction(tx, limitsContract, 'DailyLimitChanged', { newLimit: dailyLimit.toString() }) + if (!isRelativeDailyLimit) { + await expectEvent.inTransaction(tx, limitsContract, 'ExecutionDailyLimitChanged', { + newLimit: homeDailyLimit.toString() + }) + } + } + it('should initialize', shouldInitialize(false)) + it('should initialize (relative limit)', shouldInitialize(true)) }) describe('#executeSignatures', async () => { const value = ether('0.25') @@ -223,40 +274,61 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, decimalShiftZero, - otherSideBridge.address + otherSideBridge.address, + absoluteLimitsContract.address ) await token.mint(foreignBridge.address, value) }) - it('should allow to executeSignatures', async () => { - const recipientAccount = accounts[3] - const balanceBefore = await token.balanceOf(recipientAccount) + const shouldAllowToExecuteSignatures = isRelativeDailyLimit => + async function() { + foreignBridge = await ForeignBridgeErcToNativeMock.new() + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + otherSideBridge.address, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.mint(foreignBridge.address, value) - const transactionHash = '0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80' - const message = createMessage(recipientAccount, value, transactionHash, foreignBridge.address) - const signature = await sign(authorities[0], message) - const vrs = signatureToVRS(signature) - false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + const recipientAccount = accounts[3] + const balanceBefore = await token.balanceOf(recipientAccount) - const { logs } = await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled + const transactionHash = '0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80' + const message = createMessage(recipientAccount, value, transactionHash, foreignBridge.address) + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature) + false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipientAccount) - logs[0].args.value.should.be.bignumber.equal(value) - const balanceAfter = await token.balanceOf(recipientAccount) - const balanceAfterBridge = await token.balanceOf(foreignBridge.address) - balanceAfter.should.be.bignumber.equal(balanceBefore.add(value)) - balanceAfterBridge.should.be.bignumber.equal(ZERO) - true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) - }) + const { logs } = await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipientAccount) + event.args.value.should.be.bignumber.equal(value) + const balanceAfter = await token.balanceOf(recipientAccount) + const balanceAfterBridge = await token.balanceOf(foreignBridge.address) + balanceAfter.should.be.bignumber.equal(balanceBefore.add(value)) + balanceAfterBridge.should.be.bignumber.equal(ZERO) + true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + } + + it('should allow to executeSignatures', shouldAllowToExecuteSignatures(false)) + it('should allow to executeSignatures (relative limit)', shouldAllowToExecuteSignatures(true)) it('should allow second withdrawal with different transactionHash but same recipient and value', async () => { const recipientAccount = accounts[3] const balanceBefore = await token.balanceOf(recipientAccount) + await token.mint(foreignBridge.address, oneEther) // tx 1 const value = ether('0.25') @@ -269,7 +341,6 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled // tx 2 - await token.mint(foreignBridge.address, value) const transactionHash2 = '0x77a496628a776a03d58d7e6059a5937f04bebd8ba4ff89f76dd4bb8ba7e291ee' const message2 = createMessage(recipientAccount, value, transactionHash2, foreignBridge.address) const signature2 = await sign(authorities[0], message2) @@ -309,44 +380,89 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.rejectedWith(ERROR_MSG) }) - it('should not allow withdraw over home max tx limit', async () => { - const recipientAccount = accounts[3] - const invalidValue = ether('0.75') - await token.mint(foreignBridge.address, ether('5')) + const shouldNotAllowWithdrawOverHomeMaxTxLimit = isRelativeDailyLimit => + async function() { + foreignBridge = await ForeignBridgeErcToNativeMock.new() + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + otherSideBridge.address, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.mint(foreignBridge.address, value) - const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' - const message = createMessage(recipientAccount, invalidValue, transactionHash, foreignBridge.address) - const signature = await sign(authorities[0], message) - const vrs = signatureToVRS(signature) + const recipientAccount = accounts[3] + const invalidValue = ether('0.75') + await token.mint(foreignBridge.address, ether('5')) - await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.rejectedWith(ERROR_MSG) - }) + const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' + const message = createMessage(recipientAccount, invalidValue, transactionHash, foreignBridge.address) + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature) - it('should not allow withdraw over daily home limit', async () => { - const recipientAccount = accounts[3] - await token.mint(foreignBridge.address, ether('5')) + await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.rejectedWith(ERROR_MSG) + } - const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' - const message = createMessage(recipientAccount, halfEther, transactionHash, foreignBridge.address) - const signature = await sign(authorities[0], message) - const vrs = signatureToVRS(signature) + it('should not allow withdraw over home max tx limit', shouldNotAllowWithdrawOverHomeMaxTxLimit(false)) + it( + 'should not allow withdraw over home max tx limit (relative limit)', + shouldNotAllowWithdrawOverHomeMaxTxLimit(true) + ) - await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled + const shouldNotAllowWithdrawOverDailyHomeLimit = isRelativeDailyLimit => + async function() { + foreignBridge = await ForeignBridgeErcToNativeMock.new() + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + otherSideBridge.address, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) - const transactionHash2 = '0x69debd8fd1923c9cb3cd8ef6461e2740b2d037943b941729d5a47671a2bb8712' - const message2 = createMessage(recipientAccount, halfEther, transactionHash2, foreignBridge.address) - const signature2 = await sign(authorities[0], message2) - const vrs2 = signatureToVRS(signature2) + const recipientAccount = accounts[3] + await token.mint(foreignBridge.address, ether('1.25')) + + const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' + const message = createMessage(recipientAccount, halfEther, transactionHash, foreignBridge.address) + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature) - await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.fulfilled + await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled - const transactionHash3 = '0x022695428093bb292db8e48bd1417c5e1b84c0bf673bd0fff23ed0fb6495b872' - const message3 = createMessage(recipientAccount, halfEther, transactionHash3, foreignBridge.address) - const signature3 = await sign(authorities[0], message3) - const vrs3 = signatureToVRS(signature3) + const transactionHash2 = '0x69debd8fd1923c9cb3cd8ef6461e2740b2d037943b941729d5a47671a2bb8712' + const message2 = createMessage(recipientAccount, halfEther, transactionHash2, foreignBridge.address) + const signature2 = await sign(authorities[0], message2) + const vrs2 = signatureToVRS(signature2) - await foreignBridge.executeSignatures([vrs3.v], [vrs3.r], [vrs3.s], message3).should.be.rejectedWith(ERROR_MSG) - }) + await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.fulfilled + + const transactionHash3 = '0x022695428093bb292db8e48bd1417c5e1b84c0bf673bd0fff23ed0fb6495b872' + const message3 = createMessage(recipientAccount, halfEther, transactionHash3, foreignBridge.address) + const signature3 = await sign(authorities[0], message3) + const vrs3 = signatureToVRS(signature3) + + await foreignBridge.executeSignatures([vrs3.v], [vrs3.r], [vrs3.s], message3).should.be.rejectedWith(ERROR_MSG) + } + + it('should not allow withdraw over daily home limit', shouldNotAllowWithdrawOverDailyHomeLimit(false)) + it( + 'should not allow withdraw over daily home limit (relative limit)', + shouldNotAllowWithdrawOverDailyHomeLimit(true) + ) }) describe('#withdraw with 2 minimum signatures', async () => { let multisigValidatorContract @@ -368,14 +484,15 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, decimalShiftZero, otherSideBridge.address, + absoluteLimitsContract.address, { from: ownerOfValidatorContract } ) - await token.mint(foreignBridgeWithMultiSignatures.address, value) + await token.mint(foreignBridgeWithMultiSignatures.address, oneEther) }) it('withdraw should fail if not enough signatures are provided', async () => { @@ -402,10 +519,9 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { [vrs.s, vrs2.s], message ).should.be.fulfilled - - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipientAccount) - logs[0].args.value.should.be.bignumber.equal(value) + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipientAccount) + event.args.value.should.be.bignumber.equal(value) true.should.be.equal(await foreignBridgeWithMultiSignatures.relayedMessages(transactionHash)) }) @@ -436,13 +552,14 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { erc20Token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, decimalShiftZero, - otherSideBridge.address + otherSideBridge.address, + absoluteLimitsContract.address ) - await erc20Token.mint(foreignBridgeWithThreeSigs.address, value) + await erc20Token.mint(foreignBridgeWithThreeSigs.address, oneEther) const txHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' const message = createMessage(recipient, value, txHash, foreignBridgeWithThreeSigs.address) @@ -465,9 +582,9 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { [vrs.s, vrs2.s, vrs3.s], message ).should.be.fulfilled - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipient) - logs[0].args.value.should.be.bignumber.equal(value) + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipient) + event.args.value.should.be.bignumber.equal(value) true.should.be.equal(await foreignBridgeWithThreeSigs.relayedMessages(txHash)) }) it('works with max allowed number of signatures required', async () => { @@ -487,11 +604,12 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { erc20Token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, decimalShiftZero, - otherSideBridge.address + otherSideBridge.address, + absoluteLimitsContract.address ) await erc20Token.mint(foreignBridgeWithMaxSigs.address, value) @@ -540,11 +658,12 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, decimalShiftZero, - otherSideBridge.address + otherSideBridge.address, + absoluteLimitsContract.address ) // Deploy V2 @@ -567,10 +686,11 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { requireBlockConfirmations, gasPrice, ['3', '2', '1'], - ['3', '2'], + ['3', '2', '1'], owner, decimalShiftZero, - otherSideBridge.address + otherSideBridge.address, + absoluteLimitsContract.address ) .encodeABI() @@ -582,41 +702,45 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { }) }) describe('#claimTokens', async () => { - it('can send erc20', async () => { - const owner = accounts[0] - token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) - const foreignBridgeImpl = await ForeignBridge.new() - const storageProxy = await EternalStorageProxy.new().should.be.fulfilled - await storageProxy.upgradeTo('1', foreignBridgeImpl.address).should.be.fulfilled - const foreignBridge = await ForeignBridge.at(storageProxy.address) + const canSendErc20 = isRelativeDailyLimit => + async function() { + const owner = accounts[0] + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + const foreignBridgeImpl = await ForeignBridge.new() + const storageProxy = await EternalStorageProxy.new().should.be.fulfilled + await storageProxy.upgradeTo('1', foreignBridgeImpl.address).should.be.fulfilled + const foreignBridge = await ForeignBridge.at(storageProxy.address) - await foreignBridge.initialize( - validatorContract.address, - token.address, - requireBlockConfirmations, - gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridge.address - ) - const tokenSecond = await ERC677BridgeToken.new('Roman Token', 'RST', 18) + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + otherSideBridge.address, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + const tokenSecond = await ERC677BridgeToken.new('Roman Token', 'RST', 18) - await tokenSecond.mint(accounts[0], halfEther).should.be.fulfilled - expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(halfEther) + await tokenSecond.mint(accounts[0], halfEther).should.be.fulfilled + expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(halfEther) - await tokenSecond.transfer(foreignBridge.address, halfEther) - expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(ZERO) - expect(await tokenSecond.balanceOf(foreignBridge.address)).to.be.bignumber.equal(halfEther) + await tokenSecond.transfer(foreignBridge.address, halfEther) + expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(ZERO) + expect(await tokenSecond.balanceOf(foreignBridge.address)).to.be.bignumber.equal(halfEther) - await foreignBridge - .claimTokens(tokenSecond.address, accounts[3], { from: accounts[3] }) - .should.be.rejectedWith(ERROR_MSG) - await foreignBridge.claimTokens(tokenSecond.address, accounts[3], { from: owner }) - expect(await tokenSecond.balanceOf(foreignBridge.address)).to.be.bignumber.equal(ZERO) - expect(await tokenSecond.balanceOf(accounts[3])).to.be.bignumber.equal(halfEther) - }) + await foreignBridge + .claimTokens(tokenSecond.address, accounts[3], { from: accounts[3] }) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge.claimTokens(tokenSecond.address, accounts[3], { from: owner }) + expect(await tokenSecond.balanceOf(foreignBridge.address)).to.be.bignumber.equal(ZERO) + expect(await tokenSecond.balanceOf(accounts[3])).to.be.bignumber.equal(halfEther) + } + it('can send erc20', canSendErc20(false)) + it('can send erc20 (relative limit)', canSendErc20(true)) }) describe('#decimalShift', async () => { const decimalShiftTwo = 2 @@ -638,16 +762,18 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, decimalShiftTwo, - otherSideBridge.address + otherSideBridge.address, + absoluteLimitsContract.address ) - await token.mint(foreignBridge.address, valueOnForeign) + await token.mint(foreignBridge.address, valueOnHome.mul(toBN('2'))) const recipientAccount = accounts[3] const balanceBefore = await token.balanceOf(recipientAccount) + const balanceBridgeBefore = await token.balanceOf(foreignBridge.address) const transactionHash = '0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80' const message = createMessage(recipientAccount, valueOnHome, transactionHash, foreignBridge.address) @@ -656,14 +782,13 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) const { logs } = await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled - - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipientAccount) - logs[0].args.value.should.be.bignumber.equal(valueOnHome) + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipientAccount) + event.args.value.should.be.bignumber.equal(valueOnHome) const balanceAfter = await token.balanceOf(recipientAccount) balanceAfter.should.be.bignumber.equal(balanceBefore.add(valueOnForeign)) - const balanceAfterBridge = await token.balanceOf(foreignBridge.address) - balanceAfterBridge.should.be.bignumber.equal(ZERO) + const balanceBridgeAfter = await token.balanceOf(foreignBridge.address) + balanceBridgeAfter.should.be.bignumber.equal(balanceBridgeBefore.sub(valueOnForeign)) true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) }) @@ -685,16 +810,18 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, decimalShiftTwo, otherSideBridge.address, + absoluteLimitsContract.address, { from: ownerOfValidatorContract } ) - await token.mint(foreignBridgeWithMultiSignatures.address, valueOnForeign) + await token.mint(foreignBridgeWithMultiSignatures.address, valueOnHome.mul(toBN('2'))) const balanceBefore = await token.balanceOf(recipient) + const balanceBridgeBefore = await token.balanceOf(foreignBridgeWithMultiSignatures.address) const txHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' const message = createMessage(recipient, valueOnHome, txHash, foreignBridgeWithMultiSignatures.address) @@ -713,13 +840,14 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { [vrs.s, vrs2.s], message ).should.be.fulfilled - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipient) - logs[0].args.value.should.be.bignumber.equal(valueOnHome) + const event = logs.find(item => item.event === 'RelayedMessage') + event.event.should.be.equal('RelayedMessage') + event.args.recipient.should.be.equal(recipient) + event.args.value.should.be.bignumber.equal(valueOnHome) const balanceAfter = await token.balanceOf(recipient) balanceAfter.should.be.bignumber.equal(balanceBefore.add(valueOnForeign)) - const balanceAfterBridge = await token.balanceOf(foreignBridgeWithMultiSignatures.address) - balanceAfterBridge.should.be.bignumber.equal(ZERO) + const balanceBridgeAfter = await token.balanceOf(foreignBridgeWithMultiSignatures.address) + balanceBridgeAfter.should.be.bignumber.equal(balanceBridgeBefore.sub(valueOnForeign)) true.should.be.equal(await foreignBridgeWithMultiSignatures.relayedMessages(txHash)) }) }) @@ -736,46 +864,65 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { token.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, decimalShiftZero, - otherSideBridge.address + otherSideBridge.address, + absoluteLimitsContract.address ) await token.mint(user, ether('2')) }) - it('should allow to bridge tokens using approve and relayTokens', async () => { - // Given - const currentDay = await foreignBridge.getCurrentDay() - expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) + const shouldAllowToBridgeTokens = isRelativeDailyLimit => + async function() { + foreignBridge = await ForeignBridge.new() + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + otherSideBridge.address, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.mint(user, ether('2')) + // Given + const currentDay = await foreignBridge.getCurrentDay() + expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, value, { - from: user - }).should.be.rejectedWith(ERROR_MSG) + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, value, { + from: user + }).should.be.rejectedWith(ERROR_MSG) - await token.approve(foreignBridge.address, value, { from: user }).should.be.fulfilled + await token.approve(foreignBridge.address, value, { from: user }).should.be.fulfilled - // When - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, ZERO_ADDRESS, value, { - from: user - }).should.be.rejectedWith(ERROR_MSG) - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, foreignBridge.address, value, { - from: user - }).should.be.rejectedWith(ERROR_MSG) - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, user, 0, { - from: user - }).should.be.rejectedWith(ERROR_MSG) - const { logs } = await foreignBridge.methods['relayTokens(address,address,uint256)'](user, user, value, { - from: user - }).should.be.fulfilled + // When + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, ZERO_ADDRESS, value, { + from: user + }).should.be.rejectedWith(ERROR_MSG) + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, foreignBridge.address, value, { + from: user + }).should.be.rejectedWith(ERROR_MSG) + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, user, 0, { + from: user + }).should.be.rejectedWith(ERROR_MSG) + const { logs } = await foreignBridge.methods['relayTokens(address,address,uint256)'](user, user, value, { + from: user + }).should.be.fulfilled - // Then - expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(value) - expectEventInLogs(logs, 'UserRequestForAffirmation', { - recipient: user, - value - }) - }) + // Then + expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(value) + expectEventInLogs(logs, 'UserRequestForAffirmation', { + recipient: user, + value + }) + } + it('should allow to bridge tokens using approve and relayTokens', shouldAllowToBridgeTokens(false)) + it('should allow to bridge tokens using approve and relayTokens (relative limit)', shouldAllowToBridgeTokens(true)) it('should allow to bridge tokens using approve and relayTokens with different recipient', async () => { // Given const currentDay = await foreignBridge.getCurrentDay() @@ -852,38 +999,57 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { value }) }) - it('should not be able to transfer more than limit', async () => { - // Given - const userSupply = ether('2') - const bigValue = oneEther - const smallValue = ether('0.001') - const currentDay = await foreignBridge.getCurrentDay() - expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) + const shouldNotBeAbleToTransferMoreThanLimit = isRelativeDailyLimit => + async function() { + foreignBridge = await ForeignBridge.new() + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + await foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + otherSideBridge.address, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.mint(user, ether('2')) - await token.approve(foreignBridge.address, userSupply, { from: user }).should.be.fulfilled + // Given + const userSupply = ether('2') + const bigValue = oneEther + const smallValue = ether('0.001') + const currentDay = await foreignBridge.getCurrentDay() + expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - // When - // value < minPerTx - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, smallValue, { - from: user - }).should.be.rejectedWith(ERROR_MSG) - // value > maxPerTx - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, bigValue, { - from: user - }).should.be.rejectedWith(ERROR_MSG) + await token.approve(foreignBridge.address, userSupply, { from: user }).should.be.fulfilled - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, halfEther, { from: user }) - .should.be.fulfilled - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, halfEther, { from: user }) - .should.be.fulfilled - // totalSpentPerDay > dailyLimit - await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, halfEther, { - from: user - }).should.be.rejectedWith(ERROR_MSG) + // When + // value < minPerTx + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, smallValue, { + from: user + }).should.be.rejectedWith(ERROR_MSG) + // value > maxPerTx + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, bigValue, { + from: user + }).should.be.rejectedWith(ERROR_MSG) + + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, halfEther, { from: user }) + .should.be.fulfilled + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, halfEther, { from: user }) + .should.be.fulfilled + // totalSpentPerDay > dailyLimit + await foreignBridge.methods['relayTokens(address,address,uint256)'](user, recipient, halfEther, { + from: user + }).should.be.rejectedWith(ERROR_MSG) - // Then - expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(oneEther) - }) + // Then + expect(await foreignBridge.totalSpentPerDay(currentDay)).to.be.bignumber.equal(oneEther) + } + it('should not be able to transfer more than limit', shouldNotBeAbleToTransferMoreThanLimit(false)) + it('should not be able to transfer more than limit (relative limit)', shouldNotBeAbleToTransferMoreThanLimit(true)) it('should allow to call relayTokens without specifying the sender', async () => { // Given await foreignBridge.methods['relayTokens(address,uint256)'](recipient, value, { @@ -922,11 +1088,12 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { sai.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, decimalShiftZero, - otherSideBridge.address + otherSideBridge.address, + absoluteLimitsContract.address ) // Mint the bridge some sai tokens @@ -975,11 +1142,12 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { dai.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, decimalShiftZero, - otherSideBridge.address + otherSideBridge.address, + absoluteLimitsContract.address ) // Mint sai tokens to a user @@ -1280,11 +1448,12 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { dai.address, requireBlockConfirmations, gasPrice, - [dailyLimit, maxPerTx, minPerTx], - [homeDailyLimit, homeMaxPerTx], + requestLimitsArray, + executionLimitsArray, owner, decimalShiftZero, - otherSideBridge.address + otherSideBridge.address, + absoluteLimitsContract.address ) expect(await saiTop.caged()).to.be.bignumber.equal(ZERO) @@ -1313,4 +1482,83 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { }) }) }) + describe('#executionDailyLimit (relative)', () => { + let token + let foreignBridge + + function initialize(customExecutionLimitsArray) { + return foreignBridge.initialize( + validatorContract.address, + token.address, + requireBlockConfirmations, + gasPrice, + requestLimitsArray, + customExecutionLimitsArray, + owner, + decimalShiftZero, + otherSideBridge.address, + relativeLimitsContract.address + ).should.be.fulfilled + } + + beforeEach(async () => { + token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + foreignBridge = await ForeignBridge.new() + }) + it('should be calculated correctly - 1', async () => { + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(accounts[0], halfEther).should.be.fulfilled + await token.mint(foreignBridge.address, halfEther).should.be.fulfilled + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(halfEther) + expect(await token.totalSupply()).to.be.bignumber.equal(oneEther) + + const limit = await foreignBridge.executionDailyLimit() + const expectedLimit = calculateDailyLimit(halfEther, targetLimit, threshold, homeMinPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + it('should be calculated correctly - 2', async function() { + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(accounts[0], halfEther).should.be.fulfilled + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(ZERO) + expect(await token.totalSupply()).to.be.bignumber.equal(halfEther) + + const limit = await foreignBridge.executionDailyLimit() + expect(limit).to.be.bignumber.equal(ZERO) + }) + it('should be calculated correctly - 3', async function() { + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(foreignBridge.address, homeMinPerTx).should.be.fulfilled + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(homeMinPerTx) + + const limit = await foreignBridge.executionDailyLimit() + expect(limit).to.be.bignumber.equal(homeMinPerTx) + }) + it('should be calculated correctly - 4', async function() { + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(foreignBridge.address, threshold).should.be.fulfilled + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(threshold) + + const limit = await foreignBridge.executionDailyLimit() + expect(limit).to.be.bignumber.equal(threshold.mul(targetLimit).div(oneEther)) + }) + it('should be calculated correctly - 5', async function() { + const amountToMint = ether('5') + const targetLimit = ether('0.06') + const threshold = ether('100') + const homeMinPerTx = ether('0.1') + + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(foreignBridge.address, amountToMint).should.be.fulfilled + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(amountToMint) + + const limit = await foreignBridge.executionDailyLimit() + const expectedLimit = calculateDailyLimit(amountToMint, targetLimit, threshold, homeMinPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + }) }) diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index 32d6fc666..d84068147 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -7,292 +7,401 @@ const RewardableValidators = artifacts.require('RewardableValidators.sol') const FeeManagerErcToNative = artifacts.require('FeeManagerErcToNative.sol') const FeeManagerErcToNativePOSDAO = artifacts.require('FeeManagerErcToNativePOSDAO') const FeeManagerMock = artifacts.require('FeeManagerMock') +const AbsoluteDailyLimit = artifacts.require('AbsoluteDailyLimit.sol') +const RelativeDailyLimit = artifacts.require('RelativeDailyLimit.sol') const { expect } = require('chai') +const { expectEvent } = require('@openzeppelin/test-helpers') const { ERROR_MSG, ZERO_ADDRESS, toBN } = require('../setup') -const { createMessage, sign, ether, expectEventInLogs, createAccounts } = require('../helpers/helpers') +const { + createMessage, + sign, + ether, + expectEventInLogs, + calculateDailyLimit, + createAccounts +} = require('../helpers/helpers') -const minPerTx = ether('0.01') const requireBlockConfirmations = 8 const gasPrice = web3.utils.toWei('1', 'gwei') const quarterEther = ether('0.25') const oneEther = ether('1') const halfEther = ether('0.5') +const minPerTx = ether('0.01') +const maxPerTx = halfEther const foreignDailyLimit = oneEther const foreignMaxPerTx = halfEther +const foreignMinPerTx = quarterEther const ZERO = toBN(0) const MAX_GAS = 8000000 const MAX_VALIDATORS = 50 const decimalShiftZero = 0 +const targetLimit = ether('0.05') +const threshold = ether('10000') contract('HomeBridge_ERC20_to_Native', async accounts => { + const isRelativeDailyLimit = false + + const limitsArray = [oneEther, halfEther, minPerTx] + const relativeLimitsArray = [targetLimit, threshold, halfEther, minPerTx] + let homeContract let validatorContract let blockRewardContract let authorities let owner + let absoluteLimitsContract + let relativeLimitsContract + before(async () => { validatorContract = await BridgeValidators.new() blockRewardContract = await BlockReward.new() authorities = [accounts[1]] owner = accounts[0] await validatorContract.initialize(1, authorities, owner) + absoluteLimitsContract = await AbsoluteDailyLimit.new() + relativeLimitsContract = await RelativeDailyLimit.new() }) - describe('#initialize', async () => { - beforeEach(async () => { - homeContract = await HomeBridge.new() - }) - it('sets variables', async () => { - expect(await homeContract.validatorContract()).to.be.equal(ZERO_ADDRESS) - expect(await homeContract.deployedAtBlock()).to.be.bignumber.equal(ZERO) - expect(await homeContract.dailyLimit()).to.be.bignumber.equal(ZERO) - expect(await homeContract.maxPerTx()).to.be.bignumber.equal(ZERO) - expect(await homeContract.decimalShift()).to.be.bignumber.equal(ZERO) - expect(await homeContract.isInitialized()).to.be.equal(false) - expect(await homeContract.blockRewardContract()).to.be.equal(ZERO_ADDRESS) - - const { logs } = await homeContract.initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], - owner, - '9' - ).should.be.fulfilled - - expect(await homeContract.isInitialized()).to.be.equal(true) - expect(await homeContract.validatorContract()).to.be.equal(validatorContract.address) - expect(await homeContract.deployedAtBlock()).to.be.bignumber.above(ZERO) - expect(await homeContract.dailyLimit()).to.be.bignumber.equal('3') - expect(await homeContract.maxPerTx()).to.be.bignumber.equal('2') - expect(await homeContract.minPerTx()).to.be.bignumber.equal('1') - expect(await homeContract.decimalShift()).to.be.bignumber.equal('9') - expect(await homeContract.blockRewardContract()).to.be.equal(blockRewardContract.address) - expect(await homeContract.gasPrice()).to.be.bignumber.equal(gasPrice) - const bridgeMode = '0x18762d46' // 4 bytes of keccak256('erc-to-native-core') - expect(await homeContract.getBridgeMode()).to.be.equal(bridgeMode) - const { major, minor, patch } = await homeContract.getBridgeInterfacesVersion() - expect(major).to.be.bignumber.gte(ZERO) - expect(minor).to.be.bignumber.gte(ZERO) - expect(patch).to.be.bignumber.gte(ZERO) - - expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { - requiredBlockConfirmations: toBN(requireBlockConfirmations) + const initialize = isRelativeDailyLimit => + async function() { + const limitsArray = isRelativeDailyLimit ? ['1', '3', '2', '1'] : ['3', '2', '1'] + let limitsContract + + beforeEach(async () => { + homeContract = await HomeBridge.new() + limitsContract = isRelativeDailyLimit ? relativeLimitsContract : absoluteLimitsContract }) - expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) - expectEventInLogs(logs, 'ExecutionDailyLimitChanged', { newLimit: foreignDailyLimit }) - expectEventInLogs(logs, 'DailyLimitChanged', { newLimit: '3' }) - }) - - it('can update block reward contract', async () => { - ZERO_ADDRESS.should.be.equal(await homeContract.blockRewardContract()) - - await homeContract.initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ).should.be.fulfilled - - blockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) - - const secondBlockRewardContract = await BlockReward.new() - await homeContract.setBlockRewardContract(secondBlockRewardContract.address) - secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) - - const thirdBlockRewardContract = await BlockReward.new() - await homeContract - .setBlockRewardContract(thirdBlockRewardContract.address, { from: accounts[4] }) - .should.be.rejectedWith(ERROR_MSG) - secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) - - const notAContract = accounts[5] - await homeContract.setBlockRewardContract(notAContract).should.be.rejectedWith(ERROR_MSG) - secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) - - await homeContract.setBlockRewardContract(validatorContract.address).should.be.rejectedWith(ERROR_MSG) - secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) - - const oldBlockRewardContract = await OldBlockReward.new() - await homeContract.setBlockRewardContract(oldBlockRewardContract.address).should.be.fulfilled - oldBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) - }) - - it('cant set maxPerTx > dailyLimit', async () => { - false.should.be.equal(await homeContract.isInitialized()) - - await homeContract - .initialize( - validatorContract.address, - ['1', '2', '1'], - gasPrice, - requireBlockConfirmations, - blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) - await homeContract - .initialize( + it('sets variables', async () => { + expect(await homeContract.validatorContract()).to.be.equal(ZERO_ADDRESS) + expect(await homeContract.deployedAtBlock()).to.be.bignumber.equal(ZERO) + expect(await homeContract.decimalShift()).to.be.bignumber.equal(ZERO) + expect(await homeContract.isInitialized()).to.be.equal(false) + expect(await homeContract.blockRewardContract()).to.be.equal(ZERO_ADDRESS) + + const { logs, tx } = await homeContract.initialize( validatorContract.address, - ['3', '2', '2'], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) + '9', + limitsContract.address + ).should.be.fulfilled + + expect(await homeContract.isInitialized()).to.be.equal(true) + expect(await homeContract.validatorContract()).to.be.equal(validatorContract.address) + expect(await homeContract.deployedAtBlock()).to.be.bignumber.above(ZERO) + if (!isRelativeDailyLimit) { + expect(await homeContract.dailyLimit()).to.be.bignumber.equal('3') + } + expect(await homeContract.maxPerTx()).to.be.bignumber.equal('2') + expect(await homeContract.minPerTx()).to.be.bignumber.equal('1') + expect(await homeContract.decimalShift()).to.be.bignumber.equal('9') + expect(await homeContract.blockRewardContract()).to.be.equal(blockRewardContract.address) + expect(await homeContract.gasPrice()).to.be.bignumber.equal(gasPrice) + const bridgeMode = '0x18762d46' // 4 bytes of keccak256('erc-to-native-core') + expect(await homeContract.getBridgeMode()).to.be.equal(bridgeMode) + const { major, minor, patch } = await homeContract.getBridgeInterfacesVersion() + expect(major).to.be.bignumber.gte(ZERO) + expect(minor).to.be.bignumber.gte(ZERO) + expect(patch).to.be.bignumber.gte(ZERO) + + expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { + requiredBlockConfirmations: toBN(requireBlockConfirmations) + }) + expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) + await expectEvent.inTransaction(tx, limitsContract, 'ExecutionDailyLimitChanged', { + newLimit: foreignDailyLimit.toString() + }) + if (!isRelativeDailyLimit) { + await expectEvent.inTransaction(tx, limitsContract, 'DailyLimitChanged', { newLimit: '3' }) + } + }) - false.should.be.equal(await homeContract.isInitialized()) - }) + it('can update block reward contract', async () => { + ZERO_ADDRESS.should.be.equal(await homeContract.blockRewardContract()) - it('can be deployed via upgradeToAndCall', async () => { - const storageProxy = await EternalStorageProxy.new().should.be.fulfilled - const data = homeContract.contract.methods - .initialize( + await homeContract.initialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - ['3', '2'], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero - ) - .encodeABI() + decimalShiftZero, + limitsContract.address + ).should.be.fulfilled - await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled - const finalContract = await HomeBridge.at(storageProxy.address) + blockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) - expect(await finalContract.isInitialized()).to.be.equal(true) - expect(await finalContract.validatorContract()).to.be.equal(validatorContract.address) - expect(await finalContract.dailyLimit()).to.be.bignumber.equal('3') - expect(await finalContract.maxPerTx()).to.be.bignumber.equal('2') - expect(await finalContract.minPerTx()).to.be.bignumber.equal('1') - expect(await finalContract.blockRewardContract()).to.be.equal(blockRewardContract.address) - }) - it('can be upgraded keeping the state', async () => { - const homeOwner = accounts[8] - const storageProxy = await EternalStorageProxy.new().should.be.fulfilled - const data = homeContract.contract.methods - .initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - blockRewardContract.address, - ['3', '2'], - homeOwner, - decimalShiftZero - ) - .encodeABI() + const secondBlockRewardContract = await BlockReward.new() + await homeContract.setBlockRewardContract(secondBlockRewardContract.address) + secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) - await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled - const finalContract = await HomeBridge.at(storageProxy.address) + const thirdBlockRewardContract = await BlockReward.new() + await homeContract + .setBlockRewardContract(thirdBlockRewardContract.address, { from: accounts[4] }) + .should.be.rejectedWith(ERROR_MSG) + secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) - expect(await finalContract.isInitialized()).to.be.equal(true) - expect(await finalContract.validatorContract()).to.be.equal(validatorContract.address) - expect(await finalContract.dailyLimit()).to.be.bignumber.equal('3') - expect(await finalContract.maxPerTx()).to.be.bignumber.equal('2') - expect(await finalContract.minPerTx()).to.be.bignumber.equal('1') - expect(await finalContract.blockRewardContract()).to.be.equal(blockRewardContract.address) + const notAContract = accounts[5] + await homeContract.setBlockRewardContract(notAContract).should.be.rejectedWith(ERROR_MSG) + secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) - const homeContractV2 = await HomeBridge.new() - await storageProxy.upgradeTo('2', homeContractV2.address).should.be.fulfilled - const finalContractV2 = await HomeBridge.at(storageProxy.address) + await homeContract.setBlockRewardContract(validatorContract.address).should.be.rejectedWith(ERROR_MSG) + secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) - expect(await finalContractV2.isInitialized()).to.be.equal(true) - expect(await finalContractV2.validatorContract()).to.be.equal(validatorContract.address) - expect(await finalContractV2.dailyLimit()).to.be.bignumber.equal('3') - expect(await finalContractV2.maxPerTx()).to.be.bignumber.equal('2') - expect(await finalContractV2.minPerTx()).to.be.bignumber.equal('1') - expect(await finalContractV2.blockRewardContract()).to.be.equal(blockRewardContract.address) - }) - it('cant initialize with invalid arguments', async () => { - false.should.be.equal(await homeContract.isInitialized()) - await homeContract - .initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - 0, - blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) - await homeContract - .initialize( - owner, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) - await homeContract - .initialize( - ZERO_ADDRESS, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) - await homeContract - .initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - owner, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) - await homeContract - .initialize( + const oldBlockRewardContract = await OldBlockReward.new() + await homeContract.setBlockRewardContract(oldBlockRewardContract.address).should.be.fulfilled + oldBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) + }) + + it('cant set maxPerTx > dailyLimit', async () => { + false.should.be.equal(await homeContract.isInitialized()) + + if (isRelativeDailyLimit) { + await homeContract + .initialize( + validatorContract.address, + [ether('2'), '3', '2', '1'], + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await homeContract + .initialize( + validatorContract.address, + ['1', '1', '3', '2'], + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + } else { + await homeContract + .initialize( + validatorContract.address, + ['1', '2', '1'], + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + } + await homeContract + .initialize( + validatorContract.address, + isRelativeDailyLimit ? ['1', '3', '2', '2'] : ['3', '2', '2'], + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + + false.should.be.equal(await homeContract.isInitialized()) + }) + + it('can be deployed via upgradeToAndCall', async () => { + const storageProxy = await EternalStorageProxy.new().should.be.fulfilled + const data = homeContract.contract.methods + .initialize( + validatorContract.address, + limitsArray, + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + ['3', '2', '1'], + owner, + decimalShiftZero, + limitsContract.address + ) + .encodeABI() + + await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled + const finalContract = await HomeBridge.at(storageProxy.address) + + expect(await finalContract.isInitialized()).to.be.equal(true) + expect(await finalContract.validatorContract()).to.be.equal(validatorContract.address) + if (!isRelativeDailyLimit) { + expect(await finalContract.dailyLimit()).to.be.bignumber.equal('3') + } + expect(await finalContract.maxPerTx()).to.be.bignumber.equal('2') + expect(await finalContract.minPerTx()).to.be.bignumber.equal('1') + expect(await finalContract.blockRewardContract()).to.be.equal(blockRewardContract.address) + }) + it('can be upgraded keeping the state', async () => { + const homeOwner = accounts[8] + const storageProxy = await EternalStorageProxy.new().should.be.fulfilled + const data = homeContract.contract.methods + .initialize( + validatorContract.address, + limitsArray, + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + ['3', '2', '1'], + homeOwner, + decimalShiftZero, + limitsContract.address + ) + .encodeABI() + + await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled + const finalContract = await HomeBridge.at(storageProxy.address) + + expect(await finalContract.isInitialized()).to.be.equal(true) + expect(await finalContract.validatorContract()).to.be.equal(validatorContract.address) + if (!isRelativeDailyLimit) { + expect(await finalContract.dailyLimit()).to.be.bignumber.equal('3') + } + expect(await finalContract.maxPerTx()).to.be.bignumber.equal('2') + expect(await finalContract.minPerTx()).to.be.bignumber.equal('1') + expect(await finalContract.blockRewardContract()).to.be.equal(blockRewardContract.address) + + const homeContractV2 = await HomeBridge.new() + await storageProxy.upgradeTo('2', homeContractV2.address).should.be.fulfilled + const finalContractV2 = await HomeBridge.at(storageProxy.address) + + expect(await finalContractV2.isInitialized()).to.be.equal(true) + expect(await finalContractV2.validatorContract()).to.be.equal(validatorContract.address) + if (!isRelativeDailyLimit) { + expect(await finalContractV2.dailyLimit()).to.be.bignumber.equal('3') + } + expect(await finalContractV2.maxPerTx()).to.be.bignumber.equal('2') + expect(await finalContractV2.minPerTx()).to.be.bignumber.equal('1') + expect(await finalContractV2.blockRewardContract()).to.be.equal(blockRewardContract.address) + }) + it('cant initialize with invalid arguments', async () => { + false.should.be.equal(await homeContract.isInitialized()) + await homeContract + .initialize( + validatorContract.address, + limitsArray, + gasPrice, + 0, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await homeContract + .initialize( + owner, + limitsArray, + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await homeContract + .initialize( + ZERO_ADDRESS, + limitsArray, + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await homeContract + .initialize( + validatorContract.address, + limitsArray, + gasPrice, + requireBlockConfirmations, + owner, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await homeContract + .initialize( + validatorContract.address, + limitsArray, + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [halfEther, oneEther, quarterEther], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await homeContract + .initialize( + validatorContract.address, + limitsArray, + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [oneEther, halfEther, halfEther], + owner, + decimalShiftZero, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await homeContract + .initialize( + validatorContract.address, + limitsArray, + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + ZERO_ADDRESS + ) + .should.be.rejectedWith(ERROR_MSG) + await homeContract.initialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [halfEther, oneEther], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero - ) - .should.be.rejectedWith(ERROR_MSG) - await homeContract.initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ).should.be.fulfilled - true.should.be.equal(await homeContract.isInitialized()) - }) - }) + decimalShiftZero, + limitsContract.address + ).should.be.fulfilled + true.should.be.equal(await homeContract.isInitialized()) + }) + } + describe('#initialize', initialize(false)) + describe('#initialize (relative limit)', initialize(true)) describe('#rewardableInitialize', async () => { + const limitsArray = ['3', '2', '1'] let feeManager let homeFee let foreignFee @@ -305,29 +414,30 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { it('sets variables', async () => { expect(await homeContract.validatorContract()).to.be.equal(ZERO_ADDRESS) expect(await homeContract.deployedAtBlock()).to.be.bignumber.equal(ZERO) - expect(await homeContract.dailyLimit()).to.be.bignumber.equal(ZERO) - expect(await homeContract.maxPerTx()).to.be.bignumber.equal(ZERO) expect(await homeContract.decimalShift()).to.be.bignumber.equal(ZERO) expect(await homeContract.isInitialized()).to.be.equal(false) expect(await homeContract.blockRewardContract()).to.be.equal(ZERO_ADDRESS) await homeContract.rewardableInitialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], - '9' + '9', + absoluteLimitsContract.address ).should.be.fulfilled expect(await homeContract.isInitialized()).to.be.equal(true) expect(await homeContract.validatorContract()).to.be.equal(validatorContract.address) expect(await homeContract.deployedAtBlock()).to.be.bignumber.above(ZERO) - expect(await homeContract.dailyLimit()).to.be.bignumber.equal('3') + if (!isRelativeDailyLimit) { + expect(await homeContract.dailyLimit()).to.be.bignumber.equal('3') + } expect(await homeContract.maxPerTx()).to.be.bignumber.equal('2') expect(await homeContract.minPerTx()).to.be.bignumber.equal('1') expect(await homeContract.decimalShift()).to.be.bignumber.equal('9') @@ -353,98 +463,120 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { await homeContract .rewardableInitialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, 0, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract .rewardableInitialize( owner, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract .rewardableInitialize( ZERO_ADDRESS, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract .rewardableInitialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, owner, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract .rewardableInitialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [halfEther, oneEther], + [halfEther, oneEther, quarterEther], owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract .rewardableInitialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [oneEther, halfEther, halfEther], + owner, + feeManager.address, + [homeFee, foreignFee], + decimalShiftZero, + absoluteLimitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await homeContract + .rewardableInitialize( + validatorContract.address, + limitsArray, + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, ZERO_ADDRESS, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract.rewardableInitialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled true.should.be.equal(await homeContract.isInitialized()) }) @@ -452,15 +584,16 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { it('can update fee contract', async () => { await homeContract.rewardableInitialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // Given @@ -477,15 +610,16 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { it('can update fee', async () => { await homeContract.rewardableInitialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // Given @@ -505,15 +639,16 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { it('fee should be less than 100%', async () => { await homeContract.rewardableInitialize( validatorContract.address, - ['3', '2', '1'], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled const invalidFee = ether('1') @@ -535,405 +670,486 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { expect(await homeContract.getForeignFee()).to.be.bignumber.equals(newForeignFee) }) }) - describe('#fallback', async () => { - beforeEach(async () => { - homeContract = await HomeBridge.new() - await homeContract.initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ) - }) + const fallback = isRelativeDailyLimit => + function() { + beforeEach(async () => { + homeContract = await HomeBridge.new() + await homeContract.initialize( + validatorContract.address, + isRelativeDailyLimit ? [targetLimit, '10000', '2', '1'] : ['3', '2', '1'], + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + }) - it('should accept native coins', async () => { - const currentDay = await homeContract.getCurrentDay() - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) + it('should accept native coins', async () => { + const currentDay = await homeContract.getCurrentDay() + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) - const minted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) - minted.should.be.bignumber.equal('10') + await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) + const minted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) + minted.should.be.bignumber.equal('10') - const { logs } = await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + const { logs } = await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled - expectEventInLogs(logs, 'UserRequestForSignature', { recipient: accounts[1], value: toBN(1) }) - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('1') - expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('1') + expectEventInLogs(logs, 'UserRequestForSignature', { recipient: accounts[1], value: toBN(1) }) + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('1') + expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('1') - const homeContractBalance = toBN(await web3.eth.getBalance(homeContract.address)) - homeContractBalance.should.be.bignumber.equal(ZERO) - }) + const homeContractBalance = toBN(await web3.eth.getBalance(homeContract.address)) + homeContractBalance.should.be.bignumber.equal(ZERO) + }) - it('should accumulate burnt coins', async () => { - await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) + it('should accumulate burnt coins', async () => { + await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) - const currentDay = await homeContract.getCurrentDay() - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) + const currentDay = await homeContract.getCurrentDay() + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled - expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('1') + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('1') - await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled - expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('2') + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('2') - await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled - expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('3') + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('3') - const homeContractBalance = toBN(await web3.eth.getBalance(homeContract.address)) - homeContractBalance.should.be.bignumber.equal(ZERO) - }) + const homeContractBalance = toBN(await web3.eth.getBalance(homeContract.address)) + homeContractBalance.should.be.bignumber.equal(ZERO) + }) - it('doesnt let you send more than daily limit', async () => { - await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) + it('doesnt let you send more than daily limit', async () => { + homeContract = await HomeBridge.new() + await homeContract.initialize( + validatorContract.address, + isRelativeDailyLimit ? [targetLimit, '20', '2', '1'] : ['3', '2', '1'], + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) - const currentDay = await homeContract.getCurrentDay() - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) + await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) - await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + const currentDay = await homeContract.getCurrentDay() + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('1') - expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('1') + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled - await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('2') + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('1') + expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('1') - await homeContract.sendTransaction({ from: accounts[1], value: 2 }).should.be.rejectedWith(ERROR_MSG) + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('2') - await homeContract.setDailyLimit(4).should.be.fulfilled - await homeContract.sendTransaction({ from: accounts[1], value: 2 }).should.be.fulfilled - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('4') - expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('4') - }) + await homeContract.sendTransaction({ from: accounts[1], value: 2 }).should.be.rejectedWith(ERROR_MSG) - it('doesnt let you send more than max amount per tx', async () => { - await blockRewardContract.addMintedTotallyByBridge(200, homeContract.address) + if (!isRelativeDailyLimit) { + await homeContract.setDailyLimit(4).should.be.fulfilled + await homeContract.sendTransaction({ from: accounts[1], value: 2 }).should.be.fulfilled + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('4') + expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('4') + } + }) - await homeContract.sendTransaction({ - from: accounts[1], - value: 1 - }).should.be.fulfilled - await homeContract - .sendTransaction({ - from: accounts[1], - value: 3 - }) - .should.be.rejectedWith(ERROR_MSG) - await homeContract.setMaxPerTx(100).should.be.rejectedWith(ERROR_MSG) - await homeContract.setDailyLimit(100).should.be.fulfilled - await homeContract.setMaxPerTx(99).should.be.fulfilled - // meets max per tx and daily limit - await homeContract.sendTransaction({ - from: accounts[1], - value: 99 - }).should.be.fulfilled - // above daily limit - await homeContract - .sendTransaction({ + it('doesnt let you send more than max amount per tx', async () => { + await blockRewardContract.addMintedTotallyByBridge(102, homeContract.address) + + await homeContract.sendTransaction({ from: accounts[1], value: 1 - }) - .should.be.rejectedWith(ERROR_MSG) - }) + }).should.be.fulfilled + await homeContract + .sendTransaction({ + from: accounts[1], + value: 3 + }) + .should.be.rejectedWith(ERROR_MSG) + if (!isRelativeDailyLimit) { + await homeContract.setMaxPerTx(100).should.be.rejectedWith(ERROR_MSG) + await homeContract.setDailyLimit(100).should.be.fulfilled + } + await homeContract.setMaxPerTx(99).should.be.fulfilled + // meets max per tx and daily limit + await homeContract.sendTransaction({ + from: accounts[1], + value: 99 + }).should.be.fulfilled + // // above daily limit + await homeContract + .sendTransaction({ + from: accounts[1], + value: 1 + }) + .should.be.rejectedWith(ERROR_MSG) + }) - it('should not let to deposit less than minPerTx', async () => { - const newDailyLimit = 100 - const newMaxPerTx = 50 - const newMinPerTx = 20 + it('should not let to deposit less than minPerTx', async () => { + const newDailyLimit = 100 + const newMaxPerTx = 50 + const newMinPerTx = 20 - await blockRewardContract.addMintedTotallyByBridge(200, homeContract.address) + await blockRewardContract.addMintedTotallyByBridge(200, homeContract.address) - await homeContract.setDailyLimit(newDailyLimit).should.be.fulfilled - await homeContract.setMaxPerTx(newMaxPerTx).should.be.fulfilled - await homeContract.setMinPerTx(newMinPerTx).should.be.fulfilled + await homeContract.setDailyLimit(newDailyLimit).should.be.fulfilled + await homeContract.setMaxPerTx(newMaxPerTx).should.be.fulfilled + await homeContract.setMinPerTx(newMinPerTx).should.be.fulfilled - await homeContract.sendTransaction({ from: accounts[1], value: newMinPerTx }).should.be.fulfilled - await homeContract - .sendTransaction({ from: accounts[1], value: newMinPerTx - 1 }) - .should.be.rejectedWith(ERROR_MSG) - }) + await homeContract.sendTransaction({ from: accounts[1], value: newMinPerTx }).should.be.fulfilled + await homeContract + .sendTransaction({ from: accounts[1], value: newMinPerTx - 1 }) + .should.be.rejectedWith(ERROR_MSG) + }) - it('should fail if not enough bridged tokens', async () => { - const initiallyMinted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) - initiallyMinted.should.be.bignumber.equal(ZERO) + it('should fail if not enough bridged tokens', async () => { + const initiallyMinted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) + initiallyMinted.should.be.bignumber.equal(ZERO) - await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.rejectedWith(ERROR_MSG) + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.rejectedWith(ERROR_MSG) - await blockRewardContract.addMintedTotallyByBridge(2, homeContract.address) + const amountToMint = isRelativeDailyLimit ? '3' : '2' + await blockRewardContract.addMintedTotallyByBridge(amountToMint, homeContract.address) - await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled - await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled - await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.rejectedWith(ERROR_MSG) + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.rejectedWith(ERROR_MSG) - const minted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) - const burnt = await homeContract.totalBurntCoins() + const minted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) + const burnt = await homeContract.totalBurntCoins() - minted.should.be.bignumber.equal('2') - burnt.should.be.bignumber.equal('2') - }) - }) - describe('#relayTokens', () => { - const recipient = accounts[7] - beforeEach(async () => { - homeContract = await HomeBridge.new() - await homeContract.initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ) - }) - it('should accept native coins and alternative receiver', async () => { - const currentDay = await homeContract.getCurrentDay() - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) + minted.should.be.bignumber.equal(amountToMint) + burnt.should.be.bignumber.equal('2') + }) + } + describe('#fallback', fallback(false)) + describe('#fallback (relative limit)', fallback(true)) + const relayTokens = isRelativeDailyLimit => + function() { + const recipient = accounts[7] + beforeEach(async () => { + homeContract = await HomeBridge.new() + await homeContract.initialize( + validatorContract.address, + isRelativeDailyLimit ? [targetLimit, '10000', '2', '1'] : ['3', '2', '1'], + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + }) + it('should accept native coins and alternative receiver', async () => { + const currentDay = await homeContract.getCurrentDay() + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) - const minted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) - minted.should.be.bignumber.equal('10') + await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) + const minted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) + minted.should.be.bignumber.equal('10') - const { logs } = await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled + const { logs } = await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled - expectEventInLogs(logs, 'UserRequestForSignature', { recipient, value: toBN(1) }) - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('1') - expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('1') + expectEventInLogs(logs, 'UserRequestForSignature', { recipient, value: toBN(1) }) + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('1') + expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('1') - const homeContractBalance = toBN(await web3.eth.getBalance(homeContract.address)) - homeContractBalance.should.be.bignumber.equal(ZERO) - }) - it('should accumulate burnt coins', async () => { - await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) + const homeContractBalance = toBN(await web3.eth.getBalance(homeContract.address)) + homeContractBalance.should.be.bignumber.equal(ZERO) + }) + it('should accumulate burnt coins', async () => { + await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) - const currentDay = await homeContract.getCurrentDay() - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) + const currentDay = await homeContract.getCurrentDay() + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled - expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('1') + await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled + expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('1') - await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled - expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('2') + await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled + expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('2') - await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled - expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('3') + await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled + expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('3') - const homeContractBalance = toBN(await web3.eth.getBalance(homeContract.address)) - homeContractBalance.should.be.bignumber.equal(ZERO) - }) - it('doesnt let you send more than daily limit', async () => { - await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) + const homeContractBalance = toBN(await web3.eth.getBalance(homeContract.address)) + homeContractBalance.should.be.bignumber.equal(ZERO) + }) + it('doesnt let you send more than daily limit', async () => { + homeContract = await HomeBridge.new() + await homeContract.initialize( + validatorContract.address, + isRelativeDailyLimit ? [targetLimit, '20', '2', '1'] : ['3', '2', '1'], + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) - const currentDay = await homeContract.getCurrentDay() - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) + const currentDay = await homeContract.getCurrentDay() + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled + await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('1') - expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('1') + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('1') + expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('1') - await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('2') + await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('2') - await homeContract.relayTokens(recipient, { from: accounts[1], value: 2 }).should.be.rejectedWith(ERROR_MSG) + await homeContract.relayTokens(recipient, { from: accounts[1], value: 2 }).should.be.rejectedWith(ERROR_MSG) - await homeContract.setDailyLimit(4).should.be.fulfilled - await homeContract.relayTokens(recipient, { from: accounts[1], value: 2 }).should.be.fulfilled - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('4') - expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('4') - }) - it('doesnt let you send more than max amount per tx', async () => { - await blockRewardContract.addMintedTotallyByBridge(200, homeContract.address) + if (!isRelativeDailyLimit) { + await homeContract.setDailyLimit(4).should.be.fulfilled + await homeContract.relayTokens(recipient, { from: accounts[1], value: 2 }).should.be.fulfilled + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('4') + expect(await homeContract.totalBurntCoins()).to.be.bignumber.equal('4') + } + }) + it('doesnt let you send more than max amount per tx', async () => { + await blockRewardContract.addMintedTotallyByBridge(102, homeContract.address) - await homeContract.relayTokens(recipient, { - from: accounts[1], - value: 1 - }).should.be.fulfilled - await homeContract - .relayTokens(recipient, { - from: accounts[1], - value: 3 - }) - .should.be.rejectedWith(ERROR_MSG) - await homeContract.setMaxPerTx(100).should.be.rejectedWith(ERROR_MSG) - await homeContract.setDailyLimit(100).should.be.fulfilled - await homeContract.setMaxPerTx(99).should.be.fulfilled - // meets max per tx and daily limit - await homeContract.relayTokens(recipient, { - from: accounts[1], - value: 99 - }).should.be.fulfilled - // above daily limit - await homeContract - .relayTokens(recipient, { + await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 - }) - .should.be.rejectedWith(ERROR_MSG) - }) - it('should not let to deposit less than minPerTx', async () => { - const newDailyLimit = 100 - const newMaxPerTx = 50 - const newMinPerTx = 20 - - await blockRewardContract.addMintedTotallyByBridge(200, homeContract.address) - - await homeContract.setDailyLimit(newDailyLimit).should.be.fulfilled - await homeContract.setMaxPerTx(newMaxPerTx).should.be.fulfilled - await homeContract.setMinPerTx(newMinPerTx).should.be.fulfilled + }).should.be.fulfilled + await homeContract + .relayTokens(recipient, { + from: accounts[1], + value: 3 + }) + .should.be.rejectedWith(ERROR_MSG) + if (!isRelativeDailyLimit) { + await homeContract.setMaxPerTx(100).should.be.rejectedWith(ERROR_MSG) + await homeContract.setDailyLimit(100).should.be.fulfilled + } + await homeContract.setMaxPerTx(99).should.be.fulfilled + // meets max per tx and daily limit + await homeContract.relayTokens(recipient, { + from: accounts[1], + value: 99 + }).should.be.fulfilled + // above daily limit + await homeContract + .relayTokens(recipient, { + from: accounts[1], + value: 1 + }) + .should.be.rejectedWith(ERROR_MSG) + }) + it('should not let to deposit less than minPerTx', async () => { + const newDailyLimit = 100 + const newMaxPerTx = 50 + const newMinPerTx = 20 + + await blockRewardContract.addMintedTotallyByBridge(200, homeContract.address) + + if (!isRelativeDailyLimit) { + await homeContract.setDailyLimit(newDailyLimit).should.be.fulfilled + } + await homeContract.setMaxPerTx(newMaxPerTx).should.be.fulfilled + await homeContract.setMinPerTx(newMinPerTx).should.be.fulfilled + + await homeContract.relayTokens(recipient, { from: accounts[1], value: newMinPerTx }).should.be.fulfilled + await homeContract + .relayTokens(recipient, { from: accounts[1], value: newMinPerTx - 1 }) + .should.be.rejectedWith(ERROR_MSG) + }) + it('should fail if not enough bridged tokens', async () => { + const initiallyMinted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) + initiallyMinted.should.be.bignumber.equal(ZERO) - await homeContract.relayTokens(recipient, { from: accounts[1], value: newMinPerTx }).should.be.fulfilled - await homeContract - .relayTokens(recipient, { from: accounts[1], value: newMinPerTx - 1 }) - .should.be.rejectedWith(ERROR_MSG) - }) - it('should fail if not enough bridged tokens', async () => { - const initiallyMinted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) - initiallyMinted.should.be.bignumber.equal(ZERO) + await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.rejectedWith(ERROR_MSG) - await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.rejectedWith(ERROR_MSG) + const amountToMint = isRelativeDailyLimit ? '3' : '2' + await blockRewardContract.addMintedTotallyByBridge(amountToMint, homeContract.address) - await blockRewardContract.addMintedTotallyByBridge(2, homeContract.address) + await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled - await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled + await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled - await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.fulfilled + await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.rejectedWith(ERROR_MSG) - await homeContract.relayTokens(recipient, { from: accounts[1], value: 1 }).should.be.rejectedWith(ERROR_MSG) + const minted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) + const burnt = await homeContract.totalBurntCoins() - const minted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) - const burnt = await homeContract.totalBurntCoins() + minted.should.be.bignumber.equal(amountToMint) + burnt.should.be.bignumber.equal('2') + }) + } + describe('#relayTokens', relayTokens(false)) + describe('#relayTokens (relative limit)', relayTokens(true)) + const settingLimits = isRelativeDailyLimit => + function() { + let homeContract + beforeEach(async () => { + homeContract = await HomeBridge.new() + await homeContract.initialize( + validatorContract.address, + isRelativeDailyLimit ? ['1', '3', '2', '1'] : ['3', '2', '1'], + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + }) + it('setMaxPerTx allows to set only to owner and cannot be more than daily limit', async () => { + await homeContract.setMaxPerTx(2, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) + await homeContract.setMaxPerTx(2, { from: owner }).should.be.fulfilled + + if (!isRelativeDailyLimit) { + await homeContract.setMaxPerTx(3, { from: owner }).should.be.rejectedWith(ERROR_MSG) + } + const maxPerTx = await homeContract.maxPerTx() + maxPerTx.should.be.bignumber.equal(toBN(2)) + }) - minted.should.be.bignumber.equal('2') - burnt.should.be.bignumber.equal('2') - }) - }) - describe('#setting limits', async () => { - let homeContract - beforeEach(async () => { - homeContract = await HomeBridge.new() - await homeContract.initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ) - }) - it('setMaxPerTx allows to set only to owner and cannot be more than daily limit', async () => { - await homeContract.setMaxPerTx(2, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) - await homeContract.setMaxPerTx(2, { from: owner }).should.be.fulfilled + it('setMinPerTx allows to set only to owner and cannot be more than daily limit and should be less than maxPerTx', async () => { + await homeContract.setMinPerTx(1, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) + await homeContract.setMinPerTx(1, { from: owner }).should.be.fulfilled - await homeContract.setMaxPerTx(3, { from: owner }).should.be.rejectedWith(ERROR_MSG) - const maxPerTx = await homeContract.maxPerTx() - maxPerTx.should.be.bignumber.equal(toBN(2)) - }) + await homeContract.setMinPerTx(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) + const minPerTx = await homeContract.minPerTx() + minPerTx.should.be.bignumber.equal(toBN(1)) + }) - it('setMinPerTx allows to set only to owner and cannot be more than daily limit and should be less than maxPerTx', async () => { - await homeContract.setMinPerTx(1, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) - await homeContract.setMinPerTx(1, { from: owner }).should.be.fulfilled + it('setMaxPerTx allows to set limit to zero', async () => { + await homeContract.setMaxPerTx(0, { from: owner }).should.be.fulfilled - await homeContract.setMinPerTx(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) - const minPerTx = await homeContract.minPerTx() - minPerTx.should.be.bignumber.equal(toBN(1)) - }) + const maxPerTx = await homeContract.maxPerTx() + maxPerTx.should.be.bignumber.equal(ZERO) + }) - it('setMaxPerTx allows to set limit to zero', async () => { - await homeContract.setMaxPerTx(0, { from: owner }).should.be.fulfilled + it('setExecutionMaxPerTx allows to set only to owner and cannot be more than execution daily limit', async () => { + const newValue = ether('0.3') - const maxPerTx = await homeContract.maxPerTx() - maxPerTx.should.be.bignumber.equal(ZERO) - }) + const initialExecutionMaxPerTx = await homeContract.executionMaxPerTx() - it('setExecutionMaxPerTx allows to set only to owner and cannot be more than execution daily limit', async () => { - const newValue = ether('0.3') + initialExecutionMaxPerTx.should.be.bignumber.not.equal(newValue) - const initialExecutionMaxPerTx = await homeContract.executionMaxPerTx() + await homeContract.setExecutionMaxPerTx(newValue, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) + await homeContract.setExecutionMaxPerTx(newValue, { from: owner }).should.be.fulfilled - initialExecutionMaxPerTx.should.be.bignumber.not.equal(newValue) + await homeContract.setExecutionMaxPerTx(oneEther, { from: owner }).should.be.rejectedWith(ERROR_MSG) + const executionMaxPerTx = await homeContract.executionMaxPerTx() + executionMaxPerTx.should.be.bignumber.equal(newValue) + }) - await homeContract.setExecutionMaxPerTx(newValue, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) - await homeContract.setExecutionMaxPerTx(newValue, { from: owner }).should.be.fulfilled + it('setExecutionMinPerTx allows to set only to owner and cannot be more than execution daily limit and should be less than executionMaxPerTx', async () => { + const newValue = ether('0.1') + await homeContract.setExecutionMinPerTx(newValue, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) + await homeContract.setExecutionMinPerTx(newValue, { from: owner }).should.be.fulfilled - await homeContract.setExecutionMaxPerTx(oneEther, { from: owner }).should.be.rejectedWith(ERROR_MSG) - const executionMaxPerTx = await homeContract.executionMaxPerTx() - executionMaxPerTx.should.be.bignumber.equal(newValue) - }) + await homeContract.setExecutionMinPerTx(ether('0.6'), { from: owner }).should.be.rejectedWith(ERROR_MSG) + const minPerTx = await homeContract.executionMinPerTx() + minPerTx.should.be.bignumber.equal(newValue) + }) - it('executionDailyLimit allows to set only to owner', async () => { - const newValue = ether('1.5') + it('executionDailyLimit allows to set only to owner', async () => { + const newValue = ether('1.5') - const initialExecutionDailyLimit = await homeContract.executionDailyLimit() + const initialExecutionDailyLimit = await homeContract.executionDailyLimit() - initialExecutionDailyLimit.should.be.bignumber.not.equal(newValue) + initialExecutionDailyLimit.should.be.bignumber.not.equal(newValue) - await homeContract.setExecutionDailyLimit(newValue, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) - await homeContract.setExecutionDailyLimit('2', { from: owner }).should.be.rejectedWith(ERROR_MSG) + await homeContract.setExecutionDailyLimit(newValue, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) + await homeContract.setExecutionDailyLimit('2', { from: owner }).should.be.rejectedWith(ERROR_MSG) - await homeContract.setExecutionDailyLimit(newValue, { from: owner }).should.be.fulfilled - expect(await homeContract.executionDailyLimit()).to.be.bignumber.equal(newValue) + await homeContract.setExecutionDailyLimit(newValue, { from: owner }).should.be.fulfilled + expect(await homeContract.executionDailyLimit()).to.be.bignumber.equal(newValue) - await homeContract.setExecutionDailyLimit(0, { from: owner }).should.be.fulfilled - expect(await homeContract.executionDailyLimit()).to.be.bignumber.equal(ZERO) + await homeContract.setExecutionDailyLimit(0, { from: owner }).should.be.fulfilled + expect(await homeContract.executionDailyLimit()).to.be.bignumber.equal(ZERO) - await homeContract.setExecutionDailyLimit(newValue, { from: owner }).should.be.fulfilled - expect(await homeContract.executionDailyLimit()).to.be.bignumber.equal(newValue) - }) - }) + await homeContract.setExecutionDailyLimit(newValue, { from: owner }).should.be.fulfilled + expect(await homeContract.executionDailyLimit()).to.be.bignumber.equal(newValue) + }) + } + describe('#setting limits', settingLimits(false)) + describe('#setting limits (relative limit)', settingLimits(true)) describe('#executeAffirmation', async () => { let homeBridge beforeEach(async () => { homeBridge = await HomeBridge.new() await homeBridge.initialize( validatorContract.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) await blockRewardContract.sendTransaction({ from: accounts[2], value: oneEther }).should.be.fulfilled }) + const shouldAllowValidatorToExecuteAffirmation = isRelativeDailyLimit => + async function() { + homeBridge = await HomeBridge.new() + await homeBridge.initialize( + validatorContract.address, + isRelativeDailyLimit ? relativeLimitsArray : limitsArray, + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await blockRewardContract.sendTransaction({ + from: accounts[2], + value: oneEther + }).should.be.fulfilled + + const recipient = accounts[5] + const value = halfEther + const balanceBefore = await web3.eth.getBalance(recipient) + const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' + const { logs } = await homeBridge.executeAffirmation(recipient, value, transactionHash, { + from: authorities[0] + }) - it('should allow validator to executeAffirmation', async () => { - const recipient = accounts[5] - const value = halfEther - const balanceBefore = await web3.eth.getBalance(recipient) - const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' - const { logs } = await homeBridge.executeAffirmation(recipient, value, transactionHash, { - from: authorities[0] - }) - - expectEventInLogs(logs, 'SignedForAffirmation', { - signer: authorities[0], - transactionHash - }) - expectEventInLogs(logs, 'AffirmationCompleted', { - recipient, - value, - transactionHash - }) - const balanceAfter = toBN(await web3.eth.getBalance(recipient)) - balanceAfter.should.be.bignumber.equal(toBN(balanceBefore).add(value)) + expectEventInLogs(logs, 'SignedForAffirmation', { + signer: authorities[0], + transactionHash + }) + expectEventInLogs(logs, 'AffirmationCompleted', { + recipient, + value, + transactionHash + }) + const balanceAfter = toBN(await web3.eth.getBalance(recipient)) + balanceAfter.should.be.bignumber.equal(toBN(balanceBefore).add(value)) - const msgHash = web3.utils.soliditySha3(recipient, value, transactionHash) - const senderHash = web3.utils.soliditySha3(authorities[0], msgHash) - true.should.be.equal(await homeBridge.affirmationsSigned(senderHash)) - }) + const msgHash = web3.utils.soliditySha3(recipient, value, transactionHash) + const senderHash = web3.utils.soliditySha3(authorities[0], msgHash) + true.should.be.equal(await homeBridge.affirmationsSigned(senderHash)) + } + it('should allow validator to executeAffirmation', shouldAllowValidatorToExecuteAffirmation(false)) + it('should allow validator to executeAffirmation (relative limit)', shouldAllowValidatorToExecuteAffirmation(true)) it('should allow validator to executeAffirmation with zero value', async () => { const recipient = accounts[5] @@ -970,13 +1186,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { const homeBridgeWithTwoSigs = await HomeBridge.new() await homeBridgeWithTwoSigs.initialize( validatorContractWith2Signatures.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) const recipient = accounts[5] const value = halfEther @@ -1034,13 +1251,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { homeBridge = await HomeBridge.new() await homeBridge.initialize( validatorContract.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, ZERO_ADDRESS, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) const recipient = accounts[5] @@ -1060,13 +1278,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { const homeBridgeWithThreeSigs = await HomeBridge.new() await homeBridgeWithThreeSigs.initialize( validatorContractWith3Signatures.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) const value = halfEther @@ -1094,20 +1313,46 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { transactionHash }) }) - it('should not allow execute affirmation over foreign max tx limit', async () => { - const recipient = accounts[5] - const value = oneEther - const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' - const { logs } = await homeBridge.executeAffirmation(recipient, value, transactionHash, { - from: authorities[0] - }).should.be.fulfilled - - expectEventInLogs(logs, 'AmountLimitExceeded', { - recipient, - value, - transactionHash - }) - }) + const shouldNotAllowExecuteAffirmationOverForeignMaxTxLimit = isRelativeDailyLimit => + async function() { + homeBridge = await HomeBridge.new() + await homeBridge.initialize( + validatorContract.address, + isRelativeDailyLimit ? relativeLimitsArray : limitsArray, + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await blockRewardContract.sendTransaction({ + from: accounts[2], + value: oneEther + }).should.be.fulfilled + + const recipient = accounts[5] + const value = oneEther + const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' + const { logs } = await homeBridge.executeAffirmation(recipient, value, transactionHash, { + from: authorities[0] + }).should.be.fulfilled + + expectEventInLogs(logs, 'AmountLimitExceeded', { + recipient, + value, + transactionHash + }) + } + it( + 'should not allow execute affirmation over foreign max tx limit', + shouldNotAllowExecuteAffirmationOverForeignMaxTxLimit(false) + ) + it( + 'should not allow execute affirmation over foreign max tx limit (relative limit)', + shouldNotAllowExecuteAffirmationOverForeignMaxTxLimit(true) + ) it('should fail if txHash already set as above of limits', async () => { const recipient = accounts[5] const value = oneEther @@ -1129,73 +1374,94 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { .executeAffirmation(accounts[6], value, transactionHash, { from: authorities[0] }) .should.be.rejectedWith(ERROR_MSG) }) - it('should not allow execute affirmation over daily foreign limit', async () => { - await blockRewardContract.sendTransaction({ - from: accounts[2], - value: oneEther - }).should.be.fulfilled - - const recipient = accounts[5] - const value = halfEther - const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' - const { logs } = await homeBridge.executeAffirmation(recipient, value, transactionHash, { - from: authorities[0] - }).should.be.fulfilled + const shouldNotAllowExecuteAffirmationOverDailyForeignLimit = isRelativeDailyLimit => + async function() { + homeBridge = await HomeBridge.new() + await homeBridge.initialize( + validatorContract.address, + isRelativeDailyLimit ? relativeLimitsArray : limitsArray, + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await blockRewardContract.sendTransaction({ + from: accounts[2], + value: oneEther.mul(toBN('2')) + }).should.be.fulfilled + + const recipient = accounts[5] + const value = halfEther + const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' + const { logs } = await homeBridge.executeAffirmation(recipient, value, transactionHash, { + from: authorities[0] + }).should.be.fulfilled + + expectEventInLogs(logs, 'SignedForAffirmation', { + signer: authorities[0], + transactionHash + }) + expectEventInLogs(logs, 'AffirmationCompleted', { + recipient, + value, + transactionHash + }) - expectEventInLogs(logs, 'SignedForAffirmation', { - signer: authorities[0], - transactionHash - }) - expectEventInLogs(logs, 'AffirmationCompleted', { - recipient, - value, - transactionHash - }) + const transactionHash2 = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' + const { logs: logs2 } = await homeBridge.executeAffirmation(recipient, value, transactionHash2, { + from: authorities[0] + }).should.be.fulfilled - const transactionHash2 = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' - const { logs: logs2 } = await homeBridge.executeAffirmation(recipient, value, transactionHash2, { - from: authorities[0] - }).should.be.fulfilled + expectEventInLogs(logs2, 'SignedForAffirmation', { + signer: authorities[0], + transactionHash: transactionHash2 + }) + expectEventInLogs(logs2, 'AffirmationCompleted', { + recipient, + value, + transactionHash: transactionHash2 + }) - expectEventInLogs(logs2, 'SignedForAffirmation', { - signer: authorities[0], - transactionHash: transactionHash2 - }) - expectEventInLogs(logs2, 'AffirmationCompleted', { - recipient, - value, - transactionHash: transactionHash2 - }) + const transactionHash3 = '0x69debd8fd1923c9cb3cd8ef6461e2740b2d037943b941729d5a47671a2bb8712' + const { logs: logs3 } = await homeBridge.executeAffirmation(recipient, value, transactionHash3, { + from: authorities[0] + }).should.be.fulfilled - const transactionHash3 = '0x69debd8fd1923c9cb3cd8ef6461e2740b2d037943b941729d5a47671a2bb8712' - const { logs: logs3 } = await homeBridge.executeAffirmation(recipient, value, transactionHash3, { - from: authorities[0] - }).should.be.fulfilled + expectEventInLogs(logs3, 'AmountLimitExceeded', { + recipient, + value, + transactionHash: transactionHash3 + }) - expectEventInLogs(logs3, 'AmountLimitExceeded', { - recipient, - value, - transactionHash: transactionHash3 - }) + const outOfLimitAmount = await homeBridge.outOfLimitAmount() - const outOfLimitAmount = await homeBridge.outOfLimitAmount() + outOfLimitAmount.should.be.bignumber.equal(halfEther) - outOfLimitAmount.should.be.bignumber.equal(halfEther) + const transactionHash4 = '0xc9ffe298d85ec5c515153608924b7bdcf1835539813dcc82cdbcc071170c3196' + const { logs: logs4 } = await homeBridge.executeAffirmation(recipient, value, transactionHash4, { + from: authorities[0] + }).should.be.fulfilled - const transactionHash4 = '0xc9ffe298d85ec5c515153608924b7bdcf1835539813dcc82cdbcc071170c3196' - const { logs: logs4 } = await homeBridge.executeAffirmation(recipient, value, transactionHash4, { - from: authorities[0] - }).should.be.fulfilled - - expectEventInLogs(logs4, 'AmountLimitExceeded', { - recipient, - value, - transactionHash: transactionHash4 - }) + expectEventInLogs(logs4, 'AmountLimitExceeded', { + recipient, + value, + transactionHash: transactionHash4 + }) - const newOutOfLimitAmount = await homeBridge.outOfLimitAmount() - newOutOfLimitAmount.should.be.bignumber.equal(oneEther) - }) + const newOutOfLimitAmount = await homeBridge.outOfLimitAmount() + newOutOfLimitAmount.should.be.bignumber.equal(oneEther) + } + it( + 'should not allow execute affirmation over daily foreign limit', + shouldNotAllowExecuteAffirmationOverDailyForeignLimit(false) + ) + it( + 'should not allow execute affirmation over daily foreign limit (relative limit)', + shouldNotAllowExecuteAffirmationOverDailyForeignLimit(true) + ) }) describe('#submitSignature', async () => { let validatorContractWith2Signatures @@ -1210,13 +1476,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { homeBridgeWithTwoSigs = await HomeBridge.new() await homeBridgeWithTwoSigs.initialize( validatorContractWith2Signatures.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) }) @@ -1278,13 +1545,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { const homeBridgeWithThreeSigs = await HomeBridge.new() await homeBridgeWithThreeSigs.initialize( validatorContractWith3Signatures.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) const value = halfEther @@ -1383,13 +1651,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { homeBridge = await HomeBridge.at(storageProxy.address) await homeBridge.initialize( validatorContract.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) }) it('Should revert if value to unlock is bigger than max per transaction', async () => { @@ -1621,13 +1890,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { }).should.be.fulfilled await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.sendTransaction({ from: accounts[2], @@ -1690,13 +1960,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { homeBridge = await HomeBridge.at(storageProxy.address) await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.sendTransaction({ from: accounts[2], @@ -1774,13 +2045,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { }).should.be.fulfilled await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.sendTransaction({ from: accounts[2], @@ -1848,13 +2120,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { }).should.be.fulfilled await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.sendTransaction({ from: accounts[0], @@ -1953,13 +2226,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { }).should.be.fulfilled await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.sendTransaction({ from: accounts[0], @@ -2057,9 +2331,10 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.sendTransaction({ from: owner, @@ -2102,13 +2377,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { homeBridge = await HomeBridge.at(storageProxy.address) await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.addMintedTotallyByBridge(oneEther, homeBridge.address) }) @@ -2157,13 +2433,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { homeBridge = await HomeBridge.at(storageProxy.address) await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.addMintedTotallyByBridge(oneEther, homeBridge.address) }) @@ -2214,13 +2491,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { }).should.be.fulfilled await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.addMintedTotallyByBridge(oneEther, homeBridge.address) @@ -2283,13 +2561,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { }).should.be.fulfilled await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.addMintedTotallyByBridge(oneEther, homeBridge.address) @@ -2377,13 +2656,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { }).should.be.fulfilled await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.addMintedTotallyByBridge(oneEther, homeBridge.address) @@ -2470,9 +2750,10 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.addMintedTotallyByBridge(oneEther, homeBridge.address) @@ -2540,13 +2821,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { await blockRewardContract.setValidatorsRewards(rewards) await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.sendTransaction({ from: accounts[2], @@ -2617,13 +2899,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { await blockRewardContract.setValidatorsRewards(rewards) await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.sendTransaction({ from: accounts[0], @@ -2726,13 +3009,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { await blockRewardContract.setValidatorsRewards(rewards) await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.sendTransaction({ from: accounts[0], @@ -2843,9 +3127,10 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.sendTransaction({ from: accounts[0], @@ -2888,13 +3173,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { homeBridge = await HomeBridge.at(storageProxy.address) await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.addMintedTotallyByBridge(oneEther, homeBridge.address) }) @@ -2943,13 +3229,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { homeBridge = await HomeBridge.at(storageProxy.address) await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.addMintedTotallyByBridge(oneEther, homeBridge.address) }) @@ -3001,13 +3288,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { await blockRewardContract.setValidatorsRewards(rewards) await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.addMintedTotallyByBridge(oneEther, homeBridge.address) @@ -3077,13 +3365,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { await blockRewardContract.setValidatorsRewards(rewards) await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.addMintedTotallyByBridge(oneEther, homeBridge.address) @@ -3178,13 +3467,14 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { await blockRewardContract.setValidatorsRewards(rewards) await homeBridge.initialize( rewardableValidators.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.addMintedTotallyByBridge(oneEther, homeBridge.address) @@ -3288,9 +3578,10 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await blockRewardContract.addMintedTotallyByBridge(oneEther, homeBridge.address) @@ -3338,18 +3629,20 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { const ownerOfValidators = accounts[0] await validatorContractWith2Signatures.initialize(2, authoritiesThreeAccs, ownerOfValidators) const homeBridgeWithTwoSigs = await HomeBridge.new() - const currentDay = await homeBridgeWithTwoSigs.getCurrentDay() await homeBridgeWithTwoSigs.initialize( validatorContractWith2Signatures.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftTwo + decimalShiftTwo, + absoluteLimitsContract.address ) + + const currentDay = await homeBridgeWithTwoSigs.getCurrentDay() const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' const balanceBefore = toBN(await web3.eth.getBalance(recipient)) const totalExecutedPerDayBefore = await homeBridgeWithTwoSigs.totalExecutedPerDay(currentDay) @@ -3407,17 +3700,18 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { gasPrice, requireBlockConfirmations, blockRewardContract.address, - [foreignDailyLimit, foreignMaxPerTx], + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], owner, - decimalShiftTwo + decimalShiftTwo, + absoluteLimitsContract.address ) const currentDay = await homeContract.getCurrentDay() expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) + await blockRewardContract.addMintedTotallyByBridge(100, homeContract.address) const minted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) - minted.should.be.bignumber.equal('10') + minted.should.be.bignumber.equal('100') const recipientAccount = accounts[1] @@ -3445,4 +3739,64 @@ contract('HomeBridge_ERC20_to_Native', async accounts => { logsSubmitSignature[1].event.should.be.equal('CollectedSignatures') }) }) + describe('#dailyLimit (relative)', () => { + let homeBridge + + function initialize(customLimitsArray) { + return homeBridge.initialize( + validatorContract.address, + customLimitsArray, + gasPrice, + requireBlockConfirmations, + blockRewardContract.address, + [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx], + owner, + decimalShiftZero, + relativeLimitsContract.address + ).should.be.fulfilled + } + + beforeEach(async () => { + homeBridge = await HomeBridge.new() + }) + it('should be calculated correctly - 1', async function() { + await initialize([targetLimit, threshold, maxPerTx, minPerTx]) + + await blockRewardContract.addMintedTotallyByBridge(halfEther, homeBridge.address) + + const limit = await homeBridge.dailyLimit() + const expectedLimit = calculateDailyLimit(halfEther, targetLimit, threshold, minPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + it('should be calculated correctly - 2', async function() { + await initialize([targetLimit, threshold, maxPerTx, minPerTx]) + + await blockRewardContract.addMintedTotallyByBridge(minPerTx, homeBridge.address) + + const limit = await homeBridge.dailyLimit() + expect(limit).to.be.bignumber.equal(minPerTx) + }) + it('should be calculated correctly - 3', async function() { + await initialize([targetLimit, threshold, maxPerTx, minPerTx]) + + await blockRewardContract.addMintedTotallyByBridge(threshold, homeBridge.address) + + const limit = await homeBridge.dailyLimit() + expect(limit).to.be.bignumber.equal(threshold.mul(targetLimit).div(oneEther)) + }) + it('should be calculated correctly - 4', async function() { + const amountToMint = ether('5') + const targetLimit = ether('0.06') + const threshold = ether('100') + const minPerTx = ether('0.1') + + await initialize([targetLimit, threshold, maxPerTx, minPerTx]) + + await blockRewardContract.addMintedTotallyByBridge(amountToMint, homeBridge.address) + + const limit = await homeBridge.dailyLimit() + const expectedLimit = calculateDailyLimit(amountToMint, targetLimit, threshold, minPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + }) }) diff --git a/test/helpers/helpers.js b/test/helpers/helpers.js index 25472bf08..5d82cd0bf 100644 --- a/test/helpers/helpers.js +++ b/test/helpers/helpers.js @@ -1,5 +1,5 @@ const { expect } = require('chai') -const { BN } = require('../setup') +const { BN, toBN } = require('../setup') // returns a Promise that resolves with a hex string that is the signature of // `data` signed with the key of `address` @@ -213,3 +213,20 @@ function addTxHashToAMBData(encodedData, transactionHash) { } module.exports.addTxHashToAMBData = addTxHashToAMBData + +function calculateDailyLimit(balance, targetLimit, threshold, minPerTx) { + if (balance.lte(minPerTx)) { + return balance + } + let limit = targetLimit + const multiplier = ether('1').pow(toBN(2)) + if (balance.gt(minPerTx) && balance.lt(threshold)) { + const a = ether('1').sub(limit).mul(multiplier).div(threshold.sub(minPerTx).pow(toBN(2))) // eslint-disable-line + const b = a.mul(threshold).mul(toBN(2)) + const c = limit.mul(multiplier).add(a.mul(threshold.pow(toBN(2)))) + limit = a.mul(balance.pow(toBN(2))).sub(b.mul(balance)).add(c).div(multiplier) // eslint-disable-line + } + return balance.mul(limit).div(ether('1')) +} + +module.exports.calculateDailyLimit = calculateDailyLimit diff --git a/test/native_to_erc/foreign_bridge_test.js b/test/native_to_erc/foreign_bridge_test.js index f112054e3..45cccff10 100644 --- a/test/native_to_erc/foreign_bridge_test.js +++ b/test/native_to_erc/foreign_bridge_test.js @@ -7,8 +7,11 @@ const FeeManagerNativeToErc = artifacts.require('FeeManagerNativeToErc.sol') const RewardableValidators = artifacts.require('RewardableValidators.sol') const POA20 = artifacts.require('ERC677BridgeToken.sol') const NoReturnTransferTokenMock = artifacts.require('NoReturnTransferTokenMock.sol') +const AbsoluteDailyLimit = artifacts.require('AbsoluteDailyLimit.sol') +const RelativeDailyLimit = artifacts.require('RelativeDailyLimit.sol') const { expect } = require('chai') +const { expectEvent } = require('@openzeppelin/test-helpers') const { ERROR_MSG, ZERO_ADDRESS, toBN } = require('../setup') const { createMessage, @@ -17,6 +20,7 @@ const { getEvents, ether, expectEventInLogs, + calculateDailyLimit, createAccounts, createFullAccounts } = require('../helpers/helpers') @@ -28,18 +32,27 @@ const requireBlockConfirmations = 8 const gasPrice = web3.utils.toWei('1', 'gwei') const homeDailyLimit = oneEther const homeMaxPerTx = halfEther +const homeMinPerTx = minPerTx const ZERO = toBN(0) const MAX_GAS = 8000000 const MAX_VALIDATORS = 50 const MAX_SIGNATURES = MAX_VALIDATORS const decimalShiftZero = 0 +const targetLimit = ether('0.05') +const threshold = ether('10000') + +contract('ForeignBridge_Native_to_ERC', async accounts => { + const limitsArray = [oneEther, halfEther, minPerTx] + const relativeLimitsArray = [targetLimit, threshold, halfEther, minPerTx] -contract('ForeignBridge', async accounts => { let validatorContract let authorities let owner let token let otherSideBridgeAddress + let absoluteLimitsContract + let relativeLimitsContract + before(async () => { validatorContract = await BridgeValidators.new() authorities = [accounts[1], accounts[2]] @@ -47,136 +60,168 @@ contract('ForeignBridge', async accounts => { await validatorContract.initialize(1, authorities, owner) const otherSideBridge = await HomeBridge.new() otherSideBridgeAddress = otherSideBridge.address + absoluteLimitsContract = await AbsoluteDailyLimit.new() + relativeLimitsContract = await RelativeDailyLimit.new() }) describe('#initialize', async () => { - it('should initialize', async () => { - token = await POA20.new('POA ERC20 Foundation', 'POA20', 18) - const foreignBridge = await ForeignBridge.new() - - expect(await foreignBridge.validatorContract()).to.be.equal(ZERO_ADDRESS) - expect(await foreignBridge.deployedAtBlock()).to.be.bignumber.equal(ZERO) - expect(await foreignBridge.isInitialized()).to.be.equal(false) - expect(await foreignBridge.requiredBlockConfirmations()).to.be.bignumber.equal(ZERO) - expect(await foreignBridge.dailyLimit()).to.be.bignumber.equal(ZERO) - expect(await foreignBridge.maxPerTx()).to.be.bignumber.equal(ZERO) - expect(await foreignBridge.decimalShift()).to.be.bignumber.equal(ZERO) - - await foreignBridge - .initialize( - ZERO_ADDRESS, - token.address, - [oneEther, halfEther, minPerTx], - gasPrice, - requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridgeAddress - ) - .should.be.rejectedWith(ERROR_MSG) - await foreignBridge - .initialize( - validatorContract.address, - ZERO_ADDRESS, - [oneEther, halfEther, minPerTx], - gasPrice, - requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridgeAddress - ) - .should.be.rejectedWith(ERROR_MSG) - await foreignBridge - .initialize( + const shouldInitialize = isRelativeDailyLimit => + async function() { + token = await POA20.new('POA ERC20 Foundation', 'POA20', 18) + const foreignBridge = await ForeignBridge.new() + const requestLimits = isRelativeDailyLimit ? relativeLimitsArray : limitsArray + const limitsContract = isRelativeDailyLimit ? relativeLimitsContract : absoluteLimitsContract + + expect(await foreignBridge.validatorContract()).to.be.equal(ZERO_ADDRESS) + expect(await foreignBridge.deployedAtBlock()).to.be.bignumber.equal(ZERO) + expect(await foreignBridge.isInitialized()).to.be.equal(false) + expect(await foreignBridge.requiredBlockConfirmations()).to.be.bignumber.equal(ZERO) + expect(await foreignBridge.decimalShift()).to.be.bignumber.equal(ZERO) + + await foreignBridge + .initialize( + ZERO_ADDRESS, + token.address, + requestLimits, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge + .initialize( + validatorContract.address, + ZERO_ADDRESS, + requestLimits, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge + .initialize( + validatorContract.address, + token.address, + requestLimits, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + ZERO_ADDRESS + ) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge + .initialize( + validatorContract.address, + token.address, + requestLimits, + 0, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge + .initialize( + owner, + token.address, + requestLimits, + requireBlockConfirmations, + gasPrice, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge + .initialize( + validatorContract.address, + owner, + requestLimits, + requireBlockConfirmations, + gasPrice, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + await foreignBridge + .initialize( + validatorContract.address, + token.address, + requestLimits, + gasPrice, + 0, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + limitsContract.address + ) + .should.be.rejectedWith(ERROR_MSG) + const { logs, tx } = await foreignBridge.initialize( validatorContract.address, token.address, - [oneEther, halfEther, minPerTx], - 0, - requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridgeAddress - ) - .should.be.rejectedWith(ERROR_MSG) - await foreignBridge - .initialize( - owner, - token.address, - [oneEther, halfEther, minPerTx], - requireBlockConfirmations, + requestLimits, gasPrice, - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridgeAddress - ) - .should.be.rejectedWith(ERROR_MSG) - await foreignBridge - .initialize( - validatorContract.address, - owner, - [oneEther, halfEther, minPerTx], requireBlockConfirmations, - gasPrice, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, - decimalShiftZero, - otherSideBridgeAddress + '9', + otherSideBridgeAddress, + limitsContract.address ) - .should.be.rejectedWith(ERROR_MSG) - await foreignBridge - .initialize( - validatorContract.address, - token.address, - [oneEther, halfEther, minPerTx], - gasPrice, - 0, - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridgeAddress - ) - .should.be.rejectedWith(ERROR_MSG) - const { logs } = await foreignBridge.initialize( - validatorContract.address, - token.address, - [oneEther, halfEther, minPerTx], - gasPrice, - requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], - owner, - '9', - otherSideBridgeAddress - ) - - expect(await foreignBridge.isInitialized()).to.be.equal(true) - expect(await foreignBridge.validatorContract()).to.be.equal(validatorContract.address) - expect(await foreignBridge.deployedAtBlock()).to.be.bignumber.above(ZERO) - expect(await foreignBridge.requiredBlockConfirmations()).to.be.bignumber.equal( - requireBlockConfirmations.toString() - ) - expect(await foreignBridge.gasPrice()).to.be.bignumber.equal(gasPrice) - expect(await foreignBridge.dailyLimit()).to.be.bignumber.equal(oneEther) - expect(await foreignBridge.maxPerTx()).to.be.bignumber.equal(halfEther) - expect(await foreignBridge.minPerTx()).to.be.bignumber.equal(minPerTx) - expect(await foreignBridge.decimalShift()).to.be.bignumber.equal('9') - const bridgeMode = '0x92a8d7fe' // 4 bytes of keccak256('native-to-erc-core') - expect(await foreignBridge.getBridgeMode()).to.be.equal(bridgeMode) - const { major, minor, patch } = await foreignBridge.getBridgeInterfacesVersion() - expect(major).to.be.bignumber.gte(ZERO) - expect(minor).to.be.bignumber.gte(ZERO) - expect(patch).to.be.bignumber.gte(ZERO) - expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { - requiredBlockConfirmations: toBN(requireBlockConfirmations) - }) - expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) - expectEventInLogs(logs, 'ExecutionDailyLimitChanged', { newLimit: homeDailyLimit }) - expectEventInLogs(logs, 'DailyLimitChanged', { newLimit: oneEther }) - }) + expect(await foreignBridge.isInitialized()).to.be.equal(true) + expect(await foreignBridge.validatorContract()).to.be.equal(validatorContract.address) + expect(await foreignBridge.deployedAtBlock()).to.be.bignumber.above(ZERO) + expect(await foreignBridge.requiredBlockConfirmations()).to.be.bignumber.equal( + requireBlockConfirmations.toString() + ) + expect(await foreignBridge.gasPrice()).to.be.bignumber.equal(gasPrice) + expect(await foreignBridge.maxPerTx()).to.be.bignumber.equal(halfEther) + expect(await foreignBridge.minPerTx()).to.be.bignumber.equal(minPerTx) + expect(await foreignBridge.decimalShift()).to.be.bignumber.equal('9') + const bridgeMode = '0x92a8d7fe' // 4 bytes of keccak256('native-to-erc-core') + expect(await foreignBridge.getBridgeMode()).to.be.equal(bridgeMode) + const { major, minor, patch } = await foreignBridge.getBridgeInterfacesVersion() + expect(major).to.be.bignumber.gte(ZERO) + expect(minor).to.be.bignumber.gte(ZERO) + expect(patch).to.be.bignumber.gte(ZERO) + if (!isRelativeDailyLimit) { + expect(await foreignBridge.dailyLimit()).to.be.bignumber.equal(oneEther) + } + + expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { + requiredBlockConfirmations: toBN(requireBlockConfirmations) + }) + expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) + await expectEvent.inTransaction(tx, limitsContract, 'ExecutionDailyLimitChanged', { + newLimit: homeDailyLimit.toString() + }) + if (!isRelativeDailyLimit) { + await expectEvent.inTransaction(tx, limitsContract, 'DailyLimitChanged', { newLimit: oneEther.toString() }) + } + } + it('should initialize', shouldInitialize(false)) + it('should initialize (relative limit)', shouldInitialize(true)) }) describe('#executeSignatures', async () => { @@ -187,38 +232,58 @@ contract('ForeignBridge', async accounts => { await foreignBridge.initialize( validatorContract.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) await token.transferOwnership(foreignBridge.address) }) - it('should allow to deposit', async () => { - const recipientAccount = accounts[3] - const balanceBefore = await token.balanceOf(recipientAccount) - const totalSupplyBefore = await token.totalSupply() - const value = ether('0.25') - const transactionHash = '0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80' - const message = createMessage(recipientAccount, value, transactionHash, foreignBridge.address) - const signature = await sign(authorities[0], message) - const vrs = signatureToVRS(signature) - false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) - const { logs } = await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipientAccount) - logs[0].args.value.should.be.bignumber.equal(value) - logs[0].args.transactionHash.should.be.equal(transactionHash) - - const balanceAfter = await token.balanceOf(recipientAccount) - const totalSupplyAfter = await token.totalSupply() - balanceAfter.should.be.bignumber.equal(balanceBefore.add(value)) - totalSupplyAfter.should.be.bignumber.equal(totalSupplyBefore.add(value)) - true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) - }) + const shouldAllowToDeposit = isRelativeDailyLimit => + async function() { + foreignBridge = await ForeignBridge.new() + token = await POA20.new('POA ERC20 Foundation', 'POA20', 18) + await foreignBridge.initialize( + validatorContract.address, + token.address, + isRelativeDailyLimit ? relativeLimitsArray : limitsArray, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.transferOwnership(foreignBridge.address) + + const recipientAccount = accounts[3] + const balanceBefore = await token.balanceOf(recipientAccount) + const totalSupplyBefore = await token.totalSupply() + const value = ether('0.25') + const transactionHash = '0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80' + const message = createMessage(recipientAccount, value, transactionHash, foreignBridge.address) + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature) + false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + const { logs } = await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipientAccount) + event.args.value.should.be.bignumber.equal(value) + event.args.transactionHash.should.be.equal(transactionHash) + + const balanceAfter = await token.balanceOf(recipientAccount) + const totalSupplyAfter = await token.totalSupply() + balanceAfter.should.be.bignumber.equal(balanceBefore.add(value)) + totalSupplyAfter.should.be.bignumber.equal(totalSupplyBefore.add(value)) + true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + } + it('should allow to deposit', shouldAllowToDeposit(false)) + it('should allow to deposit (relative limit)', shouldAllowToDeposit(true)) it('should reject if address is not foreign address', async () => { const recipientAccount = accounts[3] const value = ether('0.25') @@ -247,11 +312,10 @@ contract('ForeignBridge', async accounts => { const vrs2 = signatureToVRS(signature2) false.should.be.equal(await foreignBridge.relayedMessages(transactionHash2)) const { logs } = await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.fulfilled - - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipientAccount) - logs[0].args.value.should.be.bignumber.equal(value) - logs[0].args.transactionHash.should.be.equal(transactionHash2) + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipientAccount) + event.args.value.should.be.bignumber.equal(value) + event.args.transactionHash.should.be.equal(transactionHash2) const totalSupply = await token.totalSupply() const balanceAfter = await token.balanceOf(recipientAccount) balanceAfter.should.be.bignumber.equal(balanceBefore.add(value.mul(toBN(2)))) @@ -278,42 +342,88 @@ contract('ForeignBridge', async accounts => { await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.rejectedWith(ERROR_MSG) }) - it('should not allow withdraw over home max tx limit', async () => { - const recipientAccount = accounts[3] - const invalidValue = ether('0.75') + const shouldNotAllowWithdrawOverHomeMaxTxLimit = isRelativeDailyLimit => + async function() { + foreignBridge = await ForeignBridge.new() + token = await POA20.new('POA ERC20 Foundation', 'POA20', 18) + await foreignBridge.initialize( + validatorContract.address, + token.address, + isRelativeDailyLimit ? relativeLimitsArray : limitsArray, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.transferOwnership(foreignBridge.address) - const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' - const message = createMessage(recipientAccount, invalidValue, transactionHash, foreignBridge.address) - const signature = await sign(authorities[0], message) - const vrs = signatureToVRS(signature) + const recipientAccount = accounts[3] + const invalidValue = ether('0.75') - await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.rejectedWith(ERROR_MSG) - }) + const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' + const message = createMessage(recipientAccount, invalidValue, transactionHash, foreignBridge.address) + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature) - it('should not allow withdraw over daily home limit', async () => { - const recipientAccount = accounts[3] + await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.rejectedWith(ERROR_MSG) + } - const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' - const message = createMessage(recipientAccount, halfEther, transactionHash, foreignBridge.address) - const signature = await sign(authorities[0], message) - const vrs = signatureToVRS(signature) + it('should not allow withdraw over home max tx limit', shouldNotAllowWithdrawOverHomeMaxTxLimit(false)) + it( + 'should not allow withdraw over home max tx limit (relative limit)', + shouldNotAllowWithdrawOverHomeMaxTxLimit(true) + ) + + const shouldNotAllowWithdrawOverDailyHomeLimit = isRelativeDailyLimit => + async function() { + foreignBridge = await ForeignBridge.new() + token = await POA20.new('POA ERC20 Foundation', 'POA20', 18) + await foreignBridge.initialize( + validatorContract.address, + token.address, + isRelativeDailyLimit ? relativeLimitsArray : limitsArray, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.transferOwnership(foreignBridge.address) - await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled + const recipientAccount = accounts[3] - const transactionHash2 = '0x69debd8fd1923c9cb3cd8ef6461e2740b2d037943b941729d5a47671a2bb8712' - const message2 = createMessage(recipientAccount, halfEther, transactionHash2, foreignBridge.address) - const signature2 = await sign(authorities[0], message2) - const vrs2 = signatureToVRS(signature2) + const transactionHash = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' + const message = createMessage(recipientAccount, halfEther, transactionHash, foreignBridge.address) + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature) - await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.fulfilled + await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled - const transactionHash3 = '0x022695428093bb292db8e48bd1417c5e1b84c0bf673bd0fff23ed0fb6495b872' - const message3 = createMessage(recipientAccount, halfEther, transactionHash3, foreignBridge.address) - const signature3 = await sign(authorities[0], message3) - const vrs3 = signatureToVRS(signature3) + const transactionHash2 = '0x69debd8fd1923c9cb3cd8ef6461e2740b2d037943b941729d5a47671a2bb8712' + const message2 = createMessage(recipientAccount, halfEther, transactionHash2, foreignBridge.address) + const signature2 = await sign(authorities[0], message2) + const vrs2 = signatureToVRS(signature2) - await foreignBridge.executeSignatures([vrs3.v], [vrs3.r], [vrs3.s], message3).should.be.rejectedWith(ERROR_MSG) - }) + await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.fulfilled + + const transactionHash3 = '0x022695428093bb292db8e48bd1417c5e1b84c0bf673bd0fff23ed0fb6495b872' + const message3 = createMessage(recipientAccount, halfEther, transactionHash3, foreignBridge.address) + const signature3 = await sign(authorities[0], message3) + const vrs3 = signatureToVRS(signature3) + + await foreignBridge.executeSignatures([vrs3.v], [vrs3.r], [vrs3.s], message3).should.be.rejectedWith(ERROR_MSG) + } + + it('should not allow withdraw over daily home limit', shouldNotAllowWithdrawOverDailyHomeLimit(false)) + it( + 'should not allow withdraw over daily home limit (relative limit)', + shouldNotAllowWithdrawOverDailyHomeLimit(true) + ) }) describe('#executeSignatures with 2 minimum signatures', async () => { @@ -333,13 +443,14 @@ contract('ForeignBridge', async accounts => { await foreignBridgeWithMultiSignatures.initialize( multisigValidatorContract.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, decimalShiftZero, otherSideBridgeAddress, + absoluteLimitsContract.address, { from: ownerOfValidatorContract } ) await token.transferOwnership(foreignBridgeWithMultiSignatures.address) @@ -365,11 +476,10 @@ contract('ForeignBridge', async accounts => { [vrs.s, vrs2.s], message ).should.be.fulfilled - - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipientAccount) - logs[0].args.value.should.be.bignumber.equal(value) - logs[0].args.transactionHash.should.be.equal(transactionHash) + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipientAccount) + event.args.value.should.be.bignumber.equal(value) + event.args.transactionHash.should.be.equal(transactionHash) true.should.be.equal(await foreignBridgeWithMultiSignatures.relayedMessages(transactionHash)) }) it('deposit should fail if duplicate signature is provided', async () => { @@ -398,13 +508,14 @@ contract('ForeignBridge', async accounts => { await foreignBridgeWithThreeSigs.initialize( validatorContractWith3Signatures.address, erc20Token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) await erc20Token.transferOwnership(foreignBridgeWithThreeSigs.address) @@ -429,9 +540,9 @@ contract('ForeignBridge', async accounts => { [vrs.s, vrs2.s, vrs3.s], message ).should.be.fulfilled - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipient) - logs[0].args.value.should.be.bignumber.equal(value) + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipient) + event.args.value.should.be.bignumber.equal(value) true.should.be.equal(await foreignBridgeWithThreeSigs.relayedMessages(txHash)) }) it('works with max allowed number of signatures required', async () => { @@ -449,13 +560,14 @@ contract('ForeignBridge', async accounts => { await foreignBridgeWithMaxSigs.initialize( validatorContract.address, erc20Token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) await erc20Token.transferOwnership(foreignBridgeWithMaxSigs.address) @@ -489,13 +601,14 @@ contract('ForeignBridge', async accounts => { await foreignBridgeWithThreeSigs.initialize( validatorContractWith3Signatures.address, erc20Token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) await erc20Token.transferOwnership(foreignBridgeWithThreeSigs.address) @@ -522,211 +635,236 @@ contract('ForeignBridge', async accounts => { [vrs.s, vrs2.s, vrs3.s], message ).should.be.fulfilled - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipient) - logs[0].args.value.should.be.bignumber.equal(value) + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipient) + event.args.value.should.be.bignumber.equal(value) true.should.be.equal(await foreignBridgeWithThreeSigs.relayedMessages(txHash)) }) }) - describe('#onTokenTransfer', async () => { - it('can only be called from token contract', async () => { - const owner = accounts[3] - const user = accounts[4] - token = await POA20.new('POA ERC20 Foundation', 'POA20', 18, { from: owner }) - const foreignBridge = await ForeignBridge.new() - await foreignBridge.initialize( - validatorContract.address, - token.address, - [oneEther, halfEther, minPerTx], - gasPrice, - requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridgeAddress - ) - await token.mint(user, halfEther, { from: owner }).should.be.fulfilled - await token.transferOwnership(foreignBridge.address, { from: owner }) - await foreignBridge.onTokenTransfer(user, halfEther, '0x', { from: owner }).should.be.rejectedWith(ERROR_MSG) - await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled - expect(await token.totalSupply()).to.be.bignumber.equal(ZERO) - expect(await token.balanceOf(user)).to.be.bignumber.equal(ZERO) - }) - it('should not allow to burn more than the limit', async () => { - const owner = accounts[3] - const user = accounts[4] - const valueMoreThanLimit = halfEther.add(toBN(1)) - token = await POA20.new('POA ERC20 Foundation', 'POA20', 18, { from: owner }) - const foreignBridge = await ForeignBridge.new() + const onTokenTransfer = isRelativeDailyLimit => + function() { + it('can only be called from token contract', async () => { + const owner = accounts[3] + const user = accounts[4] + token = await POA20.new('POA ERC20 Foundation', 'POA20', 18, { from: owner }) + const foreignBridge = await ForeignBridge.new() + await foreignBridge.initialize( + validatorContract.address, + token.address, + isRelativeDailyLimit ? relativeLimitsArray : limitsArray, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.mint(user, halfEther, { from: owner }).should.be.fulfilled + await token.mint(foreignBridge.address, oneEther, { from: owner }).should.be.fulfilled + await token.transferOwnership(foreignBridge.address, { from: owner }) + await foreignBridge.onTokenTransfer(user, halfEther, '0x', { from: owner }).should.be.rejectedWith(ERROR_MSG) + await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled + expect(await token.totalSupply()).to.be.bignumber.equal(oneEther) + expect(await token.balanceOf(user)).to.be.bignumber.equal(ZERO) + }) + it('should not allow to burn more than the limit', async () => { + const owner = accounts[3] + const user = accounts[4] + const valueMoreThanLimit = halfEther.add(toBN(1)) + token = await POA20.new('POA ERC20 Foundation', 'POA20', 18, { from: owner }) + const foreignBridge = await ForeignBridge.new() + + await foreignBridge.initialize( + validatorContract.address, + token.address, + isRelativeDailyLimit ? relativeLimitsArray : limitsArray, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.mint(user, valueMoreThanLimit, { from: owner }).should.be.fulfilled + await token.mint(foreignBridge.address, oneEther, { from: owner }).should.be.fulfilled - await foreignBridge.initialize( - validatorContract.address, - token.address, - [oneEther, halfEther, minPerTx], - gasPrice, - requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridgeAddress - ) - await token.mint(user, valueMoreThanLimit, { from: owner }).should.be.fulfilled - await token.transferOwnership(foreignBridge.address, { from: owner }) + valueMoreThanLimit.add(oneEther).should.be.bignumber.equal(await token.totalSupply()) + valueMoreThanLimit.should.be.bignumber.equal(await token.balanceOf(user)) - await token - .transferAndCall(foreignBridge.address, valueMoreThanLimit, '0x', { from: user }) - .should.be.rejectedWith(ERROR_MSG) + await token.transferOwnership(foreignBridge.address, { from: owner }) - valueMoreThanLimit.should.be.bignumber.equal(await token.totalSupply()) - valueMoreThanLimit.should.be.bignumber.equal(await token.balanceOf(user)) + await token + .transferAndCall(foreignBridge.address, valueMoreThanLimit, '0x', { from: user }) + .should.be.rejectedWith(ERROR_MSG) - await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled + valueMoreThanLimit.add(oneEther).should.be.bignumber.equal(await token.totalSupply()) + valueMoreThanLimit.should.be.bignumber.equal(await token.balanceOf(user)) - expect(await token.totalSupply()).to.be.bignumber.equal('1') - expect(await token.balanceOf(user)).to.be.bignumber.equal('1') + await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled - const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) - expect(events[0].returnValues.recipient).to.be.equal(user) - expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(halfEther) - }) - it('should only let to send within maxPerTx limit', async () => { - const owner = accounts[3] - const user = accounts[4] - const valueMoreThanLimit = halfEther.add(toBN(1)) - token = await POA20.new('POA ERC20 Foundation', 'POA20', 18, { from: owner }) - const foreignBridge = await ForeignBridge.new() - await foreignBridge.initialize( - validatorContract.address, - token.address, - [oneEther, halfEther, minPerTx], - gasPrice, - requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridgeAddress - ) - await token.mint(user, oneEther.add(toBN(1)), { from: owner }).should.be.fulfilled + expect(await token.totalSupply()).to.be.bignumber.equal(oneEther.add(toBN(1))) + expect(await token.balanceOf(user)).to.be.bignumber.equal('1') - await token.transferOwnership(foreignBridge.address, { from: owner }) + const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) + expect(events[0].returnValues.recipient).to.be.equal(user) + expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(halfEther) + }) + it('should only let to send within maxPerTx limit', async () => { + const owner = accounts[3] + const user = accounts[4] + const valueMoreThanLimit = halfEther.add(toBN(1)) + token = await POA20.new('POA ERC20 Foundation', 'POA20', 18, { from: owner }) + const foreignBridge = await ForeignBridge.new() + await foreignBridge.initialize( + validatorContract.address, + token.address, + isRelativeDailyLimit ? relativeLimitsArray : limitsArray, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.mint(user, oneEther.add(toBN(1)), { from: owner }).should.be.fulfilled + await token.mint(foreignBridge.address, oneEther, { from: owner }).should.be.fulfilled - await token - .transferAndCall(foreignBridge.address, valueMoreThanLimit, '0x', { from: user }) - .should.be.rejectedWith(ERROR_MSG) + await token.transferOwnership(foreignBridge.address, { from: owner }) - oneEther.add(toBN(1)).should.be.bignumber.equal(await token.totalSupply()) - oneEther.add(toBN(1)).should.be.bignumber.equal(await token.balanceOf(user)) + await token + .transferAndCall(foreignBridge.address, valueMoreThanLimit, '0x', { from: user }) + .should.be.rejectedWith(ERROR_MSG) - await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled + const twoEther = oneEther.mul(toBN(2)) + twoEther.add(toBN(1)).should.be.bignumber.equal(await token.totalSupply()) + oneEther.add(toBN(1)).should.be.bignumber.equal(await token.balanceOf(user)) - valueMoreThanLimit.should.be.bignumber.equal(await token.totalSupply()) - valueMoreThanLimit.should.be.bignumber.equal(await token.balanceOf(user)) + await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled - await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled + valueMoreThanLimit.add(oneEther).should.be.bignumber.equal(await token.totalSupply()) + valueMoreThanLimit.should.be.bignumber.equal(await token.balanceOf(user)) - expect(await token.totalSupply()).to.be.bignumber.equal('1') - expect(await token.balanceOf(user)).to.be.bignumber.equal('1') - await token.transferAndCall(foreignBridge.address, '1', '0x', { from: user }).should.be.rejectedWith(ERROR_MSG) - }) - it('should not let to withdraw less than minPerTx', async () => { - const owner = accounts[3] - const user = accounts[4] - const valueLessThanMinPerTx = minPerTx.sub(toBN(1)) - token = await POA20.new('POA ERC20 Foundation', 'POA20', 18, { from: owner }) - const foreignBridge = await ForeignBridge.new() - await foreignBridge.initialize( - validatorContract.address, - token.address, - [oneEther, halfEther, minPerTx], - gasPrice, - requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridgeAddress - ) - await token.mint(user, oneEther, { from: owner }).should.be.fulfilled - await token.transferOwnership(foreignBridge.address, { from: owner }) + await token.transferAndCall(foreignBridge.address, halfEther, '0x', { from: user }).should.be.fulfilled - await token - .transferAndCall(foreignBridge.address, valueLessThanMinPerTx, '0x', { from: user }) - .should.be.rejectedWith(ERROR_MSG) + expect(await token.totalSupply()).to.be.bignumber.equal(oneEther.add(toBN(1))) + expect(await token.balanceOf(user)).to.be.bignumber.equal('1') + await token.transferAndCall(foreignBridge.address, '1', '0x', { from: user }).should.be.rejectedWith(ERROR_MSG) + }) + it('should not let to withdraw less than minPerTx', async () => { + const owner = accounts[3] + const user = accounts[4] + const valueLessThanMinPerTx = minPerTx.sub(toBN(1)) + token = await POA20.new('POA ERC20 Foundation', 'POA20', 18, { from: owner }) + const foreignBridge = await ForeignBridge.new() + await foreignBridge.initialize( + validatorContract.address, + token.address, + isRelativeDailyLimit ? relativeLimitsArray : limitsArray, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.mint(user, oneEther, { from: owner }).should.be.fulfilled + await token.transferOwnership(foreignBridge.address, { from: owner }) - oneEther.should.be.bignumber.equal(await token.totalSupply()) - oneEther.should.be.bignumber.equal(await token.balanceOf(user)) + await token + .transferAndCall(foreignBridge.address, valueLessThanMinPerTx, '0x', { from: user }) + .should.be.rejectedWith(ERROR_MSG) - await token.transferAndCall(foreignBridge.address, minPerTx, '0x', { from: user }).should.be.fulfilled + oneEther.should.be.bignumber.equal(await token.totalSupply()) + oneEther.should.be.bignumber.equal(await token.balanceOf(user)) - oneEther.sub(minPerTx).should.be.bignumber.equal(await token.totalSupply()) - oneEther.sub(minPerTx).should.be.bignumber.equal(await token.balanceOf(user)) - }) - it('should be able to specify a different receiver', async () => { - const owner = accounts[3] - const user = accounts[4] - const user2 = accounts[5] - token = await POA20.new('POA ERC20 Foundation', 'POA20', 18, { from: owner }) - const foreignBridge = await ForeignBridge.new() - await foreignBridge.initialize( - validatorContract.address, - token.address, - [oneEther, halfEther, minPerTx], - gasPrice, - requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridgeAddress - ) - await token.mint(user, halfEther, { from: owner }).should.be.fulfilled - await token.transferOwnership(foreignBridge.address, { from: owner }) - await token - .transferAndCall(foreignBridge.address, halfEther, otherSideBridgeAddress, { from: user }) - .should.be.rejectedWith(ERROR_MSG) - await token - .transferAndCall(foreignBridge.address, halfEther, '0x00', { from: user }) - .should.be.rejectedWith(ERROR_MSG) - await token.transferAndCall(foreignBridge.address, halfEther, user2, { from: user }).should.be.fulfilled - expect(await token.totalSupply()).to.be.bignumber.equal(ZERO) - expect(await token.balanceOf(user)).to.be.bignumber.equal(ZERO) - const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) - expect(events[0].returnValues.recipient).to.be.equal(user2) - expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(halfEther) - }) - }) + await token.transferAndCall(foreignBridge.address, minPerTx, '0x', { from: user }).should.be.fulfilled - describe('#setting limits', async () => { - let foreignBridge - beforeEach(async () => { - token = await POA20.new('POA ERC20 Foundation', 'POA20', 18) - foreignBridge = await ForeignBridge.new() - await foreignBridge.initialize( - validatorContract.address, - token.address, - [oneEther, halfEther, minPerTx], - gasPrice, - requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridgeAddress - ) - await token.transferOwnership(foreignBridge.address) - }) - it('#setMaxPerTx allows to set only to owner and cannot be more than daily limit', async () => { - await foreignBridge.setMaxPerTx(halfEther, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) - await foreignBridge.setMaxPerTx(halfEther, { from: owner }).should.be.fulfilled + oneEther.sub(minPerTx).should.be.bignumber.equal(await token.totalSupply()) + oneEther.sub(minPerTx).should.be.bignumber.equal(await token.balanceOf(user)) + }) + it('should be able to specify a different receiver', async () => { + const owner = accounts[3] + const user = accounts[4] + const user2 = accounts[5] + token = await POA20.new('POA ERC20 Foundation', 'POA20', 18, { from: owner }) + const foreignBridge = await ForeignBridge.new() + await foreignBridge.initialize( + validatorContract.address, + token.address, + isRelativeDailyLimit ? relativeLimitsArray : limitsArray, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.mint(user, halfEther, { from: owner }).should.be.fulfilled + await token.mint(foreignBridge.address, oneEther, { from: owner }).should.be.fulfilled + await token.transferOwnership(foreignBridge.address, { from: owner }) + await token + .transferAndCall(foreignBridge.address, halfEther, otherSideBridgeAddress, { from: user }) + .should.be.rejectedWith(ERROR_MSG) + await token + .transferAndCall(foreignBridge.address, halfEther, '0x00', { from: user }) + .should.be.rejectedWith(ERROR_MSG) + await token.transferAndCall(foreignBridge.address, halfEther, user2, { from: user }).should.be.fulfilled + expect(await token.totalSupply()).to.be.bignumber.equal(oneEther) + expect(await token.balanceOf(user)).to.be.bignumber.equal(ZERO) + const events = await getEvents(foreignBridge, { event: 'UserRequestForAffirmation' }) + expect(events[0].returnValues.recipient).to.be.equal(user2) + expect(toBN(events[0].returnValues.value)).to.be.bignumber.equal(halfEther) + }) + } + + describe('#onTokenTransfer', onTokenTransfer(false)) + describe('#onTokenTransfer (relative limit)', onTokenTransfer(true)) + + const settingLimits = isRelativeDailyLimit => + function() { + let foreignBridge + beforeEach(async () => { + token = await POA20.new('POA ERC20 Foundation', 'POA20', 18) + foreignBridge = await ForeignBridge.new() + await foreignBridge.initialize( + validatorContract.address, + token.address, + isRelativeDailyLimit ? relativeLimitsArray : limitsArray, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.transferOwnership(foreignBridge.address) + }) + it('#setMaxPerTx allows to set only to owner and cannot be more than daily limit', async () => { + await foreignBridge.setMaxPerTx(halfEther, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) + await foreignBridge.setMaxPerTx(halfEther, { from: owner }).should.be.fulfilled - await foreignBridge.setMaxPerTx(oneEther, { from: owner }).should.be.rejectedWith(ERROR_MSG) - }) + if (!isRelativeDailyLimit) { + await foreignBridge.setMaxPerTx(oneEther, { from: owner }).should.be.rejectedWith(ERROR_MSG) + } + }) - it('#setMinPerTx allows to set only to owner and cannot be more than daily limit and should be less than maxPerTx', async () => { - await foreignBridge.setMinPerTx(minPerTx, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) - await foreignBridge.setMinPerTx(minPerTx, { from: owner }).should.be.fulfilled + it('#setMinPerTx allows to set only to owner and cannot be more than daily limit and should be less than maxPerTx', async () => { + await foreignBridge.setMinPerTx(minPerTx, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) + await foreignBridge.setMinPerTx(minPerTx, { from: owner }).should.be.fulfilled - await foreignBridge.setMinPerTx(oneEther, { from: owner }).should.be.rejectedWith(ERROR_MSG) - }) - }) + await foreignBridge.setMinPerTx(oneEther, { from: owner }).should.be.rejectedWith(ERROR_MSG) + }) + } + + describe('#setting limits', settingLimits(false)) + describe('#setting limits (relative limit)', settingLimits(true)) describe('#upgradeable', async () => { it('can be upgraded', async () => { @@ -760,10 +898,11 @@ contract('ForeignBridge', async accounts => { [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX], gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) await token.transferOwnership(foreignBridgeProxy.address).should.be.fulfilled @@ -791,10 +930,11 @@ contract('ForeignBridge', async accounts => { [FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX], gasPrice, requireBlockConfirmations, - ['3', '2'], + ['3', '2', '1'], owner, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) .encodeABI() await storageProxy.upgradeToAndCall('1', foreignBridge.address, data).should.be.fulfilled @@ -817,10 +957,11 @@ contract('ForeignBridge', async accounts => { ['3', '2', '1'], gasPrice, requireBlockConfirmations, - ['3', '2'], + ['3', '2', '1'], owner, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) .encodeABI() await storageProxy.upgradeToAndCall('1', foreignBridge.address, data).should.be.fulfilled @@ -829,39 +970,43 @@ contract('ForeignBridge', async accounts => { }) describe('#claimTokens', async () => { - it('can send erc20', async () => { - const owner = accounts[0] - token = await POA20.new('POA ERC20 Foundation', 'POA20', 18) - const foreignBridgeImpl = await ForeignBridge.new() - const storageProxy = await EternalStorageProxy.new().should.be.fulfilled - await storageProxy.upgradeTo('1', foreignBridgeImpl.address).should.be.fulfilled - const foreignBridge = await ForeignBridge.at(storageProxy.address) - await foreignBridge.initialize( - validatorContract.address, - token.address, - [oneEther, halfEther, minPerTx], - gasPrice, - requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], - owner, - decimalShiftZero, - otherSideBridgeAddress - ) - await token.transferOwnership(foreignBridge.address) + const canSendErc20 = isRelativeDailyLimit => + async function() { + const owner = accounts[0] + token = await POA20.new('POA ERC20 Foundation', 'POA20', 18) + const foreignBridgeImpl = await ForeignBridge.new() + const storageProxy = await EternalStorageProxy.new().should.be.fulfilled + await storageProxy.upgradeTo('1', foreignBridgeImpl.address).should.be.fulfilled + const foreignBridge = await ForeignBridge.at(storageProxy.address) + await foreignBridge.initialize( + validatorContract.address, + token.address, + isRelativeDailyLimit ? relativeLimitsArray : limitsArray, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await token.transferOwnership(foreignBridge.address) - const tokenSecond = await POA20.new('Roman Token', 'RST', 18) + const tokenSecond = await POA20.new('Roman Token', 'RST', 18) - await tokenSecond.mint(accounts[0], halfEther).should.be.fulfilled - expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(halfEther) + await tokenSecond.mint(accounts[0], halfEther).should.be.fulfilled + expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(halfEther) - await tokenSecond.transfer(foreignBridge.address, halfEther) - expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(ZERO) - expect(await tokenSecond.balanceOf(foreignBridge.address)).to.be.bignumber.equal(halfEther) + await tokenSecond.transfer(foreignBridge.address, halfEther) + expect(await tokenSecond.balanceOf(accounts[0])).to.be.bignumber.equal(ZERO) + expect(await tokenSecond.balanceOf(foreignBridge.address)).to.be.bignumber.equal(halfEther) - await foreignBridge.claimTokens(tokenSecond.address, accounts[3], { from: owner }) - expect(await tokenSecond.balanceOf(foreignBridge.address)).to.be.bignumber.equal(ZERO) - expect(await tokenSecond.balanceOf(accounts[3])).to.be.bignumber.equal(halfEther) - }) + await foreignBridge.claimTokens(tokenSecond.address, accounts[3], { from: owner }) + expect(await tokenSecond.balanceOf(foreignBridge.address)).to.be.bignumber.equal(ZERO) + expect(await tokenSecond.balanceOf(accounts[3])).to.be.bignumber.equal(halfEther) + } + it('can send erc20', canSendErc20(false)) + it('can send erc20 (relative limit)', canSendErc20(true)) it('also calls claimTokens on tokenAddress', async () => { const owner = accounts[0] token = await POA20.new('POA ERC20 Foundation', 'POA20', 18) @@ -872,13 +1017,14 @@ contract('ForeignBridge', async accounts => { await foreignBridge.initialize( validatorContract.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) await token.transferOwnership(foreignBridge.address) @@ -905,13 +1051,14 @@ contract('ForeignBridge', async accounts => { await foreignBridge.initialize( validatorContract.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) const tokenMock = await NoReturnTransferTokenMock.new() @@ -950,112 +1097,117 @@ contract('ForeignBridge', async accounts => { expect(await foreignBridge.deployedAtBlock()).to.be.bignumber.equal(ZERO) expect(await foreignBridge.isInitialized()).to.be.equal(false) expect(await foreignBridge.requiredBlockConfirmations()).to.be.bignumber.equal(ZERO) - expect(await foreignBridge.dailyLimit()).to.be.bignumber.equal(ZERO) - expect(await foreignBridge.maxPerTx()).to.be.bignumber.equal(ZERO) expect(await foreignBridge.decimalShift()).to.be.bignumber.equal(ZERO) await foreignBridge .rewardableInitialize( ZERO_ADDRESS, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, homeFee, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await foreignBridge .rewardableInitialize( rewardableValidators.address, ZERO_ADDRESS, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, homeFee, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await foreignBridge .rewardableInitialize( rewardableValidators.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, 0, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, homeFee, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await foreignBridge .rewardableInitialize( owner, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, requireBlockConfirmations, gasPrice, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, homeFee, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await foreignBridge .rewardableInitialize( rewardableValidators.address, owner, - [oneEther, halfEther, minPerTx], + limitsArray, requireBlockConfirmations, gasPrice, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, homeFee, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await foreignBridge .rewardableInitialize( rewardableValidators.address, owner, - [oneEther, halfEther, minPerTx], + limitsArray, requireBlockConfirmations, gasPrice, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, ZERO_ADDRESS, homeFee, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await foreignBridge.rewardableInitialize( rewardableValidators.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, homeFee, '9', - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ).should.be.fulfilled expect(await foreignBridge.isInitialized()).to.be.equal(true) @@ -1085,15 +1237,16 @@ contract('ForeignBridge', async accounts => { await foreignBridge.rewardableInitialize( rewardableValidators.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, homeFee, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ).should.be.fulfilled // Given @@ -1111,15 +1264,16 @@ contract('ForeignBridge', async accounts => { await foreignBridge.rewardableInitialize( rewardableValidators.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, homeFee, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ).should.be.fulfilled // Given @@ -1136,15 +1290,16 @@ contract('ForeignBridge', async accounts => { await foreignBridge.rewardableInitialize( rewardableValidators.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, homeFee, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ).should.be.fulfilled // Given @@ -1170,15 +1325,16 @@ contract('ForeignBridge', async accounts => { await foreignBridge.rewardableInitialize( rewardableValidators.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, homeFee, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ).should.be.fulfilled // Then @@ -1213,15 +1369,16 @@ contract('ForeignBridge', async accounts => { await foreignBridge.rewardableInitialize( rewardableValidators.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, feeInWei, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ).should.be.fulfilled await token.transferOwnership(foreignBridge.address) @@ -1236,14 +1393,14 @@ contract('ForeignBridge', async accounts => { const { logs } = await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled - logs[0].event.should.be.equal('FeeDistributedFromSignatures') - logs[0].args.feeAmount.should.be.bignumber.equal(feeAmount) - logs[0].args.transactionHash.should.be.equal(transactionHash) + let event = logs.find(item => item.event === 'FeeDistributedFromSignatures') + event.args.feeAmount.should.be.bignumber.equal(feeAmount) + event.args.transactionHash.should.be.equal(transactionHash) - logs[1].event.should.be.equal('RelayedMessage') - logs[1].args.recipient.should.be.equal(recipientAccount) - logs[1].args.value.should.be.bignumber.equal(value) - logs[1].args.transactionHash.should.be.equal(transactionHash) + event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipientAccount) + event.args.value.should.be.bignumber.equal(value) + event.args.transactionHash.should.be.equal(transactionHash) const balanceAfter = await token.balanceOf(recipientAccount) const totalSupplyAfter = await token.totalSupply() @@ -1272,15 +1429,16 @@ contract('ForeignBridge', async accounts => { await foreignBridge.rewardableInitialize( rewardableValidators.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, feeInWei, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ).should.be.fulfilled await token.transferOwnership(foreignBridge.address) @@ -1310,14 +1468,14 @@ contract('ForeignBridge', async accounts => { ).should.be.fulfilled // Then - logs[0].event.should.be.equal('FeeDistributedFromSignatures') - logs[0].args.feeAmount.should.be.bignumber.equal(feeAmount) - logs[0].args.transactionHash.should.be.equal(transactionHash) + let event = logs.find(item => item.event === 'FeeDistributedFromSignatures') + event.args.feeAmount.should.be.bignumber.equal(feeAmount) + event.args.transactionHash.should.be.equal(transactionHash) - logs[1].event.should.be.equal('RelayedMessage') - logs[1].args.recipient.should.be.equal(recipientAccount) - logs[1].args.value.should.be.bignumber.equal(value) - logs[1].args.transactionHash.should.be.equal(transactionHash) + event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipientAccount) + event.args.value.should.be.bignumber.equal(value) + event.args.transactionHash.should.be.equal(transactionHash) const balanceAfter = await token.balanceOf(recipientAccount) const totalSupplyAfter = await token.totalSupply() @@ -1359,15 +1517,16 @@ contract('ForeignBridge', async accounts => { await foreignBridge.rewardableInitialize( rewardableValidators.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, feeInWei, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ).should.be.fulfilled await token.transferOwnership(foreignBridge.address) @@ -1399,14 +1558,14 @@ contract('ForeignBridge', async accounts => { ).should.be.fulfilled // Then - logs[0].event.should.be.equal('FeeDistributedFromSignatures') - logs[0].args.feeAmount.should.be.bignumber.equal(feeAmount) - logs[0].args.transactionHash.should.be.equal(transactionHash) + let event = logs.find(item => item.event === 'FeeDistributedFromSignatures') + event.args.feeAmount.should.be.bignumber.equal(feeAmount) + event.args.transactionHash.should.be.equal(transactionHash) - logs[1].event.should.be.equal('RelayedMessage') - logs[1].args.recipient.should.be.equal(recipientAccount) - logs[1].args.value.should.be.bignumber.equal(value) - logs[1].args.transactionHash.should.be.equal(transactionHash) + event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipientAccount) + event.args.value.should.be.bignumber.equal(value) + event.args.transactionHash.should.be.equal(transactionHash) const balanceAfter = await token.balanceOf(recipientAccount) const totalSupplyAfter = await token.totalSupply() @@ -1442,12 +1601,13 @@ contract('ForeignBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, feeManager.address, feeInWei, decimalShiftZero, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ).should.be.fulfilled await token.transferOwnership(foreignBridge.address) @@ -1479,13 +1639,14 @@ contract('ForeignBridge', async accounts => { await foreignBridgeWithThreeSigs.initialize( validatorContractWith3Signatures.address, erc20Token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, decimalShiftTwo, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) await erc20Token.transferOwnership(foreignBridgeWithThreeSigs.address) @@ -1511,9 +1672,9 @@ contract('ForeignBridge', async accounts => { [vrs.s, vrs2.s, vrs3.s], message ).should.be.fulfilled - logs[0].event.should.be.equal('RelayedMessage') - logs[0].args.recipient.should.be.equal(recipient) - logs[0].args.value.should.be.bignumber.equal(valueOnHome) + const event = logs.find(item => item.event === 'RelayedMessage') + event.args.recipient.should.be.equal(recipient) + event.args.value.should.be.bignumber.equal(valueOnHome) true.should.be.equal(await foreignBridgeWithThreeSigs.relayedMessages(txHash)) const balanceAfterRecipient = await erc20Token.balanceOf(recipient) balanceAfterRecipient.should.be.bignumber.equal(balanceBeforeRecipient.add(valueOnForeign)) @@ -1529,15 +1690,17 @@ contract('ForeignBridge', async accounts => { await foreignBridge.initialize( validatorContract.address, token.address, - [oneEther, halfEther, minPerTx], + limitsArray, gasPrice, requireBlockConfirmations, - [homeDailyLimit, homeMaxPerTx], + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], owner, decimalShiftTwo, - otherSideBridgeAddress + otherSideBridgeAddress, + absoluteLimitsContract.address ) await token.mint(user, value, { from: owner }).should.be.fulfilled + await token.mint(foreignBridge.address, value, { from: owner }).should.be.fulfilled expect(await token.balanceOf(user)).to.be.bignumber.equal(value) await token.transferOwnership(foreignBridge.address, { from: owner }) const { logs } = await token.transferAndCall(foreignBridge.address, value, '0x', { from: user }) @@ -1546,4 +1709,73 @@ contract('ForeignBridge', async accounts => { expect(await token.balanceOf(user)).to.be.bignumber.equal(ZERO) }) }) + describe('#dailyLimit (relative)', () => { + let token + let foreignBridge + + function initialize(customLimitsArray) { + return foreignBridge.initialize( + validatorContract.address, + token.address, + customLimitsArray, + gasPrice, + requireBlockConfirmations, + [homeDailyLimit, homeMaxPerTx, homeMinPerTx], + owner, + decimalShiftZero, + otherSideBridgeAddress, + relativeLimitsContract.address + ).should.be.fulfilled + } + + beforeEach(async () => { + token = await POA20.new('POA ERC20 Foundation', 'POA20', 18) + foreignBridge = await ForeignBridge.new() + }) + it('should be calculated correctly - 1', async () => { + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(accounts[0], halfEther).should.be.fulfilled + await token.mint(foreignBridge.address, halfEther).should.be.fulfilled + expect(await token.balanceOf(foreignBridge.address)).to.be.bignumber.equal(halfEther) + expect(await token.totalSupply()).to.be.bignumber.equal(oneEther) + + const limit = await foreignBridge.dailyLimit() + const expectedLimit = calculateDailyLimit(oneEther, targetLimit, threshold, homeMinPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + it('should be calculated correctly - 2', async function() { + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(foreignBridge.address, homeMinPerTx).should.be.fulfilled + expect(await token.totalSupply()).to.be.bignumber.equal(homeMinPerTx) + + const limit = await foreignBridge.dailyLimit() + expect(limit).to.be.bignumber.equal(homeMinPerTx) + }) + it('should be calculated correctly - 3', async function() { + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(foreignBridge.address, threshold).should.be.fulfilled + expect(await token.totalSupply()).to.be.bignumber.equal(threshold) + + const limit = await foreignBridge.dailyLimit() + expect(limit).to.be.bignumber.equal(threshold.mul(targetLimit).div(oneEther)) + }) + it('should be calculated correctly - 4', async function() { + const amountToMint = ether('5') + const targetLimit = ether('0.06') + const threshold = ether('100') + const homeMinPerTx = ether('0.1') + + await initialize([targetLimit, threshold, homeMaxPerTx, homeMinPerTx]) + + await token.mint(foreignBridge.address, amountToMint).should.be.fulfilled + expect(await token.totalSupply()).to.be.bignumber.equal(amountToMint) + + const limit = await foreignBridge.dailyLimit() + const expectedLimit = calculateDailyLimit(amountToMint, targetLimit, threshold, homeMinPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + }) }) diff --git a/test/native_to_erc/home_bridge_test.js b/test/native_to_erc/home_bridge_test.js index 38ae1f79d..95145501d 100644 --- a/test/native_to_erc/home_bridge_test.js +++ b/test/native_to_erc/home_bridge_test.js @@ -7,10 +7,20 @@ const FeeManagerNativeToErcBothDirections = artifacts.require('FeeManagerNativeT const RewardableValidators = artifacts.require('RewardableValidators.sol') const ERC677BridgeToken = artifacts.require('ERC677BridgeToken.sol') const NoReturnTransferTokenMock = artifacts.require('NoReturnTransferTokenMock.sol') +const AbsoluteDailyLimit = artifacts.require('AbsoluteDailyLimit.sol') +const RelativeExecutionDailyLimit = artifacts.require('RelativeExecutionDailyLimit.sol') const { expect } = require('chai') +const { expectEvent } = require('@openzeppelin/test-helpers') const { ERROR_MSG, ZERO_ADDRESS, toBN } = require('../setup') -const { createMessage, sign, ether, expectEventInLogs, createAccounts } = require('../helpers/helpers') +const { + createMessage, + sign, + ether, + expectEventInLogs, + calculateDailyLimit, + createAccounts +} = require('../helpers/helpers') const minPerTx = ether('0.01') const requireBlockConfirmations = 8 @@ -20,67 +30,88 @@ const twoEther = ether('2') const halfEther = ether('0.5') const foreignDailyLimit = oneEther const foreignMaxPerTx = halfEther +const foreignMinPerTx = minPerTx const ZERO = toBN(0) const MAX_GAS = 8000000 const MAX_VALIDATORS = 50 const decimalShiftZero = 0 +const targetLimit = ether('0.05') +const threshold = ether('10000') + +contract('HomeBridge_Native_to_ERC', async accounts => { + const executionLimitsArray = [foreignDailyLimit, foreignMaxPerTx, foreignMinPerTx] + const relativeExecutionLimitsArray = [targetLimit, threshold, foreignMaxPerTx, foreignMinPerTx] -contract('HomeBridge', async accounts => { let homeContract let validatorContract let authorities let owner + let absoluteLimitsContract + let relativeLimitsContract + before(async () => { validatorContract = await BridgeValidators.new() authorities = [accounts[1]] owner = accounts[0] await validatorContract.initialize(1, authorities, owner) + absoluteLimitsContract = await AbsoluteDailyLimit.new() + relativeLimitsContract = await RelativeExecutionDailyLimit.new() }) describe('#initialize', async () => { beforeEach(async () => { homeContract = await HomeBridge.new() }) - it('sets variables', async () => { - expect(await homeContract.validatorContract()).to.be.equal(ZERO_ADDRESS) - expect(await homeContract.deployedAtBlock()).to.be.bignumber.equal(ZERO) - expect(await homeContract.dailyLimit()).to.be.bignumber.equal(ZERO) - expect(await homeContract.maxPerTx()).to.be.bignumber.equal(ZERO) - expect(await homeContract.decimalShift()).to.be.bignumber.equal(ZERO) - expect(await homeContract.isInitialized()).to.be.equal(false) - - const { logs } = await homeContract.initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], - owner, - '9' - ).should.be.fulfilled + const setsVariables = isRelativeDailyLimit => + async function() { + expect(await homeContract.validatorContract()).to.be.equal(ZERO_ADDRESS) + expect(await homeContract.limitsContract()).to.be.equal(ZERO_ADDRESS) + expect(await homeContract.deployedAtBlock()).to.be.bignumber.equal(ZERO) + expect(await homeContract.decimalShift()).to.be.bignumber.equal(ZERO) + expect(await homeContract.isInitialized()).to.be.equal(false) - expect(await homeContract.isInitialized()).to.be.equal(true) - expect(await homeContract.validatorContract()).to.be.equal(validatorContract.address) - expect(await homeContract.deployedAtBlock()).to.be.bignumber.above(ZERO) - expect(await homeContract.dailyLimit()).to.be.bignumber.equal('3') - expect(await homeContract.maxPerTx()).to.be.bignumber.equal('2') - expect(await homeContract.minPerTx()).to.be.bignumber.equal('1') - expect(await homeContract.gasPrice()).to.be.bignumber.equal(gasPrice) - expect(await homeContract.decimalShift()).to.be.bignumber.equal('9') - const bridgeMode = '0x92a8d7fe' // 4 bytes of keccak256('native-to-erc-core') - expect(await homeContract.getBridgeMode()).to.be.equal(bridgeMode) - const { major, minor, patch } = await homeContract.getBridgeInterfacesVersion() - expect(major).to.be.bignumber.gte(ZERO) - expect(minor).to.be.bignumber.gte(ZERO) - expect(patch).to.be.bignumber.gte(ZERO) + const limitsContract = isRelativeDailyLimit ? relativeLimitsContract : absoluteLimitsContract - expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { - requiredBlockConfirmations: toBN(requireBlockConfirmations) - }) - expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) - expectEventInLogs(logs, 'ExecutionDailyLimitChanged', { newLimit: foreignDailyLimit }) - expectEventInLogs(logs, 'DailyLimitChanged', { newLimit: '3' }) - }) + const { logs, tx } = await homeContract.initialize( + validatorContract.address, + ['3', '2', '1'], + gasPrice, + requireBlockConfirmations, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + '9', + limitsContract.address + ).should.be.fulfilled + + expect(await homeContract.isInitialized()).to.be.equal(true) + expect(await homeContract.validatorContract()).to.be.equal(validatorContract.address) + expect(await homeContract.limitsContract()).to.be.equal(limitsContract.address) + expect(await homeContract.deployedAtBlock()).to.be.bignumber.above(ZERO) + expect(await homeContract.dailyLimit()).to.be.bignumber.equal('3') + expect(await homeContract.maxPerTx()).to.be.bignumber.equal('2') + expect(await homeContract.minPerTx()).to.be.bignumber.equal('1') + expect(await homeContract.gasPrice()).to.be.bignumber.equal(gasPrice) + expect(await homeContract.decimalShift()).to.be.bignumber.equal('9') + const bridgeMode = '0x92a8d7fe' // 4 bytes of keccak256('native-to-erc-core') + expect(await homeContract.getBridgeMode()).to.be.equal(bridgeMode) + const { major, minor, patch } = await homeContract.getBridgeInterfacesVersion() + expect(major).to.be.bignumber.gte(ZERO) + expect(minor).to.be.bignumber.gte(ZERO) + expect(patch).to.be.bignumber.gte(ZERO) + + expectEventInLogs(logs, 'RequiredBlockConfirmationChanged', { + requiredBlockConfirmations: toBN(requireBlockConfirmations) + }) + expectEventInLogs(logs, 'GasPriceChanged', { gasPrice }) + await expectEvent.inTransaction(tx, limitsContract, 'DailyLimitChanged', { newLimit: '3' }) + if (!isRelativeDailyLimit) { + await expectEvent.inTransaction(tx, limitsContract, 'ExecutionDailyLimitChanged', { + newLimit: foreignDailyLimit.toString() + }) + } + } + it('sets variables', setsVariables(false)) + it('sets variables (relative limit)', setsVariables(true)) it('cant set maxPerTx > dailyLimit', async () => { false.should.be.equal(await homeContract.isInitialized()) await homeContract @@ -89,9 +120,10 @@ contract('HomeBridge', async accounts => { ['1', '2', '1'], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract @@ -100,9 +132,10 @@ contract('HomeBridge', async accounts => { ['3', '2', '2'], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) false.should.be.equal(await homeContract.isInitialized()) @@ -114,9 +147,10 @@ contract('HomeBridge', async accounts => { ['3', '2', '1'], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled expect(await homeContract.gasPrice()).to.be.bignumber.equal(gasPrice) @@ -139,9 +173,10 @@ contract('HomeBridge', async accounts => { ['3', '2', '1'], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled expect(await homeContract.requiredBlockConfirmations()).to.be.bignumber.equal(toBN(requireBlockConfirmations)) @@ -169,9 +204,10 @@ contract('HomeBridge', async accounts => { ['3', '2', '1'], gasPrice, requireBlockConfirmations, - ['3', '2'], + ['3', '2', '1'], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .encodeABI() await storageProxy.upgradeTo('1', accounts[5]).should.be.rejectedWith(ERROR_MSG) @@ -193,9 +229,10 @@ contract('HomeBridge', async accounts => { ['3', '2', '1'], gasPrice, 0, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract @@ -204,9 +241,10 @@ contract('HomeBridge', async accounts => { ['3', '2', '1'], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract @@ -215,9 +253,10 @@ contract('HomeBridge', async accounts => { ['3', '2', '1'], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeContract.initialize( @@ -225,9 +264,10 @@ contract('HomeBridge', async accounts => { ['3', '2', '1'], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled true.should.be.equal(await homeContract.isInitialized()) }) @@ -238,9 +278,10 @@ contract('HomeBridge', async accounts => { ['3', '2', '1'], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled expect(await homeContract.owner()).to.be.equal(owner) @@ -264,9 +305,10 @@ contract('HomeBridge', async accounts => { ['3', '2', '1'], gasPrice, requireBlockConfirmations, - ['3', '2'], + ['3', '2', '1'], owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .encodeABI() await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled @@ -276,228 +318,242 @@ contract('HomeBridge', async accounts => { }) }) - describe('#fallback', async () => { - beforeEach(async () => { - homeContract = await HomeBridge.new() - await homeContract.initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ) - }) - it('should accept native coins', async () => { - const currentDay = await homeContract.getCurrentDay() - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - - const { logs } = await homeContract.sendTransaction({ - from: accounts[1], - value: 1 - }).should.be.fulfilled - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('1') - - expectEventInLogs(logs, 'UserRequestForSignature', { recipient: accounts[1], value: toBN(1) }) + const fallback = isRelativeDailyLimit => + function() { + beforeEach(async () => { + homeContract = await HomeBridge.new() + await homeContract.initialize( + validatorContract.address, + ['3', '2', '1'], + gasPrice, + requireBlockConfirmations, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + }) + it('should accept native coins', async () => { + const currentDay = await homeContract.getCurrentDay() + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - await homeContract - .sendTransaction({ + const { logs } = await homeContract.sendTransaction({ from: accounts[1], - value: 3 - }) - .should.be.rejectedWith(ERROR_MSG) + value: 1 + }).should.be.fulfilled + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('1') - await homeContract.setDailyLimit(4).should.be.fulfilled - await homeContract.sendTransaction({ - from: accounts[1], - value: 1 - }).should.be.fulfilled + expectEventInLogs(logs, 'UserRequestForSignature', { recipient: accounts[1], value: toBN(1) }) - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('2') - }) + await homeContract + .sendTransaction({ + from: accounts[1], + value: 3 + }) + .should.be.rejectedWith(ERROR_MSG) - it('doesnt let you send more than max amount per tx', async () => { - await homeContract.sendTransaction({ - from: accounts[1], - value: 1 - }).should.be.fulfilled - await homeContract - .sendTransaction({ - from: accounts[1], - value: 3 - }) - .should.be.rejectedWith(ERROR_MSG) - await homeContract.setMaxPerTx(100).should.be.rejectedWith(ERROR_MSG) - await homeContract.setDailyLimit(100).should.be.fulfilled - await homeContract.setMaxPerTx(99).should.be.fulfilled - // meets max per tx and daily limit - await homeContract.sendTransaction({ - from: accounts[1], - value: 99 - }).should.be.fulfilled - // above daily limit - await homeContract - .sendTransaction({ + await homeContract.setDailyLimit(4).should.be.fulfilled + await homeContract.sendTransaction({ from: accounts[1], value: 1 - }) - .should.be.rejectedWith(ERROR_MSG) - }) + }).should.be.fulfilled - it('should not let to deposit less than minPerTx', async () => { - const newDailyLimit = 100 - const newMaxPerTx = 50 - const newMinPerTx = 20 - await homeContract.setDailyLimit(newDailyLimit).should.be.fulfilled - await homeContract.setMaxPerTx(newMaxPerTx).should.be.fulfilled - await homeContract.setMinPerTx(newMinPerTx).should.be.fulfilled + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('2') + }) - await homeContract.sendTransaction({ - from: accounts[1], - value: newMinPerTx - }).should.be.fulfilled - await homeContract - .sendTransaction({ + it('doesnt let you send more than max amount per tx', async () => { + await homeContract.sendTransaction({ from: accounts[1], - value: newMinPerTx - 1 - }) - .should.be.rejectedWith(ERROR_MSG) - }) - }) - - describe('#relayTokens', async () => { - const user = accounts[1] - const user2 = accounts[2] - beforeEach(async () => { - homeContract = await HomeBridge.new() - await homeContract.initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ) - }) - it('should accept native coins and alternative receiver', async () => { - const currentDay = await homeContract.getCurrentDay() - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) + value: 1 + }).should.be.fulfilled + await homeContract + .sendTransaction({ + from: accounts[1], + value: 3 + }) + .should.be.rejectedWith(ERROR_MSG) + await homeContract.setMaxPerTx(100).should.be.rejectedWith(ERROR_MSG) + await homeContract.setDailyLimit(100).should.be.fulfilled + await homeContract.setMaxPerTx(99).should.be.fulfilled + // meets max per tx and daily limit + await homeContract.sendTransaction({ + from: accounts[1], + value: 99 + }).should.be.fulfilled + // above daily limit + await homeContract + .sendTransaction({ + from: accounts[1], + value: 1 + }) + .should.be.rejectedWith(ERROR_MSG) + }) - const { logs } = await homeContract.relayTokens(user2, { - from: user, - value: 1 - }).should.be.fulfilled - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('1') + it('should not let to deposit less than minPerTx', async () => { + const newDailyLimit = 100 + const newMaxPerTx = 50 + const newMinPerTx = 20 + await homeContract.setDailyLimit(newDailyLimit).should.be.fulfilled + await homeContract.setMaxPerTx(newMaxPerTx).should.be.fulfilled + await homeContract.setMinPerTx(newMinPerTx).should.be.fulfilled - expectEventInLogs(logs, 'UserRequestForSignature', { recipient: user2, value: toBN(1) }) + await homeContract.sendTransaction({ + from: accounts[1], + value: newMinPerTx + }).should.be.fulfilled + await homeContract + .sendTransaction({ + from: accounts[1], + value: newMinPerTx - 1 + }) + .should.be.rejectedWith(ERROR_MSG) + }) + } + + describe('#fallback', fallback(false)) + describe('#fallback (relative limit)', fallback(true)) + + const relayTokens = isRelativeDailyLimit => + function() { + const user = accounts[1] + const user2 = accounts[2] + beforeEach(async () => { + homeContract = await HomeBridge.new() + await homeContract.initialize( + validatorContract.address, + ['3', '2', '1'], + gasPrice, + requireBlockConfirmations, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + }) + it('should accept native coins and alternative receiver', async () => { + const currentDay = await homeContract.getCurrentDay() + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) - await homeContract - .relayTokens(user2, { + const { logs } = await homeContract.relayTokens(user2, { from: user, - value: 3 - }) - .should.be.rejectedWith(ERROR_MSG) + value: 1 + }).should.be.fulfilled + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('1') - await homeContract.setDailyLimit(4).should.be.fulfilled - await homeContract.relayTokens(user2, { - from: user, - value: 1 - }).should.be.fulfilled + expectEventInLogs(logs, 'UserRequestForSignature', { recipient: user2, value: toBN(1) }) - expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('2') - }) + await homeContract + .relayTokens(user2, { + from: user, + value: 3 + }) + .should.be.rejectedWith(ERROR_MSG) - it('doesnt let you send more than max amount per tx', async () => { - await homeContract.relayTokens(user2, { - from: user, - value: 1 - }).should.be.fulfilled - await homeContract - .relayTokens(user2, { + await homeContract.setDailyLimit(4).should.be.fulfilled + await homeContract.relayTokens(user2, { from: user, - value: 3 - }) - .should.be.rejectedWith(ERROR_MSG) - await homeContract.setMaxPerTx(100).should.be.rejectedWith(ERROR_MSG) - await homeContract.setDailyLimit(100).should.be.fulfilled - await homeContract.setMaxPerTx(99).should.be.fulfilled - // meets max per tx and daily limit - await homeContract.relayTokens(user2, { - from: user, - value: 99 - }).should.be.fulfilled - // above daily limit - await homeContract - .relayTokens(user2, { + value: 1 + }).should.be.fulfilled + + expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('2') + }) + + it('doesnt let you send more than max amount per tx', async () => { + await homeContract.relayTokens(user2, { from: user, value: 1 - }) - .should.be.rejectedWith(ERROR_MSG) - }) + }).should.be.fulfilled + await homeContract + .relayTokens(user2, { + from: user, + value: 3 + }) + .should.be.rejectedWith(ERROR_MSG) + await homeContract.setMaxPerTx(100).should.be.rejectedWith(ERROR_MSG) + await homeContract.setDailyLimit(100).should.be.fulfilled + await homeContract.setMaxPerTx(99).should.be.fulfilled + // meets max per tx and daily limit + await homeContract.relayTokens(user2, { + from: user, + value: 99 + }).should.be.fulfilled + // above daily limit + await homeContract + .relayTokens(user2, { + from: user, + value: 1 + }) + .should.be.rejectedWith(ERROR_MSG) + }) - it('should not let to deposit less than minPerTx', async () => { - const newDailyLimit = 100 - const newMaxPerTx = 50 - const newMinPerTx = 20 - await homeContract.setDailyLimit(newDailyLimit).should.be.fulfilled - await homeContract.setMaxPerTx(newMaxPerTx).should.be.fulfilled - await homeContract.setMinPerTx(newMinPerTx).should.be.fulfilled + it('should not let to deposit less than minPerTx', async () => { + const newDailyLimit = 100 + const newMaxPerTx = 50 + const newMinPerTx = 20 + await homeContract.setDailyLimit(newDailyLimit).should.be.fulfilled + await homeContract.setMaxPerTx(newMaxPerTx).should.be.fulfilled + await homeContract.setMinPerTx(newMinPerTx).should.be.fulfilled - await homeContract.relayTokens(user2, { - from: user, - value: newMinPerTx - }).should.be.fulfilled - await homeContract - .relayTokens(user2, { + await homeContract.relayTokens(user2, { from: user, - value: newMinPerTx - 1 - }) - .should.be.rejectedWith(ERROR_MSG) - }) - }) + value: newMinPerTx + }).should.be.fulfilled + await homeContract + .relayTokens(user2, { + from: user, + value: newMinPerTx - 1 + }) + .should.be.rejectedWith(ERROR_MSG) + }) + } - describe('#setting limits', async () => { - let homeContract - beforeEach(async () => { - homeContract = await HomeBridge.new() - await homeContract.initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], - owner, - decimalShiftZero - ) - }) - it('#setMaxPerTx allows to set only to owner and cannot be more than daily limit', async () => { - await homeContract.setMaxPerTx(2, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) - await homeContract.setMaxPerTx(2, { from: owner }).should.be.fulfilled + describe('#relayTokens', relayTokens(false)) + describe('#relayTokens (relative limit)', relayTokens(true)) - await homeContract.setMaxPerTx(3, { from: owner }).should.be.rejectedWith(ERROR_MSG) - }) - it('#setMinPerTx allows to set only to owner and cannot be more than daily limit and should be less than maxPerTx', async () => { - await homeContract.setMinPerTx(1, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) - await homeContract.setMinPerTx(1, { from: owner }).should.be.fulfilled + const settingLimits = isRelativeDailyLimit => + function() { + let homeContract + beforeEach(async () => { + homeContract = await HomeBridge.new() + await homeContract.initialize( + validatorContract.address, + ['3', '2', '1'], + gasPrice, + requireBlockConfirmations, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + }) + it('#setMaxPerTx allows to set only to owner and cannot be more than daily limit', async () => { + await homeContract.setMaxPerTx(2, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) + await homeContract.setMaxPerTx(2, { from: owner }).should.be.fulfilled - await homeContract.setMinPerTx(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) - }) - it('#setDailyLimit allow to set by owner and should be greater than maxPerTx or zero', async () => { - await homeContract.setDailyLimit(4, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) - await homeContract.setDailyLimit(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) + await homeContract.setMaxPerTx(3, { from: owner }).should.be.rejectedWith(ERROR_MSG) + }) + it('#setMinPerTx allows to set only to owner and cannot be more than daily limit and should be less than maxPerTx', async () => { + await homeContract.setMinPerTx(1, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) + await homeContract.setMinPerTx(1, { from: owner }).should.be.fulfilled + + await homeContract.setMinPerTx(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) + }) + it('#setDailyLimit allow to set by owner and should be greater than maxPerTx or zero', async () => { + await homeContract.setDailyLimit(4, { from: authorities[0] }).should.be.rejectedWith(ERROR_MSG) + await homeContract.setDailyLimit(2, { from: owner }).should.be.rejectedWith(ERROR_MSG) - await homeContract.setDailyLimit(4, { from: owner }).should.be.fulfilled - expect(await homeContract.dailyLimit()).to.be.bignumber.equal('4') + await homeContract.setDailyLimit(4, { from: owner }).should.be.fulfilled + expect(await homeContract.dailyLimit()).to.be.bignumber.equal('4') - await homeContract.setDailyLimit(0, { from: owner }).should.be.fulfilled - expect(await homeContract.dailyLimit()).to.be.bignumber.equal(ZERO) + await homeContract.setDailyLimit(0, { from: owner }).should.be.fulfilled + expect(await homeContract.dailyLimit()).to.be.bignumber.equal(ZERO) - await homeContract.setDailyLimit(4, { from: owner }).should.be.fulfilled - expect(await homeContract.dailyLimit()).to.be.bignumber.equal('4') - }) - }) + await homeContract.setDailyLimit(4, { from: owner }).should.be.fulfilled + expect(await homeContract.dailyLimit()).to.be.bignumber.equal('4') + }) + } + describe('#setting limits', settingLimits(false)) + describe('#setting limits (relative limit)', settingLimits(true)) describe('#executeAffirmation', async () => { let homeBridge @@ -508,42 +564,63 @@ contract('HomeBridge', async accounts => { [twoEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) await homeBridge.sendTransaction({ from: accounts[2], value: halfEther }).should.be.fulfilled }) - it('should allow validator to executeAffirmation', async () => { - const recipient = accounts[5] - const value = halfEther - const balanceBefore = toBN(await web3.eth.getBalance(recipient)) - const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' - const { logs } = await homeBridge.executeAffirmation(recipient, value, transactionHash, { - from: authorities[0] - }) - - expectEventInLogs(logs, 'SignedForAffirmation', { - signer: authorities[0], - transactionHash - }) - expectEventInLogs(logs, 'AffirmationCompleted', { - recipient, - value, - transactionHash - }) - const homeBalanceAfter = toBN(await web3.eth.getBalance(homeBridge.address)) - const balanceAfter = toBN(await web3.eth.getBalance(recipient)) - balanceAfter.should.be.bignumber.equal(balanceBefore.add(value)) - homeBalanceAfter.should.be.bignumber.equal(ZERO) - - const msgHash = web3.utils.soliditySha3(recipient, value, transactionHash) - const senderHash = web3.utils.soliditySha3(authorities[0], msgHash) - true.should.be.equal(await homeBridge.affirmationsSigned(senderHash)) - }) + const shouldAllowValidatorToExecuteAffirmation = isRelativeDailyLimit => + async function() { + homeBridge = await HomeBridge.new() + await homeBridge.initialize( + validatorContract.address, + [twoEther, oneEther, minPerTx], + gasPrice, + requireBlockConfirmations, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await homeBridge.sendTransaction({ + from: accounts[2], + value: oneEther + }).should.be.fulfilled + + const recipient = accounts[5] + const value = halfEther + + const balanceBefore = toBN(await web3.eth.getBalance(recipient)) + const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' + const { logs } = await homeBridge.executeAffirmation(recipient, value, transactionHash, { + from: authorities[0] + }).should.be.fulfilled + + expectEventInLogs(logs, 'SignedForAffirmation', { + signer: authorities[0], + transactionHash + }) + expectEventInLogs(logs, 'AffirmationCompleted', { + recipient, + value, + transactionHash + }) + const homeBalanceAfter = toBN(await web3.eth.getBalance(homeBridge.address)) + const balanceAfter = toBN(await web3.eth.getBalance(recipient)) + balanceAfter.should.be.bignumber.equal(balanceBefore.add(value)) + homeBalanceAfter.should.be.bignumber.equal(halfEther) + + const msgHash = web3.utils.soliditySha3(recipient, value, transactionHash) + const senderHash = web3.utils.soliditySha3(authorities[0], msgHash) + true.should.be.equal(await homeBridge.affirmationsSigned(senderHash)) + } + it('should allow validator to executeAffirmation', shouldAllowValidatorToExecuteAffirmation(false)) + it('should allow validator to executeAffirmation (relative limit)', shouldAllowValidatorToExecuteAffirmation(true)) it('should allow validator to executeAffirmation with zero value', async () => { const recipient = accounts[5] @@ -580,20 +657,21 @@ contract('HomeBridge', async accounts => { const homeBridgeWithTwoSigs = await HomeBridge.new() await homeBridgeWithTwoSigs.initialize( validatorContractWith2Signatures.address, - [twoEther, halfEther, minPerTx], + [twoEther, ether('1.5'), minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) await homeBridgeWithTwoSigs.sendTransaction({ from: accounts[2], - value: halfEther + value: ether('1.5') }).should.be.fulfilled const homeBalanceBefore = toBN(await web3.eth.getBalance(homeBridgeWithTwoSigs.address)) - homeBalanceBefore.should.be.bignumber.equal(halfEther) + homeBalanceBefore.should.be.bignumber.equal(ether('1.5')) const recipient = accounts[5] const value = halfEther @@ -606,7 +684,7 @@ contract('HomeBridge', async accounts => { }).should.be.fulfilled expectEventInLogs(logs, 'SignedForAffirmation', { signer: authorities[0], transactionHash }) - halfEther.should.be.bignumber.equal(await web3.eth.getBalance(homeBridgeWithTwoSigs.address)) + ether('1.5').should.be.bignumber.equal(await web3.eth.getBalance(homeBridgeWithTwoSigs.address)) const notProcessed = await homeBridgeWithTwoSigs.numAffirmationsSigned(msgHash) notProcessed.should.be.bignumber.equal('1') @@ -619,7 +697,7 @@ contract('HomeBridge', async accounts => { const balanceAfter = toBN(await web3.eth.getBalance(recipient)) balanceAfter.should.be.bignumber.equal(balanceBefore.add(value)) - expect(toBN(await web3.eth.getBalance(homeBridgeWithTwoSigs.address))).to.be.bignumber.equal(ZERO) + expect(toBN(await web3.eth.getBalance(homeBridgeWithTwoSigs.address))).to.be.bignumber.equal(oneEther) expectEventInLogs(secondSignature.logs, 'AffirmationCompleted', { recipient, @@ -671,9 +749,10 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) await homeBridgeWithTwoSigs.sendTransaction({ @@ -713,6 +792,8 @@ contract('HomeBridge', async accounts => { await revertFallbackContract.receiveEth({ from: accounts[0], value: halfEther }) expect(toBN(await web3.eth.getBalance(revertFallbackContract.address))).to.be.bignumber.equal(halfEther) + await homeBridge.sendTransaction({ from: accounts[2], value: halfEther }) + const transactionHash = '0x106335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' const { logs } = await homeBridge.executeAffirmation(revertFallbackContract.address, halfEther, transactionHash, { from: authorities[0] @@ -730,7 +811,7 @@ contract('HomeBridge', async accounts => { const homeBalanceAfter = toBN(await web3.eth.getBalance(homeBridge.address)) const balanceAfter = toBN(await web3.eth.getBalance(revertFallbackContract.address)) balanceAfter.should.be.bignumber.equal(halfEther.add(halfEther)) - homeBalanceAfter.should.be.bignumber.equal(ZERO) + homeBalanceAfter.should.be.bignumber.equal(halfEther) }) it('works with 5 validators and 3 required signatures', async () => { const recipient = accounts[8] @@ -745,14 +826,19 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) const value = halfEther const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' + await homeBridgeWithThreeSigs.sendTransaction({ + from: recipient, + value: halfEther + }).should.be.fulfilled await homeBridgeWithThreeSigs.sendTransaction({ from: recipient, value: halfEther @@ -779,56 +865,103 @@ contract('HomeBridge', async accounts => { transactionHash }) }) - it('should not allow execute affirmation over foreign max tx limit', async () => { - const recipient = accounts[5] - const value = oneEther - const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' - - await homeBridge - .executeAffirmation(recipient, value, transactionHash, { from: authorities[0] }) - .should.be.rejectedWith(ERROR_MSG) - }) - it('should not allow execute affirmation over daily foreign limit', async () => { - await homeBridge.sendTransaction({ from: accounts[2], value: halfEther }).should.be.fulfilled - await homeBridge.sendTransaction({ from: accounts[2], value: halfEther }).should.be.fulfilled - - const recipient = accounts[5] - const value = halfEther - const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' - const { logs } = await homeBridge.executeAffirmation(recipient, value, transactionHash, { - from: authorities[0] - }).should.be.fulfilled - - expectEventInLogs(logs, 'SignedForAffirmation', { - signer: authorities[0], - transactionHash - }) - expectEventInLogs(logs, 'AffirmationCompleted', { - recipient, - value, - transactionHash - }) + const shouldNotAllowExecuteAffirmationOverForeignMaxTxLimit = isRelativeDailyLimit => + async function() { + homeBridge = await HomeBridge.new() + await homeBridge.initialize( + validatorContract.address, + [twoEther, oneEther, minPerTx], + gasPrice, + requireBlockConfirmations, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await homeBridge.sendTransaction({ + from: accounts[2], + value: oneEther + }).should.be.fulfilled + + const recipient = accounts[5] + const value = oneEther + const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' + + await homeBridge + .executeAffirmation(recipient, value, transactionHash, { from: authorities[0] }) + .should.be.rejectedWith(ERROR_MSG) + } + it( + 'should not allow execute affirmation over foreign max tx limit', + shouldNotAllowExecuteAffirmationOverForeignMaxTxLimit(false) + ) + it( + 'should not allow execute affirmation over foreign max tx limit (relative limit)', + shouldNotAllowExecuteAffirmationOverForeignMaxTxLimit(true) + ) + const shouldNotAllowExecuteAffirmationOverDailyForeignLimit = isRelativeDailyLimit => + async function() { + homeBridge = await HomeBridge.new() + await homeBridge.initialize( + validatorContract.address, + [twoEther, oneEther.add(halfEther), minPerTx], + gasPrice, + requireBlockConfirmations, + isRelativeDailyLimit ? relativeExecutionLimitsArray : executionLimitsArray, + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + await homeBridge.sendTransaction({ + from: accounts[2], + value: oneEther.add(halfEther) + }).should.be.fulfilled + + const recipient = accounts[5] + const value = halfEther + const transactionHash = '0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415' + const { logs } = await homeBridge.executeAffirmation(recipient, value, transactionHash, { + from: authorities[0] + }).should.be.fulfilled + + expectEventInLogs(logs, 'SignedForAffirmation', { + signer: authorities[0], + transactionHash + }) + expectEventInLogs(logs, 'AffirmationCompleted', { + recipient, + value, + transactionHash + }) - const transactionHash2 = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' - const { logs: logs2 } = await homeBridge.executeAffirmation(recipient, value, transactionHash2, { - from: authorities[0] - }).should.be.fulfilled + const transactionHash2 = '0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121' + const { logs: logs2 } = await homeBridge.executeAffirmation(recipient, value, transactionHash2, { + from: authorities[0] + }).should.be.fulfilled - expectEventInLogs(logs2, 'SignedForAffirmation', { - signer: authorities[0], - transactionHash: transactionHash2 - }) - expectEventInLogs(logs2, 'AffirmationCompleted', { - recipient, - value, - transactionHash: transactionHash2 - }) + expectEventInLogs(logs2, 'SignedForAffirmation', { + signer: authorities[0], + transactionHash: transactionHash2 + }) + expectEventInLogs(logs2, 'AffirmationCompleted', { + recipient, + value, + transactionHash: transactionHash2 + }) - const transactionHash3 = '0x69debd8fd1923c9cb3cd8ef6461e2740b2d037943b941729d5a47671a2bb8712' - await homeBridge - .executeAffirmation(recipient, value, transactionHash3, { from: authorities[0] }) - .should.be.rejectedWith(ERROR_MSG) - }) + const transactionHash3 = '0x69debd8fd1923c9cb3cd8ef6461e2740b2d037943b941729d5a47671a2bb8712' + await homeBridge + .executeAffirmation(recipient, value, transactionHash3, { from: authorities[0] }) + .should.be.rejectedWith(ERROR_MSG) + } + it( + 'should not allow execute affirmation over daily foreign limit', + shouldNotAllowExecuteAffirmationOverDailyForeignLimit(false) + ) + it( + 'should not allow execute affirmation over daily foreign limit (relative limit)', + shouldNotAllowExecuteAffirmationOverDailyForeignLimit(true) + ) }) describe('#isAlreadyProcessed', async () => { @@ -858,9 +991,10 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) }) it('allows a validator to submit a signature', async () => { @@ -918,9 +1052,10 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) const value = halfEther @@ -1012,91 +1147,99 @@ contract('HomeBridge', async accounts => { }) }) - describe('#claimTokens', () => { - it('should work with token that return bool on transfer', async () => { - const storageProxy = await EternalStorageProxy.new() - const data = homeContract.contract.methods - .initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - ['3', '2'], - owner, - decimalShiftZero - ) - .encodeABI() - await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled - const homeBridge = await HomeBridge.at(storageProxy.address) - - const token = await ERC677BridgeToken.new('Test', 'TST', 18) - - await token.mint(accounts[0], halfEther).should.be.fulfilled - expect(await token.balanceOf(accounts[0])).to.be.bignumber.equal(halfEther) - - await token.transfer(homeBridge.address, halfEther).should.be.fulfilled - expect(await token.balanceOf(accounts[0])).to.be.bignumber.equal(ZERO) - expect(await token.balanceOf(homeBridge.address)).to.be.bignumber.equal(halfEther) - - await homeBridge.claimTokens(token.address, accounts[3], { from: owner }).should.be.fulfilled - expect(await token.balanceOf(homeBridge.address)).to.be.bignumber.equal(ZERO) - expect(await token.balanceOf(accounts[3])).to.be.bignumber.equal(halfEther) - }) - it('should works with token that not return on transfer', async () => { - const storageProxy = await EternalStorageProxy.new() - const data = homeContract.contract.methods - .initialize( - validatorContract.address, - ['3', '2', '1'], - gasPrice, - requireBlockConfirmations, - ['3', '2'], - owner, - decimalShiftZero - ) - .encodeABI() - await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled - const homeBridge = await HomeBridge.at(storageProxy.address) - - const tokenMock = await NoReturnTransferTokenMock.new() - - await tokenMock.mint(accounts[0], halfEther).should.be.fulfilled - expect(await tokenMock.balanceOf(accounts[0])).to.be.bignumber.equal(halfEther) - - await tokenMock.transfer(homeBridge.address, halfEther).should.be.fulfilled - expect(await tokenMock.balanceOf(accounts[0])).to.be.bignumber.equal(ZERO) - expect(await tokenMock.balanceOf(homeBridge.address)).to.be.bignumber.equal(halfEther) - - await homeBridge.claimTokens(tokenMock.address, accounts[3], { from: owner }).should.be.fulfilled - expect(await tokenMock.balanceOf(homeBridge.address)).to.be.bignumber.equal(ZERO) - expect(await tokenMock.balanceOf(accounts[3])).to.be.bignumber.equal(halfEther) - }) - it('should work for native coins', async () => { - const storageProxy = await EternalStorageProxy.new() - const data = homeContract.contract.methods - .initialize( - validatorContract.address, - [oneEther.toString(), halfEther.toString(), '1'], - gasPrice, - requireBlockConfirmations, - [oneEther.toString(), halfEther.toString()], - owner, - decimalShiftZero - ) - .encodeABI() - await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled - const homeBridge = await HomeBridge.at(storageProxy.address) - - const balanceBefore = toBN(await web3.eth.getBalance(accounts[3])) - - await homeBridge.sendTransaction({ from: accounts[2], value: halfEther }).should.be.fulfilled - expect(toBN(await web3.eth.getBalance(homeBridge.address))).to.be.bignumber.equal(halfEther) - - await homeBridge.claimTokens(ZERO_ADDRESS, accounts[3], { from: owner }).should.be.fulfilled - expect(toBN(await web3.eth.getBalance(homeBridge.address))).to.be.bignumber.equal(ZERO) - expect(toBN(await web3.eth.getBalance(accounts[3]))).to.be.bignumber.equal(balanceBefore.add(halfEther)) - }) - }) + const claimTokens = isRelativeDailyLimit => + function() { + it('should work with token that return bool on transfer', async () => { + const storageProxy = await EternalStorageProxy.new() + const data = homeContract.contract.methods + .initialize( + validatorContract.address, + ['3', '2', '1'], + gasPrice, + requireBlockConfirmations, + isRelativeDailyLimit ? ['1', '3', '2', '1'] : ['3', '2', '1'], + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + .encodeABI() + await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled + const homeBridge = await HomeBridge.at(storageProxy.address) + + const token = await ERC677BridgeToken.new('Test', 'TST', 18) + + await token.mint(accounts[0], halfEther).should.be.fulfilled + expect(await token.balanceOf(accounts[0])).to.be.bignumber.equal(halfEther) + + await token.transfer(homeBridge.address, halfEther).should.be.fulfilled + expect(await token.balanceOf(accounts[0])).to.be.bignumber.equal(ZERO) + expect(await token.balanceOf(homeBridge.address)).to.be.bignumber.equal(halfEther) + + await homeBridge.claimTokens(token.address, accounts[3], { from: owner }).should.be.fulfilled + expect(await token.balanceOf(homeBridge.address)).to.be.bignumber.equal(ZERO) + expect(await token.balanceOf(accounts[3])).to.be.bignumber.equal(halfEther) + }) + it('should works with token that not return on transfer', async () => { + const storageProxy = await EternalStorageProxy.new() + const data = homeContract.contract.methods + .initialize( + validatorContract.address, + ['3', '2', '1'], + gasPrice, + requireBlockConfirmations, + isRelativeDailyLimit ? ['1', '3', '2', '1'] : ['3', '2', '1'], + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + .encodeABI() + await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled + const homeBridge = await HomeBridge.at(storageProxy.address) + + const tokenMock = await NoReturnTransferTokenMock.new() + + await tokenMock.mint(accounts[0], halfEther).should.be.fulfilled + expect(await tokenMock.balanceOf(accounts[0])).to.be.bignumber.equal(halfEther) + + await tokenMock.transfer(homeBridge.address, halfEther).should.be.fulfilled + expect(await tokenMock.balanceOf(accounts[0])).to.be.bignumber.equal(ZERO) + expect(await tokenMock.balanceOf(homeBridge.address)).to.be.bignumber.equal(halfEther) + + await homeBridge.claimTokens(tokenMock.address, accounts[3], { from: owner }).should.be.fulfilled + expect(await tokenMock.balanceOf(homeBridge.address)).to.be.bignumber.equal(ZERO) + expect(await tokenMock.balanceOf(accounts[3])).to.be.bignumber.equal(halfEther) + }) + it('should work for native coins', async () => { + const storageProxy = await EternalStorageProxy.new() + const data = homeContract.contract.methods + .initialize( + validatorContract.address, + [oneEther.toString(), halfEther.toString(), '1'], + gasPrice, + requireBlockConfirmations, + isRelativeDailyLimit + ? [targetLimit.toString(), threshold.toString(), halfEther.toString(), '1'] + : [oneEther.toString(), halfEther.toString(), '1'], + owner, + decimalShiftZero, + isRelativeDailyLimit ? relativeLimitsContract.address : absoluteLimitsContract.address + ) + .encodeABI() + await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled + const homeBridge = await HomeBridge.at(storageProxy.address) + + const balanceBefore = toBN(await web3.eth.getBalance(accounts[3])) + + await homeBridge.sendTransaction({ from: accounts[2], value: halfEther }).should.be.fulfilled + expect(toBN(await web3.eth.getBalance(homeBridge.address))).to.be.bignumber.equal(halfEther) + + await homeBridge.claimTokens(ZERO_ADDRESS, accounts[3], { from: owner }).should.be.fulfilled + expect(toBN(await web3.eth.getBalance(homeBridge.address))).to.be.bignumber.equal(ZERO) + expect(toBN(await web3.eth.getBalance(accounts[3]))).to.be.bignumber.equal(balanceBefore.add(halfEther)) + }) + } + describe('#claimTokens', claimTokens(false)) + describe('#claimTokens (relative limit)', claimTokens(true)) describe('#rewardableInitialize', async () => { let homeFee @@ -1117,8 +1260,6 @@ contract('HomeBridge', async accounts => { const feeManager = await FeeManagerNativeToErc.new() expect(await homeBridge.validatorContract()).to.be.equal(ZERO_ADDRESS) expect(await homeBridge.deployedAtBlock()).to.be.bignumber.equal(ZERO) - expect(await homeBridge.dailyLimit()).to.be.bignumber.equal(ZERO) - expect(await homeBridge.maxPerTx()).to.be.bignumber.equal(ZERO) expect(await homeBridge.isInitialized()).to.be.equal(false) await homeBridge @@ -1127,11 +1268,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeBridge @@ -1140,11 +1282,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], 0, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeBridge @@ -1153,11 +1296,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, 0, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeBridge @@ -1166,11 +1310,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, ZERO_ADDRESS, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ) .should.be.rejectedWith(ERROR_MSG) await homeBridge.rewardableInitialize( @@ -1178,11 +1323,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled expect(await homeBridge.isInitialized()).to.be.equal(true) @@ -1212,11 +1358,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // Given @@ -1237,11 +1384,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // Given @@ -1261,11 +1409,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // Given @@ -1292,11 +1441,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // Then @@ -1314,11 +1464,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [homeFee, foreignFee], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // Then @@ -1354,11 +1505,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [notUsedFee, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // When @@ -1403,11 +1555,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [notUsedFee, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // When @@ -1453,11 +1606,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [notUsedFee, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await homeBridge.sendTransaction({ @@ -1513,16 +1667,21 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [notUsedFee, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await homeBridge.sendTransaction({ from: accounts[0], value: halfEther }).should.be.fulfilled + await homeBridge.sendTransaction({ + from: accounts[0], + value: halfEther + }).should.be.fulfilled const recipient = accounts[5] const balanceBefore = toBN(await web3.eth.getBalance(recipient)) @@ -1585,16 +1744,21 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [notUsedFee, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await homeBridge.sendTransaction({ from: accounts[0], value: halfEther }).should.be.fulfilled + await homeBridge.sendTransaction({ + from: accounts[0], + value: halfEther + }).should.be.fulfilled const recipient = accounts[8] const balanceBefore = toBN(await web3.eth.getBalance(recipient)) @@ -1651,7 +1815,7 @@ contract('HomeBridge', async accounts => { ).to.equal(true) const homeBridgeBalance = toBN(await web3.eth.getBalance(homeBridge.address)) - homeBridgeBalance.should.be.bignumber.equal(ZERO) + homeBridgeBalance.should.be.bignumber.equal(halfEther) }) it('should distribute fee to 5 validators', async () => { // Given @@ -1680,16 +1844,21 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [notUsedFee, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await homeBridge.sendTransaction({ from: accounts[0], value: halfEther }).should.be.fulfilled + await homeBridge.sendTransaction({ + from: accounts[0], + value: halfEther + }).should.be.fulfilled const recipient = '0xf4BEF13F9f4f2B203FAF0C3cBbaAbe1afE056955' const balanceBefore = toBN(await web3.eth.getBalance(recipient)) @@ -1776,11 +1945,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [notUsedFee, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await homeBridge.sendTransaction({ from: accounts[0], @@ -1825,11 +1995,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [feeInWei, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // When @@ -1875,11 +2046,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [feeInWei, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled // When @@ -1930,11 +2102,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [feeInWei, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await homeBridge.sendTransaction({ @@ -1982,7 +2155,6 @@ contract('HomeBridge', async accounts => { const feeInWei = ether(fee.toString()) const feePerValidator = toBN(166666666666666) const feePerValidatorPlusDiff = toBN(166666666666668) - const initialValue = halfEther const valueCalc = 0.5 * (1 - fee) const value = ether(valueCalc.toString()) const feeAmountCalc = 0.5 * fee @@ -1993,16 +2165,21 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [feeInWei, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await homeBridge.sendTransaction({ from: user, - value: initialValue + value: halfEther + }).should.be.fulfilled + await homeBridge.sendTransaction({ + from: user, + value: halfEther }).should.be.fulfilled const initialBalanceRewardAddress1 = toBN(await web3.eth.getBalance(rewards[0])) @@ -2065,7 +2242,6 @@ contract('HomeBridge', async accounts => { // 0.1% fee const fee = 0.001 const feeInWei = ether(fee.toString()) - const initialValue = halfEther const valueCalc = 0.5 * (1 - fee) const value = ether(valueCalc.toString()) const feeAmountCalc = 0.5 * fee @@ -2077,16 +2253,21 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [feeInWei, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await homeBridge.sendTransaction({ from: user, - value: initialValue + value: halfEther + }).should.be.fulfilled + await homeBridge.sendTransaction({ + from: user, + value: halfEther }).should.be.fulfilled const initialBalanceRewardAddress1 = toBN(await web3.eth.getBalance(rewards[0])) @@ -2160,11 +2341,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [feeInWei, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await homeBridge.sendTransaction({ @@ -2213,16 +2395,21 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [feeInWei, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await homeBridge.sendTransaction({ from: accounts[0], value: halfEther }).should.be.fulfilled + await homeBridge.sendTransaction({ + from: accounts[0], + value: halfEther + }).should.be.fulfilled const recipient = accounts[5] const balanceBefore = toBN(await web3.eth.getBalance(recipient)) @@ -2284,16 +2471,21 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [feeInWei, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await homeBridge.sendTransaction({ from: accounts[0], value: halfEther }).should.be.fulfilled + await homeBridge.sendTransaction({ + from: accounts[0], + value: halfEther + }).should.be.fulfilled const recipient = accounts[8] const balanceBefore = toBN(await web3.eth.getBalance(recipient)) @@ -2350,7 +2542,7 @@ contract('HomeBridge', async accounts => { ).to.equal(true) const homeBridgeBalance = toBN(await web3.eth.getBalance(homeBridge.address)) - homeBridgeBalance.should.be.bignumber.equal('0') + homeBridgeBalance.should.be.bignumber.equal(halfEther) }) it('should distribute fee to 5 validators', async () => { // Given @@ -2378,16 +2570,21 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [feeInWei, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await homeBridge.sendTransaction({ from: accounts[0], value: halfEther }).should.be.fulfilled + await homeBridge.sendTransaction({ + from: accounts[0], + value: halfEther + }).should.be.fulfilled const recipient = '0xf4BEF13F9f4f2B203FAF0C3cBbaAbe1afE056955' const balanceBefore = toBN(await web3.eth.getBalance(recipient)) @@ -2473,11 +2670,12 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, feeManager.address, [feeInWei, feeInWei], - decimalShiftZero + decimalShiftZero, + absoluteLimitsContract.address ).should.be.fulfilled await homeBridge.sendTransaction({ from: accounts[0], @@ -2509,9 +2707,10 @@ contract('HomeBridge', async accounts => { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftTwo + decimalShiftTwo, + absoluteLimitsContract.address ) const valueOnForeign = toBN('1000') @@ -2559,9 +2758,10 @@ contract('HomeBridge', async accounts => { ['3', '2', '1'], gasPrice, requireBlockConfirmations, - [foreignDailyLimit, foreignMaxPerTx], + executionLimitsArray, owner, - decimalShiftTwo + decimalShiftTwo, + absoluteLimitsContract.address ) const currentDay = await homeContract.getCurrentDay() expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal(ZERO) @@ -2590,4 +2790,67 @@ contract('HomeBridge', async accounts => { expect(await homeContract.totalSpentPerDay(currentDay)).to.be.bignumber.equal('2') }) }) + describe('#executionDailyLimit (relative)', () => { + let homeBridge + + function initialize(customExecutionLimitsArray) { + return homeBridge.initialize( + validatorContract.address, + [threshold.add(toBN(1)), threshold, minPerTx], + gasPrice, + requireBlockConfirmations, + customExecutionLimitsArray, + owner, + decimalShiftZero, + relativeLimitsContract.address + ).should.be.fulfilled + } + + beforeEach(async () => { + homeBridge = await HomeBridge.new() + }) + it('should be calculated correctly - 1', async () => { + await initialize([targetLimit, threshold, foreignMaxPerTx, foreignMinPerTx]) + + await homeBridge.sendTransaction({ from: accounts[4], value: halfEther }).should.be.fulfilled + expect(toBN(await web3.eth.getBalance(homeBridge.address))).to.be.bignumber.equal(halfEther) + + const limit = await homeBridge.executionDailyLimit() + const expectedLimit = calculateDailyLimit(halfEther, targetLimit, threshold, foreignMinPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + it('should be calculated correctly - 2', async function() { + await initialize([targetLimit, threshold, foreignMaxPerTx, foreignMinPerTx]) + + await homeBridge.sendTransaction({ from: accounts[4], value: foreignMinPerTx }).should.be.fulfilled + expect(toBN(await web3.eth.getBalance(homeBridge.address))).to.be.bignumber.equal(foreignMinPerTx) + + const limit = await homeBridge.executionDailyLimit() + expect(limit).to.be.bignumber.equal(foreignMinPerTx) + }) + it('should be calculated correctly - 3', async function() { + await initialize([targetLimit, threshold, foreignMaxPerTx, foreignMinPerTx]) + + await homeBridge.sendTransaction({ from: accounts[4], value: threshold }).should.be.fulfilled + expect(toBN(await web3.eth.getBalance(homeBridge.address))).to.be.bignumber.equal(threshold) + + const limit = await homeBridge.executionDailyLimit() + expect(limit).to.be.bignumber.equal(threshold.mul(targetLimit).div(oneEther)) + }) + it('should be calculated correctly - 4', async function() { + const amountToSend = ether('5') + const targetLimit = ether('0.06') + const threshold = ether('100') + const foreignMinPerTx = ether('0.1') + + await initialize([targetLimit, threshold, foreignMaxPerTx, foreignMinPerTx]) + + await homeBridge.sendTransaction({ from: accounts[4], value: amountToSend }).should.be.fulfilled + expect(toBN(await web3.eth.getBalance(homeBridge.address))).to.be.bignumber.equal(amountToSend) + + const limit = await homeBridge.executionDailyLimit() + const expectedLimit = calculateDailyLimit(amountToSend, targetLimit, threshold, foreignMinPerTx) + expect(limit).to.be.bignumber.equal(expectedLimit) + }) + }) }) diff --git a/test/poa20_test.js b/test/poa20_test.js index 743a3b606..cce410294 100644 --- a/test/poa20_test.js +++ b/test/poa20_test.js @@ -7,6 +7,7 @@ const StakingTest = artifacts.require('Staking.sol') const HomeErcToErcBridge = artifacts.require('HomeBridgeErcToErc.sol') const ForeignNativeToErcBridge = artifacts.require('ForeignBridgeNativeToErc.sol') const BridgeValidators = artifacts.require('BridgeValidators.sol') +const AbsoluteDailyLimit = artifacts.require('AbsoluteDailyLimit.sol') const { expect } = require('chai') const { ERROR_MSG, ERROR_MSG_OPCODE, ZERO_ADDRESS, BN } = require('./setup') @@ -19,14 +20,19 @@ const oneEther = ether('1') const halfEther = ether('0.5') const executionDailyLimit = oneEther const executionMaxPerTx = halfEther +const executionMinPerTx = minPerTx const ZERO = new BN(0) const decimalShiftZero = 0 async function testERC677BridgeToken(accounts, rewardable) { let token + let limitsContract const owner = accounts[0] const user = accounts[1] const tokenContract = rewardable ? POA20RewardableMock : POA20 + before(async () => { + limitsContract = await AbsoluteDailyLimit.new() + }) beforeEach(async () => { token = await tokenContract.new('POA ERC20 Foundation', 'POA20', 18) }) @@ -234,9 +240,10 @@ async function testERC677BridgeToken(accounts, rewardable) { gasPrice, requireBlockConfirmations, token.address, - [executionDailyLimit, executionMaxPerTx], + [executionDailyLimit, executionMaxPerTx, executionMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + limitsContract.address ) foreignNativeToErcBridge = await ForeignNativeToErcBridge.new() await foreignNativeToErcBridge.initialize( @@ -245,10 +252,11 @@ async function testERC677BridgeToken(accounts, rewardable) { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [executionDailyLimit, executionMaxPerTx], + [executionDailyLimit, executionMaxPerTx, executionMinPerTx], owner, decimalShiftZero, - homeErcToErcContract.address + homeErcToErcContract.address, + limitsContract.address ) }) it('sends tokens to recipient', async () => { @@ -438,9 +446,10 @@ async function testERC677BridgeToken(accounts, rewardable) { gasPrice, requireBlockConfirmations, token.address, - [executionDailyLimit, executionMaxPerTx], + [executionDailyLimit, executionMaxPerTx, executionMinPerTx], owner, - decimalShiftZero + decimalShiftZero, + limitsContract.address ) foreignNativeToErcBridge = await ForeignNativeToErcBridge.new() await foreignNativeToErcBridge.initialize( @@ -449,10 +458,11 @@ async function testERC677BridgeToken(accounts, rewardable) { [oneEther, halfEther, minPerTx], gasPrice, requireBlockConfirmations, - [executionDailyLimit, executionMaxPerTx], + [executionDailyLimit, executionMaxPerTx, executionMinPerTx], owner, decimalShiftZero, - homeErcToErcContract.address + homeErcToErcContract.address, + limitsContract.address ) }) it('calls contractFallback', async () => {