diff --git a/.travis.yml b/.travis.yml index b6ab826..e4a2acd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,56 +1,24 @@ -services: - - xvfb language: node_js -git: - depth: false matrix: fast_finish: true include: - - node_js: 8 - env: TEST=unit - node_js: 11 - env: TEST=unit - - node_js: 12 - env: TEST=unit - - node_js: 10 - env: TEST=build_and_lint - - node_js: 10 - env: TEST=unit_and_e2e_clients - - node_js: 10 - env: TEST=e2e_ganache - - node_js: 10 - env: TEST=e2e_mosaic - node_js: 10 - env: TEST=e2e_browsers - addons: - chrome: stable - firefox: latest - allow_failures: - - node_js: 10 - env: TEST=e2e_ganache - - node_js: 10 - env: TEST=e2e_mosaic - + - node_js: 9 + - node_js: 8 addons: apt: sources: - ubuntu-toolchain-r-test packages: - - gcc-5 - - g++-5 - + - gcc-6 + - g++-6 before_install: - if [ $TRAVIS_OS_NAME == "linux" ]; then - export CC="gcc-5"; - export CXX="g++-5"; - export LINK="gcc-5"; - export LINKXX="g++-5"; - fi - - export DISPLAY=:99.0 - - export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true -install: - - if [[ $TEST != "e2e_ganache" ]] && [[ $TEST != "e2e_mosaic" ]]; then - npm install; + export CC="gcc-6"; + export CXX="g++-6"; + export LINK="gcc-6"; + export LINKXX="g++-6"; fi script: - npm run test \ No newline at end of file diff --git a/README.md b/README.md index 0ef226a..1d1e92e 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,27 @@ sudo apt-get install nodejs sudo apt-get install npm ``` +### Recommended + +- [nvm](https://github.com/nvm-sh/nvm) + +```bash +nvm install v8.17.0 +nvm use v8.17.0 +npm install +npm run test +``` + ### Running Tests ```bash npm test ``` + +### Merging contracts for deployment + +```bash +npm run merge-contracts +``` + +Outputs the merged contracts in `./contracts-merged` \ No newline at end of file diff --git a/build/deployments.json b/build/deployments.json index 4e908c5..4944fdf 100644 --- a/build/deployments.json +++ b/build/deployments.json @@ -1 +1 @@ -{"stage_0_before_allocation":{"name":"stage_0_before_allocation","rico_address":"0x6b4FfCA103EB517BEF1734cbe42A0581255d744e","token_address":"0x9B847956292e355ee7C74106e60E1155B9540056"},"stage_0_at_allocation":{"name":"stage_0_at_allocation","rico_address":"0x1B5377EA425f241D668D99f197E401182C098F3e","token_address":"0x509F12467384734E405D5E6Cc5ED524BA9c715BA"},"stage_0_at_allocation_one_contribution_whitelist_no":{"name":"stage_0_at_allocation_one_contribution_whitelist_no","rico_address":"0xcbbED7CbFd0FB8a9222224fE71FAb46f0C69De15","token_address":"0x198d46E74eF75eCa2b75802a097d049ba40CE97f"},"stage_0_at_allocation_one_contribution_whitelist_yes":{"name":"stage_0_at_allocation_one_contribution_whitelist_yes","rico_address":"0x282Db946EAdF5059D90AeAdA76F66aa112d2e5C5","token_address":"0x05c01caB30416F7D19e8C948cF5169d9050Acf13"}} \ No newline at end of file +{"before_allocation":{"name":"before_allocation","rico_address":"0x2C1DE44AEd10792665507EBcf8f3C8584B5C23Fd","token_address":"0x509F12467384734E405D5E6Cc5ED524BA9c715BA"},"stage_0_at_allocation":{"name":"stage_0_at_allocation","rico_address":"0x282Db946EAdF5059D90AeAdA76F66aa112d2e5C5","token_address":"0x198d46E74eF75eCa2b75802a097d049ba40CE97f"},"stage_0_at_allocation_one_contribution_whitelist_no":{"name":"stage_0_at_allocation_one_contribution_whitelist_no","rico_address":"0x8345d7C203522B081f77712c55Cf19286AD440aF","token_address":"0x05c01caB30416F7D19e8C948cF5169d9050Acf13"},"stage_0_at_allocation_one_contribution_whitelist_yes":{"name":"stage_0_at_allocation_one_contribution_whitelist_yes","rico_address":"0xA4cF040c80cf036583d331e7259a03BdA0e26Fa7","token_address":"0xA5973312Ca99bAB7FC2EA53bA2d9dAB66C3B4A93"}} \ No newline at end of file diff --git a/contracts/ReversibleICO.sol b/contracts/ReversibleICO.sol index 7516925..f82adb7 100644 --- a/contracts/ReversibleICO.sol +++ b/contracts/ReversibleICO.sol @@ -1,10 +1,10 @@ /* - * source https://github.com/mickys/rico-poc/ - * @name RICO - * @package rico-poc - * @author Micky Socaci + * source https://github.com/lukso-network/rICO-smart-contracts + * @name rICO + * @package rICO-smart-contracts + * @author Micky Socaci , Fabian Vogelsteller <@frozeman> * @license MIT -*/ + */ pragma solidity ^0.5.0; @@ -15,124 +15,153 @@ import "./zeppelin/introspection/IERC1820Registry.sol"; contract ReversibleICO is IERC777Recipient { + /* - * Instances - */ + * Instances + */ using SafeMath for uint256; + /// @dev The address of the introspection registry contract deployed. IERC1820Registry private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24); bytes32 constant private TOKENS_RECIPIENT_INTERFACE_HASH = keccak256("ERC777TokensRecipient"); - IERC777 public tokenContract; /* - * Contract States - */ + * Contract States + */ + /// @dev It is set to TRUE after the deployer initializes the contract. bool public initialized; // default: false + + /// @dev The contract can be automatically frozen in case of inconsistencies. bool public frozen; // default: false - bool public started; // default: false - bool public ended; // default: false + /* - * Addresses - */ + * Addresses + */ + /// @dev Only the deployer is allowed to initialize the contract. address public deployerAddress; + /// @dev The actual rICO token contract address. address public tokenContractAddress; + /// @dev The address of wallet of the project running the rICO. address public projectWalletAddress; + /// @dev Only the whitelist controller can whitelist addresses. address public whitelistControllerAddress; + /* - * Public Variables - */ + * Public Variables + */ + /// @dev Total amount tokens minted. uint256 public tokenSupply; // default: 0 - - uint256 public committedETH; // default: 0 + /// @dev Total amount of ETH received by the smart contract. + uint256 public totalReceivedETH; // default: 0 + /// @dev Total amount of ETH returned. uint256 public returnedETH; // default: 0 - uint256 public acceptedETH; // default: 0 + /// @dev Total amount of ETH accepted as a commitment to buy tokens (not including pending). + uint256 public committedETH; // default: 0 + /// @dev Total amount of ETH withdrawn. uint256 public withdrawnETH; // default: 0 - + /// @dev Count of the number the project has withdrawn from the funds raised. uint256 public projectWithdrawCount; // default: 0 + /// @dev Total amount allocated to the project by participant withdraws. uint256 public projectAllocatedETH; // default: 0 + /// @dev Total amount of ETH withdrawn by the project uint256 public projectWithdrawnETH; // default: 0 + /// @dev Block where last project withdraw happened + uint256 public lastProjectWithdrawBlock; // default: 0 + + /// @dev amount of ETH remaining from last withdrawn by the project + uint256 public remainingFromLastProjectWithdraw; // default: 0 + /// @dev amount of ETH available at block when last withdrawn by the project happened + uint256 public globalAvailableAtLastProjectWithdraw; // default: 0 - // Minimum amount of ETH we accept for a contribution - // everything lower will trigger a canceling of pending ETH + /// @dev Minimum amount of ETH accepted for a contribution. + /// @dev Everything lower than that will trigger a canceling of pending ETH. uint256 public minContribution = 0.001 ether; + /* - * Commit phase (Stage 0) - */ + * Commit phase (Stage 0) + */ + /// @dev Initial token price in the commit phase (Stage 0). uint256 public commitPhasePrice; + /// @dev Block number that indicates the start of the commit phase. uint256 public commitPhaseStartBlock; + /// @dev Block number that indicates the end of the commit phase. uint256 public commitPhaseEndBlock; + /// @dev The duration of the commit phase in blocks. uint256 public commitPhaseBlockCount; + + /* + * Buy phases (Stages 1-n) + */ + /// @dev Block number that indicates the start of the buy phase (Stages 1-n). uint256 public buyPhaseStartBlock; + /// @dev Block number that indicates the end of the buy phase. uint256 public buyPhaseEndBlock; + /// @dev The duration of the buy phase in blocks. uint256 public buyPhaseBlockCount; - uint256 public stageBlockCount; /* - * Stages - * Stage 0 = commit phase - * Stage 1-n = buy phase - */ + * Stages + * Stage 0 = commit phase + * Stage 1-n = buy phase + */ struct Stage { - uint256 startBlock; - uint256 endBlock; + uint128 startBlock; + uint128 endBlock; uint256 tokenPrice; } - mapping ( uint8 => Stage ) public stages; - uint8 public stageCount; // default: 0 + mapping(uint8 => Stage) public stages; + uint8 public stageCount; + uint256 public stageBlockCount; /* - * Participants - */ - + * Participants + */ struct Participant { - bool whitelisted; - uint32 contributionsCount; - uint256 committedETH; // msg.value - uint256 returnedETH; // committedETH - acceptedETH - uint256 acceptedETH; // lower than msg.value if maxCap already reached - uint256 withdrawnETH; // cancel() / withdraw() - uint256 allocatedETH; // allocated to project when contributing or exiting - uint256 reservedTokens; // total tokens bought in all stages - uint256 boughtTokens; // total tokens already sent to the participant in all stages - uint256 returnedTokens; // total tokens returned by participant to contract in all stages - mapping ( uint8 => ParticipantDetailsByStage ) byStage; - } - - mapping ( address => Participant ) public participantsByAddress; - mapping ( uint256 => address ) public participantsById; - uint256 public participantCount = 0; - - struct ParticipantDetailsByStage { - uint256 committedETH; // msg.value - uint256 returnedETH; // committedETH - acceptedETH - uint256 acceptedETH; // lower than msg.value if maxCap already reached - uint256 withdrawnETH; // withdrawn from current stage + bool whitelisted; + uint32 contributionsCount; + mapping(uint8 => ParticipantDetails) byStage; + } + + struct ParticipantDetails { + uint256 totalReceivedETH; // Total amount of ETH received by the smart contract. + uint256 returnedETH; // totalReceivedETH - committedETH + uint256 committedETH; // lower than msg.value if maxCap already reached + uint256 withdrawnETH; // withdrawn from current stage uint256 allocatedETH; // allocated to project when contributing or exiting uint256 reservedTokens; // tokens bought in this stage - uint256 boughtTokens; // tokens already sent to the participant in this stage - uint256 returnedTokens; // tokens returned by participant to contract + uint256 boughtTokens; // tokens already sent to the participant in this stage + uint256 returnedTokens; // tokens returned by participant to contract } - /* - * Events - */ + /// @dev Maps participants aggregated (i.e. all stages) stats by their address. + mapping(address => ParticipantDetails) public participantAggregatedStats; + /// @dev Maps participants stage stats by their address. + mapping(address => Participant) public participantsByAddress; + /// @dev Maps participants address to a unique participant ID (incremental IDs, based on "participantCount"). + mapping(uint256 => address) public participantsById; + /// @dev Total number of rICO participants. + uint256 public participantCount; + + /* + * Events + */ enum ApplicationEventTypes { - NOT_SET, // 0; will match default value of a mapping result - CONTRIBUTION_NEW, // 1 - CONTRIBUTION_CANCEL, // 2 - PARTICIPANT_CANCEL, // 3 - COMMITMENT_ACCEPTED, // 4 - WHITELIST_APPROVE, // 5 - WHITELIST_REJECT, // 6 - PROJECT_WITHDRAW // 7 + NOT_SET, // 0; will match default value of a mapping result + CONTRIBUTION_NEW, // 1 + CONTRIBUTION_CANCEL, // 2 + PARTICIPANT_CANCEL, // 3 + COMMITMENT_ACCEPTED, // 4 + WHITELIST_APPROVE, // 5 + WHITELIST_REJECT, // 6 + PROJECT_WITHDRAW // 7 } event ApplicationEvent ( @@ -143,12 +172,12 @@ contract ReversibleICO is IERC777Recipient { ); enum TransferTypes { - NOT_SET, // 0 - AUTOMATIC_RETURN, // 1 - WHITELIST_REJECT, // 2 - PARTICIPANT_CANCEL, // 3 - PARTICIPANT_WITHDRAW, // 4 - PROJECT_WITHDRAW // 5 + NOT_SET, // 0 + AUTOMATIC_RETURN, // 1 + WHITELIST_REJECT, // 2 + PARTICIPANT_CANCEL, // 3 + PARTICIPANT_WITHDRAW, // 4 + PROJECT_WITHDRAW // 5 } event TransferEvent ( @@ -161,13 +190,25 @@ contract ReversibleICO is IERC777Recipient { // ------------------------------------------------------------------------------------------------ - // Constructor + /// @notice Constructor sets the deployer and defines ERC777TokensRecipient interface support. constructor() public { deployerAddress = msg.sender; _erc1820.setInterfaceImplementer(address(this), TOKENS_RECIPIENT_INTERFACE_HASH, address(this)); } + /** + * @notice Initializes the contract. Only the deployer (set in the constructor) can call this method. + * @param _tokenContractAddress The address of the ERC777 rICO token contract. + * @param _whitelistControllerAddress The address of the controller handling whitelisting. + * @param _projectWalletAddress The project wallet that can withdraw the contributions. + * @param _commitPhaseStartBlock The block in which the commit phase starts. + * @param _commitPhaseBlockCount The duration of the commit phase in blocks. + * @param _commitPhasePrice The initial token price (in wei) during the commit phase. + * @param _stageCount The number of the rICO stages. + * @param _stageBlockCount The duration of each stage in blocks. + * @param _stagePriceIncrease A factor used to increase the token price at each subsequent stage. + */ function init( address _tokenContractAddress, address _whitelistControllerAddress, @@ -175,15 +216,17 @@ contract ReversibleICO is IERC777Recipient { uint256 _commitPhaseStartBlock, uint256 _commitPhaseBlockCount, uint256 _commitPhasePrice, - uint8 _stageCount, + uint8 _stageCount, uint256 _stageBlockCount, uint256 _stagePriceIncrease ) - public - onlyDeployer - isNotInitialized + public + onlyDeployer + isNotInitialized { + require(_commitPhaseStartBlock > getCurrentBlockNumber(), "Start block cannot be set in the past."); + // Assign address variables tokenContractAddress = _tokenContractAddress; whitelistControllerAddress = _whitelistControllerAddress; @@ -192,76 +235,76 @@ contract ReversibleICO is IERC777Recipient { // Assign other variables commitPhaseStartBlock = _commitPhaseStartBlock; commitPhaseBlockCount = _commitPhaseBlockCount; - commitPhaseEndBlock = _commitPhaseStartBlock + _commitPhaseBlockCount; + commitPhaseEndBlock = _commitPhaseStartBlock.add(_commitPhaseBlockCount).sub(1); commitPhasePrice = _commitPhasePrice; stageBlockCount = _stageBlockCount; - - - // initialize ERC777 tokenContract - tokenContract = IERC777(tokenContractAddress); - + stageCount = _stageCount; // Setup stage 0: The commit phase. - Stage storage stage0 = stages[stageCount]; // stageCount = 0 - stage0.startBlock = _commitPhaseStartBlock; - stage0.endBlock = _commitPhaseStartBlock + _commitPhaseBlockCount; - stage0.tokenPrice = _commitPhasePrice; - - stageCount++; // stageCount = 1 + Stage storage commitPhase = stages[0]; + commitPhase.startBlock = uint128(_commitPhaseStartBlock); + commitPhase.endBlock = uint128(commitPhaseEndBlock); + commitPhase.tokenPrice = _commitPhasePrice; // Setup stage 1 to n: The buy phase stages - uint256 lastStageBlockEnd = stage0.endBlock; - - for(uint8 i = 1; i <= _stageCount; i++) { - - Stage storage stageN = stages[stageCount]; // stageCount = n - stageN.startBlock = lastStageBlockEnd + 1; - stageN.endBlock = lastStageBlockEnd + _stageBlockCount + 1; - stageN.tokenPrice = _commitPhasePrice + ( _stagePriceIncrease * (i) ); - - stageCount++; // stageCount = n + 1 - - lastStageBlockEnd = stageN.endBlock; + // Each new stage starts after the previous phase's endBlock + uint256 previousStageEndBlock = commitPhase.endBlock; + + // Update stages: start, end, price + for (uint8 i = 1; i <= _stageCount; i++) { + // Get i-th stage + Stage storage stageN = stages[i]; + // Start block is previous phase end block + 1, e.g. previous stage end=0, start=1; + stageN.startBlock = uint128(previousStageEndBlock.add(1)); + // End block is previous phase end block + stage duration e.g. start=1, duration=10, end=0+10=10; + stageN.endBlock = uint128(previousStageEndBlock.add(_stageBlockCount)); + // At each stage the token price increases by _stagePriceIncrease * stageCount + stageN.tokenPrice = _commitPhasePrice.add(_stagePriceIncrease.mul(i)); + // Store the current stage endBlock in order to update the next one + previousStageEndBlock = stageN.endBlock; } - buyPhaseStartBlock = commitPhaseEndBlock + 1; - buyPhaseEndBlock = lastStageBlockEnd; - buyPhaseBlockCount = lastStageBlockEnd - buyPhaseStartBlock; - + // The buy phase starts on the subsequent block of the commitPhase's (stage0) endBlock + buyPhaseStartBlock = commitPhaseEndBlock.add(1); + // The buy phase ends when the lat stage ends + buyPhaseEndBlock = previousStageEndBlock; + // The duration of buyPhase in blocks + buyPhaseBlockCount = previousStageEndBlock.sub(buyPhaseStartBlock).add(1); + // The contract is now initialized initialized = true; } + /* * Public functions - * The main ways to interact with the rICO. + * The main way to interact with the rICO. */ - /* - * FALLBACK function - * Allows for ETH contributions, and canceling of pending contributions - */ - function () + /** + * @notice FALLBACK function: depending on the amount received it commits or it cancels contributions. + */ + function() external payable - isInitialized - isNotFrozen { - // accept contribution for processing - if(msg.value >= minContribution) { - commit(); - - // Participant cancels commitment during commit phase (Stage 0), - // OR if they've not been whitelisted yet. + // Accept contributions higher than the minimum amount + if (msg.value >= minContribution) { + commit(msg.sender, msg.value); } else { - cancel(); + // Participant cancels commitment during commit phase (Stage 0) OR if they've not been whitelisted yet. + // This also allows for extended wallet compatibility by sending a non-zereo amount + cancel(msg.sender, msg.value); } } - /* - * ERC777TokensRecipient method for receiving tokens - */ + + /** + * @notice ERC777TokensRecipient implementation for receiving ERC777 tokens. + * @param _from Token sender. + * @param _amount Token amount. + */ function tokensReceived( address, address _from, @@ -272,146 +315,220 @@ contract ReversibleICO is IERC777Recipient { ) external isInitialized - // isNotFrozen TODO?? - // requireNotEnded + // isNotFrozen TODO?? + // requireNotEnded { - // Rico should only receive tokens from the Rico Token Tracker. - // any other transaction should revert - require(msg.sender == address(tokenContract), "Invalid token sent."); + // rICO should only receive tokens from the rICO Token Tracker. + // Transactions from any other sender should revert + require(msg.sender == tokenContractAddress, "Invalid token sent."); // 2 cases - if(_from == projectWalletAddress) { + if (_from == projectWalletAddress) { // 1 - project wallet adds tokens to the sale // Save the token amount allocated to this address tokenSupply += _amount; return; } else { - // 2 - rico contributor sends tokens back + // 2 - rICO contributor sends tokens back withdraw(_from, _amount); } + } + + /** + * @notice External wrapper for commit() so that a participant can call it directly. + */ + function commit() + public + payable + { + // Reject contributions lower than the minimum amount + require(msg.value >= minContribution, "Value sent is less than minimum contribution."); + // Call internal commit() for processing the contribution + commit(msg.sender, msg.value); } - /* - * Participant can cancel their pending ETH commitment, if they are not whitelisted yet. - */ + + /** + * @notice Commits a participant's ETH. + */ + function commit(address _sender, uint256 _value) + internal + isInitialized + isNotFrozen + isRunning + { + + // Add to received value to totalReceivedETH + totalReceivedETH = totalReceivedETH.add(_value); + + // Participant initial state record + Participant storage participantRecord = participantsByAddress[_sender]; + + // Check if participant already exists + if (participantRecord.contributionsCount == 0) { + // Identify the participants by their Id + participantsById[participantCount] = _sender; + // Increase participant count + participantCount++; + } + + // Record contribution into current stage totals for the participant + recordNewContribution(_sender, _value); + + // If whitelisted, process the contribution automatically + if (participantRecord.whitelisted == true) { + acceptContributionsForAddress(_sender, uint8(ApplicationEventTypes.COMMITMENT_ACCEPTED)); + } + } + + /** + * @notice External wrapper for cancel() so that a participant can call it directly. + */ function cancel() public + payable + { + // Call internal cancel() for processing the request + cancel(msg.sender, msg.value); + } + + /** + * @notice Cancels non-whitelisted participant's pending ETH commitment. + */ + function cancel(address _sender, uint256 _value) + internal isInitialized isNotFrozen + isRunning { - require( - participantsByAddress[msg.sender].whitelisted != true, - "Commitment canceling only possible using tokens after you got whitelisted." - ); + // Participant must have pending ETH ... + require(hasPendingETH(_sender), "cancel: Participant has no pending contributions."); - if(canCancelByEth(msg.sender)) { - cancelContributionsForAddress(msg.sender, uint8(ApplicationEventTypes.PARTICIPANT_CANCEL)); - return; + // Cancel participant's contribution. + cancelContributionsForAddress(_sender, _value, uint8(ApplicationEventTypes.PARTICIPANT_CANCEL)); + } + + /** + * @notice Returns project's current available ETH and unlocked ETH amount. + * @return uint256 The unlocked amount available to the project for withdraw. + */ + function getProjectAvailableEth() public view returns (uint256) { + // how much eth has been "approved", minus returned, minus allocated directly + uint256 globalAvailable = committedETH + .sub(withdrawnETH) + .sub(projectAllocatedETH); + + // Multiply by percentage + uint256 unlocked = globalAvailable.mul( + getCurrentUnlockPercentageFor( + getCurrentBlockNumber(), + buyPhaseStartBlock, + buyPhaseEndBlock + ) + ).div(10 ** 20); + + // add the allocated directly and subtract already withdrawn by project + uint256 totalAvailable = unlocked.add(projectAllocatedETH); + + // Due to rounding errors when participants withdraw using tokens + // projectWithdrawnETH can be 1 wei higher per participant that withdrew + // than actually available after withdraw allocation. + if (projectWithdrawnETH >= totalAvailable) { + return 0; } - revert("Participant has no contributions."); + + return totalAvailable.sub(projectWithdrawnETH); } - /* - * Project Withdraw - */ + /** + * @notice Allows for the project to withdraw ETH. + * @param _ethAmount The ETH amount in wei. + */ function projectWithdraw(uint256 _ethAmount) external isInitialized { require(msg.sender == projectWalletAddress, "Only project wallet address."); + // Get project unlocked ETH (available for withdrawing) uint256 unlocked = getProjectAvailableEth(); - require(_ethAmount <= unlocked, "Requested amount to large, not enough unlocked ETH available."); + require(_ethAmount <= unlocked, "Requested amount too big, not enough unlocked ETH available."); + // Update stats: number of project withdrawals, total amount withdrawn by the project projectWithdrawCount++; - projectWithdrawnETH += _ethAmount; + projectWithdrawnETH = projectWithdrawnETH.add(_ethAmount); + // Transfer ETH to project wallet + address(uint160(projectWalletAddress)).transfer(_ethAmount); + // Event emission emit ApplicationEvent( uint8(ApplicationEventTypes.PROJECT_WITHDRAW), uint32(projectWithdrawCount), projectWalletAddress, _ethAmount ); - - emit TransferEvent(uint8(TransferTypes.PROJECT_WITHDRAW), projectWalletAddress, _ethAmount); - address(uint160(projectWalletAddress)).transfer(_ethAmount); - } - - function getProjectAvailableEth() public view returns (uint256 _amount) { - - uint256 remainingFromAllocation = 0; - if(projectAllocatedETH > projectWithdrawnETH) { - remainingFromAllocation = projectAllocatedETH.sub(projectWithdrawnETH); - } - - // calculate ETH that is globally available - uint256 globalAvailable = acceptedETH - .sub(withdrawnETH) - .sub(projectWithdrawnETH) - .sub(remainingFromAllocation); - - // multiply the available ETH with the percentage that belongs to the project now - uint256 unlocked = globalAvailable.mul( - getCurrentUnlockPercentage() - ).div(10 ** 20); - - return unlocked.add(remainingFromAllocation); + emit TransferEvent( + uint8(TransferTypes.PROJECT_WITHDRAW), + projectWalletAddress, + _ethAmount + ); } - /* - * Whitelists or Rejects a participants address - * - * Possible modes: WHITELIST_APPROVE: 5, WHITELIST_REJECT: 6 - */ - function whitelist( - address _address, - bool _approve - ) - public + /** + * @notice Approves or rejects participants. + * @param _addresses The list of participant address. + * @param _approve Indicates if the provided participants are approved (true) or rejected (false). + */ + function whitelist(address[] calldata _addresses, bool _approve) + external isInitialized isNotFrozen onlyWhitelistController { - Participant storage participantRecord = participantsByAddress[_address]; - - if(_approve) { - participantRecord.whitelisted = true; - - // accept all contributions - acceptContributionsForAddress(_address, uint8(ApplicationEventTypes.WHITELIST_APPROVE)); - - } else { - participantRecord.whitelisted = false; - - // cancel all contributions - cancelContributionsForAddress(_address, uint8(ApplicationEventTypes.WHITELIST_REJECT)); - } - - } - - /* - * Whitelisting or Rejecting multiple addresses - */ - function whitelistMultiple(address[] memory _address, bool _approve) public { - for( uint16 i = 0; i < _address.length; i++ ) { - whitelist(_address[i], _approve); + // Revert if the provided list is empty + require(_addresses.length > 0, "Empty list."); + for (uint256 i = 0; i < _addresses.length; i++) { + + Participant storage participantRecord = participantsByAddress[_addresses[i]]; + + if (_approve) { + // Check if participant is already in the whitelist (e.g. duplicate list entry) + if (!participantRecord.whitelisted) { + // If participants are approved: whitelist them and accept their contributions + participantRecord.whitelisted = true; + acceptContributionsForAddress(_addresses[i], uint8(ApplicationEventTypes.WHITELIST_APPROVE)); + } + } else { + // Decline participant and cancel their contributions, if they have pending ETH. + if (hasPendingETH(_addresses[i])) { + cancelContributionsForAddress(_addresses[i], 0, uint8(ApplicationEventTypes.WHITELIST_REJECT)); + } + participantRecord.whitelisted = false; + } } } // ------------------------------------------------------------------------------------------------ /* - * Public view functions - */ + * Public view functions + */ - function isWhitelisted(address _address) public view returns ( bool ) { + /** + * @notice Returns TRUE if the participant is whitelisted, otherwise FALSE. + * @param _address the participant's address. + * @return Boolean + */ + function isWhitelisted(address _address) public view returns (bool) { return participantsByAddress[_address].whitelisted; } + /* + TODO? Do we want to normalise for gas usage ?! ( ie. add useless computation just to have the same gas used at all times ? ) @@ -419,25 +536,41 @@ contract ReversibleICO is IERC777Recipient { 22797 - Case 2: lower than stage[X].endBlock 22813 - Case 3: exactly at stage[X].endBlock - Doing an iteration and validating on each item range can go upto 37391 gas for 13 stages. + Doing an iteration and validating on each item range can go up to 37391 gas for 13 stages. */ - function getCurrentStage() public view returns ( uint8 ) { + /** + * @notice Returns the current stage at the current block number. + */ + function getCurrentStage() public view returns (uint8) { return getStageAtBlock(getCurrentBlockNumber()); } - function getCurrentPrice() public view returns ( uint256 ) { + /** + * @notice Returns the current token price at the current block number. + */ + function getCurrentPrice() public view returns (uint256) { return getPriceAtBlock(getCurrentBlockNumber()); } - function getPriceAtBlock(uint256 _blockNumber) public view returns ( uint256 ) { + /** + * @notice Returns the token price at the specified block height. + * @param _blockNumber the block height at which we want to retrieve the token price. + */ + function getPriceAtBlock(uint256 _blockNumber) public view returns (uint256) { + // first retrieve the stage that the block belongs to uint8 stage = getStageAtBlock(_blockNumber); - if(stage < stageCount) { + if (stage <= stageCount) { return stages[stage].tokenPrice; } // revert with stage not found? return 0; } + /** + * @notice Returns the amount of tokens that ETH would buy at a specific stage. + * @param _ethValue The ETH amount in wei. + * @param _stageId The stage we are interested in. + */ function getTokenAmountForEthAtStage(uint256 _ethValue, uint8 _stageId) public view returns (uint256) { // Since our tokens cost less than 1 eth, and decimals are 18 // 1 wei will always buy something. @@ -446,9 +579,14 @@ contract ReversibleICO is IERC777Recipient { // return (_ethValue * (10 ** 18)) / Stages[_stageId].token_price; return _ethValue.mul( (10 ** 18) - ).div( stages[_stageId].tokenPrice ); + ).div(stages[_stageId].tokenPrice); } + /** + * @notice Returns the amount of ETH (in wei) that tokens are worth at a specified stage. + * @param _tokenAmount The amount of token. + * @param _stageId The stage we are interested in. + */ function getEthAmountForTokensAtStage(uint256 _tokenAmount, uint8 _stageId) public view returns (uint256) { // return (_token_amount * Stages[_stageId].token_price) / (10 ** 18); return _tokenAmount.mul( @@ -459,77 +597,98 @@ contract ReversibleICO is IERC777Recipient { } /* - * Participant view functions - */ + * Participant view functions + */ - // direct call: participantsByAddress[_address].byStage[_stageId]._accepted - function getParticipantDetailsByStage( - address _address, - uint8 _stageId - ) public view returns ( - uint256 stageCommittedETH, + /** + * @notice Returns participant's stats by stage. + * @param _address The participant's address. + * @param _stageId The relevant stage. + + * @dev Direct call: participantsByAddress[_address].byStage[_stageId]._accepted + */ + function getParticipantDetailsByStage(address _address, uint8 _stageId) + public + view + returns ( + uint256 stageTotalReceivedETH, uint256 stageReturnedETH, - uint256 stageAcceptedETH, + uint256 stageCommittedETH, uint256 stageWithdrawnETH, + uint256 stageAllocatedETH, uint256 stageReservedTokens, uint256 stageBoughtTokens, uint256 stageReturnedTokens ) { - ParticipantDetailsByStage storage totalsRecord = participantsByAddress[_address] - .byStage[_stageId]; - + ParticipantDetails storage totalsRecord = participantsByAddress[_address].byStage[_stageId]; return ( - totalsRecord.committedETH, + totalsRecord.totalReceivedETH, totalsRecord.returnedETH, - totalsRecord.acceptedETH, + totalsRecord.committedETH, totalsRecord.withdrawnETH, + totalsRecord.allocatedETH, totalsRecord.reservedTokens, totalsRecord.boughtTokens, totalsRecord.returnedTokens ); } - /* - * ERC777 - get the amount of locked tokens at current block number - */ - function getLockedTokenAmount(address _participantAddress) public view returns (uint256) { + /** + * @notice Returns the participant's amount of locked tokens at the current block. + * @param _participantAddress The participant's address. + * TODO: is it correct as this function is also used in the withdraw and other important functions. + */ + function getLockedTokenAmount(address _participantAddress, bool includeReserved) public view returns (uint256) { - // since we want to display token amounts even when they're not already - // transferred to their accounts, we use reserved + awarded + uint256 tokens = participantAggregatedStats[_participantAddress].boughtTokens; + if(includeReserved) { + tokens = tokens.add(participantAggregatedStats[_participantAddress].reservedTokens); + } + // Since we want to display token amounts even when they are not already + // transferred to their accounts, we use reserved + bought return getLockedTokenAmountAtBlock( - participantsByAddress[_participantAddress].reservedTokens + - participantsByAddress[_participantAddress].boughtTokens, + tokens, getCurrentBlockNumber() - ) - participantsByAddress[_participantAddress].returnedTokens; + ).sub( participantAggregatedStats[_participantAddress].returnedTokens ); } - /* - * Return cancel modes for a participant address, informational only - */ + /** + * @notice Returns the cancel modes for a participant. + * @param _participantAddress The participant's address. + * @return byEth Boolean + * @return byTokens Boolean + */ function getCancelModes(address _participantAddress) external view returns (bool byEth, bool byTokens) { - Participant storage participantRecord = participantsByAddress[_participantAddress]; + //Participant storage participantRecord = participantsByAddress[_participantAddress]; - if(participantRecord.whitelisted == true) { + //if (participantRecord.whitelisted == true) { // byEth remains false as they need to send tokens back. - byTokens = canCancelByTokens(_participantAddress); - } else { + byTokens = canWithdraw(_participantAddress); + //} else { // byTokens remains false as the participant should have no tokens to send back anyway. - byEth = canCancelByEth(_participantAddress); - } + byEth = hasPendingETH(_participantAddress); + //} } - function canCancelByTokens(address _participantAddress) public view returns (bool) { - if(getLockedTokenAmount(_participantAddress) > 0) { + /** + * @notice Returns TRUE if the participant has locked tokens in the current stage. + * @param _participantAddress The participant's address. + */ + function canWithdraw(address _participantAddress) public view returns (bool) { + if (getLockedTokenAmount(_participantAddress, false) > 0) { return true; } return false; } - function canCancelByEth(address _participantAddress) public view returns (bool) { - Participant storage participantRecord = participantsByAddress[_participantAddress]; - if(participantRecord.committedETH > 0 && participantRecord.committedETH > participantRecord.returnedETH ) { + /** + * @notice Returns TRUE if participant has pending ETH and is not whitelisted. + * @param _participantAddress The participant's address. + */ + function hasPendingETH(address _participantAddress) public view returns (bool) { + if (getParticipantPendingETH(_participantAddress) > 0) { return true; } return false; @@ -538,15 +697,21 @@ contract ReversibleICO is IERC777Recipient { // ------------------------------------------------------------------------------------------------ /* - * Helper public view functions - */ + * Helper public view functions + */ - // required so we can override when running tests + /** + * @notice Returns the current block number: required in order to override when running tests. + */ function getCurrentBlockNumber() public view returns (uint256) { return block.number; } - function getStageAtBlock(uint256 _selectedBlock) public view returns ( uint8 ) { + /** + * @notice Returns the stage which a given block belongs to. + * @param _blockNumber The block number. + */ + function getStageAtBlock(uint256 _blockNumber) public view returns (uint8) { // *NOTE: if selectedBlock is end block.. the participant will get the correct // stage now but their new transaction will end up in the @@ -557,58 +722,58 @@ contract ReversibleICO is IERC777Recipient { // contract should always display proper data. // - // return commit phase, stage 0 - if ( _selectedBlock <= commitPhaseEndBlock ) { + require(_blockNumber >= commitPhaseStartBlock && _blockNumber <= buyPhaseEndBlock, "Block outside of rICO period."); + + // Return commit phase (stage 0) + if (_blockNumber <= commitPhaseEndBlock) { return 0; } - // find buy phase stage n - // solidity floors division results, thus we get what we're looking for. - uint256 num = (_selectedBlock - commitPhaseEndBlock) / (stageBlockCount + 1) + 1; + // This is the number of blocks starting from the first stage. + uint256 distance = _blockNumber - (commitPhaseEndBlock + 1); + // Get the stageId (1..stageCount), commitPhase is stage 0 + // e.g. distance = 5, stageBlockCount = 5, stageID = 2 + uint256 stageID = 1 + (distance / stageBlockCount); - // last block of each stage always computes as stage + 1 - if(stages[uint8(num)-1].endBlock == _selectedBlock) { - // save some gas and just return instead of decrementing. - return uint8(num - 1); - } - - // return max_uint8 if outside range - // @TODO: maybe revert ?! - if(num >= stageCount) { - return 255; - } - - return uint8(num); + return uint8(stageID); } - /* - * Recalculate Funds allocation - */ + + /** + * @notice Returns the contract's available ETH to commit at a certain stage. + * @param _stage the stage id. + * TODO we use such functions in the main commit calculations, are there chances of rounding errors? + */ function availableEthAtStage(uint8 _stage) public view returns (uint256) { - return tokenContract.balanceOf(address(this)).mul( + // Multiply the number of tokens held by the contract with the token price + // at the specified stage and perform precision adjustments(div). + return IERC777(tokenContractAddress).balanceOf(address(this)).mul( stages[_stage].tokenPrice - ).div( 10 ** 18 ); + ).div(10 ** 18); } - /* - * ERC777 - get the amount of locked tokens at current block number - */ + + /** + * @notice Returns the amount of locked tokens at a certain block. + * @param _tokenAmount The amount on tokens. + * @param _blockNumber The specified block number. + */ function getLockedTokenAmountAtBlock(uint256 _tokenAmount, uint256 _blockNumber) public view returns (uint256) { - if(_tokenAmount > 0) { + if (_tokenAmount > 0) { - // if before "development / buy phase" ( stage 0 ) - // - return all tokens bought through contributing. - // if in development phase ( stage 1 to 12 ) + // if before "development / buy phase" ( in stage 0 ) + // - return all tokens bought through contributions. + // if in development phase ( in stage 1 to n ) // - calculate and return // else if after end_block // - return 0 - if(_blockNumber < buyPhaseStartBlock) { + if (_blockNumber < buyPhaseStartBlock) { // commit phase return _tokenAmount; - } else if(_blockNumber < buyPhaseEndBlock) { + } else if (_blockNumber <= buyPhaseEndBlock) { // buy phase uint8 precision = 20; @@ -619,219 +784,211 @@ contract ReversibleICO is IERC777Recipient { ).div(10 ** uint256(precision)); return bought.sub(unlocked); - - } else { - - // after contract end - return 0; } - } else { + // after buyPhase's end return 0; } + return 0; } - /* - * Calculates the percentage of bought tokens (or ETH allocated to the project) beginning from the buy phase start to the current block. - * Returns unlock percentage multiplied by 10 to the power of precision - * ( should be 20 resulting in 10 ** 20, so we can divide by 100 later and get 18 decimals ) - */ - function getCurrentUnlockPercentage() public view returns(uint256) { + /** + * @notice Calculates the percentage of bought tokens (or ETH allocated to the project) beginning from the buy phase start to the current block. + * @return Unlock percentage multiplied by 10 to the power of precision. (should be 20 resulting in 10 ** 20, so we can divide by 100 later and get 18 decimals). + */ + function getCurrentUnlockPercentageFor( + uint256 _currentBlock, + uint256 _startBlock, + uint256 _endBlock + ) public pure returns (uint256) { uint8 precision = 20; - uint256 currentBlock = getCurrentBlockNumber(); + if (_currentBlock >= _startBlock && _currentBlock <= _endBlock) { + // number of blocks ( ie: start=5/end=10 => 10 - 5 + 1 => 6 ) + uint256 totalBlockCount = _endBlock.sub(_startBlock).add(1); + + // get the number of blocks that have "elapsed" since the start block + // add 1 since start block needs to return higher than 0 + uint256 passedBlocks = _currentBlock.sub(_startBlock).add(1); - if(currentBlock > buyPhaseStartBlock && currentBlock < buyPhaseEndBlock) { - uint256 passedBlocks = currentBlock.sub(buyPhaseStartBlock); return passedBlocks.mul( 10 ** uint256(precision) - ).div(buyPhaseBlockCount); - } else if (currentBlock >= buyPhaseEndBlock) { - return 0; // 10 ** uint256(precision); + ).div(totalBlockCount); + } else if (_currentBlock > _endBlock) { + return 10 ** uint256(precision); } else { - return 0; // 10 ** uint256(precision); + return 0; } } + function getCurrentUnlockPercentage() public view returns (uint256) { + return getCurrentUnlockPercentageFor( + getCurrentBlockNumber(), + buyPhaseStartBlock, + buyPhaseEndBlock + ); + } // ------------------------------------------------------------------------------------------------ /* - * Internal functions - */ - - /* - * Participant commits funds - */ - function commit() - internal - isInitialized - isNotFrozen - { - // add to received value to committedETH - committedETH += msg.value; - - // Participant initial state record - Participant storage participantRecord = participantsByAddress[msg.sender]; - - // Check if participant already exists - if(participantRecord.contributionsCount == 0) { - // increase participant count - participantCount++; - - // index - participantsById[participantCount] = msg.sender; - } - - // record contribution into current stage totals for the participant - recordNewContribution(msg.sender, msg.value); - - // if whitelisted, process the contribution automatically - if(participantRecord.whitelisted == true) { - acceptContributionsForAddress(msg.sender, uint8(ApplicationEventTypes.COMMITMENT_ACCEPTED)); - } - } + * Internal functions + */ - /* - * Withdraw - */ + /** + * @notice Allow a participant to withdraw by sending tokens back to rICO contract. + * @param _from Sender's (participant's) address. + * @param _returnedTokenAmount The amount of tokens returned. + */ function withdraw(address _from, uint256 _returnedTokenAmount) internal { - // Whitelisted contributor sends tokens back to the RICO contract - // - unlinke cancel() method, this allows variable amounts. + uint256 currentBlockNumber = getCurrentBlockNumber(); + require(currentBlockNumber < buyPhaseEndBlock, "Withdraw not possible. Buy phase ended."); + + // Contributor sends tokens back to the rICO contract. + // - unlike cancel() method, this allows variable amounts. // - latest contributions get returned first. Participant storage participantRecord = participantsByAddress[_from]; + ParticipantDetails storage aggregatedStats = participantAggregatedStats[_from]; + + // Contributors can send more tokens than they have locked, + // thus make sure we only try to return for said amount + uint256 remainingTokenAmount = _returnedTokenAmount; + uint256 maxLocked = getLockedTokenAmount(_from, false); // get locked, but exclude reserved + uint256 returnTokenAmount; + uint256 allocatedEthAmount; + + // if returned amount is greater than the locked amount... + // set it equal to locked, keep track of the overflow tokens (remainingTokenAmount) + if (remainingTokenAmount > maxLocked) { + returnTokenAmount = remainingTokenAmount - maxLocked; + remainingTokenAmount = maxLocked; + } - // this is needed otherwise participants that can call cancel() can bypass - if(participantRecord.whitelisted == true) { - - uint256 currentBlockNumber = getCurrentBlockNumber(); - - // Contributors can send more tokens than they have locked, - // thus make sure we only try to return for said amount - uint256 remainingTokenAmount = _returnedTokenAmount; - uint256 maxLocked = getLockedTokenAmount(_from); - uint256 returnTokenAmount; - uint256 allocatedEthAmount = 0; + require(remainingTokenAmount > 0, "Withdraw not possible. Participant has no locked tokens."); - if(remainingTokenAmount > maxLocked) { - returnTokenAmount = remainingTokenAmount - maxLocked; - remainingTokenAmount = maxLocked; - } + // decrease the total allocated ETH by the equivalent participant's allocated amount + projectAllocatedETH = projectAllocatedETH.sub(aggregatedStats.allocatedETH); - projectAllocatedETH = projectAllocatedETH.sub(participantRecord.allocatedETH); + // go through stages starting with current stage + // take stage token amount and remove from "amount participant wants to return" + // get ETH amount in said stage for that token amount + // set stage tokens to 0 + // if stage tokens < remaining tokens to process, just subtract remaining from stage + // this way we can receive tokens in current stage / later stages and process them again. - if(remainingTokenAmount > 0) { + uint256 returnETHAmount; + // defaults to 0 - // go through stages starting with current stage - // take stage token amount and remove from "amount participant wants to return" - // get eth amount in said stage for that token amount - // set stage tokens to 0 - // if stage tokens < remaining tokens to process, just sub remaining from stage - // this way we can receive tokens in current stage / later stages and process them again. + for (uint8 stageId = getCurrentStage(); stageId >= 0; stageId--) { - uint256 returnETHAmount; // defaults to 0 + ParticipantDetails storage byStage = participantRecord.byStage[stageId]; - uint8 currentStageNumber = getCurrentStage(); - for( uint8 stageId = currentStageNumber; stageId >= 0; stageId-- ) { + // total participant tokens at the current stage i.e. bought - returned + uint256 totalInStage = byStage.boughtTokens.sub(byStage.returnedTokens); - // total tokens - uint256 totalInStage = participantRecord.byStage[stageId].reservedTokens + - participantRecord.byStage[stageId].boughtTokens - - participantRecord.byStage[stageId].returnedTokens; + // calculate how many tokens are actually locked at this stage... + // ...(at the current block number) and use only those for returning. + // bought - returned (at currentStage & currentBlock) + uint256 lockedTokensInStage = getLockedTokenAmountAtBlock( + byStage.boughtTokens, + currentBlockNumber + ).sub( byStage.returnedTokens ); - // calculate how many tokens are actually locked in this stage - // and only use those for return. + // only try to process stages that the participant has actually bought tokens in. + if (lockedTokensInStage > 0) { - uint256 tokensInStage = getLockedTokenAmountAtBlock( - participantRecord.byStage[stageId].reservedTokens + - participantRecord.byStage[stageId].boughtTokens, - currentBlockNumber - ) - participantRecord.byStage[stageId].returnedTokens; + // if the remaining amount is less than the amount available in the current stage + if (remainingTokenAmount < lockedTokensInStage) { + lockedTokensInStage = remainingTokenAmount; + } - // only try to process stages that actually have tokens in them. - if(tokensInStage > 0) { + // increase the returned token counters accordingly + aggregatedStats.returnedTokens = aggregatedStats.returnedTokens.add(lockedTokensInStage); + byStage.returnedTokens = byStage.returnedTokens.add(lockedTokensInStage); - if (remainingTokenAmount < tokensInStage ) { - tokensInStage = remainingTokenAmount; - } - uint256 currentETHAmount = getEthAmountForTokensAtStage(tokensInStage, stageId); + // get the equivalent amount of ETH for the locked tokens in stage + uint256 currentETHAmount = getEthAmountForTokensAtStage(lockedTokensInStage, stageId); - participantRecord.returnedTokens += tokensInStage; - participantRecord.byStage[stageId].returnedTokens += tokensInStage; + // allocate the difference in total - locked to project + uint256 unlockedETHAmount = getEthAmountForTokensAtStage( + totalInStage.sub(lockedTokensInStage), - // get eth for tokens in current stage - returnETHAmount = returnETHAmount.add(currentETHAmount); - participantRecord.byStage[stageId].withdrawnETH += currentETHAmount; + // TODO: + // we need to allocate eth to project for the global unlocked token count + // + // remainingTokenAmount.sub(lockedTokensInStage), + stageId + ); - // allocated to project - uint256 unlockedETHAmount = getEthAmountForTokensAtStage( - totalInStage.sub(tokensInStage), // unlocked token amount - stageId - ); + // increase the corresponding ETH counters for returned amount + returnETHAmount = returnETHAmount.add(currentETHAmount); + byStage.withdrawnETH = byStage.withdrawnETH.add(currentETHAmount); - allocatedEthAmount += unlockedETHAmount; - participantRecord.byStage[stageId].allocatedETH = unlockedETHAmount; + // increase the corresponding ETH counters for allocated amount + allocatedEthAmount = allocatedEthAmount.add(unlockedETHAmount); + byStage.allocatedETH = unlockedETHAmount; - // remove processed token amount from requested amount - remainingTokenAmount = remainingTokenAmount.sub(tokensInStage); + // remove processed token amount from requested amount + remainingTokenAmount = remainingTokenAmount.sub(lockedTokensInStage); - // break loop if remaining amount = 0 - if(remainingTokenAmount == 0) { - break; - } - } + // break loop if remaining amount = 0 + if (remainingTokenAmount == 0) { + break; } + } + } - if(returnTokenAmount > 0) { - // return overflow tokens received - - // allocate tokens to participant - bytes memory data; - // solium-disable-next-line security/no-send - tokenContract.send(_from, returnTokenAmount, data); - } + // return overflow tokens received + if (returnTokenAmount > 0) { + // send tokens back to participant + bytes memory data; + // solium-disable-next-line security/no-send + IERC777(tokenContractAddress).send(_from, returnTokenAmount, data); + } - participantRecord.withdrawnETH += returnETHAmount; + // increase participant's withdrawnETH counter + aggregatedStats.withdrawnETH = aggregatedStats.withdrawnETH.add(returnETHAmount); - // Adjust globals - withdrawnETH += returnETHAmount; + // Update total ETH withdrawn + withdrawnETH = withdrawnETH.add(returnETHAmount); - // allocate remaining eth to project directly - participantRecord.allocatedETH = allocatedEthAmount; - projectAllocatedETH = projectAllocatedETH.add(participantRecord.allocatedETH); + // allocate remaining ETH to project directly + aggregatedStats.allocatedETH = allocatedEthAmount; + projectAllocatedETH = projectAllocatedETH.add(aggregatedStats.allocatedETH); - participantRecord.withdrawnETH += returnETHAmount; - address(uint160(_from)).transfer(returnETHAmount); - emit TransferEvent(uint8(TransferTypes.PARTICIPANT_WITHDRAW), _from, returnETHAmount); - return; - } - } - // If address is not Whitelisted a call to this results in a revert - revert("Withdraw not possible. Participant has no locked tokens."); + // transfer ETH back to participant + address(uint160(_from)).transfer(returnETHAmount); + emit TransferEvent(uint8(TransferTypes.PARTICIPANT_WITHDRAW), _from, returnETHAmount); + return; } - /// @dev - /// just records every contribution - /// does not return anything or care about overselling - function recordNewContribution(address _from, uint256 _receivedValue) internal { + /** + * @notice Records a new contribution. + * @param _from Participant's address. + * @param _receivedValue The amount contributed. + */ + function recordNewContribution(address _from, uint256 _receivedValue) private { uint8 currentStage = getCurrentStage(); Participant storage participantRecord = participantsByAddress[_from]; - - // per account + ParticipantDetails storage aggregatedStats = participantAggregatedStats[_from]; + // Update participant's total stats participantRecord.contributionsCount++; - participantRecord.committedETH += _receivedValue; + aggregatedStats.totalReceivedETH = aggregatedStats.totalReceivedETH.add(_receivedValue); + + // Update participant's per-stage stats + ParticipantDetails storage byStage = participantRecord.byStage[currentStage]; + byStage.totalReceivedETH = byStage.totalReceivedETH.add(_receivedValue); - // per stage - ParticipantDetailsByStage storage byStage = participantRecord.byStage[currentStage]; - byStage.committedETH += _receivedValue; - // add contribution tokens to totals - // these will change when contribution is accepted if we hit max cap + // Get the equivalent amount in tokens uint256 newTokenAmount = getTokenAmountForEthAtStage( _receivedValue, currentStage ); - byStage.reservedTokens += newTokenAmount; - participantRecord.reservedTokens += newTokenAmount; + + // Update participant's reserved tokens + // TODO: what does this mean?: then can change when contribution is accepted if max cap is hit + byStage.reservedTokens = byStage.reservedTokens.add(newTokenAmount); + aggregatedStats.reservedTokens = aggregatedStats.reservedTokens.add(newTokenAmount); emit ApplicationEvent( uint8(ApplicationEventTypes.CONTRIBUTION_NEW), @@ -841,71 +998,72 @@ contract ReversibleICO is IERC777Recipient { ); } - function acceptContributionsForAddress( - address _from, - uint8 _eventType - ) - internal - { + /** + * @notice Accept a participant's contribution. + * @param _from Participant's address. + * @param _eventType Can be either WHITELIST_APPROVE or COMMITMENT_ACCEPTED. + */ + function acceptContributionsForAddress(address _from, uint8 _eventType) internal { Participant storage participantRecord = participantsByAddress[_from]; + ParticipantDetails storage aggregatedStats = participantAggregatedStats[_from]; - uint8 currentStage = getCurrentStage(); - for(uint8 i = 0; i <= currentStage; i++) { - uint8 stageId = i; + uint256 processedTotals = aggregatedStats.committedETH.add(aggregatedStats.returnedETH); + + // whitelisted( committed ) + returned is lower than total received + if (processedTotals < aggregatedStats.totalReceivedETH) { - ParticipantDetailsByStage storage byStage = participantRecord.byStage[stageId]; + uint8 currentStage = getCurrentStage(); - uint256 processedTotals = participantRecord.acceptedETH + participantRecord.returnedETH; + for (uint8 stageId = 0; stageId <= currentStage; stageId++) { - if(processedTotals < participantRecord.committedETH) { + ParticipantDetails storage byStage = participantRecord.byStage[stageId]; // handle the case when we have reserved more tokens than globally available - participantRecord.reservedTokens -= byStage.reservedTokens; + aggregatedStats.reservedTokens = aggregatedStats.reservedTokens.sub(byStage.reservedTokens); byStage.reservedTokens = 0; + // the maximum amount is equal to the total available ETH at the current stage uint256 maxAcceptableValue = availableEthAtStage(currentStage); - uint256 newAcceptedValue = byStage.committedETH - byStage.acceptedETH; - uint256 returnValue = 0; + // the per stage accepted amount: totalReceivedETH - committedETH + uint256 newAcceptedValue = byStage.totalReceivedETH.sub(byStage.committedETH).sub(byStage.returnedETH); + uint256 returnValue; - // if incomming value is higher than what we can accept, - // just accept the difference and return the rest + if (newAcceptedValue > 0) { - if(newAcceptedValue > maxAcceptableValue) { - newAcceptedValue = maxAcceptableValue; - returnValue = byStage.committedETH - byStage.returnedETH - byStage.acceptedETH - - byStage.withdrawnETH - newAcceptedValue; + // if incoming value is higher than what we can accept, + // just accept the difference and return the rest + if (newAcceptedValue > maxAcceptableValue) { + returnValue = newAcceptedValue.sub(maxAcceptableValue); + newAcceptedValue = maxAcceptableValue; - // return values - returnedETH += returnValue; - participantRecord.returnedETH += returnValue; - byStage.returnedETH = returnValue; - } - - if(newAcceptedValue > 0) { - - // Globals add to processed value to acceptedETH - acceptedETH += newAcceptedValue; - participantRecord.acceptedETH += newAcceptedValue; + // update return values + returnedETH = returnedETH.add(returnValue); + aggregatedStats.returnedETH = aggregatedStats.returnedETH.add(returnValue); + byStage.returnedETH = returnValue; + } - byStage.acceptedETH += newAcceptedValue; + // update values by adding the new accepted amount + committedETH = committedETH.add(newAcceptedValue); + aggregatedStats.committedETH = aggregatedStats.committedETH.add(newAcceptedValue); + byStage.committedETH = byStage.committedETH.add(newAcceptedValue); + // calculate the equivalent token amount uint256 newTokenAmount = getTokenAmountForEthAtStage( newAcceptedValue, stageId ); - byStage.boughtTokens += newTokenAmount; - participantRecord.boughtTokens += newTokenAmount; + // update participant's token amounts + aggregatedStats.boughtTokens = aggregatedStats.boughtTokens.add(newTokenAmount); + byStage.boughtTokens = byStage.boughtTokens.add(newTokenAmount); - // allocate tokens to participant - bytes memory data; // solium-disable-next-line security/no-send - tokenContract.send(_from, newTokenAmount, data); + IERC777(tokenContractAddress).send(_from, newTokenAmount, ""); } - // if stored value is too high to accept we then have - // a return value we must send back to our participant. - if(returnValue > 0) { + // if the incoming amount is too big to accept, then... + // ... we must transfer back the difference. + if (returnValue > 0) { address(uint160(_from)).transfer(returnValue); emit TransferEvent(uint8(TransferTypes.AUTOMATIC_RETURN), _from, returnValue); } @@ -915,91 +1073,137 @@ contract ReversibleICO is IERC777Recipient { } } - function cancelContributionsForAddress( - address _from, - uint8 _eventType - ) - internal - { + function getParticipantPendingETH(address _from) public view returns (uint256) { - Participant storage participantRecord = participantsByAddress[_from]; - // one should only be able to cancel if they haven't been whitelisted - - // but just to make sure take withdrawn and returned into account. - // to handle the case when whitelist controller whitelists some one, then rejects - // them, then whitelists them again. - uint256 participantAvailableETH = participantRecord.committedETH - - participantRecord.withdrawnETH - - participantRecord.returnedETH; - - if(participantAvailableETH > 0) { - // Adjust globals - returnedETH += participantAvailableETH; - - // Set Participant audit values - participantRecord.reservedTokens = 0; - participantRecord.withdrawnETH += participantAvailableETH; - - // globals - // since this balance was never actually "accepted" it counts as returned - // otherwise it interferes with project withdraw calculations - returnedETH += participantAvailableETH; - - // send eth back to participant including received value - address(uint160(_from)).transfer(participantAvailableETH + msg.value); - - uint8 currentTransferEventType; - if(_eventType == uint8(ApplicationEventTypes.WHITELIST_REJECT)) { - currentTransferEventType = uint8(TransferTypes.WHITELIST_REJECT); - } else if (_eventType == uint8(ApplicationEventTypes.PARTICIPANT_CANCEL)) { - currentTransferEventType = uint8(TransferTypes.PARTICIPANT_CANCEL); - } - emit TransferEvent(currentTransferEventType, _from, participantAvailableETH); + ParticipantDetails storage aggregatedStats = participantAggregatedStats[_from]; + + // return aggregatedStats.totalReceivedETH + // .sub(aggregatedStats.returnedETH) + // .sub(aggregatedStats.committedETH) + // .sub(aggregatedStats.withdrawnETH); + + // return aggregatedStats.committedETH.sub( + // aggregatedStats.withdrawnETH + // ); - emit ApplicationEvent( - _eventType, - uint32(participantRecord.contributionsCount), - _from, - participantAvailableETH + + return aggregatedStats.totalReceivedETH + // returned when contract cannot accept full received amount + // + returned by cancel() + .sub(aggregatedStats.returnedETH) + .sub( + // ETH for which we have tokens ( whitelisted ) + aggregatedStats.committedETH + // .sub( + // aggregatedStats.withdrawnETH + // ) ); - } else { - revert("Participant has not contributed any ETH yet."); + } + + /** + * @notice Cancels all of the participant's contributions so far. + * @param _from Participant's address + * @param _value the ETH amount sent with the transaction, to return + * @param _eventType Reason for canceling: {WHITELIST_REJECT, PARTICIPANT_CANCEL} + * TODO add whitelisted modifier, on all functions that require such + */ + function cancelContributionsForAddress(address _from, uint256 _value, uint8 _eventType) internal { + + // Participant should only be able to cancel if they haven't been whitelisted yet... + // ...but just to make sure take 'withdrawn' and 'returned' into account. + // This is to handle the case when whitelist controller whitelists someone, then rejects... + // ...then whitelists them again. + + Participant storage participantRecord = participantsByAddress[_from]; + ParticipantDetails storage aggregatedStats = participantAggregatedStats[_from]; + + // Get participant's pending ETH i.e. committed - withdrawnETH - returnedETH + uint256 participantPendingETH = getParticipantPendingETH(_from); + + // Revert if there is no pending ETH contribution + require(participantPendingETH > 0, "Participant has not contributed any ETH yet."); + + // Update total ETH returned + // Since this balance was never actually "accepted" it counts as returned... + // ...so it does not interfere with project withdraw calculations + returnedETH = returnedETH.add(participantPendingETH); + + // update participant's audit values + aggregatedStats.reservedTokens = 0; + aggregatedStats.returnedETH = aggregatedStats.returnedETH.add(participantPendingETH); + + uint8 currentStage = getCurrentStage(); + for (uint8 stageId = 0; stageId <= currentStage; stageId++) { + ParticipantDetails storage byStage = participantRecord.byStage[stageId]; + byStage.returnedETH = byStage.totalReceivedETH.sub(byStage.committedETH); + + byStage.reservedTokens = 0; } + + // transfer ETH back to participant including received value + address(uint160(_from)).transfer(participantPendingETH.add(_value)); + + // event emission + emit TransferEvent(_eventType, _from, participantPendingETH); + emit ApplicationEvent( + _eventType, + uint32(participantRecord.contributionsCount), + _from, + participantPendingETH + ); } /* - * Modifiers - */ + * Modifiers + */ + /** + * @notice Checks if the sender is the deployer. + */ modifier onlyDeployer() { require(msg.sender == deployerAddress, "Only the deployer can call this method."); _; } + /** + * @notice Checks if the sender is the whitelist controller. + */ modifier onlyWhitelistController() { require(msg.sender == whitelistControllerAddress, "Only the whitelist controller can call this method."); _; } + /** + * @notice Requires the contract to have been initialized. + */ modifier isInitialized() { require(initialized == true, "Contract must be initialized."); _; } + /** + * @notice Requires the contract to NOT have been initialized, + */ modifier isNotInitialized() { require(initialized == false, "Contract is already initialized."); _; } - modifier isFrozen() { - require(frozen == true, "Contract is frozen."); - _; - } - + /** + * @notice @dev Requires the contract to be not frozen. + */ modifier isNotFrozen() { require(frozen == false, "Contract can not be frozen."); _; } + /** + * @notice Checks if the rICO is running. + */ + modifier isRunning() { + uint256 blockNumber = getCurrentBlockNumber(); + require(blockNumber >= commitPhaseStartBlock && blockNumber <= buyPhaseEndBlock, "Contract outside buy in range"); + _; + } } diff --git a/contracts/RicoToken.sol b/contracts/RicoToken.sol index 0a1cd74..5dda8a7 100644 --- a/contracts/RicoToken.sol +++ b/contracts/RicoToken.sol @@ -3,7 +3,7 @@ pragma solidity ^0.5.0; import "./zeppelin/token/ERC777/ERC777.sol"; interface ReversibleICO { - function getLockedTokenAmount(address) external returns (uint256); + function getLockedTokenAmount(address, bool) external view returns (uint256); } contract RicoToken is ERC777 { @@ -45,12 +45,17 @@ contract RicoToken is ERC777 { frozen = _status; } - function getLockedBalance(address _owner) public returns(uint) { - return rICO.getLockedTokenAmount(_owner); + function getLockedBalance(address _owner) public view returns(uint) { + return rICO.getLockedTokenAmount(_owner, false); } - function getUnlockedBalance(address _owner) public returns(uint) { - return balanceOf(_owner).sub(rICO.getLockedTokenAmount(_owner)); + function getUnlockedBalance(address _owner) public view returns(uint) { + uint256 balance = balanceOf(_owner); + uint256 Locked = rICO.getLockedTokenAmount(_owner, false); + if(balance > 0 && Locked > 0 && balance >= Locked) { + return balance.sub(Locked); + } + return balance; } // We should override burn as well. So users can't burn locked amounts diff --git a/contracts/mocks/ReversibleICOMock777.sol b/contracts/mocks/ReversibleICOMock777.sol index e1850e1..dc8e998 100644 --- a/contracts/mocks/ReversibleICOMock777.sol +++ b/contracts/mocks/ReversibleICOMock777.sol @@ -18,7 +18,7 @@ contract ReversibleICOMock777 is ReversibleICOMock { balances[wallet] = _balance; } - function getLockedTokenAmount(address wallet) public view returns (uint256) { + function getLockedTokenAmount(address wallet, bool includeReserved) public view returns (uint256) { return balances[wallet]; } diff --git a/coverage.json b/coverage.json index cfe441e..fd890c1 100644 --- a/coverage.json +++ b/coverage.json @@ -1 +1 @@ -{"contracts/Gnosis/CreateCall.sol":{"l":{"11":0,"14":0,"15":0,"20":0,"23":0,"24":0},"path":"/Volumes/Dev/RICO/poc/contracts/Gnosis/CreateCall.sol","s":{"1":0,"2":0,"3":0,"4":0},"b":{"1":[0,0],"2":[0,0]},"f":{"1":0,"2":0},"fnMap":{"1":{"name":"performCreate2","line":9,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":119}}},"2":{"name":"performCreate","line":18,"loc":{"start":{"line":18,"column":4},"end":{"line":18,"column":104}}}},"statementMap":{"1":{"start":{"line":14,"column":8},"end":{"line":14,"column":70}},"2":{"start":{"line":15,"column":8},"end":{"line":15,"column":42}},"3":{"start":{"line":23,"column":9},"end":{"line":23,"column":71}},"4":{"start":{"line":24,"column":8},"end":{"line":24,"column":42}}},"branchMap":{"1":{"line":14,"type":"if","locations":[{"start":{"line":14,"column":8},"end":{"line":14,"column":8}},{"start":{"line":14,"column":8},"end":{"line":14,"column":8}}]},"2":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":9},"end":{"line":23,"column":9}},{"start":{"line":23,"column":9},"end":{"line":23,"column":9}}]}}},"contracts/Gnosis/GnosisSafe.sol":{"l":{"11":0,"12":0,"14":0,"16":0,"24":0,"34":0,"61":0,"63":0,"77":0,"78":0,"88":0,"90":0,"103":0,"111":0,"112":0,"113":0,"115":0,"119":0,"121":0,"144":0,"145":0,"146":0,"148":0,"159":0,"161":0,"162":0,"163":0,"164":0,"176":0,"177":0,"178":0,"179":0,"180":0,"193":0,"195":0,"206":0,"207":0,"208":0,"209":0,"210":0,"212":0,"215":0,"216":0,"217":0,"218":0,"219":0,"220":0,"222":0,"246":0,"248":0,"250":0,"252":0,"253":0,"255":0,"256":0,"258":0,"259":0,"260":0,"262":0,"263":0,"264":0,"276":0,"278":0,"279":0,"280":0,"281":0,"282":0,"284":0,"285":0,"298":0,"300":0,"301":0,"302":0,"303":0,"304":0,"305":0,"307":0,"308":0,"321":0,"323":0,"325":0,"326":0,"327":0,"328":0,"329":0,"330":0,"331":0,"342":0,"344":0,"345":0,"346":0,"354":0,"362":0,"372":0,"375":0,"376":0,"377":0,"378":0,"379":0,"380":0,"382":0,"401":0,"402":0,"403":0,"412":0,"413":0,"421":0,"422":0,"441":0,"442":0,"443":0,"444":0,"445":0,"461":0,"484":0,"485":0,"488":0,"489":0,"491":0,"498":0,"499":0,"502":0,"509":0,"510":0,"512":0,"519":0,"520":0,"522":0,"530":0,"531":0,"593":0,"594":0,"595":0,"597":0,"598":0,"600":0,"603":0,"634":0,"640":0,"641":0,"642":0,"643":0,"645":0,"646":0,"647":0,"648":0,"652":0,"653":0,"667":0,"668":0,"671":0,"673":0,"687":0,"689":0,"690":0,"691":0,"692":0,"693":0,"694":0,"695":0,"696":0,"698":0,"700":0,"704":0,"707":0,"710":0,"712":0,"715":0,"718":0,"720":0,"724":0,"728":0,"731":0,"733":0,"734":0,"738":0,"743":0,"745":0,"749":0,"769":0,"772":0,"773":0,"775":0,"785":0,"786":0,"797":0,"813":0,"814":0,"815":0,"818":0,"820":0,"833":0,"836":0,"869":0,"872":0,"903":0},"path":"/Volumes/Dev/RICO/poc/contracts/Gnosis/GnosisSafe.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":0,"181":0,"182":0,"183":0,"184":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,0],"42":[0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0,0],"48":[0,0],"49":[0,0],"50":[0,0],"51":[0,0],"52":[0,0],"53":[0,0],"54":[0,0],"55":[0,0],"56":[0,0],"57":[0,0],"58":[0,0],"59":[0,0],"60":[0,0],"61":[0,0],"62":[0,0],"63":[0,0],"64":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0},"fnMap":{"1":{"name":"execute","line":7,"loc":{"start":{"line":7,"column":4},"end":{"line":10,"column":5}}},"2":{"name":"executeCall","line":19,"loc":{"start":{"line":19,"column":4},"end":{"line":22,"column":5}}},"3":{"name":"executeDelegateCall","line":29,"loc":{"start":{"line":29,"column":4},"end":{"line":32,"column":5}}},"4":{"name":"transferToken","line":53,"loc":{"start":{"line":53,"column":4},"end":{"line":60,"column":5}}},"5":{"name":"authorized","line":76,"loc":{"start":{"line":76,"column":4},"end":{"line":76,"column":23}}},"6":{"name":"internalSetFallbackHandler","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":87,"column":63}}},"7":{"name":"setFallbackHandler","line":99,"loc":{"start":{"line":99,"column":4},"end":{"line":102,"column":5}}},"8":{"name":"","line":106,"loc":{"start":{"line":106,"column":4},"end":{"line":109,"column":5}}},"9":{"name":"setupModules","line":141,"loc":{"start":{"line":141,"column":4},"end":{"line":143,"column":5}}},"10":{"name":"enableModule","line":154,"loc":{"start":{"line":154,"column":4},"end":{"line":157,"column":5}}},"11":{"name":"disableModule","line":171,"loc":{"start":{"line":171,"column":4},"end":{"line":174,"column":5}}},"12":{"name":"execTransactionFromModule","line":188,"loc":{"start":{"line":188,"column":4},"end":{"line":191,"column":5}}},"13":{"name":"getModules","line":200,"loc":{"start":{"line":200,"column":4},"end":{"line":204,"column":5}}},"14":{"name":"setupOwners","line":241,"loc":{"start":{"line":241,"column":4},"end":{"line":243,"column":5}}},"15":{"name":"addOwnerWithThreshold","line":271,"loc":{"start":{"line":271,"column":4},"end":{"line":274,"column":5}}},"16":{"name":"removeOwner","line":293,"loc":{"start":{"line":293,"column":4},"end":{"line":296,"column":5}}},"17":{"name":"swapOwner","line":316,"loc":{"start":{"line":316,"column":4},"end":{"line":319,"column":5}}},"18":{"name":"changeThreshold","line":337,"loc":{"start":{"line":337,"column":4},"end":{"line":340,"column":5}}},"19":{"name":"getThreshold","line":349,"loc":{"start":{"line":349,"column":4},"end":{"line":353,"column":5}}},"20":{"name":"isOwner","line":357,"loc":{"start":{"line":357,"column":4},"end":{"line":361,"column":5}}},"21":{"name":"getOwners","line":367,"loc":{"start":{"line":367,"column":4},"end":{"line":371,"column":5}}},"22":{"name":"changeMasterCopy","line":396,"loc":{"start":{"line":396,"column":4},"end":{"line":399,"column":5}}},"23":{"name":"authorized","line":411,"loc":{"start":{"line":411,"column":4},"end":{"line":411,"column":23}}},"24":{"name":"setManager","line":416,"loc":{"start":{"line":416,"column":4},"end":{"line":418,"column":5}}},"25":{"name":"recoverKey","line":432,"loc":{"start":{"line":432,"column":4},"end":{"line":440,"column":5}}},"26":{"name":"signatureSplit","line":452,"loc":{"start":{"line":452,"column":4},"end":{"line":456,"column":5}}},"27":{"name":"mul","line":480,"loc":{"start":{"line":480,"column":2},"end":{"line":480,"column":68}}},"28":{"name":"div","line":497,"loc":{"start":{"line":497,"column":2},"end":{"line":497,"column":68}}},"29":{"name":"sub","line":508,"loc":{"start":{"line":508,"column":2},"end":{"line":508,"column":68}}},"30":{"name":"add","line":518,"loc":{"start":{"line":518,"column":2},"end":{"line":518,"column":68}}},"31":{"name":"mod","line":529,"loc":{"start":{"line":529,"column":2},"end":{"line":529,"column":68}}},"32":{"name":"setup","line":581,"loc":{"start":{"line":581,"column":4},"end":{"line":592,"column":5}}},"33":{"name":"execTransaction","line":619,"loc":{"start":{"line":619,"column":4},"end":{"line":633,"column":5}}},"34":{"name":"handlePayment","line":657,"loc":{"start":{"line":657,"column":4},"end":{"line":665,"column":5}}},"35":{"name":"checkSignatures","line":683,"loc":{"start":{"line":683,"column":4},"end":{"line":685,"column":5}}},"36":{"name":"requiredTxGas","line":764,"loc":{"start":{"line":764,"column":4},"end":{"line":768,"column":5}}},"37":{"name":"approveHash","line":782,"loc":{"start":{"line":782,"column":4},"end":{"line":784,"column":5}}},"38":{"name":"signMessage","line":793,"loc":{"start":{"line":793,"column":4},"end":{"line":796,"column":5}}},"39":{"name":"isValidSignature","line":809,"loc":{"start":{"line":809,"column":4},"end":{"line":812,"column":5}}},"40":{"name":"getMessageHash","line":826,"loc":{"start":{"line":826,"column":4},"end":{"line":832,"column":5}}},"41":{"name":"encodeTransactionData","line":853,"loc":{"start":{"line":853,"column":4},"end":{"line":868,"column":5}}},"42":{"name":"getTransactionHash","line":887,"loc":{"start":{"line":887,"column":4},"end":{"line":902,"column":5}}}},"statementMap":{"1":{"start":{"line":11,"column":8},"end":{"line":11,"column":295}},"2":{"start":{"line":12,"column":12},"end":{"line":12,"column":56}},"3":{"start":{"line":13,"column":13},"end":{"line":13,"column":405}},"4":{"start":{"line":14,"column":12},"end":{"line":14,"column":57}},"5":{"start":{"line":16,"column":12},"end":{"line":16,"column":26}},"6":{"start":{"line":61,"column":8},"end":{"line":61,"column":98}},"7":{"start":{"line":77,"column":8},"end":{"line":77,"column":91}},"8":{"start":{"line":88,"column":8},"end":{"line":88,"column":52}},"9":{"start":{"line":103,"column":8},"end":{"line":103,"column":42}},"10":{"start":{"line":111,"column":8},"end":{"line":111,"column":57}},"11":{"start":{"line":111,"column":51},"end":{"line":111,"column":57}},"12":{"start":{"line":112,"column":8},"end":{"line":112,"column":52}},"13":{"start":{"line":113,"column":8},"end":{"line":113,"column":23}},"14":{"start":{"line":119,"column":8},"end":{"line":119,"column":3768}},"15":{"start":{"line":144,"column":8},"end":{"line":144,"column":96}},"16":{"start":{"line":145,"column":8},"end":{"line":145,"column":51}},"17":{"start":{"line":146,"column":8},"end":{"line":146,"column":4794}},"18":{"start":{"line":148,"column":12},"end":{"line":148,"column":95}},"19":{"start":{"line":159,"column":8},"end":{"line":159,"column":119}},"20":{"start":{"line":161,"column":8},"end":{"line":161,"column":87}},"21":{"start":{"line":162,"column":8},"end":{"line":162,"column":59}},"22":{"start":{"line":163,"column":8},"end":{"line":163,"column":50}},"23":{"start":{"line":164,"column":8},"end":{"line":164,"column":34}},"24":{"start":{"line":176,"column":8},"end":{"line":176,"column":119}},"25":{"start":{"line":177,"column":8},"end":{"line":177,"column":107}},"26":{"start":{"line":178,"column":8},"end":{"line":178,"column":62}},"27":{"start":{"line":179,"column":8},"end":{"line":179,"column":44}},"28":{"start":{"line":180,"column":8},"end":{"line":180,"column":35}},"29":{"start":{"line":193,"column":8},"end":{"line":193,"column":135}},"30":{"start":{"line":195,"column":8},"end":{"line":195,"column":63}},"31":{"start":{"line":206,"column":8},"end":{"line":206,"column":31}},"32":{"start":{"line":207,"column":8},"end":{"line":207,"column":57}},"33":{"start":{"line":208,"column":8},"end":{"line":208,"column":7555}},"34":{"start":{"line":209,"column":12},"end":{"line":209,"column":49}},"35":{"start":{"line":212,"column":8},"end":{"line":212,"column":59}},"36":{"start":{"line":215,"column":8},"end":{"line":215,"column":22}},"37":{"start":{"line":216,"column":8},"end":{"line":216,"column":48}},"38":{"start":{"line":217,"column":8},"end":{"line":217,"column":7867}},"39":{"start":{"line":218,"column":12},"end":{"line":218,"column":45}},"40":{"start":{"line":219,"column":12},"end":{"line":219,"column":49}},"41":{"start":{"line":222,"column":8},"end":{"line":222,"column":20}},"42":{"start":{"line":246,"column":8},"end":{"line":246,"column":64}},"43":{"start":{"line":248,"column":8},"end":{"line":248,"column":83}},"44":{"start":{"line":250,"column":8},"end":{"line":250,"column":71}},"45":{"start":{"line":252,"column":8},"end":{"line":252,"column":46}},"46":{"start":{"line":253,"column":8},"end":{"line":253,"column":9267}},"47":{"start":{"line":255,"column":12},"end":{"line":255,"column":38}},"48":{"start":{"line":256,"column":12},"end":{"line":256,"column":101}},"49":{"start":{"line":258,"column":12},"end":{"line":258,"column":83}},"50":{"start":{"line":259,"column":12},"end":{"line":259,"column":39}},"51":{"start":{"line":260,"column":12},"end":{"line":260,"column":31}},"52":{"start":{"line":262,"column":8},"end":{"line":262,"column":45}},"53":{"start":{"line":263,"column":8},"end":{"line":263,"column":34}},"54":{"start":{"line":264,"column":8},"end":{"line":264,"column":29}},"55":{"start":{"line":276,"column":8},"end":{"line":276,"column":97}},"56":{"start":{"line":278,"column":8},"end":{"line":278,"column":74}},"57":{"start":{"line":279,"column":8},"end":{"line":279,"column":46}},"58":{"start":{"line":280,"column":8},"end":{"line":280,"column":38}},"59":{"start":{"line":282,"column":8},"end":{"line":282,"column":30}},"60":{"start":{"line":284,"column":8},"end":{"line":284,"column":10682}},"61":{"start":{"line":285,"column":12},"end":{"line":285,"column":38}},"62":{"start":{"line":298,"column":8},"end":{"line":298,"column":101}},"63":{"start":{"line":300,"column":8},"end":{"line":300,"column":97}},"64":{"start":{"line":301,"column":8},"end":{"line":301,"column":84}},"65":{"start":{"line":302,"column":8},"end":{"line":302,"column":40}},"66":{"start":{"line":303,"column":8},"end":{"line":303,"column":33}},"67":{"start":{"line":305,"column":8},"end":{"line":305,"column":32}},"68":{"start":{"line":307,"column":8},"end":{"line":307,"column":11859}},"69":{"start":{"line":308,"column":12},"end":{"line":308,"column":38}},"70":{"start":{"line":321,"column":8},"end":{"line":321,"column":103}},"71":{"start":{"line":323,"column":8},"end":{"line":323,"column":77}},"72":{"start":{"line":325,"column":8},"end":{"line":325,"column":103}},"73":{"start":{"line":326,"column":8},"end":{"line":326,"column":87}},"74":{"start":{"line":327,"column":8},"end":{"line":327,"column":42}},"75":{"start":{"line":328,"column":8},"end":{"line":328,"column":35}},"76":{"start":{"line":329,"column":8},"end":{"line":329,"column":36}},"77":{"start":{"line":330,"column":8},"end":{"line":330,"column":35}},"78":{"start":{"line":331,"column":8},"end":{"line":331,"column":33}},"79":{"start":{"line":342,"column":8},"end":{"line":342,"column":79}},"80":{"start":{"line":344,"column":8},"end":{"line":344,"column":71}},"81":{"start":{"line":345,"column":8},"end":{"line":345,"column":29}},"82":{"start":{"line":346,"column":8},"end":{"line":346,"column":40}},"83":{"start":{"line":354,"column":8},"end":{"line":354,"column":24}},"84":{"start":{"line":362,"column":8},"end":{"line":362,"column":70}},"85":{"start":{"line":372,"column":8},"end":{"line":372,"column":58}},"86":{"start":{"line":375,"column":8},"end":{"line":375,"column":25}},"87":{"start":{"line":376,"column":8},"end":{"line":376,"column":54}},"88":{"start":{"line":377,"column":8},"end":{"line":377,"column":14376}},"89":{"start":{"line":378,"column":12},"end":{"line":378,"column":38}},"90":{"start":{"line":379,"column":12},"end":{"line":379,"column":46}},"91":{"start":{"line":382,"column":8},"end":{"line":382,"column":20}},"92":{"start":{"line":401,"column":8},"end":{"line":401,"column":81}},"93":{"start":{"line":402,"column":8},"end":{"line":402,"column":31}},"94":{"start":{"line":403,"column":8},"end":{"line":403,"column":43}},"95":{"start":{"line":412,"column":8},"end":{"line":412,"column":88}},"96":{"start":{"line":421,"column":8},"end":{"line":421,"column":78}},"97":{"start":{"line":422,"column":8},"end":{"line":422,"column":42}},"98":{"start":{"line":441,"column":8},"end":{"line":441,"column":15}},"99":{"start":{"line":442,"column":8},"end":{"line":442,"column":17}},"100":{"start":{"line":443,"column":8},"end":{"line":443,"column":17}},"101":{"start":{"line":444,"column":8},"end":{"line":444,"column":56}},"102":{"start":{"line":445,"column":8},"end":{"line":445,"column":46}},"103":{"start":{"line":484,"column":4},"end":{"line":484,"column":18148}},"104":{"start":{"line":485,"column":6},"end":{"line":485,"column":14}},"105":{"start":{"line":488,"column":4},"end":{"line":488,"column":21}},"106":{"start":{"line":489,"column":4},"end":{"line":489,"column":22}},"107":{"start":{"line":491,"column":4},"end":{"line":491,"column":12}},"108":{"start":{"line":498,"column":4},"end":{"line":498,"column":17}},"109":{"start":{"line":499,"column":4},"end":{"line":499,"column":21}},"110":{"start":{"line":502,"column":4},"end":{"line":502,"column":12}},"111":{"start":{"line":509,"column":4},"end":{"line":509,"column":18}},"112":{"start":{"line":510,"column":4},"end":{"line":510,"column":21}},"113":{"start":{"line":512,"column":4},"end":{"line":512,"column":12}},"114":{"start":{"line":519,"column":4},"end":{"line":519,"column":21}},"115":{"start":{"line":520,"column":4},"end":{"line":520,"column":18}},"116":{"start":{"line":522,"column":4},"end":{"line":522,"column":12}},"117":{"start":{"line":530,"column":4},"end":{"line":530,"column":18}},"118":{"start":{"line":531,"column":4},"end":{"line":531,"column":16}},"119":{"start":{"line":593,"column":8},"end":{"line":593,"column":69}},"120":{"start":{"line":594,"column":8},"end":{"line":594,"column":79}},"121":{"start":{"line":595,"column":8},"end":{"line":595,"column":39}},"122":{"start":{"line":597,"column":8},"end":{"line":597,"column":29}},"123":{"start":{"line":598,"column":8},"end":{"line":598,"column":86}},"124":{"start":{"line":598,"column":43},"end":{"line":598,"column":85}},"125":{"start":{"line":600,"column":8},"end":{"line":600,"column":22262}},"126":{"start":{"line":603,"column":12},"end":{"line":603,"column":70}},"127":{"start":{"line":634,"column":8},"end":{"line":634,"column":24057}},"128":{"start":{"line":641,"column":8},"end":{"line":641,"column":75}},"129":{"start":{"line":642,"column":8},"end":{"line":642,"column":84}},"130":{"start":{"line":643,"column":8},"end":{"line":643,"column":35}},"131":{"start":{"line":645,"column":8},"end":{"line":645,"column":109}},"132":{"start":{"line":646,"column":8},"end":{"line":646,"column":39}},"133":{"start":{"line":647,"column":8},"end":{"line":647,"column":24817}},"134":{"start":{"line":648,"column":12},"end":{"line":648,"column":55}},"135":{"start":{"line":652,"column":8},"end":{"line":652,"column":25040}},"136":{"start":{"line":653,"column":12},"end":{"line":653,"column":78}},"137":{"start":{"line":667,"column":8},"end":{"line":667,"column":92}},"138":{"start":{"line":668,"column":8},"end":{"line":668,"column":25515}},"139":{"start":{"line":671,"column":12},"end":{"line":671,"column":146}},"140":{"start":{"line":673,"column":12},"end":{"line":673,"column":127}},"141":{"start":{"line":687,"column":8},"end":{"line":687,"column":83}},"142":{"start":{"line":689,"column":8},"end":{"line":689,"column":38}},"143":{"start":{"line":690,"column":8},"end":{"line":690,"column":28}},"144":{"start":{"line":691,"column":8},"end":{"line":691,"column":15}},"145":{"start":{"line":692,"column":8},"end":{"line":692,"column":17}},"146":{"start":{"line":693,"column":8},"end":{"line":693,"column":17}},"147":{"start":{"line":694,"column":8},"end":{"line":694,"column":17}},"148":{"start":{"line":695,"column":8},"end":{"line":695,"column":27057}},"149":{"start":{"line":696,"column":12},"end":{"line":696,"column":52}},"150":{"start":{"line":698,"column":12},"end":{"line":698,"column":27219}},"151":{"start":{"line":700,"column":16},"end":{"line":700,"column":49}},"152":{"start":{"line":704,"column":16},"end":{"line":704,"column":114}},"153":{"start":{"line":707,"column":16},"end":{"line":707,"column":122}},"154":{"start":{"line":710,"column":16},"end":{"line":710,"column":44}},"155":{"start":{"line":715,"column":16},"end":{"line":715,"column":147}},"156":{"start":{"line":718,"column":16},"end":{"line":718,"column":46}},"157":{"start":{"line":724,"column":16},"end":{"line":724,"column":161}},"158":{"start":{"line":726,"column":19},"end":{"line":726,"column":29267}},"159":{"start":{"line":728,"column":16},"end":{"line":728,"column":49}},"160":{"start":{"line":731,"column":16},"end":{"line":731,"column":127}},"161":{"start":{"line":733,"column":16},"end":{"line":733,"column":29824}},"162":{"start":{"line":734,"column":20},"end":{"line":734,"column":61}},"163":{"start":{"line":736,"column":19},"end":{"line":736,"column":29970}},"164":{"start":{"line":738,"column":16},"end":{"line":738,"column":127}},"165":{"start":{"line":743,"column":16},"end":{"line":743,"column":58}},"166":{"start":{"line":745,"column":12},"end":{"line":745,"column":30445}},"167":{"start":{"line":749,"column":12},"end":{"line":749,"column":35}},"168":{"start":{"line":769,"column":8},"end":{"line":769,"column":36}},"169":{"start":{"line":772,"column":8},"end":{"line":772,"column":62}},"170":{"start":{"line":773,"column":8},"end":{"line":773,"column":50}},"171":{"start":{"line":775,"column":8},"end":{"line":775,"column":52}},"172":{"start":{"line":785,"column":8},"end":{"line":785,"column":82}},"173":{"start":{"line":786,"column":8},"end":{"line":786,"column":52}},"174":{"start":{"line":797,"column":8},"end":{"line":797,"column":48}},"175":{"start":{"line":813,"column":8},"end":{"line":813,"column":51}},"176":{"start":{"line":814,"column":8},"end":{"line":814,"column":33729}},"177":{"start":{"line":815,"column":12},"end":{"line":815,"column":73}},"178":{"start":{"line":818,"column":12},"end":{"line":818,"column":65}},"179":{"start":{"line":820,"column":8},"end":{"line":820,"column":34}},"180":{"start":{"line":833,"column":8},"end":{"line":833,"column":34339}},"181":{"start":{"line":836,"column":8},"end":{"line":836,"column":34457}},"182":{"start":{"line":869,"column":8},"end":{"line":869,"column":35665}},"183":{"start":{"line":872,"column":8},"end":{"line":872,"column":84}},"184":{"start":{"line":903,"column":8},"end":{"line":903,"column":139}}},"branchMap":{"1":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":8},"end":{"line":11,"column":8}},{"start":{"line":11,"column":8},"end":{"line":11,"column":8}}]},"2":{"line":13,"type":"if","locations":[{"start":{"line":13,"column":13},"end":{"line":13,"column":13}},{"start":{"line":13,"column":13},"end":{"line":13,"column":13}}]},"3":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":8},"end":{"line":77,"column":8}},{"start":{"line":77,"column":8},"end":{"line":77,"column":8}}]},"4":{"line":111,"type":"if","locations":[{"start":{"line":111,"column":8},"end":{"line":111,"column":8}},{"start":{"line":111,"column":8},"end":{"line":111,"column":8}}]},"5":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":8},"end":{"line":119,"column":8}},{"start":{"line":119,"column":8},"end":{"line":119,"column":8}}]},"6":{"line":144,"type":"if","locations":[{"start":{"line":144,"column":8},"end":{"line":144,"column":8}},{"start":{"line":144,"column":8},"end":{"line":144,"column":8}}]},"7":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":8},"end":{"line":146,"column":8}},{"start":{"line":146,"column":8},"end":{"line":146,"column":8}}]},"8":{"line":148,"type":"if","locations":[{"start":{"line":148,"column":12},"end":{"line":148,"column":12}},{"start":{"line":148,"column":12},"end":{"line":148,"column":12}}]},"9":{"line":159,"type":"if","locations":[{"start":{"line":159,"column":8},"end":{"line":159,"column":8}},{"start":{"line":159,"column":8},"end":{"line":159,"column":8}}]},"10":{"line":161,"type":"if","locations":[{"start":{"line":161,"column":8},"end":{"line":161,"column":8}},{"start":{"line":161,"column":8},"end":{"line":161,"column":8}}]},"11":{"line":176,"type":"if","locations":[{"start":{"line":176,"column":8},"end":{"line":176,"column":8}},{"start":{"line":176,"column":8},"end":{"line":176,"column":8}}]},"12":{"line":177,"type":"if","locations":[{"start":{"line":177,"column":8},"end":{"line":177,"column":8}},{"start":{"line":177,"column":8},"end":{"line":177,"column":8}}]},"13":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"14":{"line":246,"type":"if","locations":[{"start":{"line":246,"column":8},"end":{"line":246,"column":8}},{"start":{"line":246,"column":8},"end":{"line":246,"column":8}}]},"15":{"line":248,"type":"if","locations":[{"start":{"line":248,"column":8},"end":{"line":248,"column":8}},{"start":{"line":248,"column":8},"end":{"line":248,"column":8}}]},"16":{"line":250,"type":"if","locations":[{"start":{"line":250,"column":8},"end":{"line":250,"column":8}},{"start":{"line":250,"column":8},"end":{"line":250,"column":8}}]},"17":{"line":256,"type":"if","locations":[{"start":{"line":256,"column":12},"end":{"line":256,"column":12}},{"start":{"line":256,"column":12},"end":{"line":256,"column":12}}]},"18":{"line":258,"type":"if","locations":[{"start":{"line":258,"column":12},"end":{"line":258,"column":12}},{"start":{"line":258,"column":12},"end":{"line":258,"column":12}}]},"19":{"line":276,"type":"if","locations":[{"start":{"line":276,"column":8},"end":{"line":276,"column":8}},{"start":{"line":276,"column":8},"end":{"line":276,"column":8}}]},"20":{"line":278,"type":"if","locations":[{"start":{"line":278,"column":8},"end":{"line":278,"column":8}},{"start":{"line":278,"column":8},"end":{"line":278,"column":8}}]},"21":{"line":284,"type":"if","locations":[{"start":{"line":284,"column":8},"end":{"line":284,"column":8}},{"start":{"line":284,"column":8},"end":{"line":284,"column":8}}]},"22":{"line":298,"type":"if","locations":[{"start":{"line":298,"column":8},"end":{"line":298,"column":8}},{"start":{"line":298,"column":8},"end":{"line":298,"column":8}}]},"23":{"line":300,"type":"if","locations":[{"start":{"line":300,"column":8},"end":{"line":300,"column":8}},{"start":{"line":300,"column":8},"end":{"line":300,"column":8}}]},"24":{"line":301,"type":"if","locations":[{"start":{"line":301,"column":8},"end":{"line":301,"column":8}},{"start":{"line":301,"column":8},"end":{"line":301,"column":8}}]},"25":{"line":307,"type":"if","locations":[{"start":{"line":307,"column":8},"end":{"line":307,"column":8}},{"start":{"line":307,"column":8},"end":{"line":307,"column":8}}]},"26":{"line":321,"type":"if","locations":[{"start":{"line":321,"column":8},"end":{"line":321,"column":8}},{"start":{"line":321,"column":8},"end":{"line":321,"column":8}}]},"27":{"line":323,"type":"if","locations":[{"start":{"line":323,"column":8},"end":{"line":323,"column":8}},{"start":{"line":323,"column":8},"end":{"line":323,"column":8}}]},"28":{"line":325,"type":"if","locations":[{"start":{"line":325,"column":8},"end":{"line":325,"column":8}},{"start":{"line":325,"column":8},"end":{"line":325,"column":8}}]},"29":{"line":326,"type":"if","locations":[{"start":{"line":326,"column":8},"end":{"line":326,"column":8}},{"start":{"line":326,"column":8},"end":{"line":326,"column":8}}]},"30":{"line":342,"type":"if","locations":[{"start":{"line":342,"column":8},"end":{"line":342,"column":8}},{"start":{"line":342,"column":8},"end":{"line":342,"column":8}}]},"31":{"line":344,"type":"if","locations":[{"start":{"line":344,"column":8},"end":{"line":344,"column":8}},{"start":{"line":344,"column":8},"end":{"line":344,"column":8}}]},"32":{"line":401,"type":"if","locations":[{"start":{"line":401,"column":8},"end":{"line":401,"column":8}},{"start":{"line":401,"column":8},"end":{"line":401,"column":8}}]},"33":{"line":412,"type":"if","locations":[{"start":{"line":412,"column":8},"end":{"line":412,"column":8}},{"start":{"line":412,"column":8},"end":{"line":412,"column":8}}]},"34":{"line":421,"type":"if","locations":[{"start":{"line":421,"column":8},"end":{"line":421,"column":8}},{"start":{"line":421,"column":8},"end":{"line":421,"column":8}}]},"35":{"line":484,"type":"if","locations":[{"start":{"line":484,"column":4},"end":{"line":484,"column":4}},{"start":{"line":484,"column":4},"end":{"line":484,"column":4}}]},"36":{"line":489,"type":"if","locations":[{"start":{"line":489,"column":4},"end":{"line":489,"column":4}},{"start":{"line":489,"column":4},"end":{"line":489,"column":4}}]},"37":{"line":498,"type":"if","locations":[{"start":{"line":498,"column":4},"end":{"line":498,"column":4}},{"start":{"line":498,"column":4},"end":{"line":498,"column":4}}]},"38":{"line":509,"type":"if","locations":[{"start":{"line":509,"column":4},"end":{"line":509,"column":4}},{"start":{"line":509,"column":4},"end":{"line":509,"column":4}}]},"39":{"line":520,"type":"if","locations":[{"start":{"line":520,"column":4},"end":{"line":520,"column":4}},{"start":{"line":520,"column":4},"end":{"line":520,"column":4}}]},"40":{"line":530,"type":"if","locations":[{"start":{"line":530,"column":4},"end":{"line":530,"column":4}},{"start":{"line":530,"column":4},"end":{"line":530,"column":4}}]},"41":{"line":593,"type":"if","locations":[{"start":{"line":593,"column":8},"end":{"line":593,"column":8}},{"start":{"line":593,"column":8},"end":{"line":593,"column":8}}]},"42":{"line":598,"type":"if","locations":[{"start":{"line":598,"column":8},"end":{"line":598,"column":8}},{"start":{"line":598,"column":8},"end":{"line":598,"column":8}}]},"43":{"line":600,"type":"if","locations":[{"start":{"line":600,"column":8},"end":{"line":600,"column":8}},{"start":{"line":600,"column":8},"end":{"line":600,"column":8}}]},"44":{"line":642,"type":"if","locations":[{"start":{"line":642,"column":8},"end":{"line":642,"column":8}},{"start":{"line":642,"column":8},"end":{"line":642,"column":8}}]},"45":{"line":647,"type":"if","locations":[{"start":{"line":647,"column":8},"end":{"line":647,"column":8}},{"start":{"line":647,"column":8},"end":{"line":647,"column":8}}]},"46":{"line":652,"type":"if","locations":[{"start":{"line":652,"column":8},"end":{"line":652,"column":8}},{"start":{"line":652,"column":8},"end":{"line":652,"column":8}}]},"47":{"line":668,"type":"if","locations":[{"start":{"line":668,"column":8},"end":{"line":668,"column":8}},{"start":{"line":668,"column":8},"end":{"line":668,"column":8}}]},"48":{"line":671,"type":"if","locations":[{"start":{"line":671,"column":12},"end":{"line":671,"column":12}},{"start":{"line":671,"column":12},"end":{"line":671,"column":12}}]},"49":{"line":673,"type":"if","locations":[{"start":{"line":673,"column":12},"end":{"line":673,"column":12}},{"start":{"line":673,"column":12},"end":{"line":673,"column":12}}]},"50":{"line":687,"type":"if","locations":[{"start":{"line":687,"column":8},"end":{"line":687,"column":8}},{"start":{"line":687,"column":8},"end":{"line":687,"column":8}}]},"51":{"line":698,"type":"if","locations":[{"start":{"line":698,"column":12},"end":{"line":698,"column":12}},{"start":{"line":698,"column":12},"end":{"line":698,"column":12}}]},"52":{"line":704,"type":"if","locations":[{"start":{"line":704,"column":16},"end":{"line":704,"column":16}},{"start":{"line":704,"column":16},"end":{"line":704,"column":16}}]},"53":{"line":707,"type":"if","locations":[{"start":{"line":707,"column":16},"end":{"line":707,"column":16}},{"start":{"line":707,"column":16},"end":{"line":707,"column":16}}]},"54":{"line":715,"type":"if","locations":[{"start":{"line":715,"column":16},"end":{"line":715,"column":16}},{"start":{"line":715,"column":16},"end":{"line":715,"column":16}}]},"55":{"line":724,"type":"if","locations":[{"start":{"line":724,"column":16},"end":{"line":724,"column":16}},{"start":{"line":724,"column":16},"end":{"line":724,"column":16}}]},"56":{"line":726,"type":"if","locations":[{"start":{"line":726,"column":19},"end":{"line":726,"column":19}},{"start":{"line":726,"column":19},"end":{"line":726,"column":19}}]},"57":{"line":731,"type":"if","locations":[{"start":{"line":731,"column":16},"end":{"line":731,"column":16}},{"start":{"line":731,"column":16},"end":{"line":731,"column":16}}]},"58":{"line":733,"type":"if","locations":[{"start":{"line":733,"column":16},"end":{"line":733,"column":16}},{"start":{"line":733,"column":16},"end":{"line":733,"column":16}}]},"59":{"line":736,"type":"if","locations":[{"start":{"line":736,"column":19},"end":{"line":736,"column":19}},{"start":{"line":736,"column":19},"end":{"line":736,"column":19}}]},"60":{"line":745,"type":"if","locations":[{"start":{"line":745,"column":12},"end":{"line":745,"column":12}},{"start":{"line":745,"column":12},"end":{"line":745,"column":12}}]},"61":{"line":772,"type":"if","locations":[{"start":{"line":772,"column":8},"end":{"line":772,"column":8}},{"start":{"line":772,"column":8},"end":{"line":772,"column":8}}]},"62":{"line":785,"type":"if","locations":[{"start":{"line":785,"column":8},"end":{"line":785,"column":8}},{"start":{"line":785,"column":8},"end":{"line":785,"column":8}}]},"63":{"line":814,"type":"if","locations":[{"start":{"line":814,"column":8},"end":{"line":814,"column":8}},{"start":{"line":814,"column":8},"end":{"line":814,"column":8}}]},"64":{"line":815,"type":"if","locations":[{"start":{"line":815,"column":12},"end":{"line":815,"column":12}},{"start":{"line":815,"column":12},"end":{"line":815,"column":12}}]}}},"contracts/ReversibleICO.sol":{"l":{"104":35,"105":35,"115":118,"117":116,"120":2,"140":10,"141":10,"142":10,"145":10,"148":10,"149":10,"150":10,"151":10,"153":10,"156":10,"157":10,"158":10,"159":10,"160":10,"162":10,"165":10,"167":120,"168":120,"169":120,"170":120,"171":120,"173":120,"176":10,"178":10,"179":10,"181":10,"195":270,"208":289,"209":171,"213":118,"216":118,"218":71,"223":47,"224":4,"227":43,"231":5,"235":10,"236":10,"237":8,"240":2,"253":156,"265":7,"365":88,"379":116,"382":116,"385":116,"387":34,"390":34,"394":116,"397":116,"398":18,"408":116,"409":116,"412":116,"413":116,"416":116,"417":116,"421":116,"424":116,"425":116,"427":116,"441":42,"443":42,"444":42,"445":92,"447":92,"449":92,"451":92,"454":88,"455":88,"457":88,"459":88,"460":88,"465":88,"466":4,"467":4,"471":4,"472":4,"473":4,"476":88,"479":36,"480":36,"482":36,"484":36,"488":36,"489":36,"492":36,"494":36,"499":88,"500":4,"501":4,"504":88,"516":4,"522":4,"526":4,"528":4,"531":4,"532":4,"535":4,"538":4,"540":4,"541":4,"542":2,"544":2,"546":4,"548":4,"555":0,"577":2,"578":0,"581":2,"582":2,"583":2,"585":0,"596":12,"597":12,"599":12,"600":12,"602":5,"605":7,"614":5,"615":4,"617":1,"625":9,"626":9,"627":5,"629":4,"641":10,"644":10,"646":7,"650":7,"651":7,"652":7,"654":7,"655":5,"656":5,"659":7,"668":5,"670":5,"671":5,"676":12,"683":12,"685":7,"686":1,"688":7,"690":7,"691":7,"694":7,"695":7,"698":7,"701":7,"702":5,"707":5,"711":3,"713":3,"717":5,"719":5,"720":5,"721":5,"722":5,"727":5,"746":22,"749":20,"752":10,"753":10,"757":10,"775":28,"777":28,"778":24,"781":24,"784":2,"787":2,"790":2,"801":0,"802":0,"807":0,"815":0,"830":43,"831":43,"833":43,"834":35,"835":35,"839":2,"841":6,"852":95,"864":107,"872":50,"875":10,"880":32,"881":32,"883":32,"888":32,"893":8,"896":57,"908":4,"910":3,"911":3,"913":0,"914":0,"917":0,"924":0,"925":0,"929":6,"930":6,"933":6,"954":35,"957":35,"974":10,"975":10,"979":30,"980":28,"984":304,"985":292,"989":10,"990":10,"994":0,"995":0,"999":0,"1000":0,"1004":0,"1005":0,"1009":0,"1010":0,"1014":0,"1015":0,"1019":266,"1020":266},"path":"/Volumes/Dev/RICO/poc/contracts/ReversibleICO.sol","s":{"1":35,"2":35,"3":118,"4":116,"5":2,"6":10,"7":10,"8":10,"9":10,"10":10,"11":10,"12":10,"13":10,"14":10,"15":10,"16":10,"17":10,"18":10,"19":10,"20":10,"21":120,"22":120,"23":120,"24":120,"25":120,"26":10,"27":10,"28":10,"29":10,"30":270,"31":289,"32":171,"33":118,"34":118,"35":71,"36":47,"37":4,"38":43,"39":5,"40":10,"41":10,"42":8,"43":2,"44":156,"45":7,"46":88,"47":116,"48":116,"49":116,"50":34,"51":116,"52":116,"53":18,"54":116,"55":116,"56":116,"57":116,"58":116,"59":116,"60":116,"61":116,"62":116,"63":42,"64":42,"65":42,"66":92,"67":92,"68":92,"69":92,"70":88,"71":88,"72":88,"73":88,"74":88,"75":88,"76":4,"77":4,"78":4,"79":4,"80":4,"81":88,"82":36,"83":36,"84":36,"85":36,"86":36,"87":36,"88":36,"89":36,"90":88,"91":4,"92":4,"93":88,"94":4,"95":4,"96":4,"97":4,"98":4,"99":4,"100":4,"101":4,"102":4,"103":4,"104":2,"105":2,"106":2,"107":4,"108":4,"109":0,"110":2,"111":0,"112":2,"113":2,"114":2,"115":0,"116":12,"117":12,"118":12,"119":12,"120":5,"121":7,"122":5,"123":4,"124":1,"125":9,"126":9,"127":5,"128":4,"129":10,"130":10,"131":7,"132":7,"133":7,"134":7,"135":7,"136":5,"137":5,"138":7,"139":5,"140":5,"141":5,"142":12,"143":12,"144":7,"145":1,"146":7,"147":7,"148":7,"149":7,"150":7,"151":7,"152":7,"153":5,"154":3,"155":3,"156":5,"157":5,"158":5,"159":5,"160":5,"161":5,"162":22,"163":20,"164":10,"165":10,"166":10,"167":28,"168":28,"169":24,"170":24,"171":4,"172":2,"173":2,"174":2,"175":0,"176":0,"177":0,"178":0,"179":43,"180":43,"181":43,"182":35,"183":35,"184":8,"185":2,"186":6,"187":95,"188":107,"189":50,"190":10,"191":40,"192":32,"193":32,"194":32,"195":32,"196":8,"197":57,"198":4,"199":3,"200":3,"201":0,"202":0,"203":0,"204":0,"205":6,"206":6,"207":6,"208":35,"209":35,"210":10,"211":30,"212":304,"213":10,"214":0,"215":0,"216":0,"217":0,"218":0,"219":266},"b":{"1":[116,2],"2":[171,118],"3":[71,47],"4":[4,43],"5":[8,2],"6":[34,82],"7":[18,98],"8":[88,4],"9":[4,84],"10":[36,52],"11":[4,84],"12":[4,0],"13":[2,2],"14":[2,0],"15":[0,2],"16":[2,0],"17":[5,7],"18":[4,1],"19":[5,4],"20":[7,3],"21":[5,2],"22":[5,2],"23":[7,5],"24":[1,6],"25":[5,2],"26":[3,2],"27":[20,2],"28":[10,10],"29":[24,4],"30":[2,2],"31":[35,8],"32":[2,6],"33":[50,57],"34":[10,40],"35":[32,8],"36":[3,1],"37":[0,3],"38":[10,0],"39":[28,2],"40":[292,12],"41":[10,0],"42":[0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[266,0]},"f":{"1":35,"2":118,"3":10,"4":270,"5":289,"6":5,"7":10,"8":156,"9":7,"10":88,"11":116,"12":116,"13":42,"14":4,"15":0,"16":2,"17":12,"18":5,"19":9,"20":10,"21":22,"22":28,"23":0,"24":0,"25":0,"26":43,"27":95,"28":107,"29":4,"30":6,"31":35,"32":10,"33":30,"34":304,"35":10,"36":0,"37":0,"38":0,"39":0,"40":0,"41":266},"fnMap":{"1":{"name":"constructor","line":103,"loc":{"start":{"line":103,"column":4},"end":{"line":103,"column":22}}},"2":{"name":"","line":109,"loc":{"start":{"line":109,"column":4},"end":{"line":114,"column":5}}},"3":{"name":"addSettings","line":124,"loc":{"start":{"line":124,"column":4},"end":{"line":138,"column":5}}},"4":{"name":"getCurrentStage","line":194,"loc":{"start":{"line":194,"column":4},"end":{"line":194,"column":58}}},"5":{"name":"getStageAtBlock","line":198,"loc":{"start":{"line":198,"column":4},"end":{"line":198,"column":79}}},"6":{"name":"getCurrentPrice","line":230,"loc":{"start":{"line":230,"column":4},"end":{"line":230,"column":60}}},"7":{"name":"getPriceAtBlock","line":234,"loc":{"start":{"line":234,"column":4},"end":{"line":234,"column":79}}},"8":{"name":"getTokenAmountForEthAtStage","line":245,"loc":{"start":{"line":245,"column":4},"end":{"line":250,"column":5}}},"9":{"name":"getEthAmountForTokensAtStage","line":258,"loc":{"start":{"line":258,"column":4},"end":{"line":263,"column":5}}},"10":{"name":"availableEth","line":364,"loc":{"start":{"line":364,"column":4},"end":{"line":364,"column":55}}},"11":{"name":"commit","line":373,"loc":{"start":{"line":373,"column":4},"end":{"line":377,"column":5}}},"12":{"name":"recordNewContribution","line":405,"loc":{"start":{"line":405,"column":4},"end":{"line":407,"column":5}}},"13":{"name":"acceptContributionsForAddress","line":435,"loc":{"start":{"line":435,"column":4},"end":{"line":440,"column":5}}},"14":{"name":"cancelContributionsForAddress","line":509,"loc":{"start":{"line":509,"column":4},"end":{"line":514,"column":5}}},"15":{"name":"recalculateFunds","line":562,"loc":{"start":{"line":562,"column":4},"end":{"line":564,"column":5}}},"16":{"name":"cancel","line":571,"loc":{"start":{"line":571,"column":4},"end":{"line":576,"column":5}}},"17":{"name":"getCancelModeStates","line":591,"loc":{"start":{"line":591,"column":4},"end":{"line":595,"column":5}}},"18":{"name":"canCancelBySendingTokensBack","line":609,"loc":{"start":{"line":609,"column":4},"end":{"line":613,"column":5}}},"19":{"name":"canCancelBySendingEthToContract","line":620,"loc":{"start":{"line":620,"column":4},"end":{"line":624,"column":5}}},"20":{"name":"withdraw","line":635,"loc":{"start":{"line":635,"column":4},"end":{"line":635,"column":75}}},"21":{"name":"tokensReceived","line":731,"loc":{"start":{"line":731,"column":4},"end":{"line":743,"column":5}}},"22":{"name":"whitelistOrReject","line":766,"loc":{"start":{"line":766,"column":4},"end":{"line":774,"column":5}}},"23":{"name":"whitelistOrRejectMultiple","line":800,"loc":{"start":{"line":800,"column":4},"end":{"line":800,"column":83}}},"24":{"name":"isWhitelisted","line":806,"loc":{"start":{"line":806,"column":4},"end":{"line":806,"column":71}}},"25":{"name":"getCurrentBlockNumber","line":814,"loc":{"start":{"line":814,"column":4},"end":{"line":814,"column":64}}},"26":{"name":"getCurrentUnlockRatio","line":826,"loc":{"start":{"line":826,"column":4},"end":{"line":829,"column":5}}},"27":{"name":"getLockedTokenAmount","line":848,"loc":{"start":{"line":848,"column":4},"end":{"line":848,"column":79}}},"28":{"name":"getLockedFromAmountAtBlock","line":862,"loc":{"start":{"line":862,"column":4},"end":{"line":862,"column":109}}},"29":{"name":"projectWithdraw","line":904,"loc":{"start":{"line":904,"column":4},"end":{"line":907,"column":5}}},"30":{"name":"getProjectAvailableEth","line":928,"loc":{"start":{"line":928,"column":4},"end":{"line":928,"column":73}}},"31":{"name":"ParticipantTotalsDetails","line":941,"loc":{"start":{"line":941,"column":4},"end":{"line":952,"column":7}}},"32":{"name":"onlyDeployer","line":973,"loc":{"start":{"line":973,"column":4},"end":{"line":973,"column":25}}},"33":{"name":"onlyWhitelistController","line":978,"loc":{"start":{"line":978,"column":4},"end":{"line":978,"column":36}}},"34":{"name":"requireInitialized","line":983,"loc":{"start":{"line":983,"column":4},"end":{"line":983,"column":31}}},"35":{"name":"requireNotInitialized","line":988,"loc":{"start":{"line":988,"column":4},"end":{"line":988,"column":34}}},"36":{"name":"requireRunning","line":993,"loc":{"start":{"line":993,"column":4},"end":{"line":993,"column":27}}},"37":{"name":"requireNotRunning","line":998,"loc":{"start":{"line":998,"column":4},"end":{"line":998,"column":30}}},"38":{"name":"requireEnded","line":1003,"loc":{"start":{"line":1003,"column":4},"end":{"line":1003,"column":25}}},"39":{"name":"requireNotEnded","line":1008,"loc":{"start":{"line":1008,"column":4},"end":{"line":1008,"column":28}}},"40":{"name":"requireFrozen","line":1013,"loc":{"start":{"line":1013,"column":4},"end":{"line":1013,"column":26}}},"41":{"name":"requireNotFrozen","line":1018,"loc":{"start":{"line":1018,"column":4},"end":{"line":1018,"column":29}}}},"statementMap":{"1":{"start":{"line":104,"column":8},"end":{"line":104,"column":35}},"2":{"start":{"line":105,"column":8},"end":{"line":105,"column":102}},"3":{"start":{"line":115,"column":8},"end":{"line":115,"column":2923}},"4":{"start":{"line":117,"column":12},"end":{"line":117,"column":19}},"5":{"start":{"line":120,"column":12},"end":{"line":120,"column":19}},"6":{"start":{"line":140,"column":8},"end":{"line":140,"column":49}},"7":{"start":{"line":141,"column":8},"end":{"line":141,"column":63}},"8":{"start":{"line":142,"column":8},"end":{"line":142,"column":51}},"9":{"start":{"line":145,"column":8},"end":{"line":145,"column":50}},"10":{"start":{"line":148,"column":8},"end":{"line":148,"column":31}},"11":{"start":{"line":149,"column":8},"end":{"line":149,"column":51}},"12":{"start":{"line":150,"column":8},"end":{"line":150,"column":61}},"13":{"start":{"line":151,"column":8},"end":{"line":151,"column":41}},"14":{"start":{"line":153,"column":8},"end":{"line":153,"column":41}},"15":{"start":{"line":156,"column":8},"end":{"line":156,"column":77}},"16":{"start":{"line":157,"column":8},"end":{"line":157,"column":44}},"17":{"start":{"line":158,"column":8},"end":{"line":158,"column":66}},"18":{"start":{"line":159,"column":8},"end":{"line":159,"column":49}},"19":{"start":{"line":162,"column":8},"end":{"line":162,"column":57}},"20":{"start":{"line":165,"column":8},"end":{"line":165,"column":4643}},"21":{"start":{"line":167,"column":12},"end":{"line":167,"column":58}},"22":{"start":{"line":168,"column":12},"end":{"line":168,"column":58}},"23":{"start":{"line":169,"column":12},"end":{"line":169,"column":75}},"24":{"start":{"line":170,"column":12},"end":{"line":170,"column":85}},"25":{"start":{"line":173,"column":12},"end":{"line":173,"column":52}},"26":{"start":{"line":176,"column":8},"end":{"line":176,"column":35}},"27":{"start":{"line":178,"column":8},"end":{"line":178,"column":54}},"28":{"start":{"line":179,"column":8},"end":{"line":179,"column":75}},"29":{"start":{"line":181,"column":8},"end":{"line":181,"column":25}},"30":{"start":{"line":195,"column":8},"end":{"line":195,"column":55}},"31":{"start":{"line":208,"column":8},"end":{"line":208,"column":6361}},"32":{"start":{"line":209,"column":12},"end":{"line":209,"column":20}},"33":{"start":{"line":213,"column":8},"end":{"line":213,"column":86}},"34":{"start":{"line":216,"column":8},"end":{"line":216,"column":6682}},"35":{"start":{"line":218,"column":12},"end":{"line":218,"column":33}},"36":{"start":{"line":223,"column":8},"end":{"line":223,"column":6946}},"37":{"start":{"line":224,"column":12},"end":{"line":224,"column":22}},"38":{"start":{"line":227,"column":8},"end":{"line":227,"column":25}},"39":{"start":{"line":231,"column":8},"end":{"line":231,"column":55}},"40":{"start":{"line":235,"column":8},"end":{"line":235,"column":50}},"41":{"start":{"line":236,"column":8},"end":{"line":236,"column":7321}},"42":{"start":{"line":237,"column":12},"end":{"line":237,"column":51}},"43":{"start":{"line":240,"column":8},"end":{"line":240,"column":16}},"44":{"start":{"line":253,"column":8},"end":{"line":253,"column":7949}},"45":{"start":{"line":265,"column":8},"end":{"line":265,"column":8249}},"46":{"start":{"line":365,"column":8},"end":{"line":365,"column":11162}},"47":{"start":{"line":379,"column":8},"end":{"line":379,"column":31}},"48":{"start":{"line":382,"column":8},"end":{"line":382,"column":81}},"49":{"start":{"line":385,"column":8},"end":{"line":385,"column":11697}},"50":{"start":{"line":390,"column":12},"end":{"line":390,"column":58}},"51":{"start":{"line":394,"column":8},"end":{"line":394,"column":51}},"52":{"start":{"line":397,"column":8},"end":{"line":397,"column":12119}},"53":{"start":{"line":398,"column":12},"end":{"line":398,"column":96}},"54":{"start":{"line":408,"column":8},"end":{"line":408,"column":46}},"55":{"start":{"line":409,"column":8},"end":{"line":409,"column":80}},"56":{"start":{"line":413,"column":8},"end":{"line":413,"column":51}},"57":{"start":{"line":416,"column":8},"end":{"line":416,"column":79}},"58":{"start":{"line":417,"column":8},"end":{"line":417,"column":41}},"59":{"start":{"line":421,"column":8},"end":{"line":421,"column":13027}},"60":{"start":{"line":424,"column":8},"end":{"line":424,"column":48}},"61":{"start":{"line":425,"column":8},"end":{"line":425,"column":58}},"62":{"start":{"line":427,"column":8},"end":{"line":427,"column":13254}},"63":{"start":{"line":441,"column":8},"end":{"line":441,"column":80}},"64":{"start":{"line":443,"column":8},"end":{"line":443,"column":46}},"65":{"start":{"line":444,"column":8},"end":{"line":444,"column":13718}},"66":{"start":{"line":445,"column":12},"end":{"line":445,"column":30}},"67":{"start":{"line":447,"column":12},"end":{"line":447,"column":79}},"68":{"start":{"line":449,"column":12},"end":{"line":449,"column":93}},"69":{"start":{"line":451,"column":12},"end":{"line":451,"column":13988}},"70":{"start":{"line":454,"column":16},"end":{"line":454,"column":75}},"71":{"start":{"line":455,"column":16},"end":{"line":455,"column":42}},"72":{"start":{"line":457,"column":16},"end":{"line":457,"column":59}},"73":{"start":{"line":459,"column":16},"end":{"line":459,"column":78}},"74":{"start":{"line":460,"column":16},"end":{"line":460,"column":39}},"75":{"start":{"line":465,"column":16},"end":{"line":465,"column":14601}},"76":{"start":{"line":466,"column":20},"end":{"line":466,"column":56}},"77":{"start":{"line":467,"column":20},"end":{"line":467,"column":14775}},"78":{"start":{"line":471,"column":20},"end":{"line":471,"column":45}},"79":{"start":{"line":472,"column":20},"end":{"line":472,"column":60}},"80":{"start":{"line":473,"column":20},"end":{"line":473,"column":49}},"81":{"start":{"line":476,"column":16},"end":{"line":476,"column":15101}},"82":{"start":{"line":479,"column":20},"end":{"line":479,"column":50}},"83":{"start":{"line":480,"column":20},"end":{"line":480,"column":65}},"84":{"start":{"line":482,"column":20},"end":{"line":482,"column":55}},"85":{"start":{"line":484,"column":20},"end":{"line":484,"column":15404}},"86":{"start":{"line":488,"column":20},"end":{"line":488,"column":59}},"87":{"start":{"line":489,"column":20},"end":{"line":489,"column":69}},"88":{"start":{"line":492,"column":20},"end":{"line":492,"column":37}},"89":{"start":{"line":494,"column":20},"end":{"line":494,"column":69}},"90":{"start":{"line":499,"column":16},"end":{"line":499,"column":16070}},"91":{"start":{"line":500,"column":20},"end":{"line":500,"column":68}},"92":{"start":{"line":501,"column":20},"end":{"line":501,"column":101}},"93":{"start":{"line":504,"column":16},"end":{"line":504,"column":89}},"94":{"start":{"line":516,"column":8},"end":{"line":516,"column":80}},"95":{"start":{"line":522,"column":8},"end":{"line":522,"column":16953}},"96":{"start":{"line":526,"column":8},"end":{"line":526,"column":17107}},"97":{"start":{"line":528,"column":12},"end":{"line":528,"column":49}},"98":{"start":{"line":531,"column":12},"end":{"line":531,"column":48}},"99":{"start":{"line":532,"column":12},"end":{"line":532,"column":65}},"100":{"start":{"line":535,"column":12},"end":{"line":535,"column":50}},"101":{"start":{"line":538,"column":12},"end":{"line":538,"column":84}},"102":{"start":{"line":540,"column":12},"end":{"line":540,"column":46}},"103":{"start":{"line":541,"column":12},"end":{"line":541,"column":17686}},"104":{"start":{"line":542,"column":16},"end":{"line":542,"column":79}},"105":{"start":{"line":543,"column":19},"end":{"line":543,"column":17854}},"106":{"start":{"line":544,"column":16},"end":{"line":544,"column":81}},"107":{"start":{"line":546,"column":12},"end":{"line":546,"column":92}},"108":{"start":{"line":548,"column":12},"end":{"line":548,"column":18130}},"109":{"start":{"line":555,"column":12},"end":{"line":555,"column":69}},"110":{"start":{"line":577,"column":8},"end":{"line":577,"column":18792}},"111":{"start":{"line":578,"column":12},"end":{"line":578,"column":95}},"112":{"start":{"line":581,"column":8},"end":{"line":581,"column":18969}},"113":{"start":{"line":582,"column":12},"end":{"line":582,"column":101}},"114":{"start":{"line":583,"column":12},"end":{"line":583,"column":18}},"115":{"start":{"line":585,"column":8},"end":{"line":585,"column":58}},"116":{"start":{"line":596,"column":8},"end":{"line":596,"column":20}},"117":{"start":{"line":597,"column":8},"end":{"line":597,"column":23}},"118":{"start":{"line":599,"column":8},"end":{"line":599,"column":89}},"119":{"start":{"line":600,"column":8},"end":{"line":600,"column":19596}},"120":{"start":{"line":602,"column":12},"end":{"line":602,"column":70}},"121":{"start":{"line":605,"column":12},"end":{"line":605,"column":70}},"122":{"start":{"line":614,"column":8},"end":{"line":614,"column":20126}},"123":{"start":{"line":615,"column":12},"end":{"line":615,"column":23}},"124":{"start":{"line":617,"column":8},"end":{"line":617,"column":20}},"125":{"start":{"line":625,"column":8},"end":{"line":625,"column":89}},"126":{"start":{"line":626,"column":8},"end":{"line":626,"column":20472}},"127":{"start":{"line":627,"column":12},"end":{"line":627,"column":23}},"128":{"start":{"line":629,"column":8},"end":{"line":629,"column":20}},"129":{"start":{"line":641,"column":8},"end":{"line":641,"column":76}},"130":{"start":{"line":644,"column":8},"end":{"line":644,"column":21146}},"131":{"start":{"line":646,"column":12},"end":{"line":646,"column":64}},"132":{"start":{"line":650,"column":12},"end":{"line":650,"column":65}},"133":{"start":{"line":651,"column":12},"end":{"line":651,"column":59}},"134":{"start":{"line":652,"column":12},"end":{"line":652,"column":41}},"135":{"start":{"line":654,"column":12},"end":{"line":654,"column":21586}},"136":{"start":{"line":655,"column":16},"end":{"line":655,"column":67}},"137":{"start":{"line":656,"column":16},"end":{"line":656,"column":47}},"138":{"start":{"line":659,"column":12},"end":{"line":659,"column":21772}},"139":{"start":{"line":668,"column":16},"end":{"line":668,"column":43}},"140":{"start":{"line":670,"column":16},"end":{"line":670,"column":60}},"141":{"start":{"line":671,"column":16},"end":{"line":671,"column":22407}},"142":{"start":{"line":676,"column":20},"end":{"line":676,"column":22697}},"143":{"start":{"line":683,"column":20},"end":{"line":683,"column":23076}},"144":{"start":{"line":685,"column":24},"end":{"line":685,"column":23131}},"145":{"start":{"line":686,"column":28},"end":{"line":686,"column":65}},"146":{"start":{"line":688,"column":24},"end":{"line":688,"column":106}},"147":{"start":{"line":690,"column":24},"end":{"line":690,"column":75}},"148":{"start":{"line":691,"column":24},"end":{"line":691,"column":93}},"149":{"start":{"line":694,"column":24},"end":{"line":694,"column":78}},"150":{"start":{"line":695,"column":24},"end":{"line":695,"column":88}},"151":{"start":{"line":698,"column":24},"end":{"line":698,"column":87}},"152":{"start":{"line":701,"column":24},"end":{"line":701,"column":24048}},"153":{"start":{"line":707,"column":16},"end":{"line":707,"column":24190}},"154":{"start":{"line":711,"column":20},"end":{"line":711,"column":37}},"155":{"start":{"line":713,"column":20},"end":{"line":713,"column":68}},"156":{"start":{"line":717,"column":16},"end":{"line":717,"column":46}},"157":{"start":{"line":719,"column":16},"end":{"line":719,"column":61}},"158":{"start":{"line":720,"column":16},"end":{"line":720,"column":64}},"159":{"start":{"line":721,"column":16},"end":{"line":721,"column":101}},"160":{"start":{"line":722,"column":16},"end":{"line":722,"column":22}},"161":{"start":{"line":727,"column":8},"end":{"line":727,"column":83}},"162":{"start":{"line":746,"column":8},"end":{"line":746,"column":91}},"163":{"start":{"line":749,"column":8},"end":{"line":749,"column":25593}},"164":{"start":{"line":752,"column":12},"end":{"line":752,"column":32}},"165":{"start":{"line":753,"column":12},"end":{"line":753,"column":18}},"166":{"start":{"line":757,"column":12},"end":{"line":757,"column":33}},"167":{"start":{"line":775,"column":8},"end":{"line":775,"column":79}},"168":{"start":{"line":777,"column":8},"end":{"line":777,"column":26258}},"169":{"start":{"line":778,"column":12},"end":{"line":778,"column":47}},"170":{"start":{"line":781,"column":12},"end":{"line":781,"column":57}},"171":{"start":{"line":783,"column":15},"end":{"line":783,"column":26486}},"172":{"start":{"line":784,"column":12},"end":{"line":784,"column":48}},"173":{"start":{"line":787,"column":12},"end":{"line":787,"column":57}},"174":{"start":{"line":790,"column":12},"end":{"line":790,"column":63}},"175":{"start":{"line":801,"column":8},"end":{"line":801,"column":27089}},"176":{"start":{"line":802,"column":12},"end":{"line":802,"column":48}},"177":{"start":{"line":807,"column":8},"end":{"line":807,"column":58}},"178":{"start":{"line":815,"column":8},"end":{"line":815,"column":27}},"179":{"start":{"line":830,"column":8},"end":{"line":830,"column":28}},"180":{"start":{"line":831,"column":8},"end":{"line":831,"column":54}},"181":{"start":{"line":833,"column":8},"end":{"line":833,"column":27945}},"182":{"start":{"line":834,"column":12},"end":{"line":834,"column":75}},"183":{"start":{"line":835,"column":12},"end":{"line":835,"column":28139}},"184":{"start":{"line":838,"column":15},"end":{"line":838,"column":28230}},"185":{"start":{"line":839,"column":12},"end":{"line":839,"column":20}},"186":{"start":{"line":841,"column":12},"end":{"line":841,"column":20}},"187":{"start":{"line":852,"column":8},"end":{"line":852,"column":28777}},"188":{"start":{"line":864,"column":8},"end":{"line":864,"column":29197}},"189":{"start":{"line":872,"column":12},"end":{"line":872,"column":29537}},"190":{"start":{"line":875,"column":16},"end":{"line":875,"column":34}},"191":{"start":{"line":877,"column":19},"end":{"line":877,"column":29673}},"192":{"start":{"line":880,"column":16},"end":{"line":880,"column":36}},"193":{"start":{"line":881,"column":16},"end":{"line":881,"column":44}},"194":{"start":{"line":883,"column":16},"end":{"line":883,"column":29847}},"195":{"start":{"line":888,"column":16},"end":{"line":888,"column":43}},"196":{"start":{"line":893,"column":16},"end":{"line":893,"column":24}},"197":{"start":{"line":896,"column":12},"end":{"line":896,"column":20}},"198":{"start":{"line":908,"column":8},"end":{"line":908,"column":97}},"199":{"start":{"line":910,"column":8},"end":{"line":910,"column":51}},"200":{"start":{"line":911,"column":8},"end":{"line":911,"column":88}},"201":{"start":{"line":914,"column":8},"end":{"line":914,"column":39}},"202":{"start":{"line":917,"column":8},"end":{"line":917,"column":30657}},"203":{"start":{"line":924,"column":8},"end":{"line":924,"column":98}},"204":{"start":{"line":925,"column":8},"end":{"line":925,"column":65}},"205":{"start":{"line":929,"column":8},"end":{"line":929,"column":57}},"206":{"start":{"line":930,"column":8},"end":{"line":930,"column":31183}},"207":{"start":{"line":933,"column":8},"end":{"line":933,"column":48}},"208":{"start":{"line":954,"column":8},"end":{"line":954,"column":31788}},"209":{"start":{"line":957,"column":8},"end":{"line":957,"column":31877}},"210":{"start":{"line":974,"column":8},"end":{"line":974,"column":97}},"211":{"start":{"line":979,"column":8},"end":{"line":979,"column":131}},"212":{"start":{"line":984,"column":8},"end":{"line":984,"column":87}},"213":{"start":{"line":989,"column":8},"end":{"line":989,"column":95}},"214":{"start":{"line":994,"column":8},"end":{"line":994,"column":69}},"215":{"start":{"line":999,"column":8},"end":{"line":999,"column":74}},"216":{"start":{"line":1004,"column":8},"end":{"line":1004,"column":74}},"217":{"start":{"line":1009,"column":8},"end":{"line":1009,"column":79}},"218":{"start":{"line":1014,"column":8},"end":{"line":1014,"column":72}},"219":{"start":{"line":1019,"column":8},"end":{"line":1019,"column":77}}},"branchMap":{"1":{"line":115,"type":"if","locations":[{"start":{"line":115,"column":8},"end":{"line":115,"column":8}},{"start":{"line":115,"column":8},"end":{"line":115,"column":8}}]},"2":{"line":208,"type":"if","locations":[{"start":{"line":208,"column":8},"end":{"line":208,"column":8}},{"start":{"line":208,"column":8},"end":{"line":208,"column":8}}]},"3":{"line":216,"type":"if","locations":[{"start":{"line":216,"column":8},"end":{"line":216,"column":8}},{"start":{"line":216,"column":8},"end":{"line":216,"column":8}}]},"4":{"line":223,"type":"if","locations":[{"start":{"line":223,"column":8},"end":{"line":223,"column":8}},{"start":{"line":223,"column":8},"end":{"line":223,"column":8}}]},"5":{"line":236,"type":"if","locations":[{"start":{"line":236,"column":8},"end":{"line":236,"column":8}},{"start":{"line":236,"column":8},"end":{"line":236,"column":8}}]},"6":{"line":385,"type":"if","locations":[{"start":{"line":385,"column":8},"end":{"line":385,"column":8}},{"start":{"line":385,"column":8},"end":{"line":385,"column":8}}]},"7":{"line":397,"type":"if","locations":[{"start":{"line":397,"column":8},"end":{"line":397,"column":8}},{"start":{"line":397,"column":8},"end":{"line":397,"column":8}}]},"8":{"line":451,"type":"if","locations":[{"start":{"line":451,"column":12},"end":{"line":451,"column":12}},{"start":{"line":451,"column":12},"end":{"line":451,"column":12}}]},"9":{"line":465,"type":"if","locations":[{"start":{"line":465,"column":16},"end":{"line":465,"column":16}},{"start":{"line":465,"column":16},"end":{"line":465,"column":16}}]},"10":{"line":476,"type":"if","locations":[{"start":{"line":476,"column":16},"end":{"line":476,"column":16}},{"start":{"line":476,"column":16},"end":{"line":476,"column":16}}]},"11":{"line":499,"type":"if","locations":[{"start":{"line":499,"column":16},"end":{"line":499,"column":16}},{"start":{"line":499,"column":16},"end":{"line":499,"column":16}}]},"12":{"line":526,"type":"if","locations":[{"start":{"line":526,"column":8},"end":{"line":526,"column":8}},{"start":{"line":526,"column":8},"end":{"line":526,"column":8}}]},"13":{"line":541,"type":"if","locations":[{"start":{"line":541,"column":12},"end":{"line":541,"column":12}},{"start":{"line":541,"column":12},"end":{"line":541,"column":12}}]},"14":{"line":543,"type":"if","locations":[{"start":{"line":543,"column":19},"end":{"line":543,"column":19}},{"start":{"line":543,"column":19},"end":{"line":543,"column":19}}]},"15":{"line":577,"type":"if","locations":[{"start":{"line":577,"column":8},"end":{"line":577,"column":8}},{"start":{"line":577,"column":8},"end":{"line":577,"column":8}}]},"16":{"line":581,"type":"if","locations":[{"start":{"line":581,"column":8},"end":{"line":581,"column":8}},{"start":{"line":581,"column":8},"end":{"line":581,"column":8}}]},"17":{"line":600,"type":"if","locations":[{"start":{"line":600,"column":8},"end":{"line":600,"column":8}},{"start":{"line":600,"column":8},"end":{"line":600,"column":8}}]},"18":{"line":614,"type":"if","locations":[{"start":{"line":614,"column":8},"end":{"line":614,"column":8}},{"start":{"line":614,"column":8},"end":{"line":614,"column":8}}]},"19":{"line":626,"type":"if","locations":[{"start":{"line":626,"column":8},"end":{"line":626,"column":8}},{"start":{"line":626,"column":8},"end":{"line":626,"column":8}}]},"20":{"line":644,"type":"if","locations":[{"start":{"line":644,"column":8},"end":{"line":644,"column":8}},{"start":{"line":644,"column":8},"end":{"line":644,"column":8}}]},"21":{"line":654,"type":"if","locations":[{"start":{"line":654,"column":12},"end":{"line":654,"column":12}},{"start":{"line":654,"column":12},"end":{"line":654,"column":12}}]},"22":{"line":659,"type":"if","locations":[{"start":{"line":659,"column":12},"end":{"line":659,"column":12}},{"start":{"line":659,"column":12},"end":{"line":659,"column":12}}]},"23":{"line":683,"type":"if","locations":[{"start":{"line":683,"column":20},"end":{"line":683,"column":20}},{"start":{"line":683,"column":20},"end":{"line":683,"column":20}}]},"24":{"line":685,"type":"if","locations":[{"start":{"line":685,"column":24},"end":{"line":685,"column":24}},{"start":{"line":685,"column":24},"end":{"line":685,"column":24}}]},"25":{"line":701,"type":"if","locations":[{"start":{"line":701,"column":24},"end":{"line":701,"column":24}},{"start":{"line":701,"column":24},"end":{"line":701,"column":24}}]},"26":{"line":707,"type":"if","locations":[{"start":{"line":707,"column":16},"end":{"line":707,"column":16}},{"start":{"line":707,"column":16},"end":{"line":707,"column":16}}]},"27":{"line":746,"type":"if","locations":[{"start":{"line":746,"column":8},"end":{"line":746,"column":8}},{"start":{"line":746,"column":8},"end":{"line":746,"column":8}}]},"28":{"line":749,"type":"if","locations":[{"start":{"line":749,"column":8},"end":{"line":749,"column":8}},{"start":{"line":749,"column":8},"end":{"line":749,"column":8}}]},"29":{"line":777,"type":"if","locations":[{"start":{"line":777,"column":8},"end":{"line":777,"column":8}},{"start":{"line":777,"column":8},"end":{"line":777,"column":8}}]},"30":{"line":783,"type":"if","locations":[{"start":{"line":783,"column":15},"end":{"line":783,"column":15}},{"start":{"line":783,"column":15},"end":{"line":783,"column":15}}]},"31":{"line":833,"type":"if","locations":[{"start":{"line":833,"column":8},"end":{"line":833,"column":8}},{"start":{"line":833,"column":8},"end":{"line":833,"column":8}}]},"32":{"line":838,"type":"if","locations":[{"start":{"line":838,"column":15},"end":{"line":838,"column":15}},{"start":{"line":838,"column":15},"end":{"line":838,"column":15}}]},"33":{"line":864,"type":"if","locations":[{"start":{"line":864,"column":8},"end":{"line":864,"column":8}},{"start":{"line":864,"column":8},"end":{"line":864,"column":8}}]},"34":{"line":872,"type":"if","locations":[{"start":{"line":872,"column":12},"end":{"line":872,"column":12}},{"start":{"line":872,"column":12},"end":{"line":872,"column":12}}]},"35":{"line":877,"type":"if","locations":[{"start":{"line":877,"column":19},"end":{"line":877,"column":19}},{"start":{"line":877,"column":19},"end":{"line":877,"column":19}}]},"36":{"line":908,"type":"if","locations":[{"start":{"line":908,"column":8},"end":{"line":908,"column":8}},{"start":{"line":908,"column":8},"end":{"line":908,"column":8}}]},"37":{"line":911,"type":"if","locations":[{"start":{"line":911,"column":8},"end":{"line":911,"column":8}},{"start":{"line":911,"column":8},"end":{"line":911,"column":8}}]},"38":{"line":974,"type":"if","locations":[{"start":{"line":974,"column":8},"end":{"line":974,"column":8}},{"start":{"line":974,"column":8},"end":{"line":974,"column":8}}]},"39":{"line":979,"type":"if","locations":[{"start":{"line":979,"column":8},"end":{"line":979,"column":8}},{"start":{"line":979,"column":8},"end":{"line":979,"column":8}}]},"40":{"line":984,"type":"if","locations":[{"start":{"line":984,"column":8},"end":{"line":984,"column":8}},{"start":{"line":984,"column":8},"end":{"line":984,"column":8}}]},"41":{"line":989,"type":"if","locations":[{"start":{"line":989,"column":8},"end":{"line":989,"column":8}},{"start":{"line":989,"column":8},"end":{"line":989,"column":8}}]},"42":{"line":994,"type":"if","locations":[{"start":{"line":994,"column":8},"end":{"line":994,"column":8}},{"start":{"line":994,"column":8},"end":{"line":994,"column":8}}]},"43":{"line":999,"type":"if","locations":[{"start":{"line":999,"column":8},"end":{"line":999,"column":8}},{"start":{"line":999,"column":8},"end":{"line":999,"column":8}}]},"44":{"line":1004,"type":"if","locations":[{"start":{"line":1004,"column":8},"end":{"line":1004,"column":8}},{"start":{"line":1004,"column":8},"end":{"line":1004,"column":8}}]},"45":{"line":1009,"type":"if","locations":[{"start":{"line":1009,"column":8},"end":{"line":1009,"column":8}},{"start":{"line":1009,"column":8},"end":{"line":1009,"column":8}}]},"46":{"line":1014,"type":"if","locations":[{"start":{"line":1014,"column":8},"end":{"line":1014,"column":8}},{"start":{"line":1014,"column":8},"end":{"line":1014,"column":8}}]},"47":{"line":1019,"type":"if","locations":[{"start":{"line":1019,"column":8},"end":{"line":1019,"column":8}},{"start":{"line":1019,"column":8},"end":{"line":1019,"column":8}}]}}},"contracts/RicoToken.sol":{"l":{"23":31,"24":31,"25":31,"35":60,"36":60,"37":60,"41":2,"45":12,"49":11,"53":102,"67":2,"68":1,"86":112,"88":23,"91":89,"94":108,"98":78,"99":74,"103":113,"104":112,"107":62,"108":60,"112":118,"113":115},"path":"/Volumes/Dev/RICO/poc/contracts/RicoToken.sol","s":{"1":31,"2":31,"3":31,"4":60,"5":60,"6":60,"7":2,"8":12,"9":11,"10":102,"11":2,"12":1,"13":112,"14":23,"15":89,"16":108,"17":78,"18":113,"19":62,"20":118},"b":{"1":[1,1],"2":[23,89],"3":[22,1],"4":[86,3],"5":[74,4],"6":[112,1],"7":[60,2],"8":[115,3]},"f":{"1":31,"2":60,"3":2,"4":12,"5":11,"6":102,"7":2,"8":112,"9":78,"10":113,"11":62,"12":118},"fnMap":{"1":{"name":"constructor","line":16,"loc":{"start":{"line":16,"column":4},"end":{"line":22,"column":5}}},"2":{"name":"setup","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":34,"column":5}}},"3":{"name":"changeManager","line":40,"loc":{"start":{"line":40,"column":4},"end":{"line":40,"column":64}}},"4":{"name":"setFrozen","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":44,"column":53}}},"5":{"name":"getLockedBalance","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":48,"column":63}}},"6":{"name":"getUnlockedBalance","line":52,"loc":{"start":{"line":52,"column":4},"end":{"line":52,"column":65}}},"7":{"name":"_burn","line":57,"loc":{"start":{"line":57,"column":4},"end":{"line":66,"column":5}}},"8":{"name":"_move","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":84,"column":5}}},"9":{"name":"onlyManager","line":97,"loc":{"start":{"line":97,"column":4},"end":{"line":97,"column":24}}},"10":{"name":"requireInitialized","line":102,"loc":{"start":{"line":102,"column":4},"end":{"line":102,"column":31}}},"11":{"name":"requireNotInitialized","line":106,"loc":{"start":{"line":106,"column":4},"end":{"line":106,"column":34}}},"12":{"name":"requireNotFrozen","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":111,"column":29}}}},"statementMap":{"1":{"start":{"line":23,"column":8},"end":{"line":23,"column":59}},"2":{"start":{"line":24,"column":8},"end":{"line":24,"column":27}},"3":{"start":{"line":25,"column":8},"end":{"line":25,"column":20}},"4":{"start":{"line":35,"column":8},"end":{"line":35,"column":34}},"5":{"start":{"line":36,"column":8},"end":{"line":36,"column":21}},"6":{"start":{"line":37,"column":8},"end":{"line":37,"column":25}},"7":{"start":{"line":41,"column":8},"end":{"line":41,"column":28}},"8":{"start":{"line":45,"column":8},"end":{"line":45,"column":23}},"9":{"start":{"line":49,"column":8},"end":{"line":49,"column":47}},"10":{"start":{"line":53,"column":8},"end":{"line":53,"column":69}},"11":{"start":{"line":67,"column":8},"end":{"line":67,"column":92}},"12":{"start":{"line":68,"column":8},"end":{"line":68,"column":63}},"13":{"start":{"line":86,"column":8},"end":{"line":86,"column":2315}},"14":{"start":{"line":88,"column":12},"end":{"line":88,"column":87}},"15":{"start":{"line":91,"column":12},"end":{"line":91,"column":96}},"16":{"start":{"line":94,"column":8},"end":{"line":94,"column":71}},"17":{"start":{"line":98,"column":8},"end":{"line":98,"column":87}},"18":{"start":{"line":103,"column":8},"end":{"line":103,"column":87}},"19":{"start":{"line":107,"column":8},"end":{"line":107,"column":95}},"20":{"start":{"line":112,"column":8},"end":{"line":112,"column":80}}},"branchMap":{"1":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":8},"end":{"line":67,"column":8}},{"start":{"line":67,"column":8},"end":{"line":67,"column":8}}]},"2":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":8},"end":{"line":86,"column":8}},{"start":{"line":86,"column":8},"end":{"line":86,"column":8}}]},"3":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":12},"end":{"line":88,"column":12}},{"start":{"line":88,"column":12},"end":{"line":88,"column":12}}]},"4":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":12},"end":{"line":91,"column":12}},{"start":{"line":91,"column":12},"end":{"line":91,"column":12}}]},"5":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":8},"end":{"line":98,"column":8}},{"start":{"line":98,"column":8},"end":{"line":98,"column":8}}]},"6":{"line":103,"type":"if","locations":[{"start":{"line":103,"column":8},"end":{"line":103,"column":8}},{"start":{"line":103,"column":8},"end":{"line":103,"column":8}}]},"7":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":8},"end":{"line":107,"column":8}},{"start":{"line":107,"column":8},"end":{"line":107,"column":8}}]},"8":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":8},"end":{"line":112,"column":8}},{"start":{"line":112,"column":8},"end":{"line":112,"column":8}}]}}}} \ No newline at end of file +{"contracts/Gnosis/CreateCall.sol":{"l":{"11":0,"14":0,"15":0,"20":0,"23":0,"24":0},"path":"/Volumes/Dev/RICO/upgrade/contracts/Gnosis/CreateCall.sol","s":{"1":0,"2":0,"3":0,"4":0},"b":{"1":[0,0],"2":[0,0]},"f":{"1":0,"2":0},"fnMap":{"1":{"name":"performCreate2","line":9,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":119}}},"2":{"name":"performCreate","line":18,"loc":{"start":{"line":18,"column":4},"end":{"line":18,"column":104}}}},"statementMap":{"1":{"start":{"line":14,"column":8},"end":{"line":14,"column":70}},"2":{"start":{"line":15,"column":8},"end":{"line":15,"column":42}},"3":{"start":{"line":23,"column":9},"end":{"line":23,"column":71}},"4":{"start":{"line":24,"column":8},"end":{"line":24,"column":42}}},"branchMap":{"1":{"line":14,"type":"if","locations":[{"start":{"line":14,"column":8},"end":{"line":14,"column":8}},{"start":{"line":14,"column":8},"end":{"line":14,"column":8}}]},"2":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":9},"end":{"line":23,"column":9}},{"start":{"line":23,"column":9},"end":{"line":23,"column":9}}]}}},"contracts/Gnosis/GnosisSafe.sol":{"l":{"11":0,"12":0,"14":0,"16":0,"24":0,"34":0,"61":0,"63":0,"77":0,"78":0,"88":0,"90":0,"103":0,"111":0,"112":0,"113":0,"115":0,"119":0,"121":0,"144":0,"145":0,"146":0,"148":0,"159":0,"161":0,"162":0,"163":0,"164":0,"176":0,"177":0,"178":0,"179":0,"180":0,"193":0,"195":0,"206":0,"207":0,"208":0,"209":0,"210":0,"212":0,"215":0,"216":0,"217":0,"218":0,"219":0,"220":0,"222":0,"246":0,"248":0,"250":0,"252":0,"253":0,"255":0,"256":0,"258":0,"259":0,"260":0,"262":0,"263":0,"264":0,"276":0,"278":0,"279":0,"280":0,"281":0,"282":0,"284":0,"285":0,"298":0,"300":0,"301":0,"302":0,"303":0,"304":0,"305":0,"307":0,"308":0,"321":0,"323":0,"325":0,"326":0,"327":0,"328":0,"329":0,"330":0,"331":0,"342":0,"344":0,"345":0,"346":0,"354":0,"362":0,"372":0,"375":0,"376":0,"377":0,"378":0,"379":0,"380":0,"382":0,"401":0,"402":0,"403":0,"412":0,"413":0,"421":0,"422":0,"441":0,"442":0,"443":0,"444":0,"445":0,"461":0,"484":0,"485":0,"488":0,"489":0,"491":0,"498":0,"499":0,"502":0,"509":0,"510":0,"512":0,"519":0,"520":0,"522":0,"530":0,"531":0,"593":0,"594":0,"595":0,"597":0,"598":0,"600":0,"603":0,"634":0,"640":0,"641":0,"642":0,"643":0,"645":0,"646":0,"647":0,"648":0,"652":0,"653":0,"667":0,"668":0,"671":0,"673":0,"687":0,"689":0,"690":0,"691":0,"692":0,"693":0,"694":0,"695":0,"696":0,"698":0,"700":0,"704":0,"707":0,"710":0,"712":0,"715":0,"718":0,"720":0,"724":0,"728":0,"731":0,"733":0,"734":0,"738":0,"743":0,"745":0,"749":0,"769":0,"772":0,"773":0,"775":0,"785":0,"786":0,"797":0,"813":0,"814":0,"815":0,"818":0,"820":0,"833":0,"836":0,"869":0,"872":0,"903":0},"path":"/Volumes/Dev/RICO/upgrade/contracts/Gnosis/GnosisSafe.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":0,"181":0,"182":0,"183":0,"184":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,0],"42":[0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0,0],"48":[0,0],"49":[0,0],"50":[0,0],"51":[0,0],"52":[0,0],"53":[0,0],"54":[0,0],"55":[0,0],"56":[0,0],"57":[0,0],"58":[0,0],"59":[0,0],"60":[0,0],"61":[0,0],"62":[0,0],"63":[0,0],"64":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0},"fnMap":{"1":{"name":"execute","line":7,"loc":{"start":{"line":7,"column":4},"end":{"line":10,"column":5}}},"2":{"name":"executeCall","line":19,"loc":{"start":{"line":19,"column":4},"end":{"line":22,"column":5}}},"3":{"name":"executeDelegateCall","line":29,"loc":{"start":{"line":29,"column":4},"end":{"line":32,"column":5}}},"4":{"name":"transferToken","line":53,"loc":{"start":{"line":53,"column":4},"end":{"line":60,"column":5}}},"5":{"name":"authorized","line":76,"loc":{"start":{"line":76,"column":4},"end":{"line":76,"column":23}}},"6":{"name":"internalSetFallbackHandler","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":87,"column":63}}},"7":{"name":"setFallbackHandler","line":99,"loc":{"start":{"line":99,"column":4},"end":{"line":102,"column":5}}},"8":{"name":"","line":106,"loc":{"start":{"line":106,"column":4},"end":{"line":109,"column":5}}},"9":{"name":"setupModules","line":141,"loc":{"start":{"line":141,"column":4},"end":{"line":143,"column":5}}},"10":{"name":"enableModule","line":154,"loc":{"start":{"line":154,"column":4},"end":{"line":157,"column":5}}},"11":{"name":"disableModule","line":171,"loc":{"start":{"line":171,"column":4},"end":{"line":174,"column":5}}},"12":{"name":"execTransactionFromModule","line":188,"loc":{"start":{"line":188,"column":4},"end":{"line":191,"column":5}}},"13":{"name":"getModules","line":200,"loc":{"start":{"line":200,"column":4},"end":{"line":204,"column":5}}},"14":{"name":"setupOwners","line":241,"loc":{"start":{"line":241,"column":4},"end":{"line":243,"column":5}}},"15":{"name":"addOwnerWithThreshold","line":271,"loc":{"start":{"line":271,"column":4},"end":{"line":274,"column":5}}},"16":{"name":"removeOwner","line":293,"loc":{"start":{"line":293,"column":4},"end":{"line":296,"column":5}}},"17":{"name":"swapOwner","line":316,"loc":{"start":{"line":316,"column":4},"end":{"line":319,"column":5}}},"18":{"name":"changeThreshold","line":337,"loc":{"start":{"line":337,"column":4},"end":{"line":340,"column":5}}},"19":{"name":"getThreshold","line":349,"loc":{"start":{"line":349,"column":4},"end":{"line":353,"column":5}}},"20":{"name":"isOwner","line":357,"loc":{"start":{"line":357,"column":4},"end":{"line":361,"column":5}}},"21":{"name":"getOwners","line":367,"loc":{"start":{"line":367,"column":4},"end":{"line":371,"column":5}}},"22":{"name":"changeMasterCopy","line":396,"loc":{"start":{"line":396,"column":4},"end":{"line":399,"column":5}}},"23":{"name":"authorized","line":411,"loc":{"start":{"line":411,"column":4},"end":{"line":411,"column":23}}},"24":{"name":"setManager","line":416,"loc":{"start":{"line":416,"column":4},"end":{"line":418,"column":5}}},"25":{"name":"recoverKey","line":432,"loc":{"start":{"line":432,"column":4},"end":{"line":440,"column":5}}},"26":{"name":"signatureSplit","line":452,"loc":{"start":{"line":452,"column":4},"end":{"line":456,"column":5}}},"27":{"name":"mul","line":480,"loc":{"start":{"line":480,"column":2},"end":{"line":480,"column":68}}},"28":{"name":"div","line":497,"loc":{"start":{"line":497,"column":2},"end":{"line":497,"column":68}}},"29":{"name":"sub","line":508,"loc":{"start":{"line":508,"column":2},"end":{"line":508,"column":68}}},"30":{"name":"add","line":518,"loc":{"start":{"line":518,"column":2},"end":{"line":518,"column":68}}},"31":{"name":"mod","line":529,"loc":{"start":{"line":529,"column":2},"end":{"line":529,"column":68}}},"32":{"name":"setup","line":581,"loc":{"start":{"line":581,"column":4},"end":{"line":592,"column":5}}},"33":{"name":"execTransaction","line":619,"loc":{"start":{"line":619,"column":4},"end":{"line":633,"column":5}}},"34":{"name":"handlePayment","line":657,"loc":{"start":{"line":657,"column":4},"end":{"line":665,"column":5}}},"35":{"name":"checkSignatures","line":683,"loc":{"start":{"line":683,"column":4},"end":{"line":685,"column":5}}},"36":{"name":"requiredTxGas","line":764,"loc":{"start":{"line":764,"column":4},"end":{"line":768,"column":5}}},"37":{"name":"approveHash","line":782,"loc":{"start":{"line":782,"column":4},"end":{"line":784,"column":5}}},"38":{"name":"signMessage","line":793,"loc":{"start":{"line":793,"column":4},"end":{"line":796,"column":5}}},"39":{"name":"isValidSignature","line":809,"loc":{"start":{"line":809,"column":4},"end":{"line":812,"column":5}}},"40":{"name":"getMessageHash","line":826,"loc":{"start":{"line":826,"column":4},"end":{"line":832,"column":5}}},"41":{"name":"encodeTransactionData","line":853,"loc":{"start":{"line":853,"column":4},"end":{"line":868,"column":5}}},"42":{"name":"getTransactionHash","line":887,"loc":{"start":{"line":887,"column":4},"end":{"line":902,"column":5}}}},"statementMap":{"1":{"start":{"line":11,"column":8},"end":{"line":11,"column":295}},"2":{"start":{"line":12,"column":12},"end":{"line":12,"column":56}},"3":{"start":{"line":13,"column":13},"end":{"line":13,"column":405}},"4":{"start":{"line":14,"column":12},"end":{"line":14,"column":57}},"5":{"start":{"line":16,"column":12},"end":{"line":16,"column":26}},"6":{"start":{"line":61,"column":8},"end":{"line":61,"column":98}},"7":{"start":{"line":77,"column":8},"end":{"line":77,"column":91}},"8":{"start":{"line":88,"column":8},"end":{"line":88,"column":52}},"9":{"start":{"line":103,"column":8},"end":{"line":103,"column":42}},"10":{"start":{"line":111,"column":8},"end":{"line":111,"column":57}},"11":{"start":{"line":111,"column":51},"end":{"line":111,"column":57}},"12":{"start":{"line":112,"column":8},"end":{"line":112,"column":52}},"13":{"start":{"line":113,"column":8},"end":{"line":113,"column":23}},"14":{"start":{"line":119,"column":8},"end":{"line":119,"column":3768}},"15":{"start":{"line":144,"column":8},"end":{"line":144,"column":96}},"16":{"start":{"line":145,"column":8},"end":{"line":145,"column":51}},"17":{"start":{"line":146,"column":8},"end":{"line":146,"column":4794}},"18":{"start":{"line":148,"column":12},"end":{"line":148,"column":95}},"19":{"start":{"line":159,"column":8},"end":{"line":159,"column":119}},"20":{"start":{"line":161,"column":8},"end":{"line":161,"column":87}},"21":{"start":{"line":162,"column":8},"end":{"line":162,"column":59}},"22":{"start":{"line":163,"column":8},"end":{"line":163,"column":50}},"23":{"start":{"line":164,"column":8},"end":{"line":164,"column":34}},"24":{"start":{"line":176,"column":8},"end":{"line":176,"column":119}},"25":{"start":{"line":177,"column":8},"end":{"line":177,"column":107}},"26":{"start":{"line":178,"column":8},"end":{"line":178,"column":62}},"27":{"start":{"line":179,"column":8},"end":{"line":179,"column":44}},"28":{"start":{"line":180,"column":8},"end":{"line":180,"column":35}},"29":{"start":{"line":193,"column":8},"end":{"line":193,"column":135}},"30":{"start":{"line":195,"column":8},"end":{"line":195,"column":63}},"31":{"start":{"line":206,"column":8},"end":{"line":206,"column":31}},"32":{"start":{"line":207,"column":8},"end":{"line":207,"column":57}},"33":{"start":{"line":208,"column":8},"end":{"line":208,"column":7555}},"34":{"start":{"line":209,"column":12},"end":{"line":209,"column":49}},"35":{"start":{"line":212,"column":8},"end":{"line":212,"column":59}},"36":{"start":{"line":215,"column":8},"end":{"line":215,"column":22}},"37":{"start":{"line":216,"column":8},"end":{"line":216,"column":48}},"38":{"start":{"line":217,"column":8},"end":{"line":217,"column":7867}},"39":{"start":{"line":218,"column":12},"end":{"line":218,"column":45}},"40":{"start":{"line":219,"column":12},"end":{"line":219,"column":49}},"41":{"start":{"line":222,"column":8},"end":{"line":222,"column":20}},"42":{"start":{"line":246,"column":8},"end":{"line":246,"column":64}},"43":{"start":{"line":248,"column":8},"end":{"line":248,"column":83}},"44":{"start":{"line":250,"column":8},"end":{"line":250,"column":71}},"45":{"start":{"line":252,"column":8},"end":{"line":252,"column":46}},"46":{"start":{"line":253,"column":8},"end":{"line":253,"column":9267}},"47":{"start":{"line":255,"column":12},"end":{"line":255,"column":38}},"48":{"start":{"line":256,"column":12},"end":{"line":256,"column":101}},"49":{"start":{"line":258,"column":12},"end":{"line":258,"column":83}},"50":{"start":{"line":259,"column":12},"end":{"line":259,"column":39}},"51":{"start":{"line":260,"column":12},"end":{"line":260,"column":31}},"52":{"start":{"line":262,"column":8},"end":{"line":262,"column":45}},"53":{"start":{"line":263,"column":8},"end":{"line":263,"column":34}},"54":{"start":{"line":264,"column":8},"end":{"line":264,"column":29}},"55":{"start":{"line":276,"column":8},"end":{"line":276,"column":97}},"56":{"start":{"line":278,"column":8},"end":{"line":278,"column":74}},"57":{"start":{"line":279,"column":8},"end":{"line":279,"column":46}},"58":{"start":{"line":280,"column":8},"end":{"line":280,"column":38}},"59":{"start":{"line":282,"column":8},"end":{"line":282,"column":30}},"60":{"start":{"line":284,"column":8},"end":{"line":284,"column":10682}},"61":{"start":{"line":285,"column":12},"end":{"line":285,"column":38}},"62":{"start":{"line":298,"column":8},"end":{"line":298,"column":101}},"63":{"start":{"line":300,"column":8},"end":{"line":300,"column":97}},"64":{"start":{"line":301,"column":8},"end":{"line":301,"column":84}},"65":{"start":{"line":302,"column":8},"end":{"line":302,"column":40}},"66":{"start":{"line":303,"column":8},"end":{"line":303,"column":33}},"67":{"start":{"line":305,"column":8},"end":{"line":305,"column":32}},"68":{"start":{"line":307,"column":8},"end":{"line":307,"column":11859}},"69":{"start":{"line":308,"column":12},"end":{"line":308,"column":38}},"70":{"start":{"line":321,"column":8},"end":{"line":321,"column":103}},"71":{"start":{"line":323,"column":8},"end":{"line":323,"column":77}},"72":{"start":{"line":325,"column":8},"end":{"line":325,"column":103}},"73":{"start":{"line":326,"column":8},"end":{"line":326,"column":87}},"74":{"start":{"line":327,"column":8},"end":{"line":327,"column":42}},"75":{"start":{"line":328,"column":8},"end":{"line":328,"column":35}},"76":{"start":{"line":329,"column":8},"end":{"line":329,"column":36}},"77":{"start":{"line":330,"column":8},"end":{"line":330,"column":35}},"78":{"start":{"line":331,"column":8},"end":{"line":331,"column":33}},"79":{"start":{"line":342,"column":8},"end":{"line":342,"column":79}},"80":{"start":{"line":344,"column":8},"end":{"line":344,"column":71}},"81":{"start":{"line":345,"column":8},"end":{"line":345,"column":29}},"82":{"start":{"line":346,"column":8},"end":{"line":346,"column":40}},"83":{"start":{"line":354,"column":8},"end":{"line":354,"column":24}},"84":{"start":{"line":362,"column":8},"end":{"line":362,"column":70}},"85":{"start":{"line":372,"column":8},"end":{"line":372,"column":58}},"86":{"start":{"line":375,"column":8},"end":{"line":375,"column":25}},"87":{"start":{"line":376,"column":8},"end":{"line":376,"column":54}},"88":{"start":{"line":377,"column":8},"end":{"line":377,"column":14376}},"89":{"start":{"line":378,"column":12},"end":{"line":378,"column":38}},"90":{"start":{"line":379,"column":12},"end":{"line":379,"column":46}},"91":{"start":{"line":382,"column":8},"end":{"line":382,"column":20}},"92":{"start":{"line":401,"column":8},"end":{"line":401,"column":81}},"93":{"start":{"line":402,"column":8},"end":{"line":402,"column":31}},"94":{"start":{"line":403,"column":8},"end":{"line":403,"column":43}},"95":{"start":{"line":412,"column":8},"end":{"line":412,"column":88}},"96":{"start":{"line":421,"column":8},"end":{"line":421,"column":78}},"97":{"start":{"line":422,"column":8},"end":{"line":422,"column":42}},"98":{"start":{"line":441,"column":8},"end":{"line":441,"column":15}},"99":{"start":{"line":442,"column":8},"end":{"line":442,"column":17}},"100":{"start":{"line":443,"column":8},"end":{"line":443,"column":17}},"101":{"start":{"line":444,"column":8},"end":{"line":444,"column":56}},"102":{"start":{"line":445,"column":8},"end":{"line":445,"column":46}},"103":{"start":{"line":484,"column":4},"end":{"line":484,"column":18148}},"104":{"start":{"line":485,"column":6},"end":{"line":485,"column":14}},"105":{"start":{"line":488,"column":4},"end":{"line":488,"column":21}},"106":{"start":{"line":489,"column":4},"end":{"line":489,"column":22}},"107":{"start":{"line":491,"column":4},"end":{"line":491,"column":12}},"108":{"start":{"line":498,"column":4},"end":{"line":498,"column":17}},"109":{"start":{"line":499,"column":4},"end":{"line":499,"column":21}},"110":{"start":{"line":502,"column":4},"end":{"line":502,"column":12}},"111":{"start":{"line":509,"column":4},"end":{"line":509,"column":18}},"112":{"start":{"line":510,"column":4},"end":{"line":510,"column":21}},"113":{"start":{"line":512,"column":4},"end":{"line":512,"column":12}},"114":{"start":{"line":519,"column":4},"end":{"line":519,"column":21}},"115":{"start":{"line":520,"column":4},"end":{"line":520,"column":18}},"116":{"start":{"line":522,"column":4},"end":{"line":522,"column":12}},"117":{"start":{"line":530,"column":4},"end":{"line":530,"column":18}},"118":{"start":{"line":531,"column":4},"end":{"line":531,"column":16}},"119":{"start":{"line":593,"column":8},"end":{"line":593,"column":69}},"120":{"start":{"line":594,"column":8},"end":{"line":594,"column":79}},"121":{"start":{"line":595,"column":8},"end":{"line":595,"column":39}},"122":{"start":{"line":597,"column":8},"end":{"line":597,"column":29}},"123":{"start":{"line":598,"column":8},"end":{"line":598,"column":86}},"124":{"start":{"line":598,"column":43},"end":{"line":598,"column":85}},"125":{"start":{"line":600,"column":8},"end":{"line":600,"column":22262}},"126":{"start":{"line":603,"column":12},"end":{"line":603,"column":70}},"127":{"start":{"line":634,"column":8},"end":{"line":634,"column":24057}},"128":{"start":{"line":641,"column":8},"end":{"line":641,"column":75}},"129":{"start":{"line":642,"column":8},"end":{"line":642,"column":84}},"130":{"start":{"line":643,"column":8},"end":{"line":643,"column":35}},"131":{"start":{"line":645,"column":8},"end":{"line":645,"column":109}},"132":{"start":{"line":646,"column":8},"end":{"line":646,"column":39}},"133":{"start":{"line":647,"column":8},"end":{"line":647,"column":24817}},"134":{"start":{"line":648,"column":12},"end":{"line":648,"column":55}},"135":{"start":{"line":652,"column":8},"end":{"line":652,"column":25040}},"136":{"start":{"line":653,"column":12},"end":{"line":653,"column":78}},"137":{"start":{"line":667,"column":8},"end":{"line":667,"column":92}},"138":{"start":{"line":668,"column":8},"end":{"line":668,"column":25515}},"139":{"start":{"line":671,"column":12},"end":{"line":671,"column":146}},"140":{"start":{"line":673,"column":12},"end":{"line":673,"column":127}},"141":{"start":{"line":687,"column":8},"end":{"line":687,"column":83}},"142":{"start":{"line":689,"column":8},"end":{"line":689,"column":38}},"143":{"start":{"line":690,"column":8},"end":{"line":690,"column":28}},"144":{"start":{"line":691,"column":8},"end":{"line":691,"column":15}},"145":{"start":{"line":692,"column":8},"end":{"line":692,"column":17}},"146":{"start":{"line":693,"column":8},"end":{"line":693,"column":17}},"147":{"start":{"line":694,"column":8},"end":{"line":694,"column":17}},"148":{"start":{"line":695,"column":8},"end":{"line":695,"column":27057}},"149":{"start":{"line":696,"column":12},"end":{"line":696,"column":52}},"150":{"start":{"line":698,"column":12},"end":{"line":698,"column":27219}},"151":{"start":{"line":700,"column":16},"end":{"line":700,"column":49}},"152":{"start":{"line":704,"column":16},"end":{"line":704,"column":114}},"153":{"start":{"line":707,"column":16},"end":{"line":707,"column":122}},"154":{"start":{"line":710,"column":16},"end":{"line":710,"column":44}},"155":{"start":{"line":715,"column":16},"end":{"line":715,"column":147}},"156":{"start":{"line":718,"column":16},"end":{"line":718,"column":46}},"157":{"start":{"line":724,"column":16},"end":{"line":724,"column":161}},"158":{"start":{"line":726,"column":19},"end":{"line":726,"column":29267}},"159":{"start":{"line":728,"column":16},"end":{"line":728,"column":49}},"160":{"start":{"line":731,"column":16},"end":{"line":731,"column":127}},"161":{"start":{"line":733,"column":16},"end":{"line":733,"column":29824}},"162":{"start":{"line":734,"column":20},"end":{"line":734,"column":61}},"163":{"start":{"line":736,"column":19},"end":{"line":736,"column":29970}},"164":{"start":{"line":738,"column":16},"end":{"line":738,"column":127}},"165":{"start":{"line":743,"column":16},"end":{"line":743,"column":58}},"166":{"start":{"line":745,"column":12},"end":{"line":745,"column":30445}},"167":{"start":{"line":749,"column":12},"end":{"line":749,"column":35}},"168":{"start":{"line":769,"column":8},"end":{"line":769,"column":36}},"169":{"start":{"line":772,"column":8},"end":{"line":772,"column":62}},"170":{"start":{"line":773,"column":8},"end":{"line":773,"column":50}},"171":{"start":{"line":775,"column":8},"end":{"line":775,"column":52}},"172":{"start":{"line":785,"column":8},"end":{"line":785,"column":82}},"173":{"start":{"line":786,"column":8},"end":{"line":786,"column":52}},"174":{"start":{"line":797,"column":8},"end":{"line":797,"column":48}},"175":{"start":{"line":813,"column":8},"end":{"line":813,"column":51}},"176":{"start":{"line":814,"column":8},"end":{"line":814,"column":33729}},"177":{"start":{"line":815,"column":12},"end":{"line":815,"column":73}},"178":{"start":{"line":818,"column":12},"end":{"line":818,"column":65}},"179":{"start":{"line":820,"column":8},"end":{"line":820,"column":34}},"180":{"start":{"line":833,"column":8},"end":{"line":833,"column":34339}},"181":{"start":{"line":836,"column":8},"end":{"line":836,"column":34457}},"182":{"start":{"line":869,"column":8},"end":{"line":869,"column":35665}},"183":{"start":{"line":872,"column":8},"end":{"line":872,"column":84}},"184":{"start":{"line":903,"column":8},"end":{"line":903,"column":139}}},"branchMap":{"1":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":8},"end":{"line":11,"column":8}},{"start":{"line":11,"column":8},"end":{"line":11,"column":8}}]},"2":{"line":13,"type":"if","locations":[{"start":{"line":13,"column":13},"end":{"line":13,"column":13}},{"start":{"line":13,"column":13},"end":{"line":13,"column":13}}]},"3":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":8},"end":{"line":77,"column":8}},{"start":{"line":77,"column":8},"end":{"line":77,"column":8}}]},"4":{"line":111,"type":"if","locations":[{"start":{"line":111,"column":8},"end":{"line":111,"column":8}},{"start":{"line":111,"column":8},"end":{"line":111,"column":8}}]},"5":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":8},"end":{"line":119,"column":8}},{"start":{"line":119,"column":8},"end":{"line":119,"column":8}}]},"6":{"line":144,"type":"if","locations":[{"start":{"line":144,"column":8},"end":{"line":144,"column":8}},{"start":{"line":144,"column":8},"end":{"line":144,"column":8}}]},"7":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":8},"end":{"line":146,"column":8}},{"start":{"line":146,"column":8},"end":{"line":146,"column":8}}]},"8":{"line":148,"type":"if","locations":[{"start":{"line":148,"column":12},"end":{"line":148,"column":12}},{"start":{"line":148,"column":12},"end":{"line":148,"column":12}}]},"9":{"line":159,"type":"if","locations":[{"start":{"line":159,"column":8},"end":{"line":159,"column":8}},{"start":{"line":159,"column":8},"end":{"line":159,"column":8}}]},"10":{"line":161,"type":"if","locations":[{"start":{"line":161,"column":8},"end":{"line":161,"column":8}},{"start":{"line":161,"column":8},"end":{"line":161,"column":8}}]},"11":{"line":176,"type":"if","locations":[{"start":{"line":176,"column":8},"end":{"line":176,"column":8}},{"start":{"line":176,"column":8},"end":{"line":176,"column":8}}]},"12":{"line":177,"type":"if","locations":[{"start":{"line":177,"column":8},"end":{"line":177,"column":8}},{"start":{"line":177,"column":8},"end":{"line":177,"column":8}}]},"13":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"14":{"line":246,"type":"if","locations":[{"start":{"line":246,"column":8},"end":{"line":246,"column":8}},{"start":{"line":246,"column":8},"end":{"line":246,"column":8}}]},"15":{"line":248,"type":"if","locations":[{"start":{"line":248,"column":8},"end":{"line":248,"column":8}},{"start":{"line":248,"column":8},"end":{"line":248,"column":8}}]},"16":{"line":250,"type":"if","locations":[{"start":{"line":250,"column":8},"end":{"line":250,"column":8}},{"start":{"line":250,"column":8},"end":{"line":250,"column":8}}]},"17":{"line":256,"type":"if","locations":[{"start":{"line":256,"column":12},"end":{"line":256,"column":12}},{"start":{"line":256,"column":12},"end":{"line":256,"column":12}}]},"18":{"line":258,"type":"if","locations":[{"start":{"line":258,"column":12},"end":{"line":258,"column":12}},{"start":{"line":258,"column":12},"end":{"line":258,"column":12}}]},"19":{"line":276,"type":"if","locations":[{"start":{"line":276,"column":8},"end":{"line":276,"column":8}},{"start":{"line":276,"column":8},"end":{"line":276,"column":8}}]},"20":{"line":278,"type":"if","locations":[{"start":{"line":278,"column":8},"end":{"line":278,"column":8}},{"start":{"line":278,"column":8},"end":{"line":278,"column":8}}]},"21":{"line":284,"type":"if","locations":[{"start":{"line":284,"column":8},"end":{"line":284,"column":8}},{"start":{"line":284,"column":8},"end":{"line":284,"column":8}}]},"22":{"line":298,"type":"if","locations":[{"start":{"line":298,"column":8},"end":{"line":298,"column":8}},{"start":{"line":298,"column":8},"end":{"line":298,"column":8}}]},"23":{"line":300,"type":"if","locations":[{"start":{"line":300,"column":8},"end":{"line":300,"column":8}},{"start":{"line":300,"column":8},"end":{"line":300,"column":8}}]},"24":{"line":301,"type":"if","locations":[{"start":{"line":301,"column":8},"end":{"line":301,"column":8}},{"start":{"line":301,"column":8},"end":{"line":301,"column":8}}]},"25":{"line":307,"type":"if","locations":[{"start":{"line":307,"column":8},"end":{"line":307,"column":8}},{"start":{"line":307,"column":8},"end":{"line":307,"column":8}}]},"26":{"line":321,"type":"if","locations":[{"start":{"line":321,"column":8},"end":{"line":321,"column":8}},{"start":{"line":321,"column":8},"end":{"line":321,"column":8}}]},"27":{"line":323,"type":"if","locations":[{"start":{"line":323,"column":8},"end":{"line":323,"column":8}},{"start":{"line":323,"column":8},"end":{"line":323,"column":8}}]},"28":{"line":325,"type":"if","locations":[{"start":{"line":325,"column":8},"end":{"line":325,"column":8}},{"start":{"line":325,"column":8},"end":{"line":325,"column":8}}]},"29":{"line":326,"type":"if","locations":[{"start":{"line":326,"column":8},"end":{"line":326,"column":8}},{"start":{"line":326,"column":8},"end":{"line":326,"column":8}}]},"30":{"line":342,"type":"if","locations":[{"start":{"line":342,"column":8},"end":{"line":342,"column":8}},{"start":{"line":342,"column":8},"end":{"line":342,"column":8}}]},"31":{"line":344,"type":"if","locations":[{"start":{"line":344,"column":8},"end":{"line":344,"column":8}},{"start":{"line":344,"column":8},"end":{"line":344,"column":8}}]},"32":{"line":401,"type":"if","locations":[{"start":{"line":401,"column":8},"end":{"line":401,"column":8}},{"start":{"line":401,"column":8},"end":{"line":401,"column":8}}]},"33":{"line":412,"type":"if","locations":[{"start":{"line":412,"column":8},"end":{"line":412,"column":8}},{"start":{"line":412,"column":8},"end":{"line":412,"column":8}}]},"34":{"line":421,"type":"if","locations":[{"start":{"line":421,"column":8},"end":{"line":421,"column":8}},{"start":{"line":421,"column":8},"end":{"line":421,"column":8}}]},"35":{"line":484,"type":"if","locations":[{"start":{"line":484,"column":4},"end":{"line":484,"column":4}},{"start":{"line":484,"column":4},"end":{"line":484,"column":4}}]},"36":{"line":489,"type":"if","locations":[{"start":{"line":489,"column":4},"end":{"line":489,"column":4}},{"start":{"line":489,"column":4},"end":{"line":489,"column":4}}]},"37":{"line":498,"type":"if","locations":[{"start":{"line":498,"column":4},"end":{"line":498,"column":4}},{"start":{"line":498,"column":4},"end":{"line":498,"column":4}}]},"38":{"line":509,"type":"if","locations":[{"start":{"line":509,"column":4},"end":{"line":509,"column":4}},{"start":{"line":509,"column":4},"end":{"line":509,"column":4}}]},"39":{"line":520,"type":"if","locations":[{"start":{"line":520,"column":4},"end":{"line":520,"column":4}},{"start":{"line":520,"column":4},"end":{"line":520,"column":4}}]},"40":{"line":530,"type":"if","locations":[{"start":{"line":530,"column":4},"end":{"line":530,"column":4}},{"start":{"line":530,"column":4},"end":{"line":530,"column":4}}]},"41":{"line":593,"type":"if","locations":[{"start":{"line":593,"column":8},"end":{"line":593,"column":8}},{"start":{"line":593,"column":8},"end":{"line":593,"column":8}}]},"42":{"line":598,"type":"if","locations":[{"start":{"line":598,"column":8},"end":{"line":598,"column":8}},{"start":{"line":598,"column":8},"end":{"line":598,"column":8}}]},"43":{"line":600,"type":"if","locations":[{"start":{"line":600,"column":8},"end":{"line":600,"column":8}},{"start":{"line":600,"column":8},"end":{"line":600,"column":8}}]},"44":{"line":642,"type":"if","locations":[{"start":{"line":642,"column":8},"end":{"line":642,"column":8}},{"start":{"line":642,"column":8},"end":{"line":642,"column":8}}]},"45":{"line":647,"type":"if","locations":[{"start":{"line":647,"column":8},"end":{"line":647,"column":8}},{"start":{"line":647,"column":8},"end":{"line":647,"column":8}}]},"46":{"line":652,"type":"if","locations":[{"start":{"line":652,"column":8},"end":{"line":652,"column":8}},{"start":{"line":652,"column":8},"end":{"line":652,"column":8}}]},"47":{"line":668,"type":"if","locations":[{"start":{"line":668,"column":8},"end":{"line":668,"column":8}},{"start":{"line":668,"column":8},"end":{"line":668,"column":8}}]},"48":{"line":671,"type":"if","locations":[{"start":{"line":671,"column":12},"end":{"line":671,"column":12}},{"start":{"line":671,"column":12},"end":{"line":671,"column":12}}]},"49":{"line":673,"type":"if","locations":[{"start":{"line":673,"column":12},"end":{"line":673,"column":12}},{"start":{"line":673,"column":12},"end":{"line":673,"column":12}}]},"50":{"line":687,"type":"if","locations":[{"start":{"line":687,"column":8},"end":{"line":687,"column":8}},{"start":{"line":687,"column":8},"end":{"line":687,"column":8}}]},"51":{"line":698,"type":"if","locations":[{"start":{"line":698,"column":12},"end":{"line":698,"column":12}},{"start":{"line":698,"column":12},"end":{"line":698,"column":12}}]},"52":{"line":704,"type":"if","locations":[{"start":{"line":704,"column":16},"end":{"line":704,"column":16}},{"start":{"line":704,"column":16},"end":{"line":704,"column":16}}]},"53":{"line":707,"type":"if","locations":[{"start":{"line":707,"column":16},"end":{"line":707,"column":16}},{"start":{"line":707,"column":16},"end":{"line":707,"column":16}}]},"54":{"line":715,"type":"if","locations":[{"start":{"line":715,"column":16},"end":{"line":715,"column":16}},{"start":{"line":715,"column":16},"end":{"line":715,"column":16}}]},"55":{"line":724,"type":"if","locations":[{"start":{"line":724,"column":16},"end":{"line":724,"column":16}},{"start":{"line":724,"column":16},"end":{"line":724,"column":16}}]},"56":{"line":726,"type":"if","locations":[{"start":{"line":726,"column":19},"end":{"line":726,"column":19}},{"start":{"line":726,"column":19},"end":{"line":726,"column":19}}]},"57":{"line":731,"type":"if","locations":[{"start":{"line":731,"column":16},"end":{"line":731,"column":16}},{"start":{"line":731,"column":16},"end":{"line":731,"column":16}}]},"58":{"line":733,"type":"if","locations":[{"start":{"line":733,"column":16},"end":{"line":733,"column":16}},{"start":{"line":733,"column":16},"end":{"line":733,"column":16}}]},"59":{"line":736,"type":"if","locations":[{"start":{"line":736,"column":19},"end":{"line":736,"column":19}},{"start":{"line":736,"column":19},"end":{"line":736,"column":19}}]},"60":{"line":745,"type":"if","locations":[{"start":{"line":745,"column":12},"end":{"line":745,"column":12}},{"start":{"line":745,"column":12},"end":{"line":745,"column":12}}]},"61":{"line":772,"type":"if","locations":[{"start":{"line":772,"column":8},"end":{"line":772,"column":8}},{"start":{"line":772,"column":8},"end":{"line":772,"column":8}}]},"62":{"line":785,"type":"if","locations":[{"start":{"line":785,"column":8},"end":{"line":785,"column":8}},{"start":{"line":785,"column":8},"end":{"line":785,"column":8}}]},"63":{"line":814,"type":"if","locations":[{"start":{"line":814,"column":8},"end":{"line":814,"column":8}},{"start":{"line":814,"column":8},"end":{"line":814,"column":8}}]},"64":{"line":815,"type":"if","locations":[{"start":{"line":815,"column":12},"end":{"line":815,"column":12}},{"start":{"line":815,"column":12},"end":{"line":815,"column":12}}]}}},"contracts/ReversibleICO.sol":{"l":{"166":34,"167":34,"188":10,"189":10,"190":10,"193":10,"194":10,"195":10,"196":10,"198":10,"202":10,"206":10,"207":10,"208":10,"209":10,"211":10,"215":10,"217":10,"219":120,"220":120,"221":120,"222":120,"224":120,"226":120,"229":10,"230":10,"231":10,"233":10,"252":128,"253":126,"258":2,"280":23,"283":21,"286":10,"287":10,"291":11,"304":2,"309":2,"310":2,"311":2,"313":0,"323":4,"325":4,"326":4,"328":4,"329":4,"332":4,"339":4,"340":4,"345":12,"346":12,"347":4,"351":12,"357":12,"361":12,"378":30,"380":30,"381":26,"384":26,"387":4,"390":4,"399":0,"400":0,"411":0,"425":203,"429":5,"433":10,"434":10,"435":8,"438":2,"447":176,"454":20,"479":35,"482":35,"500":108,"512":13,"514":13,"516":6,"519":7,"524":6,"525":5,"527":1,"531":9,"532":9,"533":5,"535":4,"546":0,"561":222,"562":143,"567":79,"570":79,"572":44,"577":35,"578":4,"581":31,"588":122,"598":122,"606":55,"609":10,"614":37,"615":37,"617":37,"621":37,"626":8,"629":67,"639":54,"640":54,"642":54,"643":49,"644":49,"648":2,"650":3,"670":126,"673":126,"676":126,"678":36,"681":36,"685":126,"688":126,"689":26,"702":11,"705":11,"707":8,"711":8,"712":8,"713":8,"714":8,"716":8,"717":6,"718":6,"721":8,"723":8,"732":6,"734":6,"735":6,"738":14,"745":14,"752":14,"754":10,"755":2,"757":10,"759":10,"760":10,"763":10,"764":10,"767":10,"772":10,"773":10,"776":10,"779":10,"780":6,"785":6,"789":4,"791":4,"794":6,"797":6,"800":6,"801":6,"803":6,"804":6,"805":6,"806":6,"810":5,"817":126,"818":126,"821":126,"822":126,"825":126,"826":126,"830":126,"833":126,"834":126,"836":126,"850":52,"852":52,"853":52,"854":126,"856":126,"858":126,"860":126,"863":122,"864":122,"866":122,"868":122,"869":122,"874":122,"875":4,"876":4,"880":4,"881":4,"882":4,"885":122,"888":46,"889":46,"891":46,"893":46,"897":46,"898":46,"901":46,"903":46,"908":122,"909":4,"910":4,"913":122,"925":6,"931":6,"935":6,"937":6,"940":6,"941":6,"946":6,"949":6,"951":6,"952":6,"953":4,"955":2,"957":6,"959":6,"966":0,"976":10,"977":10,"981":32,"982":30,"986":324,"987":315,"991":10,"992":10,"996":0,"997":0,"1001":288,"1002":288},"path":"/Volumes/Dev/RICO/upgrade/contracts/ReversibleICO.sol","s":{"1":34,"2":34,"3":10,"4":10,"5":10,"6":10,"7":10,"8":10,"9":10,"10":10,"11":10,"12":10,"13":10,"14":10,"15":10,"16":10,"17":10,"18":120,"19":120,"20":120,"21":120,"22":120,"23":10,"24":10,"25":10,"26":10,"27":128,"28":126,"29":2,"30":23,"31":21,"32":10,"33":10,"34":11,"35":2,"36":2,"37":2,"38":2,"39":0,"40":4,"41":4,"42":4,"43":4,"44":4,"45":4,"46":4,"47":12,"48":12,"49":4,"50":12,"51":12,"52":12,"53":30,"54":30,"55":26,"56":26,"57":4,"58":4,"59":0,"60":0,"61":0,"62":203,"63":5,"64":10,"65":10,"66":8,"67":2,"68":176,"69":20,"70":35,"71":35,"72":108,"73":13,"74":13,"75":6,"76":7,"77":6,"78":5,"79":1,"80":9,"81":9,"82":5,"83":4,"84":0,"85":222,"86":143,"87":79,"88":79,"89":44,"90":35,"91":4,"92":31,"93":122,"94":122,"95":55,"96":10,"97":45,"98":37,"99":37,"100":37,"101":37,"102":8,"103":67,"104":54,"105":54,"106":54,"107":49,"108":49,"109":5,"110":2,"111":3,"112":126,"113":126,"114":126,"115":36,"116":126,"117":126,"118":26,"119":11,"120":11,"121":8,"122":8,"123":8,"124":8,"125":8,"126":8,"127":6,"128":6,"129":8,"130":8,"131":6,"132":6,"133":6,"134":14,"135":14,"136":14,"137":10,"138":2,"139":10,"140":10,"141":10,"142":10,"143":10,"144":10,"145":10,"146":10,"147":10,"148":10,"149":6,"150":4,"151":4,"152":6,"153":6,"154":6,"155":6,"156":6,"157":6,"158":6,"159":6,"160":5,"161":126,"162":126,"163":126,"164":126,"165":126,"166":126,"167":126,"168":126,"169":126,"170":52,"171":52,"172":52,"173":126,"174":126,"175":126,"176":126,"177":122,"178":122,"179":122,"180":122,"181":122,"182":122,"183":4,"184":4,"185":4,"186":4,"187":4,"188":122,"189":46,"190":46,"191":46,"192":46,"193":46,"194":46,"195":46,"196":46,"197":122,"198":4,"199":4,"200":122,"201":6,"202":6,"203":6,"204":6,"205":6,"206":6,"207":6,"208":6,"209":6,"210":6,"211":4,"212":2,"213":2,"214":6,"215":6,"216":0,"217":10,"218":32,"219":324,"220":10,"221":0,"222":288},"b":{"1":[126,2],"2":[21,2],"3":[10,11],"4":[2,0],"5":[2,0],"6":[4,0],"7":[4,0],"8":[4,8],"9":[26,4],"10":[8,2],"11":[6,7],"12":[5,1],"13":[5,4],"14":[143,79],"15":[44,35],"16":[4,31],"17":[55,67],"18":[10,45],"19":[37,8],"20":[49,5],"21":[2,3],"22":[36,90],"23":[26,100],"24":[8,3],"25":[6,2],"26":[6,2],"27":[10,4],"28":[2,8],"29":[6,4],"30":[4,2],"31":[122,4],"32":[4,118],"33":[46,76],"34":[4,118],"35":[6,0],"36":[4,2],"37":[2,0],"38":[10,0],"39":[30,2],"40":[315,9],"41":[10,0],"42":[0,0],"43":[288,0]},"f":{"1":34,"2":10,"3":128,"4":23,"5":2,"6":4,"7":12,"8":30,"9":0,"10":0,"11":203,"12":5,"13":10,"14":176,"15":20,"16":35,"17":108,"18":13,"19":6,"20":9,"21":0,"22":222,"23":122,"24":122,"25":54,"26":126,"27":11,"28":126,"29":52,"30":6,"31":10,"32":32,"33":324,"34":10,"35":0,"36":288},"fnMap":{"1":{"name":"constructor","line":165,"loc":{"start":{"line":165,"column":4},"end":{"line":165,"column":22}}},"2":{"name":"init","line":171,"loc":{"start":{"line":171,"column":4},"end":{"line":185,"column":5}}},"3":{"name":"","line":245,"loc":{"start":{"line":245,"column":4},"end":{"line":250,"column":5}}},"4":{"name":"tokensReceived","line":265,"loc":{"start":{"line":265,"column":4},"end":{"line":277,"column":5}}},"5":{"name":"cancel","line":299,"loc":{"start":{"line":299,"column":4},"end":{"line":303,"column":5}}},"6":{"name":"projectWithdraw","line":319,"loc":{"start":{"line":319,"column":4},"end":{"line":322,"column":5}}},"7":{"name":"getProjectAvailableEth","line":343,"loc":{"start":{"line":343,"column":4},"end":{"line":343,"column":73}}},"8":{"name":"whitelist","line":369,"loc":{"start":{"line":369,"column":4},"end":{"line":377,"column":5}}},"9":{"name":"whitelistMultiple","line":398,"loc":{"start":{"line":398,"column":4},"end":{"line":398,"column":77}}},"10":{"name":"isWhitelisted","line":410,"loc":{"start":{"line":410,"column":4},"end":{"line":410,"column":71}}},"11":{"name":"getCurrentStage","line":424,"loc":{"start":{"line":424,"column":4},"end":{"line":424,"column":58}}},"12":{"name":"getCurrentPrice","line":428,"loc":{"start":{"line":428,"column":4},"end":{"line":428,"column":60}}},"13":{"name":"getPriceAtBlock","line":432,"loc":{"start":{"line":432,"column":4},"end":{"line":432,"column":80}}},"14":{"name":"getTokenAmountForEthAtStage","line":441,"loc":{"start":{"line":441,"column":4},"end":{"line":441,"column":103}}},"15":{"name":"getEthAmountForTokensAtStage","line":452,"loc":{"start":{"line":452,"column":4},"end":{"line":452,"column":107}}},"16":{"name":"getParticipantDetailsByStage","line":466,"loc":{"start":{"line":466,"column":4},"end":{"line":477,"column":7}}},"17":{"name":"getLockedTokenAmount","line":496,"loc":{"start":{"line":496,"column":4},"end":{"line":496,"column":90}}},"18":{"name":"getCancelModes","line":510,"loc":{"start":{"line":510,"column":4},"end":{"line":510,"column":104}}},"19":{"name":"canCancelByTokens","line":523,"loc":{"start":{"line":523,"column":4},"end":{"line":523,"column":86}}},"20":{"name":"canCancelByEth","line":530,"loc":{"start":{"line":530,"column":4},"end":{"line":530,"column":81}}},"21":{"name":"getCurrentBlockNumber","line":545,"loc":{"start":{"line":545,"column":4},"end":{"line":545,"column":64}}},"22":{"name":"getStageAtBlock","line":549,"loc":{"start":{"line":549,"column":4},"end":{"line":549,"column":80}}},"23":{"name":"availableEthAtStage","line":587,"loc":{"start":{"line":587,"column":4},"end":{"line":587,"column":74}}},"24":{"name":"getLockedTokenAmountAtBlock","line":596,"loc":{"start":{"line":596,"column":4},"end":{"line":596,"column":112}}},"25":{"name":"getCurrentUnlockPercentage","line":638,"loc":{"start":{"line":638,"column":4},"end":{"line":638,"column":68}}},"26":{"name":"commit","line":664,"loc":{"start":{"line":664,"column":4},"end":{"line":668,"column":5}}},"27":{"name":"withdraw","line":696,"loc":{"start":{"line":696,"column":4},"end":{"line":696,"column":73}}},"28":{"name":"recordNewContribution","line":816,"loc":{"start":{"line":816,"column":4},"end":{"line":816,"column":80}}},"29":{"name":"acceptContributionsForAddress","line":844,"loc":{"start":{"line":844,"column":4},"end":{"line":849,"column":5}}},"30":{"name":"cancelContributionsForAddress","line":918,"loc":{"start":{"line":918,"column":4},"end":{"line":923,"column":5}}},"31":{"name":"onlyDeployer","line":975,"loc":{"start":{"line":975,"column":4},"end":{"line":975,"column":25}}},"32":{"name":"onlyWhitelistController","line":980,"loc":{"start":{"line":980,"column":4},"end":{"line":980,"column":36}}},"33":{"name":"isInitialized","line":985,"loc":{"start":{"line":985,"column":4},"end":{"line":985,"column":26}}},"34":{"name":"isNotInitialized","line":990,"loc":{"start":{"line":990,"column":4},"end":{"line":990,"column":29}}},"35":{"name":"isFrozen","line":995,"loc":{"start":{"line":995,"column":4},"end":{"line":995,"column":21}}},"36":{"name":"isNotFrozen","line":1000,"loc":{"start":{"line":1000,"column":4},"end":{"line":1000,"column":24}}}},"statementMap":{"1":{"start":{"line":166,"column":8},"end":{"line":166,"column":35}},"2":{"start":{"line":167,"column":8},"end":{"line":167,"column":102}},"3":{"start":{"line":188,"column":8},"end":{"line":188,"column":51}},"4":{"start":{"line":189,"column":8},"end":{"line":189,"column":63}},"5":{"start":{"line":190,"column":8},"end":{"line":190,"column":51}},"6":{"start":{"line":193,"column":8},"end":{"line":193,"column":53}},"7":{"start":{"line":194,"column":8},"end":{"line":194,"column":53}},"8":{"start":{"line":195,"column":8},"end":{"line":195,"column":76}},"9":{"start":{"line":196,"column":8},"end":{"line":196,"column":43}},"10":{"start":{"line":198,"column":8},"end":{"line":198,"column":41}},"11":{"start":{"line":202,"column":8},"end":{"line":202,"column":52}},"12":{"start":{"line":206,"column":8},"end":{"line":206,"column":49}},"13":{"start":{"line":207,"column":8},"end":{"line":207,"column":49}},"14":{"start":{"line":208,"column":8},"end":{"line":208,"column":72}},"15":{"start":{"line":209,"column":8},"end":{"line":209,"column":44}},"16":{"start":{"line":215,"column":8},"end":{"line":215,"column":51}},"17":{"start":{"line":217,"column":8},"end":{"line":217,"column":6835}},"18":{"start":{"line":219,"column":12},"end":{"line":219,"column":53}},"19":{"start":{"line":220,"column":12},"end":{"line":220,"column":52}},"20":{"start":{"line":221,"column":12},"end":{"line":221,"column":69}},"21":{"start":{"line":222,"column":12},"end":{"line":222,"column":80}},"22":{"start":{"line":226,"column":12},"end":{"line":226,"column":46}},"23":{"start":{"line":229,"column":8},"end":{"line":229,"column":51}},"24":{"start":{"line":230,"column":8},"end":{"line":230,"column":43}},"25":{"start":{"line":231,"column":8},"end":{"line":231,"column":66}},"26":{"start":{"line":233,"column":8},"end":{"line":233,"column":25}},"27":{"start":{"line":252,"column":8},"end":{"line":252,"column":7812}},"28":{"start":{"line":253,"column":12},"end":{"line":253,"column":19}},"29":{"start":{"line":258,"column":12},"end":{"line":258,"column":19}},"30":{"start":{"line":280,"column":8},"end":{"line":280,"column":75}},"31":{"start":{"line":283,"column":8},"end":{"line":283,"column":8603}},"32":{"start":{"line":286,"column":12},"end":{"line":286,"column":33}},"33":{"start":{"line":287,"column":12},"end":{"line":287,"column":18}},"34":{"start":{"line":291,"column":12},"end":{"line":291,"column":35}},"35":{"start":{"line":304,"column":8},"end":{"line":304,"column":9133}},"36":{"start":{"line":309,"column":8},"end":{"line":309,"column":9318}},"37":{"start":{"line":310,"column":12},"end":{"line":310,"column":101}},"38":{"start":{"line":311,"column":12},"end":{"line":311,"column":18}},"39":{"start":{"line":313,"column":8},"end":{"line":313,"column":50}},"40":{"start":{"line":323,"column":8},"end":{"line":323,"column":82}},"41":{"start":{"line":325,"column":8},"end":{"line":325,"column":51}},"42":{"start":{"line":326,"column":8},"end":{"line":326,"column":103}},"43":{"start":{"line":329,"column":8},"end":{"line":329,"column":40}},"44":{"start":{"line":332,"column":8},"end":{"line":332,"column":10002}},"45":{"start":{"line":339,"column":8},"end":{"line":339,"column":99}},"46":{"start":{"line":340,"column":8},"end":{"line":340,"column":66}},"47":{"start":{"line":345,"column":8},"end":{"line":345,"column":43}},"48":{"start":{"line":346,"column":8},"end":{"line":346,"column":10503}},"49":{"start":{"line":347,"column":12},"end":{"line":347,"column":81}},"50":{"start":{"line":351,"column":8},"end":{"line":351,"column":10739}},"51":{"start":{"line":357,"column":8},"end":{"line":357,"column":10970}},"52":{"start":{"line":361,"column":8},"end":{"line":361,"column":52}},"53":{"start":{"line":378,"column":8},"end":{"line":378,"column":79}},"54":{"start":{"line":380,"column":8},"end":{"line":380,"column":11509}},"55":{"start":{"line":381,"column":12},"end":{"line":381,"column":47}},"56":{"start":{"line":384,"column":12},"end":{"line":384,"column":98}},"57":{"start":{"line":387,"column":12},"end":{"line":387,"column":48}},"58":{"start":{"line":390,"column":12},"end":{"line":390,"column":97}},"59":{"start":{"line":399,"column":8},"end":{"line":399,"column":12101}},"60":{"start":{"line":400,"column":12},"end":{"line":400,"column":43}},"61":{"start":{"line":411,"column":8},"end":{"line":411,"column":58}},"62":{"start":{"line":425,"column":8},"end":{"line":425,"column":55}},"63":{"start":{"line":429,"column":8},"end":{"line":429,"column":55}},"64":{"start":{"line":433,"column":8},"end":{"line":433,"column":51}},"65":{"start":{"line":434,"column":8},"end":{"line":434,"column":13312}},"66":{"start":{"line":435,"column":12},"end":{"line":435,"column":43}},"67":{"start":{"line":438,"column":8},"end":{"line":438,"column":16}},"68":{"start":{"line":447,"column":8},"end":{"line":447,"column":13887}},"69":{"start":{"line":454,"column":8},"end":{"line":454,"column":14149}},"70":{"start":{"line":479,"column":8},"end":{"line":479,"column":14798}},"71":{"start":{"line":482,"column":8},"end":{"line":482,"column":14899}},"72":{"start":{"line":500,"column":8},"end":{"line":500,"column":15599}},"73":{"start":{"line":512,"column":8},"end":{"line":512,"column":90}},"74":{"start":{"line":514,"column":8},"end":{"line":514,"column":16128}},"75":{"start":{"line":516,"column":12},"end":{"line":516,"column":60}},"76":{"start":{"line":519,"column":12},"end":{"line":519,"column":54}},"77":{"start":{"line":524,"column":8},"end":{"line":524,"column":16594}},"78":{"start":{"line":525,"column":12},"end":{"line":525,"column":23}},"79":{"start":{"line":527,"column":8},"end":{"line":527,"column":20}},"80":{"start":{"line":531,"column":8},"end":{"line":531,"column":90}},"81":{"start":{"line":532,"column":8},"end":{"line":532,"column":16896}},"82":{"start":{"line":533,"column":12},"end":{"line":533,"column":23}},"83":{"start":{"line":535,"column":8},"end":{"line":535,"column":20}},"84":{"start":{"line":546,"column":8},"end":{"line":546,"column":27}},"85":{"start":{"line":561,"column":8},"end":{"line":561,"column":17965}},"86":{"start":{"line":562,"column":12},"end":{"line":562,"column":20}},"87":{"start":{"line":567,"column":8},"end":{"line":567,"column":88}},"88":{"start":{"line":570,"column":8},"end":{"line":570,"column":18324}},"89":{"start":{"line":572,"column":12},"end":{"line":572,"column":33}},"90":{"start":{"line":577,"column":8},"end":{"line":577,"column":18581}},"91":{"start":{"line":578,"column":12},"end":{"line":578,"column":22}},"92":{"start":{"line":581,"column":8},"end":{"line":581,"column":25}},"93":{"start":{"line":588,"column":8},"end":{"line":588,"column":18829}},"94":{"start":{"line":598,"column":8},"end":{"line":598,"column":19148}},"95":{"start":{"line":606,"column":12},"end":{"line":606,"column":19482}},"96":{"start":{"line":609,"column":16},"end":{"line":609,"column":35}},"97":{"start":{"line":611,"column":19},"end":{"line":611,"column":19612}},"98":{"start":{"line":614,"column":16},"end":{"line":614,"column":36}},"99":{"start":{"line":615,"column":16},"end":{"line":615,"column":45}},"100":{"start":{"line":617,"column":16},"end":{"line":617,"column":19818}},"101":{"start":{"line":621,"column":16},"end":{"line":621,"column":43}},"102":{"start":{"line":626,"column":16},"end":{"line":626,"column":24}},"103":{"start":{"line":629,"column":12},"end":{"line":629,"column":20}},"104":{"start":{"line":639,"column":8},"end":{"line":639,"column":28}},"105":{"start":{"line":640,"column":8},"end":{"line":640,"column":54}},"106":{"start":{"line":642,"column":8},"end":{"line":642,"column":20609}},"107":{"start":{"line":643,"column":12},"end":{"line":643,"column":71}},"108":{"start":{"line":644,"column":12},"end":{"line":644,"column":20798}},"109":{"start":{"line":647,"column":15},"end":{"line":647,"column":20889}},"110":{"start":{"line":648,"column":12},"end":{"line":648,"column":20}},"111":{"start":{"line":650,"column":12},"end":{"line":650,"column":20}},"112":{"start":{"line":670,"column":8},"end":{"line":670,"column":32}},"113":{"start":{"line":673,"column":8},"end":{"line":673,"column":81}},"114":{"start":{"line":676,"column":8},"end":{"line":676,"column":21602}},"115":{"start":{"line":681,"column":12},"end":{"line":681,"column":58}},"116":{"start":{"line":685,"column":8},"end":{"line":685,"column":51}},"117":{"start":{"line":688,"column":8},"end":{"line":688,"column":22024}},"118":{"start":{"line":689,"column":12},"end":{"line":689,"column":102}},"119":{"start":{"line":702,"column":8},"end":{"line":702,"column":76}},"120":{"start":{"line":705,"column":8},"end":{"line":705,"column":22667}},"121":{"start":{"line":707,"column":12},"end":{"line":707,"column":64}},"122":{"start":{"line":711,"column":12},"end":{"line":711,"column":63}},"123":{"start":{"line":712,"column":12},"end":{"line":712,"column":59}},"124":{"start":{"line":713,"column":12},"end":{"line":713,"column":37}},"125":{"start":{"line":714,"column":12},"end":{"line":714,"column":42}},"126":{"start":{"line":716,"column":12},"end":{"line":716,"column":23145}},"127":{"start":{"line":717,"column":16},"end":{"line":717,"column":67}},"128":{"start":{"line":718,"column":16},"end":{"line":718,"column":47}},"129":{"start":{"line":721,"column":12},"end":{"line":721,"column":88}},"130":{"start":{"line":723,"column":12},"end":{"line":723,"column":23423}},"131":{"start":{"line":732,"column":16},"end":{"line":732,"column":39}},"132":{"start":{"line":734,"column":16},"end":{"line":734,"column":60}},"133":{"start":{"line":735,"column":16},"end":{"line":735,"column":24071}},"134":{"start":{"line":738,"column":20},"end":{"line":738,"column":24254}},"135":{"start":{"line":745,"column":20},"end":{"line":745,"column":24637}},"136":{"start":{"line":752,"column":20},"end":{"line":752,"column":25010}},"137":{"start":{"line":754,"column":24},"end":{"line":754,"column":25063}},"138":{"start":{"line":755,"column":28},"end":{"line":755,"column":63}},"139":{"start":{"line":757,"column":24},"end":{"line":757,"column":103}},"140":{"start":{"line":759,"column":24},"end":{"line":759,"column":72}},"141":{"start":{"line":760,"column":24},"end":{"line":760,"column":89}},"142":{"start":{"line":763,"column":24},"end":{"line":763,"column":78}},"143":{"start":{"line":764,"column":24},"end":{"line":764,"column":90}},"144":{"start":{"line":767,"column":24},"end":{"line":767,"column":25785}},"145":{"start":{"line":772,"column":24},"end":{"line":772,"column":62}},"146":{"start":{"line":773,"column":24},"end":{"line":773,"column":90}},"147":{"start":{"line":776,"column":24},"end":{"line":776,"column":85}},"148":{"start":{"line":779,"column":24},"end":{"line":779,"column":26408}},"149":{"start":{"line":785,"column":16},"end":{"line":785,"column":26550}},"150":{"start":{"line":789,"column":20},"end":{"line":789,"column":37}},"151":{"start":{"line":791,"column":20},"end":{"line":791,"column":69}},"152":{"start":{"line":794,"column":16},"end":{"line":794,"column":64}},"153":{"start":{"line":797,"column":16},"end":{"line":797,"column":46}},"154":{"start":{"line":800,"column":16},"end":{"line":800,"column":66}},"155":{"start":{"line":801,"column":16},"end":{"line":801,"column":92}},"156":{"start":{"line":803,"column":16},"end":{"line":803,"column":64}},"157":{"start":{"line":804,"column":16},"end":{"line":804,"column":64}},"158":{"start":{"line":805,"column":16},"end":{"line":805,"column":101}},"159":{"start":{"line":806,"column":16},"end":{"line":806,"column":22}},"160":{"start":{"line":810,"column":8},"end":{"line":810,"column":73}},"161":{"start":{"line":817,"column":8},"end":{"line":817,"column":46}},"162":{"start":{"line":818,"column":8},"end":{"line":818,"column":76}},"163":{"start":{"line":822,"column":8},"end":{"line":822,"column":55}},"164":{"start":{"line":825,"column":8},"end":{"line":825,"column":91}},"165":{"start":{"line":826,"column":8},"end":{"line":826,"column":45}},"166":{"start":{"line":830,"column":8},"end":{"line":830,"column":28446}},"167":{"start":{"line":833,"column":8},"end":{"line":833,"column":47}},"168":{"start":{"line":834,"column":8},"end":{"line":834,"column":57}},"169":{"start":{"line":836,"column":8},"end":{"line":836,"column":28671}},"170":{"start":{"line":850,"column":8},"end":{"line":850,"column":76}},"171":{"start":{"line":852,"column":8},"end":{"line":852,"column":46}},"172":{"start":{"line":853,"column":8},"end":{"line":853,"column":29126}},"173":{"start":{"line":854,"column":12},"end":{"line":854,"column":29}},"174":{"start":{"line":856,"column":12},"end":{"line":856,"column":90}},"175":{"start":{"line":858,"column":12},"end":{"line":858,"column":99}},"176":{"start":{"line":860,"column":12},"end":{"line":860,"column":29412}},"177":{"start":{"line":863,"column":16},"end":{"line":863,"column":73}},"178":{"start":{"line":864,"column":16},"end":{"line":864,"column":41}},"179":{"start":{"line":866,"column":16},"end":{"line":866,"column":78}},"180":{"start":{"line":868,"column":16},"end":{"line":868,"column":85}},"181":{"start":{"line":869,"column":16},"end":{"line":869,"column":39}},"182":{"start":{"line":874,"column":16},"end":{"line":874,"column":30052}},"183":{"start":{"line":875,"column":20},"end":{"line":875,"column":56}},"184":{"start":{"line":876,"column":20},"end":{"line":876,"column":30217}},"185":{"start":{"line":880,"column":20},"end":{"line":880,"column":45}},"186":{"start":{"line":881,"column":20},"end":{"line":881,"column":63}},"187":{"start":{"line":882,"column":20},"end":{"line":882,"column":52}},"188":{"start":{"line":885,"column":16},"end":{"line":885,"column":30559}},"189":{"start":{"line":888,"column":20},"end":{"line":888,"column":50}},"190":{"start":{"line":889,"column":20},"end":{"line":889,"column":68}},"191":{"start":{"line":891,"column":20},"end":{"line":891,"column":58}},"192":{"start":{"line":893,"column":20},"end":{"line":893,"column":30868}},"193":{"start":{"line":897,"column":20},"end":{"line":897,"column":57}},"194":{"start":{"line":898,"column":20},"end":{"line":898,"column":67}},"195":{"start":{"line":901,"column":20},"end":{"line":901,"column":37}},"196":{"start":{"line":903,"column":20},"end":{"line":903,"column":66}},"197":{"start":{"line":908,"column":16},"end":{"line":908,"column":31526}},"198":{"start":{"line":909,"column":20},"end":{"line":909,"column":64}},"199":{"start":{"line":910,"column":20},"end":{"line":910,"column":97}},"200":{"start":{"line":913,"column":16},"end":{"line":913,"column":91}},"201":{"start":{"line":925,"column":8},"end":{"line":925,"column":76}},"202":{"start":{"line":931,"column":8},"end":{"line":931,"column":32375}},"203":{"start":{"line":935,"column":8},"end":{"line":935,"column":32506}},"204":{"start":{"line":937,"column":12},"end":{"line":937,"column":49}},"205":{"start":{"line":940,"column":12},"end":{"line":940,"column":47}},"206":{"start":{"line":941,"column":12},"end":{"line":941,"column":68}},"207":{"start":{"line":946,"column":12},"end":{"line":946,"column":49}},"208":{"start":{"line":949,"column":12},"end":{"line":949,"column":80}},"209":{"start":{"line":951,"column":12},"end":{"line":951,"column":42}},"210":{"start":{"line":952,"column":12},"end":{"line":952,"column":33238}},"211":{"start":{"line":953,"column":16},"end":{"line":953,"column":79}},"212":{"start":{"line":954,"column":19},"end":{"line":954,"column":33405}},"213":{"start":{"line":955,"column":16},"end":{"line":955,"column":81}},"214":{"start":{"line":957,"column":12},"end":{"line":957,"column":88}},"215":{"start":{"line":959,"column":12},"end":{"line":959,"column":33676}},"216":{"start":{"line":966,"column":12},"end":{"line":966,"column":65}},"217":{"start":{"line":976,"column":8},"end":{"line":976,"column":88}},"218":{"start":{"line":981,"column":8},"end":{"line":981,"column":111}},"219":{"start":{"line":986,"column":8},"end":{"line":986,"column":68}},"220":{"start":{"line":991,"column":8},"end":{"line":991,"column":72}},"221":{"start":{"line":996,"column":8},"end":{"line":996,"column":53}},"222":{"start":{"line":1001,"column":8},"end":{"line":1001,"column":62}}},"branchMap":{"1":{"line":252,"type":"if","locations":[{"start":{"line":252,"column":8},"end":{"line":252,"column":8}},{"start":{"line":252,"column":8},"end":{"line":252,"column":8}}]},"2":{"line":280,"type":"if","locations":[{"start":{"line":280,"column":8},"end":{"line":280,"column":8}},{"start":{"line":280,"column":8},"end":{"line":280,"column":8}}]},"3":{"line":283,"type":"if","locations":[{"start":{"line":283,"column":8},"end":{"line":283,"column":8}},{"start":{"line":283,"column":8},"end":{"line":283,"column":8}}]},"4":{"line":304,"type":"if","locations":[{"start":{"line":304,"column":8},"end":{"line":304,"column":8}},{"start":{"line":304,"column":8},"end":{"line":304,"column":8}}]},"5":{"line":309,"type":"if","locations":[{"start":{"line":309,"column":8},"end":{"line":309,"column":8}},{"start":{"line":309,"column":8},"end":{"line":309,"column":8}}]},"6":{"line":323,"type":"if","locations":[{"start":{"line":323,"column":8},"end":{"line":323,"column":8}},{"start":{"line":323,"column":8},"end":{"line":323,"column":8}}]},"7":{"line":326,"type":"if","locations":[{"start":{"line":326,"column":8},"end":{"line":326,"column":8}},{"start":{"line":326,"column":8},"end":{"line":326,"column":8}}]},"8":{"line":346,"type":"if","locations":[{"start":{"line":346,"column":8},"end":{"line":346,"column":8}},{"start":{"line":346,"column":8},"end":{"line":346,"column":8}}]},"9":{"line":380,"type":"if","locations":[{"start":{"line":380,"column":8},"end":{"line":380,"column":8}},{"start":{"line":380,"column":8},"end":{"line":380,"column":8}}]},"10":{"line":434,"type":"if","locations":[{"start":{"line":434,"column":8},"end":{"line":434,"column":8}},{"start":{"line":434,"column":8},"end":{"line":434,"column":8}}]},"11":{"line":514,"type":"if","locations":[{"start":{"line":514,"column":8},"end":{"line":514,"column":8}},{"start":{"line":514,"column":8},"end":{"line":514,"column":8}}]},"12":{"line":524,"type":"if","locations":[{"start":{"line":524,"column":8},"end":{"line":524,"column":8}},{"start":{"line":524,"column":8},"end":{"line":524,"column":8}}]},"13":{"line":532,"type":"if","locations":[{"start":{"line":532,"column":8},"end":{"line":532,"column":8}},{"start":{"line":532,"column":8},"end":{"line":532,"column":8}}]},"14":{"line":561,"type":"if","locations":[{"start":{"line":561,"column":8},"end":{"line":561,"column":8}},{"start":{"line":561,"column":8},"end":{"line":561,"column":8}}]},"15":{"line":570,"type":"if","locations":[{"start":{"line":570,"column":8},"end":{"line":570,"column":8}},{"start":{"line":570,"column":8},"end":{"line":570,"column":8}}]},"16":{"line":577,"type":"if","locations":[{"start":{"line":577,"column":8},"end":{"line":577,"column":8}},{"start":{"line":577,"column":8},"end":{"line":577,"column":8}}]},"17":{"line":598,"type":"if","locations":[{"start":{"line":598,"column":8},"end":{"line":598,"column":8}},{"start":{"line":598,"column":8},"end":{"line":598,"column":8}}]},"18":{"line":606,"type":"if","locations":[{"start":{"line":606,"column":12},"end":{"line":606,"column":12}},{"start":{"line":606,"column":12},"end":{"line":606,"column":12}}]},"19":{"line":611,"type":"if","locations":[{"start":{"line":611,"column":19},"end":{"line":611,"column":19}},{"start":{"line":611,"column":19},"end":{"line":611,"column":19}}]},"20":{"line":642,"type":"if","locations":[{"start":{"line":642,"column":8},"end":{"line":642,"column":8}},{"start":{"line":642,"column":8},"end":{"line":642,"column":8}}]},"21":{"line":647,"type":"if","locations":[{"start":{"line":647,"column":15},"end":{"line":647,"column":15}},{"start":{"line":647,"column":15},"end":{"line":647,"column":15}}]},"22":{"line":676,"type":"if","locations":[{"start":{"line":676,"column":8},"end":{"line":676,"column":8}},{"start":{"line":676,"column":8},"end":{"line":676,"column":8}}]},"23":{"line":688,"type":"if","locations":[{"start":{"line":688,"column":8},"end":{"line":688,"column":8}},{"start":{"line":688,"column":8},"end":{"line":688,"column":8}}]},"24":{"line":705,"type":"if","locations":[{"start":{"line":705,"column":8},"end":{"line":705,"column":8}},{"start":{"line":705,"column":8},"end":{"line":705,"column":8}}]},"25":{"line":716,"type":"if","locations":[{"start":{"line":716,"column":12},"end":{"line":716,"column":12}},{"start":{"line":716,"column":12},"end":{"line":716,"column":12}}]},"26":{"line":723,"type":"if","locations":[{"start":{"line":723,"column":12},"end":{"line":723,"column":12}},{"start":{"line":723,"column":12},"end":{"line":723,"column":12}}]},"27":{"line":752,"type":"if","locations":[{"start":{"line":752,"column":20},"end":{"line":752,"column":20}},{"start":{"line":752,"column":20},"end":{"line":752,"column":20}}]},"28":{"line":754,"type":"if","locations":[{"start":{"line":754,"column":24},"end":{"line":754,"column":24}},{"start":{"line":754,"column":24},"end":{"line":754,"column":24}}]},"29":{"line":779,"type":"if","locations":[{"start":{"line":779,"column":24},"end":{"line":779,"column":24}},{"start":{"line":779,"column":24},"end":{"line":779,"column":24}}]},"30":{"line":785,"type":"if","locations":[{"start":{"line":785,"column":16},"end":{"line":785,"column":16}},{"start":{"line":785,"column":16},"end":{"line":785,"column":16}}]},"31":{"line":860,"type":"if","locations":[{"start":{"line":860,"column":12},"end":{"line":860,"column":12}},{"start":{"line":860,"column":12},"end":{"line":860,"column":12}}]},"32":{"line":874,"type":"if","locations":[{"start":{"line":874,"column":16},"end":{"line":874,"column":16}},{"start":{"line":874,"column":16},"end":{"line":874,"column":16}}]},"33":{"line":885,"type":"if","locations":[{"start":{"line":885,"column":16},"end":{"line":885,"column":16}},{"start":{"line":885,"column":16},"end":{"line":885,"column":16}}]},"34":{"line":908,"type":"if","locations":[{"start":{"line":908,"column":16},"end":{"line":908,"column":16}},{"start":{"line":908,"column":16},"end":{"line":908,"column":16}}]},"35":{"line":935,"type":"if","locations":[{"start":{"line":935,"column":8},"end":{"line":935,"column":8}},{"start":{"line":935,"column":8},"end":{"line":935,"column":8}}]},"36":{"line":952,"type":"if","locations":[{"start":{"line":952,"column":12},"end":{"line":952,"column":12}},{"start":{"line":952,"column":12},"end":{"line":952,"column":12}}]},"37":{"line":954,"type":"if","locations":[{"start":{"line":954,"column":19},"end":{"line":954,"column":19}},{"start":{"line":954,"column":19},"end":{"line":954,"column":19}}]},"38":{"line":976,"type":"if","locations":[{"start":{"line":976,"column":8},"end":{"line":976,"column":8}},{"start":{"line":976,"column":8},"end":{"line":976,"column":8}}]},"39":{"line":981,"type":"if","locations":[{"start":{"line":981,"column":8},"end":{"line":981,"column":8}},{"start":{"line":981,"column":8},"end":{"line":981,"column":8}}]},"40":{"line":986,"type":"if","locations":[{"start":{"line":986,"column":8},"end":{"line":986,"column":8}},{"start":{"line":986,"column":8},"end":{"line":986,"column":8}}]},"41":{"line":991,"type":"if","locations":[{"start":{"line":991,"column":8},"end":{"line":991,"column":8}},{"start":{"line":991,"column":8},"end":{"line":991,"column":8}}]},"42":{"line":996,"type":"if","locations":[{"start":{"line":996,"column":8},"end":{"line":996,"column":8}},{"start":{"line":996,"column":8},"end":{"line":996,"column":8}}]},"43":{"line":1001,"type":"if","locations":[{"start":{"line":1001,"column":8},"end":{"line":1001,"column":8}},{"start":{"line":1001,"column":8},"end":{"line":1001,"column":8}}]}}},"contracts/RicoToken.sol":{"l":{"23":31,"24":31,"25":31,"35":60,"36":60,"37":60,"41":2,"45":12,"49":11,"53":113,"67":2,"68":1,"86":124,"88":24,"91":100,"94":120,"98":78,"99":74,"103":125,"104":124,"107":62,"108":60,"112":130,"113":127},"path":"/Volumes/Dev/RICO/upgrade/contracts/RicoToken.sol","s":{"1":31,"2":31,"3":31,"4":60,"5":60,"6":60,"7":2,"8":12,"9":11,"10":113,"11":2,"12":1,"13":124,"14":24,"15":100,"16":120,"17":78,"18":125,"19":62,"20":130},"b":{"1":[1,1],"2":[24,100],"3":[23,1],"4":[97,3],"5":[74,4],"6":[124,1],"7":[60,2],"8":[127,3]},"f":{"1":31,"2":60,"3":2,"4":12,"5":11,"6":113,"7":2,"8":124,"9":78,"10":125,"11":62,"12":130},"fnMap":{"1":{"name":"constructor","line":16,"loc":{"start":{"line":16,"column":4},"end":{"line":22,"column":5}}},"2":{"name":"setup","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":34,"column":5}}},"3":{"name":"changeManager","line":40,"loc":{"start":{"line":40,"column":4},"end":{"line":40,"column":64}}},"4":{"name":"setFrozen","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":44,"column":53}}},"5":{"name":"getLockedBalance","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":48,"column":64}}},"6":{"name":"getUnlockedBalance","line":52,"loc":{"start":{"line":52,"column":4},"end":{"line":52,"column":66}}},"7":{"name":"_burn","line":57,"loc":{"start":{"line":57,"column":4},"end":{"line":66,"column":5}}},"8":{"name":"_move","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":84,"column":5}}},"9":{"name":"onlyManager","line":97,"loc":{"start":{"line":97,"column":4},"end":{"line":97,"column":24}}},"10":{"name":"requireInitialized","line":102,"loc":{"start":{"line":102,"column":4},"end":{"line":102,"column":31}}},"11":{"name":"requireNotInitialized","line":106,"loc":{"start":{"line":106,"column":4},"end":{"line":106,"column":34}}},"12":{"name":"requireNotFrozen","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":111,"column":29}}}},"statementMap":{"1":{"start":{"line":23,"column":8},"end":{"line":23,"column":60}},"2":{"start":{"line":24,"column":8},"end":{"line":24,"column":27}},"3":{"start":{"line":25,"column":8},"end":{"line":25,"column":20}},"4":{"start":{"line":35,"column":8},"end":{"line":35,"column":34}},"5":{"start":{"line":36,"column":8},"end":{"line":36,"column":21}},"6":{"start":{"line":37,"column":8},"end":{"line":37,"column":25}},"7":{"start":{"line":41,"column":8},"end":{"line":41,"column":28}},"8":{"start":{"line":45,"column":8},"end":{"line":45,"column":23}},"9":{"start":{"line":49,"column":8},"end":{"line":49,"column":48}},"10":{"start":{"line":53,"column":8},"end":{"line":53,"column":71}},"11":{"start":{"line":67,"column":8},"end":{"line":67,"column":94}},"12":{"start":{"line":68,"column":8},"end":{"line":68,"column":68}},"13":{"start":{"line":86,"column":8},"end":{"line":86,"column":2360}},"14":{"start":{"line":88,"column":12},"end":{"line":88,"column":89}},"15":{"start":{"line":91,"column":12},"end":{"line":91,"column":98}},"16":{"start":{"line":94,"column":8},"end":{"line":94,"column":77}},"17":{"start":{"line":98,"column":8},"end":{"line":98,"column":87}},"18":{"start":{"line":103,"column":8},"end":{"line":103,"column":68}},"19":{"start":{"line":107,"column":8},"end":{"line":107,"column":72}},"20":{"start":{"line":112,"column":8},"end":{"line":112,"column":80}}},"branchMap":{"1":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":8},"end":{"line":67,"column":8}},{"start":{"line":67,"column":8},"end":{"line":67,"column":8}}]},"2":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":8},"end":{"line":86,"column":8}},{"start":{"line":86,"column":8},"end":{"line":86,"column":8}}]},"3":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":12},"end":{"line":88,"column":12}},{"start":{"line":88,"column":12},"end":{"line":88,"column":12}}]},"4":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":12},"end":{"line":91,"column":12}},{"start":{"line":91,"column":12},"end":{"line":91,"column":12}}]},"5":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":8},"end":{"line":98,"column":8}},{"start":{"line":98,"column":8},"end":{"line":98,"column":8}}]},"6":{"line":103,"type":"if","locations":[{"start":{"line":103,"column":8},"end":{"line":103,"column":8}},{"start":{"line":103,"column":8},"end":{"line":103,"column":8}}]},"7":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":8},"end":{"line":107,"column":8}},{"start":{"line":107,"column":8},"end":{"line":107,"column":8}}]},"8":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":8},"end":{"line":112,"column":8}},{"start":{"line":112,"column":8},"end":{"line":112,"column":8}}]}}}} \ No newline at end of file diff --git a/output/validator.html b/output/validator.html new file mode 100644 index 0000000..7071fc4 --- /dev/null +++ b/output/validator.html @@ -0,0 +1,284 @@ + + + + + + +output/validator.log + + +
+
+> ricopoc@0.0.1 test-validator /Volumes/Dev/RICO/validator
+> scripts/run_js.sh all refresh
+
+Starting new ganache-cli instance at port 8545
+exchange neither monster ethics bless cancel ghost excite business record warfare invite
+
+--------------------------------------------------------------------
+ Running all tests in "test" folder:
+--------------------------------------------------------------------
+
+Compiling your contracts...
+===========================
+> Everything is up to date, there is nothing to compile.
+
+  ----------------------------------------------------------------
+  Step 1 - Setting up helpers and globals 
+  ---------------------------------------------------------------- 
+  ----------------------------------------------------------------
+  Step 2 - Run tests 
+  ---------------------------------------------------------------- 
+
+
+  Javascript Validator Tests
+    Integrity checking
+      Settings are assigned correctly
+        ✓ block is correct
+        ✓ commitPhaseStartBlock is correct
+        ✓ commitPhaseBlockCount is correct
+        ✓ commitPhaseEndBlock is correct
+        ✓ buyPhaseStartBlock is correct
+        ✓ buyPhaseEndBlock is correct
+        ✓ buyPhaseBlockCount is correct
+        ✓ blocksPerDay is correct
+        ✓ commitPhaseDays is correct
+        ✓ StageDays is correct
+        ✓ commitPhasePrice is 0.002
+        ✓ StagePriceIncrease is 0.0001
+      getBlockNumber()
+        ✓ returns block correctly
+      setBlockNumber()
+        ✓ sets block correctly
+    Initialization
+      stage generation
+        ✓ StageCount is correct
+        ✓ pricing increases by 10% for each stage
+    Stage Methods
+      getStageAtBlock(_blockNumber)
+        stage 0
+          ✓ should return correct stageId using startBlock
+          ✓ should return correct stageId using endBlock
+        stage 1
+          ✓ should return correct stageId using startBlock
+          ✓ should return correct stageId using endBlock
+        stage 6
+          ✓ should return correct stageId using startBlock
+          ✓ should return correct stageId using endBlock
+        last stage
+          ✓ should return correct stageId using startBlock
+          ✓ should return correct stageId using endBlock
+        1 block before 0
+          ✓ should return correct stageId using startBlock
+        1 block after last stage
+          ✓ should return 255
+    Price Methods
+      getPriceAtBlock(_blockNumber)
+        edge of commit and buy block range
+          before commitPhaseStartBlock
+            ✓ should return commitPhasePrice
+          at commitPhaseStartBlock
+            ✓ should return commitPhasePrice
+          at buyPhaseEndBlock
+            ✓ should return commitPhasePrice
+          after buyPhaseEndBlock
+            ✓ should return 0
+        first stage
+          startBlock
+            ✓ should return commitPhasePrice
+          endBlock
+            ✓ should return commitPhasePrice
+          StartBlock price and EndBlock price
+            ✓ should be higher than 0 and match
+        stage 6
+          startBlock
+            ✓ should return stage tokenPrice
+          endBlock
+            ✓ should return stage tokenPrice
+          StartBlock price and EndBlock price
+            ✓ should be higher than 0 and match
+        last stage
+          startBlock
+            ✓ should return stage tokenPrice
+          endBlock
+            ✓ should return stage tokenPrice
+          StartBlock price and EndBlock price
+            ✓ should be higher than 0 and match
+      getTokenAmountForEthAtStage()
+        1 eth
+          stage 0
+            ✓ should return 500 tokens
+          stage 1
+            ✓ should return 476.190476190476190476 tokens
+          stage 6
+            ✓ should return 384.615384615384615384 tokens
+          last stage
+            ✓ should return 312.5 tokens
+      getEthAmountForTokensAtStage()
+        1 eth worth of tokens
+          stage 0
+            ✓ should return 1 eth
+          stage 1
+            ✓ should return 1 eth minus 1 wei
+          stage 6
+            ✓ should return 1 eth minus 1 wei
+          last stage
+            ✓ should return 1 eth
+      getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precision)
+        _currentBlock in range
+          _currentBlock = 0, _startBlock = 0, _endBlock = 100
+            ✓ should return 0
+          _currentBlock = 100, _startBlock = 100, _endBlock = 200
+            ✓ should return 0
+          _currentBlock = 1, _startBlock = 0, _endBlock = 100
+            ✓ should return 0.01
+          _currentBlock = 101, _startBlock = 100, _endBlock = 200
+            ✓ should return 0.01
+          _currentBlock = 50, _startBlock = 0, _endBlock = 100
+            ✓ should return 0.5
+          _currentBlock = 100, _startBlock = 0, _endBlock = 100
+            ✓ should return 1
+        _currentBlock ouside range
+          before range => _currentBlock = 0, _startBlock = 1, _endBlock = 101
+            ✓ should return 0
+          after range => _currentBlock = 101, _startBlock = 0, _endBlock = 100
+            ✓ should return 1
+      getLockedTokensForBoughtAmountAtBlock(_tokenAmount, _blockNumber, precision) 
+        _blockNumber in range
+          _tokenAmount = 100, _blockNumber = range * 0.25
+            ✓ should return 75
+          _tokenAmount = 100, _blockNumber = range * 0.50 ( middle of the range )
+            ✓ should return 50
+          _tokenAmount = 100, _blockNumber = range * 0.75
+            ✓ should return 25
+        _blockNumber outside range
+          block before buyPhaseStartBlock
+            ✓ should return full amount
+          block after buyPhaseEndBlock
+            ✓ should return 0
+      getUnockedTokensForBoughtAmountAtBlock(_tokenAmount, _blockNumber, precision) 
+        _blockNumber in range
+          _tokenAmount = 100, _blockNumber = range * 0.25
+            ✓ should return 25
+          _tokenAmount = 100, _blockNumber = range * 0.50 ( middle of the range )
+            ✓ should return 50
+          _tokenAmount = 100, _blockNumber = range * 0.75
+            ✓ should return 75
+        _blockNumber outside range
+          block before buyPhaseStartBlock
+            ✓ should return 0
+          block after buyPhaseEndBlock
+            ✓ should return full amount
+
+  Javascript Contract Tests
+    Setup
+      TokenContractInstance
+        ✓ Deployer has correct balance
+        ✓ rICO Contract has correct balance
+    commit()
+      Participant 1 - commits 1 eth
+        Contract State changes after first contribution by a Participant
+          ✓ Contract.participantsById indexes the participant id => address
+          ✓ Contract.participantCount increases by 1
+          ParticipantRecord
+            ✓ ParticipantRecord.contributionsCount is 1
+        State changes after a new contribution
+          ✓ Contract.totalReceivedETH increases by commited value
+          ParticipantRecord
+            ✓ ParticipantRecord contribution count increases by 1
+            ✓ ParticipantRecord.totalReceivedETH increases by commited value
+            ✓ participantRecord.reservedTokens increases by getTokenAmountForEthAtStage(value)
+            ParticipantRecord.byStage[currentStage] = byStage
+              ✓ byStage.totalReceivedETH increases by commited value
+              ✓ byStage.reservedTokens increases by getTokenAmountForEthAtStage(value)
+      Participant 1 - commits 1 eth - second time
+        Contract State changes after contribution from existing Participant
+          ✓ Contract.participantCount does not change
+        State changes after a new contribution
+          ✓ Contract.totalReceivedETH increases by commited value
+          ParticipantRecord
+            ✓ ParticipantRecord contribution count increases by 1
+            ✓ ParticipantRecord.totalReceivedETH increases by commited value
+            ✓ participantRecord.reservedTokens increases by getTokenAmountForEthAtStage(value)
+            ParticipantRecord.byStage[currentStage] = byStage
+              ✓ byStage.totalReceivedETH increases by commited value
+              ✓ byStage.reservedTokens increases by getTokenAmountForEthAtStage(value)
+      Participant 1 - commits 1 eth - third time
+        Contract State changes after contribution from existing Participant
+          ✓ Contract.participantCount does not change
+        State changes after a new contribution
+          ✓ Contract.totalReceivedETH increases by commited value
+          ParticipantRecord
+            ✓ ParticipantRecord contribution count increases by 1
+            ✓ ParticipantRecord.totalReceivedETH increases by commited value
+            ✓ participantRecord.reservedTokens increases by getTokenAmountForEthAtStage(value)
+            ParticipantRecord.byStage[currentStage] = byStage
+              ✓ byStage.totalReceivedETH increases by commited value
+              ✓ byStage.reservedTokens increases by getTokenAmountForEthAtStage(value)
+      Participant 2 - commits 1 eth
+        ✓ Contract.participantCount is 2
+        Contract State changes after first contribution by a Participant
+          ✓ Contract.participantsById indexes the participant id => address
+          ✓ Contract.participantCount increases by 1
+          ParticipantRecord
+            ✓ ParticipantRecord.contributionsCount is 1
+        State changes after a new contribution
+          ✓ Contract.totalReceivedETH increases by commited value
+          ParticipantRecord
+            ✓ ParticipantRecord contribution count increases by 1
+            ✓ ParticipantRecord.totalReceivedETH increases by commited value
+            ✓ participantRecord.reservedTokens increases by getTokenAmountForEthAtStage(value)
+            ParticipantRecord.byStage[currentStage] = byStage
+              ✓ byStage.totalReceivedETH increases by commited value
+              ✓ byStage.reservedTokens increases by getTokenAmountForEthAtStage(value)
+    whitelist()
+      Scenario: Participant 1 gets whitelisted then contributes
+        Participant 1 gets whitelisted
+          ParticipantRecord
+            ✓ ParticipantRecord.whitelisted is now: true
+        Participant 1 - commits 1 eth
+          Contract State changes after first contribution by a Participant
+            ✓ Contract.participantsById indexes the participant id => address
+            ✓ Contract.participantCount increases by 1
+            ParticipantRecord
+              ✓ ParticipantRecord.contributionsCount is 1
+          State changes after a new contribution
+            ✓ Contract.totalReceivedETH increases by commited value
+            ParticipantRecord
+              ✓ ParticipantRecord contribution count increases by 1
+              ✓ ParticipantRecord.totalReceivedETH increases by commited value
+              ✓ participantRecord.reservedTokens is 0
+              ParticipantRecord.byStage[currentStage] = byStage
+                ✓ byStage.totalReceivedETH increases by commited value
+                ✓ byStage.reservedTokens is 0
+      Scenario: Participant 1 contributes then gets rejected
+        Participant 1 - commits 1 eth
+          Contract State changes after first contribution by a Participant
+            ✓ Contract.participantsById indexes the participant id => address
+            ✓ Contract.participantCount increases by 1
+            ParticipantRecord
+              ✓ ParticipantRecord.contributionsCount is 1
+          State changes after a new contribution
+            ✓ Contract.totalReceivedETH increases by commited value
+            ParticipantRecord
+              ✓ ParticipantRecord contribution count increases by 1
+              ✓ ParticipantRecord.totalReceivedETH increases by commited value
+              ✓ participantRecord.reservedTokens increases by getTokenAmountForEthAtStage(value)
+              ParticipantRecord.byStage[currentStage] = byStage
+                ✓ byStage.totalReceivedETH increases by commited value
+                ✓ byStage.reservedTokens increases by getTokenAmountForEthAtStage(value)
+        Participant 1 gets rejected
+          ParticipantRecord
+            ✓ ParticipantRecord.whitelisted is now: false
+
+
+  120 passing (82ms)
+
+Done
+--------------------------------------------------------------------
+
+Killing existing ganache-cli instance at pid 20811.
+
+
+ + diff --git a/output/validator.log b/output/validator.log new file mode 100644 index 0000000..82483d8 --- /dev/null +++ b/output/validator.log @@ -0,0 +1,271 @@ + +> ricopoc@0.0.1 test-validator /Volumes/Dev/RICO/validator +> scripts/run_js.sh all refresh + +Starting new ganache-cli instance at port 8545 +exchange neither monster ethics bless cancel ghost excite business record warfare invite + +-------------------------------------------------------------------- + Running all tests in "test" folder: +-------------------------------------------------------------------- + +Compiling your contracts... +=========================== +> Everything is up to date, there is nothing to compile. + + ---------------------------------------------------------------- + Step 1 - Setting up helpers and globals + ----------------------------------------------------------------  + ---------------------------------------------------------------- + Step 2 - Run tests + ----------------------------------------------------------------  + + + Javascript Validator Tests + Integrity checking + Settings are assigned correctly +  ✓ block is correct +  ✓ commitPhaseStartBlock is correct +  ✓ commitPhaseBlockCount is correct +  ✓ commitPhaseEndBlock is correct +  ✓ buyPhaseStartBlock is correct +  ✓ buyPhaseEndBlock is correct +  ✓ buyPhaseBlockCount is correct +  ✓ blocksPerDay is correct +  ✓ commitPhaseDays is correct +  ✓ StageDays is correct +  ✓ commitPhasePrice is 0.002 +  ✓ StagePriceIncrease is 0.0001 + getBlockNumber() +  ✓ returns block correctly + setBlockNumber() +  ✓ sets block correctly + Initialization + stage generation +  ✓ StageCount is correct +  ✓ pricing increases by 10% for each stage + Stage Methods + getStageAtBlock(_blockNumber) + stage 0 +  ✓ should return correct stageId using startBlock +  ✓ should return correct stageId using endBlock + stage 1 +  ✓ should return correct stageId using startBlock +  ✓ should return correct stageId using endBlock + stage 6 +  ✓ should return correct stageId using startBlock +  ✓ should return correct stageId using endBlock + last stage +  ✓ should return correct stageId using startBlock +  ✓ should return correct stageId using endBlock + 1 block before 0 +  ✓ should return correct stageId using startBlock + 1 block after last stage +  ✓ should return 255 + Price Methods + getPriceAtBlock(_blockNumber) + edge of commit and buy block range + before commitPhaseStartBlock +  ✓ should return commitPhasePrice + at commitPhaseStartBlock +  ✓ should return commitPhasePrice + at buyPhaseEndBlock +  ✓ should return commitPhasePrice + after buyPhaseEndBlock +  ✓ should return 0 + first stage + startBlock +  ✓ should return commitPhasePrice + endBlock +  ✓ should return commitPhasePrice + StartBlock price and EndBlock price +  ✓ should be higher than 0 and match + stage 6 + startBlock +  ✓ should return stage tokenPrice + endBlock +  ✓ should return stage tokenPrice + StartBlock price and EndBlock price +  ✓ should be higher than 0 and match + last stage + startBlock +  ✓ should return stage tokenPrice + endBlock +  ✓ should return stage tokenPrice + StartBlock price and EndBlock price +  ✓ should be higher than 0 and match + getTokenAmountForEthAtStage() + 1 eth + stage 0 +  ✓ should return 500 tokens + stage 1 +  ✓ should return 476.190476190476190476 tokens + stage 6 +  ✓ should return 384.615384615384615384 tokens + last stage +  ✓ should return 312.5 tokens + getEthAmountForTokensAtStage() + 1 eth worth of tokens + stage 0 +  ✓ should return 1 eth + stage 1 +  ✓ should return 1 eth minus 1 wei + stage 6 +  ✓ should return 1 eth minus 1 wei + last stage +  ✓ should return 1 eth + getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precision) + _currentBlock in range + _currentBlock = 0, _startBlock = 0, _endBlock = 100 +  ✓ should return 0 + _currentBlock = 100, _startBlock = 100, _endBlock = 200 +  ✓ should return 0 + _currentBlock = 1, _startBlock = 0, _endBlock = 100 +  ✓ should return 0.01 + _currentBlock = 101, _startBlock = 100, _endBlock = 200 +  ✓ should return 0.01 + _currentBlock = 50, _startBlock = 0, _endBlock = 100 +  ✓ should return 0.5 + _currentBlock = 100, _startBlock = 0, _endBlock = 100 +  ✓ should return 1 + _currentBlock ouside range + before range => _currentBlock = 0, _startBlock = 1, _endBlock = 101 +  ✓ should return 0 + after range => _currentBlock = 101, _startBlock = 0, _endBlock = 100 +  ✓ should return 1 + getLockedTokensForBoughtAmountAtBlock(_tokenAmount, _blockNumber, precision)  + _blockNumber in range + _tokenAmount = 100, _blockNumber = range * 0.25 +  ✓ should return 75 + _tokenAmount = 100, _blockNumber = range * 0.50 ( middle of the range ) +  ✓ should return 50 + _tokenAmount = 100, _blockNumber = range * 0.75 +  ✓ should return 25 + _blockNumber outside range + block before buyPhaseStartBlock +  ✓ should return full amount + block after buyPhaseEndBlock +  ✓ should return 0 + getUnockedTokensForBoughtAmountAtBlock(_tokenAmount, _blockNumber, precision)  + _blockNumber in range + _tokenAmount = 100, _blockNumber = range * 0.25 +  ✓ should return 25 + _tokenAmount = 100, _blockNumber = range * 0.50 ( middle of the range ) +  ✓ should return 50 + _tokenAmount = 100, _blockNumber = range * 0.75 +  ✓ should return 75 + _blockNumber outside range + block before buyPhaseStartBlock +  ✓ should return 0 + block after buyPhaseEndBlock +  ✓ should return full amount + + Javascript Contract Tests + Setup + TokenContractInstance +  ✓ Deployer has correct balance +  ✓ rICO Contract has correct balance + commit() + Participant 1 - commits 1 eth + Contract State changes after first contribution by a Participant +  ✓ Contract.participantsById indexes the participant id => address +  ✓ Contract.participantCount increases by 1 + ParticipantRecord +  ✓ ParticipantRecord.contributionsCount is 1 + State changes after a new contribution +  ✓ Contract.totalReceivedETH increases by commited value + ParticipantRecord +  ✓ ParticipantRecord contribution count increases by 1 +  ✓ ParticipantRecord.totalReceivedETH increases by commited value +  ✓ participantRecord.reservedTokens increases by getTokenAmountForEthAtStage(value) + ParticipantRecord.byStage[currentStage] = byStage +  ✓ byStage.totalReceivedETH increases by commited value +  ✓ byStage.reservedTokens increases by getTokenAmountForEthAtStage(value) + Participant 1 - commits 1 eth - second time + Contract State changes after contribution from existing Participant +  ✓ Contract.participantCount does not change + State changes after a new contribution +  ✓ Contract.totalReceivedETH increases by commited value + ParticipantRecord +  ✓ ParticipantRecord contribution count increases by 1 +  ✓ ParticipantRecord.totalReceivedETH increases by commited value +  ✓ participantRecord.reservedTokens increases by getTokenAmountForEthAtStage(value) + ParticipantRecord.byStage[currentStage] = byStage +  ✓ byStage.totalReceivedETH increases by commited value +  ✓ byStage.reservedTokens increases by getTokenAmountForEthAtStage(value) + Participant 1 - commits 1 eth - third time + Contract State changes after contribution from existing Participant +  ✓ Contract.participantCount does not change + State changes after a new contribution +  ✓ Contract.totalReceivedETH increases by commited value + ParticipantRecord +  ✓ ParticipantRecord contribution count increases by 1 +  ✓ ParticipantRecord.totalReceivedETH increases by commited value +  ✓ participantRecord.reservedTokens increases by getTokenAmountForEthAtStage(value) + ParticipantRecord.byStage[currentStage] = byStage +  ✓ byStage.totalReceivedETH increases by commited value +  ✓ byStage.reservedTokens increases by getTokenAmountForEthAtStage(value) + Participant 2 - commits 1 eth +  ✓ Contract.participantCount is 2 + Contract State changes after first contribution by a Participant +  ✓ Contract.participantsById indexes the participant id => address +  ✓ Contract.participantCount increases by 1 + ParticipantRecord +  ✓ ParticipantRecord.contributionsCount is 1 + State changes after a new contribution +  ✓ Contract.totalReceivedETH increases by commited value + ParticipantRecord +  ✓ ParticipantRecord contribution count increases by 1 +  ✓ ParticipantRecord.totalReceivedETH increases by commited value +  ✓ participantRecord.reservedTokens increases by getTokenAmountForEthAtStage(value) + ParticipantRecord.byStage[currentStage] = byStage +  ✓ byStage.totalReceivedETH increases by commited value +  ✓ byStage.reservedTokens increases by getTokenAmountForEthAtStage(value) + whitelist() + Scenario: Participant 1 gets whitelisted then contributes + Participant 1 gets whitelisted + ParticipantRecord +  ✓ ParticipantRecord.whitelisted is now: true + Participant 1 - commits 1 eth + Contract State changes after first contribution by a Participant +  ✓ Contract.participantsById indexes the participant id => address +  ✓ Contract.participantCount increases by 1 + ParticipantRecord +  ✓ ParticipantRecord.contributionsCount is 1 + State changes after a new contribution +  ✓ Contract.totalReceivedETH increases by commited value + ParticipantRecord +  ✓ ParticipantRecord contribution count increases by 1 +  ✓ ParticipantRecord.totalReceivedETH increases by commited value +  ✓ participantRecord.reservedTokens is 0 + ParticipantRecord.byStage[currentStage] = byStage +  ✓ byStage.totalReceivedETH increases by commited value +  ✓ byStage.reservedTokens is 0 + Scenario: Participant 1 contributes then gets rejected + Participant 1 - commits 1 eth + Contract State changes after first contribution by a Participant +  ✓ Contract.participantsById indexes the participant id => address +  ✓ Contract.participantCount increases by 1 + ParticipantRecord +  ✓ ParticipantRecord.contributionsCount is 1 + State changes after a new contribution +  ✓ Contract.totalReceivedETH increases by commited value + ParticipantRecord +  ✓ ParticipantRecord contribution count increases by 1 +  ✓ ParticipantRecord.totalReceivedETH increases by commited value +  ✓ participantRecord.reservedTokens increases by getTokenAmountForEthAtStage(value) + ParticipantRecord.byStage[currentStage] = byStage +  ✓ byStage.totalReceivedETH increases by commited value +  ✓ byStage.reservedTokens increases by getTokenAmountForEthAtStage(value) + Participant 1 gets rejected + ParticipantRecord +  ✓ ParticipantRecord.whitelisted is now: false + + +  120 passing (82ms) + +Done +-------------------------------------------------------------------- + +Killing existing ganache-cli instance at pid 20811. + diff --git a/package-lock.json b/package-lock.json index 21e6ea0..32f8bd6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,25 +5,24 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", "dev": true, "requires": { - "@babel/highlight": "^7.0.0" + "@babel/highlight": "7.5.0" } }, "@babel/generator": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.0.tgz", - "integrity": "sha512-1TTVrt7J9rcG5PMjvO7VEG3FrEoEJNHxumRq66GemPmzboLWtIjjcJgk8rokuAS7IiRSpgVSu5Vb9lc99iJkOA==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.7.tgz", + "integrity": "sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ==", "dev": true, "requires": { - "@babel/types": "^7.5.0", - "jsesc": "^2.5.1", - "lodash": "^4.17.11", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" + "@babel/types": "7.7.4", + "jsesc": "2.5.2", + "lodash": "4.17.15", + "source-map": "0.5.7" }, "dependencies": { "source-map": { @@ -35,32 +34,32 @@ } }, "@babel/helper-function-name": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", - "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", + "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.0.0", - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/helper-get-function-arity": "7.7.4", + "@babel/template": "7.7.4", + "@babel/types": "7.7.4" } }, "@babel/helper-get-function-arity": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", - "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", + "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "7.7.4" } }, "@babel/helper-split-export-declaration": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", - "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", + "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", "dev": true, "requires": { - "@babel/types": "^7.4.4" + "@babel/types": "7.7.4" } }, "@babel/highlight": { @@ -69,79 +68,62 @@ "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", "dev": true, "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" + "chalk": "2.4.2", + "esutils": "2.0.3", + "js-tokens": "4.0.0" } }, "@babel/parser": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.0.tgz", - "integrity": "sha512-I5nW8AhGpOXGCCNYGc+p7ExQIBxRFnS2fd/d862bNOKvmoEPjYPcfIjsfdy0ujagYOIYPczKgD9l3FsgTkAzKA==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", + "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", "dev": true }, "@babel/runtime": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.5.5.tgz", - "integrity": "sha512-28QvEGyQyNkB0/m2B4FU7IEZGK2NUrcMtT6BZEFALTguLk+AUT6ofsHtPk5QyjAdUkpMJ+/Em+quwz4HOt30AQ==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.7.tgz", + "integrity": "sha512-uCnC2JEVAu8AKB5do1WRIsvrdJ0flYx/A/9f/6chdacnEZ7LmavjdsDXr5ksYBegxtuTPR5Va9/+13QF/kFkCA==", "requires": { - "regenerator-runtime": "^0.13.2" + "regenerator-runtime": "0.13.3" } }, "@babel/template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", - "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", + "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.4.4", - "@babel/types": "^7.4.4" + "@babel/code-frame": "7.5.5", + "@babel/parser": "7.7.7", + "@babel/types": "7.7.4" } }, "@babel/traverse": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.0.tgz", - "integrity": "sha512-SnA9aLbyOCcnnbQEGwdfBggnc142h/rbqqsXcaATj2hZcegCl903pUD/lfpsNBlBSuWow/YDfRyJuWi2EPR5cg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", + "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.5.0", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.5.0", - "@babel/types": "^7.5.0", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.11" - }, - "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 - } + "@babel/code-frame": "7.5.5", + "@babel/generator": "7.7.7", + "@babel/helper-function-name": "7.7.4", + "@babel/helper-split-export-declaration": "7.7.4", + "@babel/parser": "7.7.7", + "@babel/types": "7.7.4", + "debug": "4.1.1", + "globals": "11.12.0", + "lodash": "4.17.15" } }, "@babel/types": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.0.tgz", - "integrity": "sha512-UFpDVqRABKsW01bvw7/wSUe56uy6RXM5+VJibVVAybDGxEW25jdwiFJEf7ASvSaC7sN7rbE/l3cLp2izav+CtQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.11", - "to-fast-properties": "^2.0.0" + "esutils": "2.0.3", + "lodash": "4.17.15", + "to-fast-properties": "2.0.0" } }, "@sindresorhus/is": { @@ -154,21 +136,41 @@ "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", "requires": { - "defer-to-connect": "^1.0.1" + "defer-to-connect": "1.1.1" + } + }, + "@truffle/blockchain-utils": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.0.11.tgz", + "integrity": "sha512-9MyQ/20M96clhIcC7fVFIckGSB8qMsmcdU6iYt98HXJ9GOLNKsCaJFz1OVsJncVreYwTUhoEXTrVBc8zrmPDJQ==" + }, + "@truffle/contract-schema": { + "version": "3.0.20", + "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.0.20.tgz", + "integrity": "sha512-n4Q+EJWyovUdsd9+XCSzjsHilIXveozIMAJ127yqG2ihAfnqbFdLC98YFSkJiXg4SZZQNKZzZzLDEctz8Ik9Ag==", + "requires": { + "ajv": "6.10.2", + "crypto-js": "3.1.9-1", + "debug": "4.1.1" } }, + "@truffle/error": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.6.tgz", + "integrity": "sha512-QUM9ZWiwlXGixFGpV18g5I6vua6/r+ZV9W/5DQA5go9A3eZUNPHPaTKMIQPJLYn6+ZV5jg5H28zCHq56LHF3yA==" + }, "@types/bn.js": { "version": "4.11.5", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.5.tgz", "integrity": "sha512-AEAZcIZga0JgVMHNtl1CprA/hXX7/wPt79AgR4XqaDt7jyj3QWYw6LPoOiznPtugDmlubUnAahMs2PFxGcQrng==", "requires": { - "@types/node": "*" + "@types/node": "12.12.21" } }, "@types/chai": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.7.tgz", - "integrity": "sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA==", + "version": "4.2.7", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.7.tgz", + "integrity": "sha512-luq8meHGYwvky0O7u0eQZdA7B4Wd9owUCqvbw2m3XCrCU8mplYOujMBbvyS547AxJkC+pGnd0Cm15eNxEUNU8g==", "dev": true }, "@types/json5": { @@ -184,17 +186,17 @@ "dev": true }, "@types/node": { - "version": "12.6.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.6.3.tgz", - "integrity": "sha512-7TEYTQT1/6PP53NftXXabIZDaZfaoBdeBm8Md/i7zsWRoBe0YwOXguyK8vhHs8ehgB/w9U4K/6EWuTyp0W6nIA==" + "version": "12.12.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.21.tgz", + "integrity": "sha512-8sRGhbpU+ck1n0PGAUgVrWrWdjSW2aqNeyC15W88GRsMpSwzv6RJGlLhE7s2RhVSOdyDmxbqlWSeThq4/7xqlA==" }, "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" + "jsonparse": "1.3.1", + "through": "2.3.8" } }, "abbrev": { @@ -207,7 +209,7 @@ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", "requires": { - "mime-types": "~2.1.24", + "mime-types": "2.1.25", "negotiator": "0.6.2" } }, @@ -221,7 +223,7 @@ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", "requires": { - "es6-promisify": "^5.0.0" + "es6-promisify": "5.0.0" } }, "agentkeepalive": { @@ -229,7 +231,7 @@ "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", "requires": { - "humanize-ms": "^1.2.1" + "humanize-ms": "1.2.1" } }, "ajv": { @@ -237,10 +239,10 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", "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" + "fast-deep-equal": "2.0.1", + "fast-json-stable-stringify": "2.1.0", + "json-schema-traverse": "0.4.1", + "uri-js": "4.2.2" } }, "amdefine": { @@ -254,104 +256,44 @@ "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", "requires": { - "string-width": "^3.0.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==" - }, - "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=" - }, - "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" - } - } + "string-width": "3.1.0" } }, "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==" - }, - "ansi-gray": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", - "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", - "requires": { - "ansi-wrap": "0.1.0" - } + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==" }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" }, "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" + "color-convert": "1.9.3" } }, - "ansi-wrap": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", - "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=" - }, "any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.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=" }, - "append-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", - "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", - "requires": { - "buffer-equal": "^1.0.0" - } - }, "append-transform": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", "dev": true, "requires": { - "default-require-extensions": "^2.0.0" + "default-require-extensions": "2.0.0" } }, "aproba": { @@ -362,115 +304,22 @@ "archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=" + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "requires": { - "sprintf-js": "~1.0.2" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" - }, - "arr-filter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", - "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", - "requires": { - "make-iterator": "^1.0.0" - } - }, - "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==" - }, - "arr-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", - "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", - "requires": { - "make-iterator": "^1.0.0" + "sprintf-js": "1.0.3" } }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" - }, - "array-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", - "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=" - }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, - "array-initial": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", - "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", - "requires": { - "array-slice": "^1.0.0", - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" - } - } - }, - "array-last": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", - "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", - "requires": { - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" - } - } - }, - "array-slice": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", - "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==" - }, - "array-sort": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", - "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", - "requires": { - "default-compare": "^1.0.0", - "get-value": "^2.0.6", - "kind-of": "^5.0.2" - }, - "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==" - } - } - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" - }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -481,7 +330,7 @@ "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "requires": { - "safer-buffer": "~2.1.0" + "safer-buffer": "2.1.2" } }, "asn1.js": { @@ -489,9 +338,9 @@ "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" + "bn.js": "4.11.8", + "inherits": "2.0.4", + "minimalistic-assert": "1.0.1" } }, "assert-plus": { @@ -504,156 +353,56 @@ "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=" - }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" }, - "async-done": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", - "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.2", - "process-nextick-args": "^2.0.0", - "stream-exhaust": "^1.0.1" - } - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==" - }, "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==" - }, - "async-settle": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", - "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", - "requires": { - "async-done": "^1.2.2" - } + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" }, "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==" - }, "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==" - }, - "bach": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", - "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", - "requires": { - "arr-filter": "^1.1.1", - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "array-each": "^1.0.0", - "array-initial": "^1.0.0", - "array-last": "^1.1.1", - "async-done": "^1.2.2", - "async-settle": "^1.0.0", - "now-and-later": "^2.0.0" - } + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.0.tgz", + "integrity": "sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==" }, "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==", - "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=", - "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==", - "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==", - "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==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, "base-x": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.7.tgz", "integrity": "sha512-zAKJGuQPihXW22fkrfOclUUZXM2g92z5GzlSMHxhO6r6Qj+Nm0ccaGNBzDZojzwOMkpjAv4J0fOv1U4go+a4iw==", "dev": true, "requires": { - "safe-buffer": "^5.0.1" + "safe-buffer": "5.2.0" } }, "base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, "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" + "tweetnacl": "0.14.5" } }, "bignumber.js": { @@ -661,11 +410,6 @@ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==" }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" - }, "bindings": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", @@ -679,7 +423,7 @@ "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", "requires": { - "safe-buffer": "^5.0.1" + "safe-buffer": "5.2.0" } }, "bitcore-lib": { @@ -688,12 +432,12 @@ "integrity": "sha512-YyzpyKtwBIeOUu55oqltfk3/Uz8SYi1ayWq3JnaoGSzR4BNpD54sYejv2gZ5TuDe4KwBqvA2C5X1zkPBtlkGhQ==", "dev": true, "requires": { - "bn.js": "=4.11.8", - "bs58": "^4.0.1", - "buffer-compare": "=1.1.1", - "elliptic": "=6.4.0", - "inherits": "=2.0.1", - "lodash": "=4.17.11" + "bn.js": "4.11.8", + "bs58": "4.0.1", + "buffer-compare": "1.1.1", + "elliptic": "6.4.0", + "inherits": "2.0.1", + "lodash": "4.17.11" }, "dependencies": { "elliptic": { @@ -702,13 +446,13 @@ "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", "dev": true, "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.7", + "hmac-drbg": "1.0.1", + "inherits": "2.0.1", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" } }, "inherits": { @@ -731,8 +475,8 @@ "integrity": "sha512-F9R+PKN6m8jDikmNbuD7yp47vdyWcNYGdu9jokiNW46VOm5E+HJM41BiIJdUIVeY9mf+U8T7URq6Knr985NVTg==", "dev": true, "requires": { - "bitcore-lib": "^8.1.1", - "unorm": "^1.4.1" + "bitcore-lib": "8.1.1", + "unorm": "1.6.0" } }, "bl": { @@ -740,8 +484,8 @@ "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" + "readable-stream": "2.3.6", + "safe-buffer": "5.2.0" } }, "block-stream": { @@ -749,13 +493,13 @@ "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", "requires": { - "inherits": "~2.0.0" + "inherits": "2.0.4" } }, "bluebird": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", - "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==" + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, "bn.js": { "version": "4.11.8", @@ -768,15 +512,15 @@ "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", "requires": { "bytes": "3.1.0", - "content-type": "~1.0.4", + "content-type": "1.0.4", "debug": "2.6.9", - "depd": "~1.1.2", + "depd": "1.1.2", "http-errors": "1.7.2", "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", + "on-finished": "2.3.0", "qs": "6.7.0", "raw-body": "2.4.0", - "type-is": "~1.6.17" + "type-is": "1.6.18" }, "dependencies": { "debug": { @@ -786,6 +530,11 @@ "requires": { "ms": "2.0.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" } } }, @@ -794,49 +543,14 @@ "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" - }, - "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==" - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" - }, - "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=" - }, - "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" - } - } + "ansi-align": "3.0.0", + "camelcase": "5.3.1", + "chalk": "2.4.2", + "cli-boxes": "2.2.0", + "string-width": "3.1.0", + "term-size": "1.2.0", + "type-fest": "0.3.1", + "widest-line": "2.0.1" } }, "brace-expansion": { @@ -844,37 +558,10 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "balanced-match": "^1.0.0", + "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==", - "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=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", @@ -883,20 +570,19 @@ "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==", - "dev": true + "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" + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "evp_bytestokey": "1.0.3", + "inherits": "2.0.4", + "safe-buffer": "5.2.0" } }, "browserify-cipher": { @@ -904,9 +590,9 @@ "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" + "browserify-aes": "1.2.0", + "browserify-des": "1.0.2", + "evp_bytestokey": "1.0.3" } }, "browserify-des": { @@ -914,10 +600,10 @@ "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" + "cipher-base": "1.0.4", + "des.js": "1.0.1", + "inherits": "2.0.4", + "safe-buffer": "5.2.0" } }, "browserify-rsa": { @@ -925,8 +611,8 @@ "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" + "bn.js": "4.11.8", + "randombytes": "2.1.0" } }, "browserify-sha3": { @@ -934,8 +620,15 @@ "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.4.tgz", "integrity": "sha1-CGxHuMgjFsnUcCLCYYWVRXbdjiY=", "requires": { - "js-sha3": "^0.6.1", - "safe-buffer": "^5.1.1" + "js-sha3": "0.6.1", + "safe-buffer": "5.2.0" + }, + "dependencies": { + "js-sha3": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", + "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" + } } }, "browserify-sign": { @@ -943,13 +636,13 @@ "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", "requires": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "elliptic": "6.5.2", + "inherits": "2.0.4", + "parse-asn1": "5.1.5" } }, "bs58": { @@ -958,16 +651,16 @@ "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", "dev": true, "requires": { - "base-x": "^3.0.2" + "base-x": "3.0.7" } }, "buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz", + "integrity": "sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==", "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" + "base64-js": "1.3.1", + "ieee754": "1.1.13" } }, "buffer-alloc": { @@ -975,8 +668,8 @@ "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": "1.1.0", + "buffer-fill": "1.0.0" } }, "buffer-alloc-unsafe": { @@ -995,11 +688,6 @@ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" }, - "buffer-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", - "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=" - }, "buffer-fill": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", @@ -1031,74 +719,25 @@ "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" }, "cacache": { - "version": "12.0.2", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.2.tgz", - "integrity": "sha512-ifKgxH2CKhJEg6tNdAwziu6Q33EvuG26tYcda6PT3WKisZcYDXsnEdnRv67Po3yCzFfaSoMjGZzJyD2c3DT1dg==", - "requires": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "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==", - "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" + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.3.tgz", + "integrity": "sha512-kqdmfXEGFepesTuROHMs3MpFLWrPkSSpRqOw80RCflZXy/khxaArvFrQ7uJxSUduzAufc6G0g1VUCOZXxWavPw==", + "requires": { + "bluebird": "3.7.2", + "chownr": "1.1.3", + "figgy-pudding": "3.5.1", + "glob": "7.1.6", + "graceful-fs": "4.2.3", + "infer-owner": "1.0.4", + "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.7.1", + "ssri": "6.0.1", + "unique-filename": "1.1.1", + "y18n": "4.0.0" } }, "cacheable-request": { @@ -1106,13 +745,13 @@ "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" + "clone-response": "1.0.2", + "get-stream": "5.1.0", + "http-cache-semantics": "4.0.3", + "keyv": "3.1.0", + "lowercase-keys": "2.0.0", + "normalize-url": "4.5.0", + "responselike": "1.0.2" }, "dependencies": { "get-stream": { @@ -1120,14 +759,9 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", "requires": { - "pump": "^3.0.0" + "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", @@ -1141,16 +775,34 @@ "integrity": "sha512-Mtgcv3lh3U0zRii/6qVgQODdPA4G3zhG+jtbCWj39RXuUFTMzH0vcdMtaJS1jPowd+It2Pqr6y3NJMQqOqCE2w==", "dev": true, "requires": { - "hasha": "^3.0.0", - "make-dir": "^2.0.0", - "package-hash": "^3.0.0", - "write-file-atomic": "^2.4.2" + "hasha": "3.0.0", + "make-dir": "2.1.0", + "package-hash": "3.0.0", + "write-file-atomic": "2.4.3" + }, + "dependencies": { + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "4.0.1", + "semver": "5.7.1" + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } } }, "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, "caseless": { "version": "0.12.0", @@ -1162,12 +814,12 @@ "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" + "assertion-error": "1.1.0", + "check-error": "1.0.2", + "deep-eql": "3.0.1", + "get-func-name": "2.0.0", + "pathval": "1.1.0", + "type-detect": "4.0.8" } }, "chai-bn": { @@ -1180,9 +832,9 @@ "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" + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.5.0" }, "dependencies": { "has-flag": { @@ -1195,7 +847,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "requires": { - "has-flag": "^3.0.0" + "has-flag": "3.0.0" } } } @@ -1205,36 +857,10 @@ "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=" }, - "chokidar": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", - "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", - "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": { - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" - } - } - }, "chownr": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz", - "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==" + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.3.tgz", + "integrity": "sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==" }, "ci-info": { "version": "2.0.0", @@ -1251,29 +877,8 @@ "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "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=", - "requires": { - "is-descriptor": "^0.1.0" - } - } + "inherits": "2.0.4", + "safe-buffer": "5.2.0" } }, "cli-boxes": { @@ -1281,55 +886,50 @@ "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.0.tgz", "integrity": "sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w==" }, - "cli-table": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.1.tgz", - "integrity": "sha1-9TsFJmqLGguTSz0IIebi3FkUriM=", - "requires": { - "colors": "1.0.3" - } + "cli-color": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-1.4.0.tgz", + "integrity": "sha512-xu6RvQqqrWEo6MPR1eixqGPywhYBHRs653F9jfXB2Hx4jdM/3WxiNE1vppRmxtMIfl16SFYTpYlrnqH/HsK/2w==", + "requires": { + "ansi-regex": "2.1.1", + "d": "1.0.1", + "es5-ext": "0.10.53", + "es6-iterator": "2.0.3", + "memoizee": "0.4.14", + "timers-ext": "0.1.7" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + } + } }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "cli-table": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.1.tgz", + "integrity": "sha1-9TsFJmqLGguTSz0IIebi3FkUriM=", "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" + "colors": "1.0.3" } }, - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=" - }, - "clone-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", - "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=" + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "requires": { + "string-width": "3.1.0", + "strip-ansi": "5.2.0", + "wrap-ansi": "5.1.0" + } }, "clone-response": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", "requires": { - "mimic-response": "^1.0.0" - } - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=" - }, - "cloneable-readable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", - "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", - "requires": { - "inherits": "^2.0.1", - "process-nextick-args": "^2.0.0", - "readable-stream": "^2.3.5" + "mimic-response": "1.0.1" } }, "code-point-at": { @@ -1337,25 +937,6 @@ "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, - "collection-map": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", - "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", - "requires": { - "arr-map": "^2.0.2", - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -1369,11 +950,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, - "color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" - }, "colors": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", @@ -1384,7 +960,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "requires": { - "delayed-stream": "~1.0.0" + "delayed-stream": "1.0.0" } }, "command-exists": { @@ -1393,9 +969,12 @@ "integrity": "sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw==" }, "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", + "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", + "requires": { + "graceful-readlink": "1.0.1" + } }, "commondir": { "version": "1.0.1", @@ -1403,11 +982,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1418,10 +992,10 @@ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" + "buffer-from": "1.1.1", + "inherits": "2.0.4", + "readable-stream": "2.3.6", + "typedarray": "0.0.6" } }, "configstore": { @@ -1429,27 +1003,12 @@ "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" - }, - "dependencies": { - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "requires": { - "pify": "^3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - } + "dot-prop": "4.2.0", + "graceful-fs": "4.2.3", + "make-dir": "1.3.0", + "unique-string": "1.0.0", + "write-file-atomic": "2.4.3", + "xdg-basedir": "3.0.0" } }, "content-disposition": { @@ -1473,17 +1032,19 @@ "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" }, "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, "requires": { - "safe-buffer": "~5.1.1" + "safe-buffer": "5.1.2" }, "dependencies": { "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==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true } } }, @@ -1507,26 +1068,12 @@ "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", "requires": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" - }, - "copy-props": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.4.tgz", - "integrity": "sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==", - "requires": { - "each-props": "^1.3.0", - "is-plain-object": "^2.0.1" + "aproba": "1.2.0", + "fs-write-stream-atomic": "1.0.10", + "iferr": "0.1.5", + "mkdirp": "0.5.1", + "rimraf": "2.7.1", + "run-queue": "1.0.3" } }, "core-util-is": { @@ -1539,8 +1086,8 @@ "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "requires": { - "object-assign": "^4", - "vary": "^1" + "object-assign": "4.1.1", + "vary": "1.1.2" } }, "cp-file": { @@ -1549,13 +1096,23 @@ "integrity": "sha512-fmvV4caBnofhPe8kOcitBwSn2f39QLjnAnGq3gO9dfd75mUytzKNZB1hde6QHunW2Rt+OwuBOMc3i1tNElbszA==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "make-dir": "^2.0.0", - "nested-error-stacks": "^2.0.0", - "pify": "^4.0.1", - "safe-buffer": "^5.0.1" + "graceful-fs": "4.2.3", + "make-dir": "2.1.0", + "nested-error-stacks": "2.0.1", + "pify": "4.0.1", + "safe-buffer": "5.2.0" }, "dependencies": { + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "4.0.1", + "semver": "5.7.1" + } + }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", @@ -1569,8 +1126,8 @@ "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" + "bn.js": "4.11.8", + "elliptic": "6.5.2" } }, "create-hash": { @@ -1578,11 +1135,11 @@ "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" + "cipher-base": "1.0.4", + "inherits": "2.0.4", + "md5.js": "1.3.5", + "ripemd160": "2.0.2", + "sha.js": "2.4.11" } }, "create-hmac": { @@ -1590,22 +1147,24 @@ "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "inherits": "2.0.4", + "ripemd160": "2.0.2", + "safe-buffer": "5.2.0", + "sha.js": "2.4.11" } }, "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "nice-try": "1.0.5", + "path-key": "2.0.1", + "semver": "5.7.1", + "shebang-command": "1.2.0", + "which": "1.3.1" } }, "crypto-browserify": { @@ -1613,24 +1172,23 @@ "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" + "browserify-cipher": "1.0.1", + "browserify-sign": "4.0.4", + "create-ecdh": "4.0.3", + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "diffie-hellman": "5.0.3", + "inherits": "2.0.4", + "pbkdf2": "3.0.17", + "public-encrypt": "4.0.3", + "randombytes": "2.1.0", + "randomfill": "1.0.4" } }, "crypto-js": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.8.tgz", - "integrity": "sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU=", - "dev": true + "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=" }, "crypto-random-string": { "version": "1.0.0", @@ -1638,17 +1196,17 @@ "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=" }, "cyclist": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", - "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=" }, "d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" + "es5-ext": "0.10.53", + "type": "1.2.0" } }, "dashdash": { @@ -1656,7 +1214,7 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { - "assert-plus": "^1.0.0" + "assert-plus": "1.0.0" } }, "dateformat": { @@ -1670,11 +1228,11 @@ "integrity": "sha1-AaqcQB7dknUFFEcLgmY5DGbGcxg=" }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "requires": { - "ms": "2.0.0" + "ms": "2.1.2" } }, "decamelize": { @@ -1692,31 +1250,14 @@ "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.0.tgz", "integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=", "requires": { - "decompress-tar": "^4.0.0", - "decompress-tarbz2": "^4.0.0", - "decompress-targz": "^4.0.0", - "decompress-unzip": "^4.0.1", - "graceful-fs": "^4.1.10", - "make-dir": "^1.0.0", - "pify": "^2.3.0", - "strip-dirs": "^2.0.0" - }, - "dependencies": { - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "requires": { - "pify": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - } - } - } + "decompress-tar": "4.1.1", + "decompress-tarbz2": "4.1.1", + "decompress-targz": "4.1.1", + "decompress-unzip": "4.0.1", + "graceful-fs": "4.2.3", + "make-dir": "1.3.0", + "pify": "2.3.0", + "strip-dirs": "2.1.0" } }, "decompress-response": { @@ -1724,7 +1265,7 @@ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", "requires": { - "mimic-response": "^1.0.0" + "mimic-response": "1.0.1" } }, "decompress-tar": { @@ -1732,9 +1273,9 @@ "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", "requires": { - "file-type": "^5.2.0", - "is-stream": "^1.1.0", - "tar-stream": "^1.5.2" + "file-type": "5.2.0", + "is-stream": "1.1.0", + "tar-stream": "1.6.2" } }, "decompress-tarbz2": { @@ -1742,11 +1283,11 @@ "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", "requires": { - "decompress-tar": "^4.1.0", - "file-type": "^6.1.0", - "is-stream": "^1.1.0", - "seek-bzip": "^1.0.5", - "unbzip2-stream": "^1.0.9" + "decompress-tar": "4.1.1", + "file-type": "6.2.0", + "is-stream": "1.1.0", + "seek-bzip": "1.0.5", + "unbzip2-stream": "1.3.3" }, "dependencies": { "file-type": { @@ -1761,9 +1302,9 @@ "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", "requires": { - "decompress-tar": "^4.1.1", - "file-type": "^5.2.0", - "is-stream": "^1.1.0" + "decompress-tar": "4.1.1", + "file-type": "5.2.0", + "is-stream": "1.1.0" } }, "decompress-unzip": { @@ -1771,10 +1312,10 @@ "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", "requires": { - "file-type": "^3.8.0", - "get-stream": "^2.2.0", - "pify": "^2.3.0", - "yauzl": "^2.4.2" + "file-type": "3.9.0", + "get-stream": "2.3.1", + "pify": "2.3.0", + "yauzl": "2.10.0" }, "dependencies": { "file-type": { @@ -1787,8 +1328,8 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", "requires": { - "object-assign": "^4.0.1", - "pinkie-promise": "^2.0.0" + "object-assign": "4.1.1", + "pinkie-promise": "2.0.1" } } } @@ -1798,7 +1339,7 @@ "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", "requires": { - "type-detect": "^4.0.0" + "type-detect": "4.0.8" } }, "deep-extend": { @@ -1811,97 +1352,27 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, - "deepmerge": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz", - "integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA==", - "optional": true - }, - "default-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", - "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", - "requires": { - "kind-of": "^5.0.2" - }, - "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==" - } - } - }, "default-require-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", "dev": true, "requires": { - "strip-bom": "^3.0.0" - }, - "dependencies": { - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - } + "strip-bom": "3.0.0" } }, - "default-resolution": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", - "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=" - }, "defer-to-connect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.0.2.tgz", - "integrity": "sha512-k09hcQcTDY+cwgiwa6PYKLm3jlagNzQ+RSvhjzESOGOx+MNOuXkxTfEvPrO1IOQ81tArCFYQgi631clB70RpQw==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.1.tgz", + "integrity": "sha512-J7thop4u3mRTkYRQ+Vpfwy2G5Ehoy82I14+14W4YMDLKdWloI9gSzRbV30s/NckQGVJtPkWNcW4oMAUigTdqiQ==" }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "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==", - "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==", - "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==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } + "object-keys": "1.1.1" } }, "delayed-stream": { @@ -1915,12 +1386,12 @@ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, "des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" + "inherits": "2.0.4", + "minimalistic-assert": "1.0.1" } }, "destroy": { @@ -1928,24 +1399,19 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=" - }, "diff": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", - "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==" + "version": "3.5.0", + "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==", "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" + "bn.js": "4.11.8", + "miller-rabin": "4.0.1", + "randombytes": "2.1.0" } }, "dom-walk": { @@ -1958,7 +1424,7 @@ "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", "requires": { - "is-obj": "^1.0.0" + "is-obj": "1.0.1" } }, "drbg.js": { @@ -1966,9 +1432,9 @@ "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", "requires": { - "browserify-aes": "^1.0.6", - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4" + "browserify-aes": "1.2.0", + "create-hash": "1.2.0", + "create-hmac": "1.1.7" } }, "duplexer3": { @@ -1981,19 +1447,10 @@ "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "each-props": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", - "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", - "requires": { - "is-plain-object": "^2.0.1", - "object.defaults": "^1.1.0" + "end-of-stream": "1.4.4", + "inherits": "2.0.4", + "readable-stream": "2.3.6", + "stream-shift": "1.0.1" } }, "ecc-jsbn": { @@ -2001,8 +1458,8 @@ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" + "jsbn": "0.1.1", + "safer-buffer": "2.1.2" } }, "ee-first": { @@ -2011,17 +1468,17 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "elliptic": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", - "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", + "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.7", + "hmac-drbg": "1.0.1", + "inherits": "2.0.4", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" } }, "emoji-regex": { @@ -2039,15 +1496,15 @@ "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", "requires": { - "iconv-lite": "~0.4.13" + "iconv-lite": "0.4.24" } }, "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "requires": { - "once": "^1.4.0" + "once": "1.4.0" } }, "err-code": { @@ -2059,41 +1516,49 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, "requires": { - "is-arrayish": "^0.2.1" + "is-arrayish": "0.2.1" } }, "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "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.0", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-keys": "^1.0.12" + "es-to-primitive": "1.2.1", + "function-bind": "1.1.1", + "has": "1.0.3", + "has-symbols": "1.0.1", + "is-callable": "1.1.5", + "is-regex": "1.0.5", + "object-inspect": "1.7.0", + "object-keys": "1.1.1", + "object.assign": "4.1.0", + "string.prototype.trimleft": "2.1.1", + "string.prototype.trimright": "2.1.1" } }, "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "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": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "is-callable": "1.1.5", + "is-date-object": "1.0.2", + "is-symbol": "1.0.3" } }, "es5-ext": { - "version": "0.10.50", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz", - "integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==", + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.1", - "next-tick": "^1.0.0" + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.3", + "next-tick": "1.0.0" } }, "es6-error": { @@ -2107,9 +1572,9 @@ "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" + "d": "1.0.1", + "es5-ext": "0.10.53", + "es6-symbol": "3.1.3" } }, "es6-promise": { @@ -2122,16 +1587,16 @@ "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "requires": { - "es6-promise": "^4.0.3" + "es6-promise": "4.2.8" } }, "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "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==", "requires": { - "d": "1", - "es5-ext": "~0.10.14" + "d": "1.0.1", + "ext": "1.4.0" } }, "es6-weak-map": { @@ -2139,10 +1604,10 @@ "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", "requires": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" + "d": "1.0.1", + "es5-ext": "0.10.53", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.3" } }, "escape-html": { @@ -2160,11 +1625,11 @@ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", "requires": { - "esprima": "^2.7.1", - "estraverse": "^1.9.1", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.2.0" + "esprima": "2.7.3", + "estraverse": "1.9.3", + "esutils": "2.0.3", + "optionator": "0.8.3", + "source-map": "0.2.0" }, "dependencies": { "source-map": { @@ -2173,7 +1638,7 @@ "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", "optional": true, "requires": { - "amdefine": ">=0.0.4" + "amdefine": "1.0.1" } } } @@ -2189,9 +1654,9 @@ "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=" }, "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, "etag": { "version": "1.8.1", @@ -2203,8 +1668,8 @@ "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", "integrity": "sha1-IprEbsqG1S4MmR58sq74P/D2i88=", "requires": { - "idna-uts46-hx": "^2.3.1", - "js-sha3": "^0.5.7" + "idna-uts46-hx": "2.3.1", + "js-sha3": "0.5.7" }, "dependencies": { "js-sha3": { @@ -2215,17 +1680,16 @@ } }, "eth-lib": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.27.tgz", - "integrity": "sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA==", + "version": "0.1.29", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.29.tgz", + "integrity": "sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ==", "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "keccakjs": "^0.2.1", - "nano-json-stream-parser": "^0.1.2", - "servify": "^0.1.12", - "ws": "^3.0.0", - "xhr-request-promise": "^0.1.2" + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "nano-json-stream-parser": "0.1.2", + "servify": "0.1.12", + "ws": "3.3.3", + "xhr-request-promise": "0.1.2" } }, "eth-lightwallet": { @@ -2249,7 +1713,12 @@ "dependencies": { "bignumber.js": { "version": "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934", - "from": "bignumber.js@git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934", + "dev": true + }, + "crypto-js": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.8.tgz", + "integrity": "sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU=", "dev": true }, "elliptic": { @@ -2258,13 +1727,50 @@ "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", "dev": true, "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.7", + "hmac-drbg": "1.0.1", + "inherits": "2.0.4", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "ethereumjs-util": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", + "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "create-hash": "1.2.0", + "ethjs-util": "0.1.6", + "keccak": "1.4.0", + "rlp": "2.2.3", + "safe-buffer": "5.2.0", + "secp256k1": "3.8.0" + } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "dev": true, + "requires": { + "bindings": "1.5.0", + "inherits": "2.0.4", + "nan": "2.14.0", + "safe-buffer": "5.2.0" + } + }, + "rlp": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz", + "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "safe-buffer": "5.2.0" } }, "tweetnacl": { @@ -2273,6 +1779,12 @@ "integrity": "sha512-kcoMoKTPYnoeS50tzoqjPY3Uv9axeuuFAZY9M/9zFnhoVvRfxz9K29IMPD7jGmt2c8SW7i3gT9WqDl2+nV7p4A==", "dev": true }, + "utf8": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz", + "integrity": "sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY=", + "dev": true + }, "web3": { "version": "0.20.7", "resolved": "https://registry.npmjs.org/web3/-/web3-0.20.7.tgz", @@ -2280,14 +1792,29 @@ "dev": true, "requires": { "bignumber.js": "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934", - "crypto-js": "^3.1.4", - "utf8": "^2.1.1", - "xhr2-cookies": "^1.1.0", - "xmlhttprequest": "*" + "crypto-js": "3.1.8", + "utf8": "2.1.2", + "xhr2-cookies": "1.1.0", + "xmlhttprequest": "1.8.0" } } } }, + "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==", + "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==" + } + } + }, "ethereum-common": { "version": "0.0.18", "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", @@ -2295,18 +1822,18 @@ "dev": true }, "ethereumjs-abi": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.7.tgz", - "integrity": "sha512-EMLOA8ICO5yAaXDhjVEfYjsJIXYutY8ufTE93eEKwsVtp2usQreKwsDTJ9zvam3omYqNuffr8IONIqb2uUslGQ==", + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", + "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", "requires": { - "bn.js": "^4.11.8", - "ethereumjs-util": "^6.0.0" + "bn.js": "4.11.8", + "ethereumjs-util": "6.2.0" } }, "ethereumjs-testrpc-sc": { - "version": "6.5.1-sc.0", - "resolved": "https://registry.npmjs.org/ethereumjs-testrpc-sc/-/ethereumjs-testrpc-sc-6.5.1-sc.0.tgz", - "integrity": "sha512-ZWhg3Rd64hAWSMM7DygDs7wITH9hDYPCvFypHkiLTiKu42wfl6QVJtkouelhtdyufzv2TFe7Lo0uOWS9NEiOqw==", + "version": "6.5.1-sc.1", + "resolved": "https://registry.npmjs.org/ethereumjs-testrpc-sc/-/ethereumjs-testrpc-sc-6.5.1-sc.1.tgz", + "integrity": "sha512-DPBwpMFFH5DTXicYjLLdTq6VLnD8p4oo5QfC9EmRKLzDsWRNXDhA9cgcdUZhhXuPM+mVAem7Q+o3Y3CQ5f+FKA==", "requires": { "ethereumjs-util": "6.1.0", "source-map-support": "0.5.12", @@ -2321,7 +1848,7 @@ "version": "3.2.1", "bundled": true, "requires": { - "color-convert": "^1.9.0" + "color-convert": "1.9.3" } }, "bindings": { @@ -2335,7 +1862,7 @@ "version": "1.1.5", "bundled": true, "requires": { - "safe-buffer": "^5.0.1" + "safe-buffer": "5.2.0" } }, "bn.js": { @@ -2350,12 +1877,12 @@ "version": "1.2.0", "bundled": true, "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "evp_bytestokey": "1.0.3", + "inherits": "2.0.4", + "safe-buffer": "5.2.0" } }, "buffer-from": { @@ -2370,17 +1897,17 @@ "version": "1.0.4", "bundled": true, "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "2.0.4", + "safe-buffer": "5.2.0" } }, "cliui": { "version": "5.0.0", "bundled": true, "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "string-width": "3.1.0", + "strip-ansi": "5.2.0", + "wrap-ansi": "5.1.0" }, "dependencies": { "ansi-regex": { @@ -2391,25 +1918,25 @@ "version": "3.1.0", "bundled": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "7.0.3", + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "5.2.0" } }, "strip-ansi": { "version": "5.2.0", "bundled": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "4.1.0" } }, "wrap-ansi": { "version": "5.1.0", "bundled": true, "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "ansi-styles": "3.2.1", + "string-width": "3.1.0", + "strip-ansi": "5.2.0" } } } @@ -2433,34 +1960,34 @@ "version": "1.2.0", "bundled": true, "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" + "cipher-base": "1.0.4", + "inherits": "2.0.4", + "md5.js": "1.3.5", + "ripemd160": "2.0.2", + "sha.js": "2.4.11" } }, "create-hmac": { "version": "1.1.7", "bundled": true, "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "inherits": "2.0.4", + "ripemd160": "2.0.2", + "safe-buffer": "5.2.0", + "sha.js": "2.4.11" } }, "cross-spawn": { "version": "6.0.5", "bundled": 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" + "nice-try": "1.0.5", + "path-key": "2.0.1", + "semver": "5.7.1", + "shebang-command": "1.2.0", + "which": "1.3.1" } }, "decamelize": { @@ -2471,22 +1998,22 @@ "version": "1.0.1", "bundled": true, "requires": { - "browserify-aes": "^1.0.6", - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4" + "browserify-aes": "1.2.0", + "create-hash": "1.2.0", + "create-hmac": "1.1.7" } }, "elliptic": { - "version": "6.5.0", + "version": "6.5.1", "bundled": true, "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.7", + "hmac-drbg": "1.0.1", + "inherits": "2.0.4", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" } }, "emoji-regex": { @@ -2497,20 +2024,20 @@ "version": "1.4.1", "bundled": true, "requires": { - "once": "^1.4.0" + "once": "1.4.0" } }, "ethereumjs-util": { "version": "6.1.0", "bundled": true, "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", + "bn.js": "4.11.8", + "create-hash": "1.2.0", "ethjs-util": "0.1.6", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" + "keccak": "1.4.0", + "rlp": "2.2.3", + "safe-buffer": "5.2.0", + "secp256k1": "3.7.1" } }, "ethjs-util": { @@ -2525,21 +2052,21 @@ "version": "1.0.3", "bundled": true, "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" + "md5.js": "1.3.5", + "safe-buffer": "5.2.0" } }, "execa": { "version": "1.0.0", "bundled": true, "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" + "cross-spawn": "6.0.5", + "get-stream": "4.1.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" } }, "file-uri-to-path": { @@ -2550,39 +2077,39 @@ "version": "3.0.0", "bundled": true, "requires": { - "locate-path": "^3.0.0" + "locate-path": "3.0.0" } }, "get-stream": { "version": "4.1.0", "bundled": true, "requires": { - "pump": "^3.0.0" + "pump": "3.0.0" } }, "hash-base": { "version": "3.0.4", "bundled": true, "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "2.0.4", + "safe-buffer": "5.2.0" } }, "hash.js": { "version": "1.1.7", "bundled": true, "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" + "inherits": "2.0.4", + "minimalistic-assert": "1.0.1" } }, "hmac-drbg": { "version": "1.0.1", "bundled": true, "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" + "hash.js": "1.1.7", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" } }, "inherits": { @@ -2613,50 +2140,50 @@ "version": "1.4.0", "bundled": true, "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" + "bindings": "1.5.0", + "inherits": "2.0.4", + "nan": "2.14.0", + "safe-buffer": "5.2.0" } }, "lcid": { "version": "2.0.0", "bundled": true, "requires": { - "invert-kv": "^2.0.0" + "invert-kv": "2.0.0" } }, "locate-path": { "version": "3.0.0", "bundled": true, "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "3.0.0", + "path-exists": "3.0.0" } }, "map-age-cleaner": { "version": "0.1.3", "bundled": true, "requires": { - "p-defer": "^1.0.0" + "p-defer": "1.0.0" } }, "md5.js": { "version": "1.3.5", "bundled": true, "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" + "hash-base": "3.0.4", + "inherits": "2.0.4", + "safe-buffer": "5.2.0" } }, "mem": { "version": "4.3.0", "bundled": true, "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" + "map-age-cleaner": "0.1.3", + "mimic-fn": "2.1.0", + "p-is-promise": "2.1.0" } }, "mimic-fn": { @@ -2683,7 +2210,7 @@ "version": "2.0.2", "bundled": true, "requires": { - "path-key": "^2.0.0" + "path-key": "2.0.1" } }, "number-is-nan": { @@ -2694,16 +2221,16 @@ "version": "1.4.0", "bundled": true, "requires": { - "wrappy": "1" + "wrappy": "1.0.2" } }, "os-locale": { "version": "3.1.0", "bundled": true, "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" + "execa": "1.0.0", + "lcid": "2.0.0", + "mem": "4.3.0" } }, "p-defer": { @@ -2719,17 +2246,17 @@ "bundled": true }, "p-limit": { - "version": "2.2.0", + "version": "2.2.1", "bundled": true, "requires": { - "p-try": "^2.0.0" + "p-try": "2.2.0" } }, "p-locate": { "version": "3.0.0", "bundled": true, "requires": { - "p-limit": "^2.0.0" + "p-limit": "2.2.1" } }, "p-try": { @@ -2748,8 +2275,8 @@ "version": "3.0.0", "bundled": true, "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "end-of-stream": "1.4.1", + "once": "1.4.0" } }, "require-directory": { @@ -2760,16 +2287,16 @@ "version": "2.0.2", "bundled": true, "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" + "hash-base": "3.0.4", + "inherits": "2.0.4" } }, "rlp": { "version": "2.2.3", "bundled": true, "requires": { - "bn.js": "^4.11.1", - "safe-buffer": "^5.1.1" + "bn.js": "4.11.8", + "safe-buffer": "5.2.0" } }, "safe-buffer": { @@ -2780,18 +2307,18 @@ "version": "3.7.1", "bundled": 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" + "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.5.1", + "nan": "2.14.0", + "safe-buffer": "5.2.0" } }, "semver": { - "version": "5.7.0", + "version": "5.7.1", "bundled": true }, "set-blocking": { @@ -2802,15 +2329,15 @@ "version": "2.4.11", "bundled": true, "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "2.0.4", + "safe-buffer": "5.2.0" } }, "shebang-command": { "version": "1.2.0", "bundled": true, "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "1.0.0" } }, "shebang-regex": { @@ -2829,24 +2356,24 @@ "version": "0.5.12", "bundled": true, "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "buffer-from": "1.1.1", + "source-map": "0.6.1" } }, "string-width": { "version": "1.0.2", "bundled": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" }, "dependencies": { "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, "requires": { - "number-is-nan": "^1.0.0" + "number-is-nan": "1.0.1" } } } @@ -2855,7 +2382,7 @@ "version": "3.0.1", "bundled": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "2.1.1" } }, "strip-eof": { @@ -2873,7 +2400,7 @@ "version": "1.3.1", "bundled": true, "requires": { - "isexe": "^2.0.0" + "isexe": "2.0.0" } }, "which-module": { @@ -2892,17 +2419,17 @@ "version": "13.2.4", "bundled": true, "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.0" + "cliui": "5.0.0", + "find-up": "3.0.0", + "get-caller-file": "2.0.5", + "os-locale": "3.1.0", + "require-directory": "2.1.1", + "require-main-filename": "2.0.0", + "set-blocking": "2.0.0", + "string-width": "3.1.0", + "which-module": "2.0.0", + "y18n": "4.0.0", + "yargs-parser": "13.1.1" }, "dependencies": { "ansi-regex": { @@ -2921,16 +2448,16 @@ "version": "3.1.0", "bundled": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "7.0.3", + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "5.2.0" } }, "strip-ansi": { "version": "5.2.0", "bundled": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "4.1.0" } } } @@ -2939,8 +2466,8 @@ "version": "13.1.1", "bundled": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "camelcase": "5.3.1", + "decamelize": "1.2.0" }, "dependencies": { "camelcase": { @@ -2957,8 +2484,8 @@ "integrity": "sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA==", "dev": true, "requires": { - "ethereum-common": "^0.0.18", - "ethereumjs-util": "^5.0.0" + "ethereum-common": "0.0.18", + "ethereumjs-util": "5.2.0" }, "dependencies": { "ethereumjs-util": { @@ -2967,87 +2494,72 @@ "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", "dev": true, "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" + "bn.js": "4.11.8", + "create-hash": "1.2.0", + "ethjs-util": "0.1.6", + "keccak": "1.4.0", + "rlp": "2.2.4", + "safe-buffer": "5.2.0", + "secp256k1": "3.8.0" + } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "dev": true, + "requires": { + "bindings": "1.5.0", + "inherits": "2.0.4", + "nan": "2.14.0", + "safe-buffer": "5.2.0" } } } }, "ethereumjs-util": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", - "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", + "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", + "@types/bn.js": "4.11.5", + "bn.js": "4.11.8", + "create-hash": "1.2.0", "ethjs-util": "0.1.6", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" + "keccak": "2.1.0", + "rlp": "2.2.4", + "secp256k1": "3.8.0" } }, "ethers": { - "version": "4.0.0-beta.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.1.tgz", - "integrity": "sha512-SoYhktEbLxf+fiux5SfCEwdzWENMvgIbMZD90I62s4GZD9nEjgEWy8ZboI3hck193Vs0bDoTohDISx84f2H2tw==", + "version": "4.0.40", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.40.tgz", + "integrity": "sha512-MC9BtV7Hpq4dgFONEfanx9aU9GhhoWU270F+/wegHZXA7FR+2KXFdt36YIQYLmVY5ykUWswDxd+f9EVkIa7JOA==", "requires": { - "@types/node": "^10.3.2", "aes-js": "3.0.0", - "bn.js": "^4.4.0", - "elliptic": "6.3.3", + "bn.js": "4.11.8", + "elliptic": "6.5.2", "hash.js": "1.1.3", "js-sha3": "0.5.7", - "scrypt-js": "2.0.3", + "scrypt-js": "2.0.4", "setimmediate": "1.0.4", "uuid": "2.0.1", "xmlhttprequest": "1.8.0" }, "dependencies": { - "@types/node": { - "version": "10.14.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.12.tgz", - "integrity": "sha512-QcAKpaO6nhHLlxWBvpc4WeLrTvPqlHOvaj0s5GriKkA1zq+bsFBPpfYCvQhLqLgYlIko8A9YrPdaMHCo5mBcpg==" - }, - "elliptic": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", - "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", - "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==", "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.0" + "inherits": "2.0.4", + "minimalistic-assert": "1.0.1" } }, "js-sha3": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" - }, - "setimmediate": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" - }, - "uuid": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" } } }, @@ -3065,11 +2577,6 @@ "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" - }, - "js-sha3": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.5.tgz", - "integrity": "sha1-uvDA6MVK1ZA0R9+Wreekobynmko=" } } }, @@ -3098,46 +2605,78 @@ "strip-hex-prefix": "1.0.0" } }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "requires": { + "d": "1.0.1", + "es5-ext": "0.10.53" + } + }, "eventemitter3": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.1.1.tgz", - "integrity": "sha1-R3hr2qCHyvext15zq8XH1UAVjNA=" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", + "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==" }, "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" + "md5.js": "1.3.5", + "safe-buffer": "5.2.0" } }, "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" + "cross-spawn": "6.0.5", + "get-stream": "4.1.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" } }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "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": { @@ -3148,76 +2687,10 @@ "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=", - "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=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "express": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", - "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==", - "requires": { - "ms": "2.0.0" - } + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "safe-buffer": { "version": "5.1.2", @@ -3226,105 +2699,31 @@ } } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" + "type": "2.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==", - "requires": { - "is-plain-object": "^2.0.4" - } + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==" } } }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^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=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.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==", - "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==", - "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==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" }, - "fancy-log": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", - "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", - "requires": { - "ansi-gray": "^0.1.1", - "color-support": "^1.1.3", - "parse-node-version": "^1.0.0", - "time-stamp": "^1.0.0" - } - }, "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", @@ -3336,9 +2735,9 @@ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==" }, "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "fast-levenshtein": { "version": "2.0.6", @@ -3350,7 +2749,7 @@ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", "requires": { - "pend": "~1.2.0" + "pend": "1.2.0" } }, "figgy-pudding": { @@ -3368,39 +2767,18 @@ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.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=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, "finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "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" + "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": { @@ -3410,6 +2788,11 @@ "requires": { "ms": "2.0.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" } } }, @@ -3419,55 +2802,44 @@ "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", "dev": true, "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" + "commondir": "1.0.1", + "make-dir": "2.1.0", + "pkg-dir": "3.0.0" + }, + "dependencies": { + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "4.0.1", + "semver": "5.7.1" + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } } }, "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "findup-sync": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, - "fined": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", - "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "requires": { - "expand-tilde": "^2.0.2", - "is-plain-object": "^2.0.3", - "object.defaults": "^1.1.0", - "object.pick": "^1.2.0", - "parse-filepath": "^1.0.1" + "locate-path": "3.0.0" } }, - "flagged-respawn": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", - "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==" - }, "flat": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", "dev": true, "requires": { - "is-buffer": "~2.0.3" + "is-buffer": "2.0.4" } }, "flush-write-stream": { @@ -3475,29 +2847,8 @@ "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - } - }, - "for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "requires": { - "is-callable": "^1.1.3" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" - }, - "for-own": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", - "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", - "requires": { - "for-in": "^1.0.1" + "inherits": "2.0.4", + "readable-stream": "2.3.6" } }, "foreground-child": { @@ -3506,8 +2857,8 @@ "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", "dev": true, "requires": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" + "cross-spawn": "4.0.2", + "signal-exit": "3.0.2" }, "dependencies": { "cross-spawn": { @@ -3516,9 +2867,25 @@ "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", "dev": true, "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" + "lru-cache": "4.1.5", + "which": "1.3.1" } + }, + "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==", + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true } } }, @@ -3532,9 +2899,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" + "asynckit": "0.4.0", + "combined-stream": "1.0.8", + "mime-types": "2.1.25" } }, "forwarded": { @@ -3542,14 +2909,6 @@ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "requires": { - "map-cache": "^0.2.2" - } - }, "fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", @@ -3560,8 +2919,8 @@ "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" + "inherits": "2.0.4", + "readable-stream": "2.3.6" } }, "fs-constants": { @@ -3570,32 +2929,21 @@ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, "fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" + "graceful-fs": "4.2.3", + "jsonfile": "4.0.0", + "universalify": "0.1.2" } }, "fs-minipass": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.6.tgz", - "integrity": "sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ==", - "requires": { - "minipass": "^2.2.1" - } - }, - "fs-mkdirp-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", - "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", "requires": { - "graceful-fs": "^4.1.11", - "through2": "^2.0.3" + "minipass": "2.9.0" } }, "fs-promise": { @@ -3603,10 +2951,10 @@ "resolved": "https://registry.npmjs.org/fs-promise/-/fs-promise-2.0.3.tgz", "integrity": "sha1-9k5PhUvPaJqovdy6JokW2z20aFQ=", "requires": { - "any-promise": "^1.3.0", - "fs-extra": "^2.0.0", - "mz": "^2.6.0", - "thenify-all": "^1.6.0" + "any-promise": "1.3.0", + "fs-extra": "2.1.2", + "mz": "2.7.0", + "thenify-all": "1.6.0" }, "dependencies": { "fs-extra": { @@ -3614,8 +2962,16 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0" + "graceful-fs": "4.2.3", + "jsonfile": "2.4.0" + } + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "requires": { + "graceful-fs": "4.2.3" } } } @@ -3625,10 +2981,10 @@ "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", "requires": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" + "graceful-fs": "4.2.3", + "iferr": "0.1.5", + "imurmurhash": "0.1.4", + "readable-stream": "2.3.6" } }, "fs.realpath": { @@ -3636,805 +2992,54 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", - "optional": true, + "fstream": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "requires": { + "graceful-fs": "4.2.3", + "inherits": "2.0.4", + "mkdirp": "0.5.1", + "rimraf": "2.7.1" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "ganache-cli": { + "version": "git://github.com/mickys/ganache-cli.git#8e64c2e8f782d8c7e5f855d819001e74bdf48732", "requires": { - "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" + "ethereumjs-util": "6.1.0", + "source-map-support": "0.5.12", + "yargs": "13.2.4" }, "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "optional": true, + "ethereumjs-util": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", + "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", "requires": { - "minipass": "^2.2.1" + "bn.js": "4.11.8", + "create-hash": "1.2.0", + "ethjs-util": "0.1.6", + "keccak": "1.4.0", + "rlp": "2.2.4", + "safe-buffer": "5.2.0", + "secp256k1": "3.8.0" } }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "optional": true, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "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" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "optional": 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" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "optional": true - }, - "needle": { - "version": "2.3.0", - "bundled": true, - "optional": true, - "requires": { - "debug": "^4.1.0", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.6", - "bundled": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "bundled": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "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" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "optional": true, - "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", - "bundled": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "optional": true - }, - "semver": { - "version": "5.7.0", - "bundled": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true - } - } - }, - "fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "ganache-cli": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/ganache-cli/-/ganache-cli-6.4.4.tgz", - "integrity": "sha512-JWygbyZuM2GQl2ZvU7tBkjpgJaKE/XEtB99ech17XTouuqLU5rBcyO3sMb/L83wAtzr0gBnTgenIBl+OeREpJw==", - "requires": { - "bn.js": "4.11.8", - "source-map-support": "0.5.9", - "yargs": "11.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "bundled": true - }, - "bn.js": { - "version": "4.11.8", - "bundled": true - }, - "buffer-from": { - "version": "1.1.1", - "bundled": true - }, - "camelcase": { - "version": "4.1.0", - "bundled": true - }, - "cliui": { - "version": "4.1.0", - "bundled": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true - }, - "cross-spawn": { - "version": "5.1.0", - "bundled": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "decamelize": { - "version": "1.2.0", - "bundled": true - }, - "execa": { - "version": "0.7.0", - "bundled": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "bundled": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "get-caller-file": { - "version": "1.0.3", - "bundled": true - }, - "get-stream": { - "version": "3.0.0", - "bundled": true - }, - "invert-kv": { - "version": "1.0.0", - "bundled": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "bundled": true - }, - "is-stream": { - "version": "1.1.0", - "bundled": true - }, - "isexe": { - "version": "2.0.0", - "bundled": true - }, - "lcid": { - "version": "1.0.0", - "bundled": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "bundled": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "lru-cache": { - "version": "4.1.4", - "bundled": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^3.0.2" - } - }, - "mem": { - "version": "1.1.0", - "bundled": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "mimic-fn": { - "version": "1.2.0", - "bundled": true - }, - "npm-run-path": { - "version": "2.0.2", - "bundled": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true - }, - "os-locale": { - "version": "2.1.0", - "bundled": true, - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" - } - }, - "p-finally": { - "version": "1.0.0", - "bundled": true - }, - "p-limit": { - "version": "1.3.0", - "bundled": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "bundled": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "bundled": true - }, - "path-exists": { - "version": "3.0.0", - "bundled": true - }, - "path-key": { - "version": "2.0.1", - "bundled": true - }, - "pseudomap": { - "version": "1.0.2", - "bundled": true - }, - "require-directory": { - "version": "2.1.1", - "bundled": true - }, - "require-main-filename": { - "version": "1.0.1", - "bundled": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true - }, - "shebang-command": { - "version": "1.2.0", - "bundled": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "bundled": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true - }, - "source-map": { - "version": "0.6.1", - "bundled": true - }, - "source-map-support": { - "version": "0.5.9", - "bundled": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "string-width": { - "version": "2.1.1", - "bundled": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "strip-eof": { - "version": "1.0.0", - "bundled": true - }, - "which": { - "version": "1.3.1", - "bundled": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "bundled": true - }, - "wrap-ansi": { - "version": "2.1.0", - "bundled": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "y18n": { - "version": "3.2.1", - "bundled": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true - }, - "yargs": { - "version": "11.1.0", - "bundled": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^9.0.2" - } - }, - "yargs-parser": { - "version": "9.0.2", - "bundled": true, - "requires": { - "camelcase": "^4.1.0" + "bindings": "1.5.0", + "inherits": "2.0.4", + "nan": "2.14.0", + "safe-buffer": "5.2.0" } } } @@ -4445,9 +3050,9 @@ "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==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-func-name": { "version": "2.0.0", @@ -4460,97 +3065,32 @@ "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==" }, "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=" + "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" + } }, "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" + "assert-plus": "1.0.0" } }, "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" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "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=", - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "glob-stream": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", - "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", - "requires": { - "extend": "^3.0.0", - "glob": "^7.1.1", - "glob-parent": "^3.1.0", - "is-negated-glob": "^1.0.0", - "ordered-read-streams": "^1.0.0", - "pumpify": "^1.3.5", - "readable-stream": "^2.1.5", - "remove-trailing-separator": "^1.0.1", - "to-absolute-glob": "^2.0.0", - "unique-stream": "^2.0.2" - }, - "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" - } - } - } - }, - "glob-watcher": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.3.tgz", - "integrity": "sha512-8tWsULNEPHKQ2MR4zXuzSmqbdyV5PtwwCaWSGQ1WwHsJ07ilNeN1JB8ntxhckbnpSHaf9dXFUHzIWvm1I13dsg==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "requires": { - "anymatch": "^2.0.0", - "async-done": "^1.2.0", - "chokidar": "^2.0.0", - "is-negated-glob": "^1.0.0", - "just-debounce": "^1.0.0", - "object.defaults": "^1.1.0" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.4", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, "global": { @@ -4558,8 +3098,8 @@ "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", "requires": { - "min-document": "^2.19.0", - "process": "~0.5.1" + "min-document": "2.19.0", + "process": "0.5.2" } }, "global-dirs": { @@ -4567,29 +3107,7 @@ "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", "requires": { - "ini": "^1.3.4" - } - }, - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" + "ini": "1.3.5" } }, "globals": { @@ -4598,39 +3116,28 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, - "glogg": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", - "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", - "requires": { - "sparkles": "^1.0.0" - } - }, "got": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", - "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", - "requires": { - "decompress-response": "^3.2.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-plain-obj": "^1.1.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "isurl": "^1.0.0-alpha5", - "lowercase-keys": "^1.0.0", - "p-cancelable": "^0.3.0", - "p-timeout": "^1.1.1", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "url-parse-lax": "^1.0.0", - "url-to-options": "^1.0.1" + "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.1.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.1.0", + "to-readable-stream": "1.0.0", + "url-parse-lax": "3.0.0" } }, "graceful-fs": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", - "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==" + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" }, "graceful-readlink": { "version": "1.0.1", @@ -4640,100 +3147,17 @@ "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "gulp": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", - "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", - "requires": { - "glob-watcher": "^5.0.3", - "gulp-cli": "^2.2.0", - "undertaker": "^1.2.1", - "vinyl-fs": "^3.0.0" - }, - "dependencies": { - "ansi-colors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", - "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", - "requires": { - "ansi-wrap": "^0.1.0" - } - }, - "gulp-cli": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.2.0.tgz", - "integrity": "sha512-rGs3bVYHdyJpLqR0TUBnlcZ1O5O++Zs4bA0ajm+zr3WFCfiSLjGwoCBqFs18wzN+ZxahT9DkOK5nDf26iDsWjA==", - "requires": { - "ansi-colors": "^1.0.1", - "archy": "^1.0.0", - "array-sort": "^1.0.0", - "color-support": "^1.1.3", - "concat-stream": "^1.6.0", - "copy-props": "^2.0.1", - "fancy-log": "^1.3.2", - "gulplog": "^1.0.0", - "interpret": "^1.1.0", - "isobject": "^3.0.1", - "liftoff": "^3.1.0", - "matchdep": "^2.0.0", - "mute-stdout": "^1.0.0", - "pretty-hrtime": "^1.0.0", - "replace-homedir": "^1.0.0", - "semver-greatest-satisfied-range": "^1.1.0", - "v8flags": "^3.0.1", - "yargs": "^7.1.0" - } - }, - "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" - } - } - } - }, - "gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", - "requires": { - "glogg": "^1.0.0" - } + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==" }, "handlebars": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", - "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", + "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", "requires": { - "neo-async": "^2.6.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" + "neo-async": "2.6.1", + "optimist": "0.6.1", + "source-map": "0.6.1", + "uglify-js": "3.7.2" } }, "har-schema": { @@ -4746,16 +3170,17 @@ "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" + "ajv": "6.10.2", + "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==", + "dev": true, "requires": { - "function-bind": "^1.1.1" + "function-bind": "1.1.1" } }, "has-ansi": { @@ -4763,7 +3188,14 @@ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "2.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + } } }, "has-flag": { @@ -4777,50 +3209,17 @@ "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==" }, "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" + "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 }, "has-to-string-tag-x": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", "requires": { - "has-symbol-support-x": "^1.4.1" - } - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "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=", - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "requires": { - "is-buffer": "^1.1.5" - } - } + "has-symbol-support-x": "1.4.2" } }, "has-yarn": { @@ -4833,8 +3232,8 @@ "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" + "inherits": "2.0.4", + "safe-buffer": "5.2.0" } }, "hash.js": { @@ -4842,8 +3241,8 @@ "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" + "inherits": "2.0.4", + "minimalistic-assert": "1.0.1" } }, "hasha": { @@ -4852,7 +3251,7 @@ "integrity": "sha1-UqMvq4Vp1BymmmH/GiFPjrfIvTk=", "dev": true, "requires": { - "is-stream": "^1.0.1" + "is-stream": "1.1.0" } }, "he": { @@ -4865,38 +3264,30 @@ "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" - } - }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "requires": { - "parse-passwd": "^1.0.0" + "hash.js": "1.1.7", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" } }, "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", + "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==" }, "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==" + "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==" }, "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==", "requires": { - "depd": "~1.1.2", + "depd": "1.1.2", "inherits": "2.0.3", "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", + "statuses": "1.5.0", "toidentifier": "1.0.0" }, "dependencies": { @@ -4917,8 +3308,23 @@ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", "requires": { - "agent-base": "4", + "agent-base": "4.3.0", "debug": "3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } } }, "http-signature": { @@ -4926,18 +3332,28 @@ "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" + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.16.1" } }, "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==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", "requires": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" + "agent-base": "4.3.0", + "debug": "3.2.6" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "2.1.2" + } + } } }, "humanize-ms": { @@ -4945,7 +3361,7 @@ "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", "requires": { - "ms": "^2.0.0" + "ms": "2.1.2" } }, "iconv-lite": { @@ -4953,7 +3369,7 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "safer-buffer": "2.1.2" } }, "idna-uts46-hx": { @@ -4982,11 +3398,11 @@ "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=" }, "ignore-walk": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", + "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", "requires": { - "minimatch": "^3.0.4" + "minimatch": "3.0.4" } }, "import-lazy": { @@ -5009,8 +3425,8 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { - "once": "^1.3.0", - "wrappy": "1" + "once": "1.4.0", + "wrappy": "1.0.2" } }, "inherits": { @@ -5029,9 +3445,9 @@ "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==" }, "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=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" }, "ip": { "version": "1.1.5", @@ -5043,146 +3459,48 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" }, - "is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", - "requires": { - "is-relative": "^1.0.0", - "is-windows": "^1.0.1" - } - }, - "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=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" - }, - "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=", - "requires": { - "binary-extensions": "^1.0.0" - } + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true }, "is-buffer": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", - "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", "dev": true }, "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true }, "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-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } + "ci-info": "2.0.0" } }, "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==", - "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==" - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true }, "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" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, "is-function": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=" }, - "is-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", @@ -5193,8 +3511,8 @@ "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" + "global-dirs": "0.1.1", + "is-path-inside": "1.0.1" } }, "is-natural-number": { @@ -5202,39 +3520,11 @@ "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=" }, - "is-negated-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", - "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=" - }, "is-npm": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-3.0.0.tgz", "integrity": "sha512-wsigDr1Kkschp2opC4G3yA6r9EgVA6NjRpWzIi9axXqeIaAATPRJc4uLujXe3Nd9uO8KoDyA4MD6aZSeXTADhA==" }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "is-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", @@ -5250,7 +3540,7 @@ "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" + "path-is-inside": "1.0.2" } }, "is-plain-obj": { @@ -5258,34 +3548,24 @@ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" }, - "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==", - "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=" }, "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-relative": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, "requires": { - "is-unc-path": "^1.0.0" + "has": "1.0.3" } }, "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=" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", + "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==" }, "is-stream": { "version": "1.1.0", @@ -5293,11 +3573,12 @@ "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==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, "requires": { - "has-symbols": "^1.0.0" + "has-symbols": "1.0.1" } }, "is-typedarray": { @@ -5305,29 +3586,6 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, - "is-unc-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", - "requires": { - "unc-path-regex": "^0.1.2" - } - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" - }, - "is-valid-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", - "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=" - }, - "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==" - }, "is-yarn-global": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", @@ -5343,11 +3601,6 @@ "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=" - }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -5358,20 +3611,34 @@ "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", "requires": { - "abbrev": "1.0.x", - "async": "1.x", - "escodegen": "1.8.x", - "esprima": "2.7.x", - "glob": "^5.0.15", - "handlebars": "^4.0.1", - "js-yaml": "3.x", - "mkdirp": "0.5.x", - "nopt": "3.x", - "once": "1.x", - "resolve": "1.1.x", - "supports-color": "^3.1.0", - "which": "^1.1.1", - "wordwrap": "^1.0.0" + "abbrev": "1.0.9", + "async": "1.5.2", + "escodegen": "1.8.1", + "esprima": "2.7.3", + "glob": "5.0.15", + "handlebars": "4.5.3", + "js-yaml": "3.13.1", + "mkdirp": "0.5.1", + "nopt": "3.0.6", + "once": "1.4.0", + "resolve": "1.1.7", + "supports-color": "3.2.3", + "which": "1.3.1", + "wordwrap": "1.0.0" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.4", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } } }, "istanbul-lib-coverage": { @@ -5386,7 +3653,7 @@ "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==", "dev": true, "requires": { - "append-transform": "^1.0.0" + "append-transform": "1.0.0" } }, "istanbul-lib-instrument": { @@ -5395,19 +3662,19 @@ "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", "dev": true, "requires": { - "@babel/generator": "^7.4.0", - "@babel/parser": "^7.4.3", - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0", - "istanbul-lib-coverage": "^2.0.5", - "semver": "^6.0.0" + "@babel/generator": "7.7.7", + "@babel/parser": "7.7.7", + "@babel/template": "7.7.4", + "@babel/traverse": "7.7.4", + "@babel/types": "7.7.4", + "istanbul-lib-coverage": "2.0.5", + "semver": "6.3.0" }, "dependencies": { "semver": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", - "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -5418,9 +3685,9 @@ "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", "dev": true, "requires": { - "istanbul-lib-coverage": "^2.0.5", - "make-dir": "^2.1.0", - "supports-color": "^6.1.0" + "istanbul-lib-coverage": "2.0.5", + "make-dir": "2.1.0", + "supports-color": "6.1.0" }, "dependencies": { "has-flag": { @@ -5429,13 +3696,29 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "4.0.1", + "semver": "5.7.1" + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, "supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "3.0.0" } } } @@ -5446,26 +3729,27 @@ "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", "dev": true, "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.5", - "make-dir": "^2.1.0", - "rimraf": "^2.6.3", - "source-map": "^0.6.1" + "debug": "4.1.1", + "istanbul-lib-coverage": "2.0.5", + "make-dir": "2.1.0", + "rimraf": "2.7.1", + "source-map": "0.6.1" }, "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "dev": true, "requires": { - "ms": "^2.1.1" + "pify": "4.0.1", + "semver": "5.7.1" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true } } @@ -5476,7 +3760,7 @@ "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==", "dev": true, "requires": { - "handlebars": "^4.1.2" + "handlebars": "4.5.3" } }, "isurl": { @@ -5484,8 +3768,8 @@ "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", "requires": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" + "has-to-string-tag-x": "1.4.1", + "is-object": "1.0.1" } }, "jju": { @@ -5494,9 +3778,9 @@ "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=" }, "js-sha3": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", - "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.5.tgz", + "integrity": "sha1-uvDA6MVK1ZA0R9+Wreekobynmko=" }, "js-tokens": { "version": "4.0.0", @@ -5509,8 +3793,8 @@ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "1.0.10", + "esprima": "4.0.1" }, "dependencies": { "esprima": { @@ -5546,7 +3830,7 @@ "resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", "integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=", "requires": { - "jju": "^1.1.0" + "jju": "1.4.0" } }, "json-schema": { @@ -5559,39 +3843,32 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" - }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "optional": true, + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz", + "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==", "requires": { - "minimist": "^1.2.0" + "minimist": "1.2.0" }, "dependencies": { "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "optional": true + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" } } }, "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", "requires": { - "graceful-fs": "^4.1.6" + "graceful-fs": "4.2.3" } }, "jsonparse": { @@ -5610,20 +3887,15 @@ "verror": "1.10.0" } }, - "just-debounce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", - "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=" - }, "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", + "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" + "bindings": "1.5.0", + "inherits": "2.0.4", + "nan": "2.14.0", + "safe-buffer": "5.2.0" } }, "keccakjs": { @@ -5631,8 +3903,8 @@ "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.3.tgz", "integrity": "sha512-BjLkNDcfaZ6l8HBG9tH0tpmDv3sS2mA7FNQxFHpCdzP3Gb2MVruXBSuoM66SnVxKJpAr5dKGdkHD+bDokt8fTg==", "requires": { - "browserify-sha3": "^0.0.4", - "sha3": "^1.2.2" + "browserify-sha3": "0.0.4", + "sha3": "1.2.6" } }, "keyv": { @@ -5643,17 +3915,12 @@ "json-buffer": "3.0.0" } }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" - }, "klaw": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", "requires": { - "graceful-fs": "^4.1.9" + "graceful-fs": "4.2.3" } }, "kleur": { @@ -5661,45 +3928,20 @@ "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==" }, - "last-run": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", - "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", - "requires": { - "default-resolution": "^2.0.0", - "es6-weak-map": "^2.0.1" - } - }, "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": { - "package-json": "^6.3.0" - } - }, - "lazystream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", - "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", - "requires": { - "readable-stream": "^2.0.5" + "package-json": "6.5.0" } }, "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" - } - }, - "lead": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", - "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "requires": { - "flush-write-stream": "^1.0.2" + "invert-kv": "2.0.0" } }, "levn": { @@ -5707,8 +3949,8 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "1.1.2", + "type-check": "0.3.2" } }, "libnpmconfig": { @@ -5716,103 +3958,44 @@ "resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz", "integrity": "sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==", "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=" - } - } - }, - "liftoff": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", - "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", - "requires": { - "extend": "^3.0.0", - "findup-sync": "^3.0.0", - "fined": "^1.0.1", - "flagged-respawn": "^1.0.0", - "is-plain-object": "^2.0.4", - "object.map": "^1.0.0", - "rechoir": "^0.6.2", - "resolve": "^1.1.7" + "figgy-pudding": "3.5.1", + "find-up": "3.0.0", + "ini": "1.3.5" } }, "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" + "graceful-fs": "4.2.3", + "parse-json": "4.0.0", + "pify": "3.0.0", + "strip-bom": "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=", + "dev": true + } } }, "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "dependencies": { - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" - } + "p-locate": "3.0.0", + "path-exists": "3.0.0" } }, "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==" + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, "lodash.flattendeep": { "version": "4.4.0", @@ -5826,7 +4009,7 @@ "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", "dev": true, "requires": { - "chalk": "^2.0.1" + "chalk": "2.4.2" } }, "lowercase-keys": { @@ -5835,29 +4018,33 @@ "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==", + "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.1.1" + } + }, + "lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "es5-ext": "0.10.53" } }, "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" + "pify": "3.0.0" }, "dependencies": { "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" } } }, @@ -5867,106 +4054,36 @@ "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==" }, "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" + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz", + "integrity": "sha512-07JHC0r1ykIoruKO8ifMXu+xEU8qOXDFETylktdug6vJDACnP+HKevOu3PXyNPzFyTSlz8vrBYlBO1JZRe8Cag==", + "requires": { + "agentkeepalive": "3.5.2", + "cacache": "12.0.3", + "http-cache-semantics": "3.8.1", + "http-proxy-agent": "2.1.0", + "https-proxy-agent": "2.2.4", + "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.2", + "ssri": "6.0.1" }, "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", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + "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==" } } }, - "make-iterator": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", - "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", - "requires": { - "kind-of": "^6.0.2" - } - }, "map-age-cleaner": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "requires": { - "object-visit": "^1.0.0" - } - }, - "matchdep": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", - "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=", "requires": { - "findup-sync": "^2.0.0", - "micromatch": "^3.0.4", - "resolve": "^1.4.0", - "stack-trace": "0.0.10" - }, - "dependencies": { - "findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "requires": { - "is-extglob": "^2.1.0" - } - }, - "resolve": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", - "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", - "requires": { - "path-parse": "^1.0.6" - } - } + "p-defer": "1.0.0" } }, "md5.js": { @@ -5974,9 +4091,9 @@ "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" + "hash-base": "3.0.4", + "inherits": "2.0.4", + "safe-buffer": "5.2.0" } }, "media-typer": { @@ -5985,11 +4102,28 @@ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "requires": { + "map-age-cleaner": "0.1.3", + "mimic-fn": "2.1.0", + "p-is-promise": "2.1.0" + } + }, + "memoizee": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz", + "integrity": "sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg==", "requires": { - "mimic-fn": "^1.0.0" + "d": "1.0.1", + "es5-ext": "0.10.53", + "es6-weak-map": "2.0.3", + "event-emitter": "0.3.5", + "is-promise": "2.1.0", + "lru-queue": "0.1.0", + "next-tick": "1.0.0", + "timers-ext": "0.1.7" } }, "memorystream": { @@ -6008,7 +4142,7 @@ "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", "dev": true, "requires": { - "source-map": "^0.6.1" + "source-map": "0.6.1" } }, "methods": { @@ -6016,33 +4150,13 @@ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "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" - } - }, "miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" + "bn.js": "4.11.8", + "brorand": "1.1.0" } }, "mime": { @@ -6051,22 +4165,22 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz", + "integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==" }, "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "version": "2.1.25", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.25.tgz", + "integrity": "sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg==", "requires": { - "mime-db": "1.40.0" + "mime-db": "1.42.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==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, "mimic-response": { "version": "1.0.1", @@ -6078,7 +4192,7 @@ "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", "requires": { - "dom-walk": "^0.1.0" + "dom-walk": "0.1.1" } }, "minimalistic-assert": { @@ -6096,36 +4210,29 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "1.1.11" } }, "minimist": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" + "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==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", "requires": { - "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==" - } + "safe-buffer": "5.2.0", + "yallist": "3.1.1" } }, "minizlib": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", "requires": { - "minipass": "^2.2.1" + "minipass": "2.9.0" } }, "mississippi": { @@ -6133,35 +4240,16 @@ "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" - } - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "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==", - "requires": { - "is-plain-object": "^2.0.4" - } - } + "concat-stream": "1.6.2", + "duplexify": "3.7.1", + "end-of-stream": "1.4.4", + "flush-write-stream": "1.1.1", + "from2": "2.3.0", + "parallel-transform": "1.2.0", + "pump": "3.0.0", + "pumpify": "1.5.1", + "stream-each": "1.2.3", + "through2": "2.0.5" } }, "mkdirp": { @@ -6170,13 +4258,6 @@ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - } } }, "mkdirp-promise": { @@ -6184,13 +4265,13 @@ "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", "requires": { - "mkdirp": "*" + "mkdirp": "0.5.1" } }, "mocha": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.4.tgz", - "integrity": "sha512-PN8CIy4RXsIoxoFJzS4QNnCH4psUCPWc4/rPrst/ecSJJbLBkubMiyGCP2Kj/9YnWbotFqAoeXyXMucj7gwCFg==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.2.tgz", + "integrity": "sha512-FgDS9Re79yU1xz5d+C4rv1G7QagNGHZ+iXF81hO8zY35YZZcLEsJVfFolfsqKFWunATEvNzMK0r/CwWd/szO9A==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -6213,333 +4294,97 @@ "supports-color": "6.0.0", "which": "1.3.1", "wide-align": "1.1.3", - "yargs": "13.2.2", - "yargs-parser": "13.0.0", - "yargs-unparser": "1.5.0" + "yargs": "13.3.0", + "yargs-parser": "13.1.1", + "yargs-unparser": "1.6.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": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "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" - } - } - } - }, - "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" - } - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "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" - } - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "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 - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "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 - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.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==", - "dev": true, - "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==", - "dev": true, - "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==", - "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=", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", "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": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.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 - }, - "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": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ms": "2.1.1" } }, - "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.4", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "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==", + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, - "yargs": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", - "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", + "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 + }, + "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=", + "dev": true + }, + "supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", "dev": true, "requires": { - "cliui": "^4.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.0.0" + "has-flag": "3.0.0" } }, - "yargs-parser": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", - "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "yargs": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "dev": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "cliui": "5.0.0", + "find-up": "3.0.0", + "get-caller-file": "2.0.5", + "require-directory": "2.1.1", + "require-main-filename": "2.0.0", + "set-blocking": "2.0.0", + "string-width": "3.1.0", + "which-module": "2.0.0", + "y18n": "4.0.0", + "yargs-parser": "13.1.1" } } } }, "mock-fs": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.1.tgz", - "integrity": "sha512-w22rOL5ZYu6HbUehB5deurghGM0hS/xBVyHMGKOuQctkk93J9z9VEOhDsiWrXOprVNQpP9uzGKdl8v9mFspKuw==" + "version": "4.10.4", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.4.tgz", + "integrity": "sha512-gDfZDLaPIvtOusbusLinfx6YSe2YpQsDT8qdP41P47dQ/NQggtkHukz7hwqgt8QvMBmAv+Z6DGmXPyb5BWX2nQ==" }, "mout": { "version": "0.11.1", @@ -6551,62 +4396,39 @@ "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" + "aproba": "1.2.0", + "copy-concurrently": "1.0.5", + "fs-write-stream-atomic": "1.0.10", + "mkdirp": "0.5.1", + "rimraf": "2.7.1", + "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-stdout": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", - "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", "requires": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" + "any-promise": "1.3.0", + "object-assign": "4.1.1", + "thenify-all": "1.6.0" } }, "nan": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", - "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" }, "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=" }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "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" - } - }, "negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", @@ -6618,10 +4440,9 @@ "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==" }, "nested-error-stacks": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz", - "integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==", - "dev": true + "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", @@ -6631,18 +4452,22 @@ "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "node-alias": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/node-alias/-/node-alias-1.0.4.tgz", "integrity": "sha1-HxuRa1a56iQcATX5fO1pQPVW8pI=", "requires": { - "chalk": "^1.1.1", - "lodash": "^4.2.0" + "chalk": "1.1.3", + "lodash": "4.17.15" }, "dependencies": { + "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": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", @@ -6653,11 +4478,19 @@ "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" + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" } }, "supports-color": { @@ -6673,8 +4506,8 @@ "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", "dev": true, "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" + "object.getownpropertydescriptors": "2.1.0", + "semver": "5.7.1" } }, "node-fetch-npm": { @@ -6682,9 +4515,9 @@ "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz", "integrity": "sha512-nJIxm1QmAj4v3nfCvEeCrYSoVwXyxLnaPBK5W1W5DGEJwjlKuC2VEUycGw5oxk+4zZahRrB84PUJJgEmhFTDFw==", "requires": { - "encoding": "^0.1.11", - "json-parse-better-errors": "^1.0.0", - "safe-buffer": "^5.1.1" + "encoding": "0.1.12", + "json-parse-better-errors": "1.0.2", + "safe-buffer": "5.2.0" } }, "nopt": { @@ -6692,7 +4525,7 @@ "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "requires": { - "abbrev": "1" + "abbrev": "1.0.9" } }, "normalize-package-data": { @@ -6700,87 +4533,74 @@ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "hosted-git-info": "2.8.5", + "resolve": "1.14.1", + "semver": "5.7.1", + "validate-npm-package-license": "3.0.4" }, "dependencies": { "resolve": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", - "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.1.tgz", + "integrity": "sha512-fn5Wobh4cxbLzuHaE+nphztHy43/b++4M6SsGFC2gB8uYwf0C8LcarfCz1un7UTW8OFQg9iNjZ4xpcFVGebDPg==", "requires": { - "path-parse": "^1.0.6" + "path-parse": "1.0.6" } } } }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, "normalize-url": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.3.0.tgz", - "integrity": "sha512-0NLtR71o4k6GLP+mr6Ty34c5GA6CMoEsncKJxvQd8NzPxaHRJNnb5gZE8R1XF4CPIS7QPHLJ74IFszwtNVAHVQ==" + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" }, - "now-and-later": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", - "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "npm-bundled": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", + "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", "requires": { - "once": "^1.3.2" + "npm-normalize-package-bin": "1.0.1" } }, - "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.21", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-3.1.21.tgz", - "integrity": "sha512-t7KygdHZ1cF2jS6kcOPiUg6s53Sq5jcOqHnddOe92qW7Xd4mh9AUT52OYYQ0YfAiP7VIdZ5379/G/atG6J0WDA==", - "requires": { - "chalk": "^2.4.2", - "cint": "^8.2.1", - "cli-table": "^0.3.1", - "commander": "^3.0.0", - "fast-diff": "^1.2.0", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-3.2.2.tgz", + "integrity": "sha512-smZLGQWYbNOQVL787LwxTKakhTll/GZ4EwlKRfskD+eTCSpxdwpbkUHbT0QxyCf1uZw86TXeAFGw8ETzmW3Fqw==", + "requires": { + "chalk": "2.4.2", + "cint": "8.2.1", + "cli-table": "0.3.1", + "commander": "3.0.2", + "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.15", - "node-alias": "^1.0.4", - "pacote": "^9.5.4", - "progress": "^2.0.3", - "prompts": "^2.2.1", - "rc-config-loader": "^2.0.4", - "requireg": "^0.2.2", - "semver": "^6.3.0", - "semver-utils": "^1.1.4", - "spawn-please": "^0.3.0", - "update-notifier": "^3.0.1" + "get-stdin": "7.0.0", + "json-parse-helpfulerror": "1.0.3", + "libnpmconfig": "1.2.1", + "lodash": "4.17.15", + "node-alias": "1.0.4", + "pacote": "9.5.11", + "progress": "2.0.3", + "prompts": "2.3.0", + "rc-config-loader": "2.0.5", + "requireg": "0.2.2", + "semver": "6.3.0", + "semver-utils": "1.1.4", + "spawn-please": "0.3.0", + "update-notifier": "3.0.1" }, "dependencies": { "commander": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.0.tgz", - "integrity": "sha512-pl3QrGOBa9RZaslQiqnnKX2J068wcQw7j9AIaBQ9/JEp5RY6je4jKTImg0Bd+rpoONSe7GUFSgkxLeo17m3Pow==" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==" }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "locate-path": "5.0.0", + "path-exists": "4.0.0" } }, "locate-path": { @@ -6788,20 +4608,7 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "requires": { - "p-locate": "^4.1.0" - } - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" - }, - "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": "4.1.0" } }, "p-locate": { @@ -6809,14 +4616,9 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "requires": { - "p-limit": "^2.2.0" + "p-limit": "2.2.1" } }, - "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": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -6829,62 +4631,53 @@ } } }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==" + }, "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==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", "requires": { - "hosted-git-info": "^2.6.0", - "osenv": "^0.1.5", - "semver": "^5.5.0", - "validate-npm-package-name": "^3.0.0" + "hosted-git-info": "2.8.5", + "osenv": "0.1.5", + "semver": "5.7.1", + "validate-npm-package-name": "3.0.0" } }, "npm-packlist": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.4.tgz", - "integrity": "sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw==", + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.7.tgz", + "integrity": "sha512-vAj7dIkp5NhieaGZxBJB8fF4R0078rqsmhJcAfXZ6O7JJhjhPK96n5Ry1oZcfLXgfun0GWTZPOxaEyqv8GBykQ==", "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" + "ignore-walk": "3.0.3", + "npm-bundled": "1.1.1" } }, "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==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz", + "integrity": "sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw==", "requires": { - "figgy-pudding": "^3.5.1", - "npm-package-arg": "^6.0.0", - "semver": "^5.4.1" + "figgy-pudding": "3.5.1", + "npm-package-arg": "6.1.1", + "semver": "5.7.1" } }, "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": { - "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", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" - } + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.2.tgz", + "integrity": "sha512-Z0IFtPEozNdeZRPh3aHHxdG+ZRpzcbQaJLthsm3VhNf6DScicTFRHZzK82u8RsJUsUHkX+QH/zcB/5pmd20H4A==", + "requires": { + "JSONStream": "1.3.5", + "bluebird": "3.7.2", + "figgy-pudding": "3.5.1", + "lru-cache": "5.1.1", + "make-fetch-happen": "5.0.2", + "npm-package-arg": "6.1.1", + "safe-buffer": "5.2.0" } }, "npm-run-path": { @@ -6892,7 +4685,7 @@ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "requires": { - "path-key": "^2.0.0" + "path-key": "2.0.1" } }, "number-is-nan": { @@ -6922,135 +4715,47 @@ "integrity": "sha512-OI0vm6ZGUnoGZv/tLdZ2esSVzDwUC88SNs+6JoSOMVxA+gKMB8Tk7jBwgemLx4O40lhhvZCVw1C+OYLOBOPXWw==", "dev": true, "requires": { - "archy": "^1.0.0", - "caching-transform": "^3.0.2", - "convert-source-map": "^1.6.0", - "cp-file": "^6.2.0", - "find-cache-dir": "^2.1.0", - "find-up": "^3.0.0", - "foreground-child": "^1.5.6", - "glob": "^7.1.3", - "istanbul-lib-coverage": "^2.0.5", - "istanbul-lib-hook": "^2.0.7", - "istanbul-lib-instrument": "^3.3.0", - "istanbul-lib-report": "^2.0.8", - "istanbul-lib-source-maps": "^3.0.6", - "istanbul-reports": "^2.2.4", - "js-yaml": "^3.13.1", - "make-dir": "^2.1.0", - "merge-source-map": "^1.1.0", - "resolve-from": "^4.0.0", - "rimraf": "^2.6.3", - "signal-exit": "^3.0.2", - "spawn-wrap": "^1.4.2", - "test-exclude": "^5.2.3", - "uuid": "^3.3.2", - "yargs": "^13.2.2", - "yargs-parser": "^13.0.0" + "archy": "1.0.0", + "caching-transform": "3.0.2", + "convert-source-map": "1.7.0", + "cp-file": "6.2.0", + "find-cache-dir": "2.1.0", + "find-up": "3.0.0", + "foreground-child": "1.5.6", + "glob": "7.1.6", + "istanbul-lib-coverage": "2.0.5", + "istanbul-lib-hook": "2.0.7", + "istanbul-lib-instrument": "3.3.0", + "istanbul-lib-report": "2.0.8", + "istanbul-lib-source-maps": "3.0.6", + "istanbul-reports": "2.2.6", + "js-yaml": "3.13.1", + "make-dir": "2.1.0", + "merge-source-map": "1.1.0", + "resolve-from": "4.0.0", + "rimraf": "2.7.1", + "signal-exit": "3.0.2", + "spawn-wrap": "1.4.3", + "test-exclude": "5.2.3", + "uuid": "3.3.3", + "yargs": "13.2.4", + "yargs-parser": "13.1.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 - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "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", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.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=", - "dev": true - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "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==", - "dev": true, - "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==", + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "pify": "4.0.1", + "semver": "5.7.1" } }, - "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==", - "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=", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, "resolve-from": { @@ -7059,76 +4764,11 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "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": { - "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==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "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==", + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", "dev": true - }, - "yargs": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", - "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.1" - } - }, - "yargs-parser": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } } } }, @@ -7142,116 +4782,45 @@ "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=", - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "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=", - "requires": { - "is-descriptor": "^0.1.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==" - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "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 }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "requires": { - "isobject": "^3.0.0" - } - }, "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" - } - }, - "object.defaults": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", - "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", - "requires": { - "array-each": "^1.0.1", - "array-slice": "^1.0.0", - "for-own": "^1.0.0", - "isobject": "^3.0.0" + "define-properties": "1.1.3", + "function-bind": "1.1.1", + "has-symbols": "1.0.1", + "object-keys": "1.1.1" } }, "object.getownpropertydescriptors": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.1" - } - }, - "object.map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", - "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", - "requires": { - "for-own": "^1.0.0", - "make-iterator": "^1.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=", - "requires": { - "isobject": "^3.0.1" - } - }, - "object.reduce": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", - "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", - "requires": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" + "define-properties": "1.1.3", + "es-abstract": "1.17.0-next.1" } }, "oboe": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.3.tgz", - "integrity": "sha1-K0hl29Rr6BIlcT9Om/5Lz09oCk8=", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.4.tgz", + "integrity": "sha1-IMiM2wwVNxuwQRklfU/dNLCqSfY=", "requires": { - "http-https": "^1.0.0" + "http-https": "1.0.0" } }, "on-finished": { @@ -7267,20 +4836,20 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "wrappy": "1" + "wrappy": "1.0.2" } }, "openzeppelin-test-helpers": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/openzeppelin-test-helpers/-/openzeppelin-test-helpers-0.4.0.tgz", - "integrity": "sha512-dcYUSolaWlZuQ6Dnc75ECZVWj6/6ALUcZBeihIKT82UXF7+UozoR+Azmg6aRw+mMLf/Bktzto+44dDooGUPw9g==", - "requires": { - "ansi-colors": "^3.2.3", - "chai-bn": "^0.1.1", - "ethjs-abi": "^0.2.1", - "semver": "^5.6.0", - "truffle-contract": "^4.0.8", - "web3-utils": "1.0.0-beta.37" + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/openzeppelin-test-helpers/-/openzeppelin-test-helpers-0.4.3.tgz", + "integrity": "sha512-ln5Exl5fciLIKIUZ6yX6Q2kO/XMQLhNh8G/uEcVfIPZCl/Q0z64ayqZZmsQLGJx1HpSZS27XjC5d48PjX72eEw==", + "requires": { + "ansi-colors": "3.2.4", + "chai-bn": "0.1.1", + "ethjs-abi": "0.2.1", + "semver": "5.7.1", + "truffle-contract": "4.0.31", + "web3-utils": "1.2.4" } }, "optimist": { @@ -7288,36 +4857,28 @@ "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" + "minimist": "0.0.8", + "wordwrap": "0.0.3" }, "dependencies": { "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" - } - } - }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" + } } }, - "ordered-read-streams": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", - "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "requires": { - "readable-stream": "^2.0.1" + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "word-wrap": "1.2.3" } }, "original-require": { @@ -7331,11 +4892,13 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" }, "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "requires": { - "lcid": "^1.0.0" + "execa": "1.0.0", + "lcid": "2.0.0", + "mem": "4.3.0" } }, "os-tmpdir": { @@ -7348,20 +4911,19 @@ "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" } }, "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==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==" }, "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" }, "p-finally": { "version": "1.0.0", @@ -7371,23 +4933,22 @@ "p-is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", - "dev": true + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==" }, "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", "requires": { - "p-try": "^1.0.0" + "p-try": "2.2.0" } }, "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "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": "^1.1.0" + "p-limit": "2.2.1" } }, "p-timeout": { @@ -7395,13 +4956,13 @@ "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", "requires": { - "p-finally": "^1.0.0" + "p-finally": "1.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=" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, "package-hash": { "version": "3.0.0", @@ -7409,10 +4970,10 @@ "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", "dev": true, "requires": { - "graceful-fs": "^4.1.15", - "hasha": "^3.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" + "graceful-fs": "4.2.3", + "hasha": "3.0.0", + "lodash.flattendeep": "4.4.0", + "release-zalgo": "1.0.0" } }, "package-json": { @@ -7420,230 +4981,103 @@ "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", "requires": { - "got": "^9.6.0", - "registry-auth-token": "^4.0.0", - "registry-url": "^5.0.0", - "semver": "^6.2.0" + "got": "9.6.0", + "registry-auth-token": "4.0.0", + "registry-url": "5.1.0", + "semver": "6.3.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" - } - }, - "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" - } - }, - "p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==" - }, - "prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - }, - "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" - } } } }, "pacote": { - "version": "9.5.5", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.5.tgz", - "integrity": "sha512-jAEP+Nqj4kyMWyNpfTU/Whx1jA7jEc5cCOlurm0/0oL+v8TAp1QSsK83N7bYe+2bEdFzMAtPG5TBebjzzGV0cA==", - "requires": { - "bluebird": "^3.5.3", - "cacache": "^12.0.2", - "figgy-pudding": "^3.5.1", - "get-stream": "^4.1.0", - "glob": "^7.1.3", - "infer-owner": "^1.0.4", - "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": { - "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" - } - }, - "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" - } - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" - } + "version": "9.5.11", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.11.tgz", + "integrity": "sha512-DMDPvFKCjCg6zMS4IfzZyvT57O/bX8XGG00eEoy4K/S4Wj+qiN8KbnmKpsTvfS6OL9r5TAicxMKWbj1yV2Yh4g==", + "requires": { + "bluebird": "3.7.2", + "cacache": "12.0.3", + "chownr": "1.1.3", + "figgy-pudding": "3.5.1", + "get-stream": "4.1.0", + "glob": "7.1.6", + "infer-owner": "1.0.4", + "lru-cache": "5.1.1", + "make-fetch-happen": "5.0.2", + "minimatch": "3.0.4", + "minipass": "2.9.0", + "mississippi": "3.0.0", + "mkdirp": "0.5.1", + "normalize-package-data": "2.5.0", + "npm-normalize-package-bin": "1.0.1", + "npm-package-arg": "6.1.1", + "npm-packlist": "1.4.7", + "npm-pick-manifest": "3.0.2", + "npm-registry-fetch": "4.0.2", + "osenv": "0.1.5", + "promise-inflight": "1.0.1", + "promise-retry": "1.1.1", + "protoduck": "5.0.1", + "rimraf": "2.7.1", + "safe-buffer": "5.2.0", + "semver": "5.7.1", + "ssri": "6.0.1", + "tar": "4.4.13", + "unique-filename": "1.1.1", + "which": "1.3.1" } }, "parallel-transform": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", - "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", "requires": { - "cyclist": "~0.2.2", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" + "cyclist": "1.0.1", + "inherits": "2.0.4", + "readable-stream": "2.3.6" } }, "parse-asn1": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", - "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", - "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-filepath": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", - "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", + "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", "requires": { - "is-absolute": "^1.0.0", - "map-cache": "^0.2.0", - "path-root": "^0.1.1" + "asn1.js": "4.10.1", + "browserify-aes": "1.2.0", + "create-hash": "1.2.0", + "evp_bytestokey": "1.0.3", + "pbkdf2": "3.0.17", + "safe-buffer": "5.2.0" } }, "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" - } + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.3.tgz", + "integrity": "sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA==" }, "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, "requires": { - "error-ex": "^1.2.0" + "error-ex": "1.3.2", + "json-parse-better-errors": "1.0.2" } }, - "parse-node-version": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", - "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==" - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" - }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" - }, "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "requires": { - "pinkie-promise": "^2.0.0" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" }, "path-is-absolute": { "version": "1.0.1", @@ -7665,32 +5099,26 @@ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, - "path-root": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", - "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", - "requires": { - "path-root-regex": "^0.1.0" - } - }, - "path-root-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", - "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=" - }, "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.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=", + "dev": true + } } }, "pathval": { @@ -7703,11 +5131,11 @@ "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" + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "ripemd160": "2.0.2", + "safe-buffer": "5.2.0", + "sha.js": "2.4.11" } }, "pend": { @@ -7735,7 +5163,7 @@ "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "requires": { - "pinkie": "^2.0.0" + "pinkie": "2.0.4" } }, "pkg-dir": { @@ -7744,79 +5172,18 @@ "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", "dev": true, "requires": { - "find-up": "^3.0.0" - }, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "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=", - "dev": true - } + "find-up": "3.0.0" } }, - "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=" - }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" }, "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" - }, - "pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" }, "process": { "version": "0.5.2", @@ -7843,17 +5210,17 @@ "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" + "err-code": "1.1.2", + "retry": "0.10.1" } }, "prompts": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.2.1.tgz", - "integrity": "sha512-VObPvJiWPhpZI6C5m60XOzTfnYg/xc/an+r9VYymj9WJW3B/DIH+REzjpAACPf8brwPeP+7vz3bIim3S+AaMjw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.0.tgz", + "integrity": "sha512-NfbbPPg/74fT7wk2XYQ7hAIp9zJyZp5Fu19iRbORqqy1BhtrkZ0fPafBU+7bmn8ie69DpT0R6QpJIN2oisYjJg==", "requires": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.3" + "kleur": "3.0.3", + "sisteransi": "1.0.4" } }, "protoduck": { @@ -7861,7 +5228,7 @@ "resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz", "integrity": "sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==", "requires": { - "genfun": "^5.0.0" + "genfun": "5.0.0" } }, "proxy-addr": { @@ -7869,7 +5236,7 @@ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", "requires": { - "forwarded": "~0.1.2", + "forwarded": "0.1.2", "ipaddr.js": "1.9.0" } }, @@ -7879,21 +5246,21 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, "psl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.2.0.tgz", - "integrity": "sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA==" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.6.0.tgz", + "integrity": "sha512-SYKKmVel98NCOYXpkwUqZqh0ahZeeKfmisiLIcEZdsb+WbLv02g/dI5BUmZnIyOe7RzZtLax81nnb2HbvC2tzA==" }, "public-encrypt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.2.0", + "parse-asn1": "5.1.5", + "randombytes": "2.1.0", + "safe-buffer": "5.2.0" } }, "pump": { @@ -7901,8 +5268,8 @@ "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" + "end-of-stream": "1.4.4", + "once": "1.4.0" } }, "pumpify": { @@ -7910,9 +5277,9 @@ "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" + "duplexify": "3.7.1", + "inherits": "2.0.4", + "pump": "2.0.1" }, "dependencies": { "pump": { @@ -7920,8 +5287,8 @@ "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "end-of-stream": "1.4.4", + "once": "1.4.0" } } } @@ -7941,22 +5308,17 @@ "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", "requires": { - "decode-uri-component": "^0.2.0", - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" + "decode-uri-component": "0.2.0", + "object-assign": "4.1.1", + "strict-uri-encode": "1.1.0" } }, - "querystringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", - "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==" - }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "requires": { - "safe-buffer": "^5.1.0" + "safe-buffer": "5.2.0" } }, "randomfill": { @@ -7964,8 +5326,8 @@ "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" + "randombytes": "2.1.0", + "safe-buffer": "5.2.0" } }, "randomhex": { @@ -7994,83 +5356,57 @@ "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" + "deep-extend": "0.6.0", + "ini": "1.3.5", + "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=" + }, + "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=" } } }, "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": { - "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=" - } + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/rc-config-loader/-/rc-config-loader-2.0.5.tgz", + "integrity": "sha512-T464K2MQlnNWOblUDIglpFhyN+zYJq7jSlL++/N0hUkcmIXeNFumwXFVdtf8qhUGohn4RYQ0wdi74R575I44PQ==", + "requires": { + "debug": "4.1.1", + "js-yaml": "3.13.1", + "json5": "2.1.1", + "object-assign": "4.1.1", + "object-keys": "1.1.1", + "path-exists": "3.0.0", + "require-from-string": "2.0.2" } }, "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" + "load-json-file": "4.0.0", + "normalize-package-data": "2.5.0", + "path-type": "3.0.0" } }, "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "dev": true, "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" + "find-up": "3.0.0", + "read-pkg": "3.0.0" } }, "readable-stream": { @@ -8078,13 +5414,13 @@ "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" + "core-util-is": "1.0.2", + "inherits": "2.0.4", + "isarray": "1.0.0", + "process-nextick-args": "2.0.1", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" }, "dependencies": { "safe-buffer": { @@ -8094,22 +5430,12 @@ } } }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "requires": { - "resolve": "^1.1.6" + "resolve": "1.1.7" } }, "regenerator-runtime": { @@ -8117,22 +5443,13 @@ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==" }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, "registry-auth-token": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.0.0.tgz", "integrity": "sha512-lpQkHxd9UL6tb3k/aHAVfnVtn+Bcs9ob5InuFLLEDqSqeq+AljB8GZW9xY0x7F+xYwEcjKe07nyoxzEYz6yvkw==", "requires": { - "rc": "^1.2.8", - "safe-buffer": "^5.0.1" + "rc": "1.2.8", + "safe-buffer": "5.2.0" } }, "registry-url": { @@ -8140,7 +5457,7 @@ "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", "requires": { - "rc": "^1.2.8" + "rc": "1.2.8" } }, "release-zalgo": { @@ -8149,63 +5466,7 @@ "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", "dev": true, "requires": { - "es6-error": "^4.0.1" - } - }, - "remove-bom-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", - "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", - "requires": { - "is-buffer": "^1.1.5", - "is-utf8": "^0.2.1" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - } - } - }, - "remove-bom-stream": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", - "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", - "requires": { - "remove-bom-buffer": "^3.0.0", - "safe-buffer": "^5.1.0", - "through2": "^2.0.3" - } - }, - "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=" - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" - }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=" - }, - "replace-homedir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", - "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=", - "requires": { - "homedir-polyfill": "^1.0.1", - "is-absolute": "^1.0.0", - "remove-trailing-separator": "^1.1.0" + "es6-error": "4.1.1" } }, "req-cwd": { @@ -8213,7 +5474,7 @@ "resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-1.0.1.tgz", "integrity": "sha1-DXOurpJm5penj3l2AZZ352rPD/8=", "requires": { - "req-from": "^1.0.1" + "req-from": "1.0.1" } }, "req-from": { @@ -8221,7 +5482,7 @@ "resolved": "https://registry.npmjs.org/req-from/-/req-from-1.0.1.tgz", "integrity": "sha1-v4HaUUeUfTLRO5R9wSpYrUWHNQ4=", "requires": { - "resolve-from": "^2.0.0" + "resolve-from": "2.0.0" } }, "request": { @@ -8229,32 +5490,37 @@ "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" + "aws-sign2": "0.7.0", + "aws4": "1.9.0", + "caseless": "0.12.0", + "combined-stream": "1.0.8", + "extend": "3.0.2", + "forever-agent": "0.6.1", + "form-data": "2.3.3", + "har-validator": "5.1.3", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.25", + "oauth-sign": "0.9.0", + "performance-now": "2.1.0", + "qs": "6.5.2", + "safe-buffer": "5.2.0", + "tough-cookie": "2.4.3", + "tunnel-agent": "0.6.0", + "uuid": "3.3.3" }, "dependencies": { "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" } } }, @@ -8269,111 +5535,59 @@ "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=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, "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" + "nested-error-stacks": "2.0.1", + "rc": "1.2.8", + "resolve": "1.7.1" }, "dependencies": { - "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==" - }, "resolve": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", "requires": { - "path-parse": "^1.0.5" + "path-parse": "1.0.6" } } } }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" - }, "resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - } - }, "resolve-from": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" }, - "resolve-options": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", - "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", - "requires": { - "value-or-function": "^3.0.0" - } - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" - }, "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" + "lowercase-keys": "1.0.1" } }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" - }, "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==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "requires": { - "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" - } - } + "glob": "7.1.6" } }, "ripemd160": { @@ -8381,17 +5595,16 @@ "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" + "hash-base": "3.0.4", + "inherits": "2.0.4" } }, "rlp": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz", - "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.4.tgz", + "integrity": "sha512-fdq2yYCWpAQBhwkZv+Z8o/Z4sPmYm1CUq6P7n6lVTOdb949CnqA0sndXal5C1NleSVSZm6q5F3iEbauyVln/iw==", "requires": { - "bn.js": "^4.11.1", - "safe-buffer": "^5.1.1" + "bn.js": "4.11.8" } }, "run-queue": { @@ -8399,15 +5612,7 @@ "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", "requires": { - "aproba": "^1.1.1" - } - }, - "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" + "aproba": "1.2.0" } }, "safe-buffer": { @@ -8415,14 +5620,6 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "requires": { - "ret": "~0.1.10" - } - }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -8433,7 +5630,7 @@ "resolved": "https://registry.npmjs.org/scrypt/-/scrypt-6.0.3.tgz", "integrity": "sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0=", "requires": { - "nan": "^2.0.8" + "nan": "2.14.0" } }, "scrypt-async": { @@ -8443,47 +5640,47 @@ "dev": true }, "scrypt-js": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", - "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", + "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==" }, "scrypt.js": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.2.0.tgz", "integrity": "sha1-r40UZbcemZARC+38WTuUeeA6ito=", "requires": { - "scrypt": "^6.0.2", - "scryptsy": "^1.2.1" + "scrypt": "6.0.3", + "scryptsy": "1.2.1" + }, + "dependencies": { + "scryptsy": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", + "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", + "requires": { + "pbkdf2": "3.0.17" + } + } } }, "scryptsy": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", - "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", - "requires": { - "pbkdf2": "^3.0.3" - } + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz", + "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==" }, "secp256k1": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", - "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", - "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==" - } + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "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.5.2", + "nan": "2.14.0", + "safe-buffer": "5.2.0" } }, "seek-bzip": { @@ -8491,38 +5688,20 @@ "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", "requires": { - "commander": "~2.8.1" - }, - "dependencies": { - "commander": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", - "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", - "requires": { - "graceful-readlink": ">= 1.0.0" - } - } + "commander": "2.8.1" } }, "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, "semver-diff": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", "requires": { - "semver": "^5.0.3" - } - }, - "semver-greatest-satisfied-range": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", - "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=", - "requires": { - "sver-compat": "^1.5.0" + "semver": "5.7.1" } }, "semver-utils": { @@ -8536,18 +5715,18 @@ "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", "requires": { "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", + "depd": "1.1.2", + "destroy": "1.0.4", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", "fresh": "0.5.2", - "http-errors": "~1.7.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" + "on-finished": "2.3.0", + "range-parser": "1.2.1", + "statuses": "1.5.0" }, "dependencies": { "debug": { @@ -8577,9 +5756,9 @@ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "parseurl": "1.3.3", "send": "0.17.1" } }, @@ -8588,11 +5767,11 @@ "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", "requires": { - "body-parser": "^1.16.0", - "cors": "^2.8.1", - "express": "^4.14.0", - "request": "^2.79.0", - "xhr": "^2.3.3" + "body-parser": "1.19.0", + "cors": "2.8.5", + "express": "4.17.1", + "request": "2.88.0", + "xhr": "2.5.0" } }, "set-blocking": { @@ -8600,31 +5779,10 @@ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, - "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==", - "requires": { - "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=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" }, "setprototypeof": { "version": "1.1.1", @@ -8636,16 +5794,23 @@ "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "2.0.4", + "safe-buffer": "5.2.0" } }, "sha3": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.3.tgz", - "integrity": "sha512-sOWDZi8cDBRkLfWOw18wvJyNblXDHzwMGnRWut8zNNeIeLnmMRO17bjpLc7OzMuj1ASUgx2IyohzUCAl+Kx5vA==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.6.tgz", + "integrity": "sha512-KgLGmJGrmNB4JWVsAV11Yk6KbvsAiygWJc7t5IebWva/0NukNrjJqhtKhzy3Eiv2AKuGvhZZt7dt1mDo7HkoiQ==", "requires": { "nan": "2.13.2" + }, + "dependencies": { + "nan": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" + } } }, "shebang-command": { @@ -8653,7 +5818,7 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "1.0.0" } }, "shebang-regex": { @@ -8666,24 +5831,9 @@ "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz", "integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==", "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - }, - "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" - } - } + "glob": "7.1.6", + "interpret": "1.2.0", + "rechoir": "0.6.2" } }, "signal-exit": { @@ -8701,143 +5851,28 @@ "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", "requires": { - "decompress-response": "^3.3.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" + "decompress-response": "3.3.0", + "once": "1.4.0", + "simple-concat": "1.0.0" } }, "sisteransi": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.3.tgz", - "integrity": "sha512-SbEG75TzH8G7eVXFSN5f9EExILKfly7SUvVY5DhhYLvfhKqhDFY0OzevWa/zwak0RLRfWS5AvfMWpd9gJvr5Yg==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.4.tgz", + "integrity": "sha512-/ekMoM4NJ59ivGSfKapeG+FWtrmWvA1p6FBZwXrqojw90vJu8lBmrTxCMuBCydKtkaUe2zt4PlxeTKpjwMbyig==" }, "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==" - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "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" - }, - "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" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "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=", - "requires": { - "is-extendable": "^0.1.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - } - } - }, - "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==", - "requires": { - "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=", - "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==", - "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==", - "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==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", + "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==" }, "socks": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.3.2.tgz", - "integrity": "sha512-pCpjxQgOByDHLlNqlnh/mNSAxIUkyBBuwwhTcV+enZGbDaClPvHdvm6uvOwZfFJkam7cGhBNbb4JxiP8UZkRvQ==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.3.3.tgz", + "integrity": "sha512-o5t52PCNtVdiOvzMry7wU4aOqYWL0PeCXRWBEiJow4/i/wr+wpsJQ9awEu1EonLIqsfGd5qSgDdxEOvCdmBEpA==", "requires": { - "ip": "^1.1.5", - "smart-buffer": "4.0.2" + "ip": "1.1.5", + "smart-buffer": "4.1.0" } }, "socks-proxy-agent": { @@ -8845,8 +5880,8 @@ "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz", "integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==", "requires": { - "agent-base": "~4.2.1", - "socks": "~2.3.2" + "agent-base": "4.2.1", + "socks": "2.3.3" }, "dependencies": { "agent-base": { @@ -8854,7 +5889,7 @@ "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" + "es6-promisify": "5.0.0" } } } @@ -8864,19 +5899,49 @@ "resolved": "https://registry.npmjs.org/sol-explore/-/sol-explore-1.6.2.tgz", "integrity": "sha1-Q66MQZ/TrAVqBfip0fsQIs1B7MI=" }, + "sol-merger": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/sol-merger/-/sol-merger-1.1.1.tgz", + "integrity": "sha512-Wm0sFXauDzJmZgxZ3a3ATfRf8OvBIt1Q+lqJw/UO5aqRbXKnBCt7TzSSLvSWl91uqub4MUubFzq6Bk/tRKnO2Q==", + "requires": { + "cli-color": "1.4.0", + "commander": "2.20.3", + "debug": "4.1.1", + "fs-extra": "8.1.0", + "glob": "7.1.6", + "strip-json-comments": "3.0.1" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "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==", + "requires": { + "graceful-fs": "4.2.3", + "jsonfile": "4.0.0", + "universalify": "0.1.2" + } + } + } + }, "solc": { "version": "0.5.10", "resolved": "https://registry.npmjs.org/solc/-/solc-0.5.10.tgz", "integrity": "sha512-Stdrh/MDkopsXYPRzPehTNYuV80Grr2CnQMuFvWj+EeRVbe3piGHxW47KebWn1sGdmK8FLaMfUehccqJP0KovQ==", "requires": { - "command-exists": "^1.2.8", - "fs-extra": "^0.30.0", - "keccak": "^1.0.2", - "memorystream": "^0.3.1", - "require-from-string": "^2.0.0", - "semver": "^5.5.0", + "command-exists": "1.2.8", + "fs-extra": "0.30.0", + "keccak": "1.4.0", + "memorystream": "0.3.1", + "require-from-string": "2.0.2", + "semver": "5.7.1", "tmp": "0.0.33", - "yargs": "^11.0.0" + "yargs": "11.1.1" }, "dependencies": { "ansi-regex": { @@ -8894,9 +5959,9 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "wrap-ansi": "2.1.0" } }, "find-up": { @@ -8904,469 +5969,229 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "requires": { - "locate-path": "^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=" - }, - "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" + "locate-path": "2.0.0" } }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" - }, - "yargs": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", - "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^9.0.2" - } - }, - "yargs-parser": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", - "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", - "requires": { - "camelcase": "^4.1.0" - } - } - } - }, - "solidity-coverage": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.6.4.tgz", - "integrity": "sha512-jj7JBag7SAh1TZE7cok+Hd6jKCjC5fTnZZM4K3CJMHOMjtXb9R/+4vHoCksUEYCIYNVpSp7+2ioxOPFRh1gBBQ==", - "requires": { - "death": "^1.1.0", - "ethereumjs-testrpc-sc": "^6.5.1-sc.0", - "istanbul": "^0.4.5", - "keccakjs": "^0.2.1", - "req-cwd": "^1.0.1", - "shelljs": "^0.8.3", - "sol-explore": "^1.6.2", - "solidity-parser-antlr": "^0.4.7", - "tree-kill": "^1.2.0", - "web3": "1.0.0-beta.50", - "web3-eth-abi": "1.0.0-beta.50" - }, - "dependencies": { - "@types/node": { - "version": "10.14.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.15.tgz", - "integrity": "sha512-CBR5avlLcu0YCILJiDIXeU2pTw7UK/NIxfC63m7d7CVamho1qDEzXKkOtEauQRPMy6MI8mLozth+JJkas7HY6g==" - }, - "ethers": { - "version": "4.0.33", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.33.tgz", - "integrity": "sha512-lAHkSPzBe0Vj+JrhmkEHLtUEKEheVktIjGDyE9gbzF4zf1vibjYgB57LraDHu4/ItqWVkztgsm8GWqcDMN+6vQ==", - "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.4", - "setimmediate": "1.0.4", - "uuid": "2.0.1", - "xmlhttprequest": "1.8.0" - }, - "dependencies": { - "elliptic": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", - "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "inherits": "^2.0.1" - } - }, - "setimmediate": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" - } - } - }, - "eventemitter3": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", - "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==" - }, "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==", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.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==", + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.0" + "graceful-fs": "4.2.3", + "jsonfile": "2.4.0", + "klaw": "1.3.1", + "path-is-absolute": "1.0.1", + "rimraf": "2.7.1" } }, - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + "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==" }, "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "requires": { - "graceful-fs": "^4.1.6" - } - }, - "scrypt-js": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", - "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==" - }, - "swarm-js": { - "version": "0.1.39", - "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.39.tgz", - "integrity": "sha512-QLMqL2rzF6n5s50BptyD6Oi0R1aWlJC5Y17SRIVXRj6OR1DRIPM7nepvrxxkjA1zNzFz6mUOMjfeqeDaWB7OOg==", - "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" + "graceful-fs": "4.2.3" } }, - "tar": { - "version": "4.4.10", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz", - "integrity": "sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==", + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "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" - } - }, - "uuid": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" - }, - "web3": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.50.tgz", - "integrity": "sha512-N4YqT1jl2tZYNWiLk5gA5BMchHJaG76d65z899DT9UTR4iI6mfqe1QIE+1YLII1x+uE8ohFzBq/aaZ8praLeoA==", - "requires": { - "@babel/runtime": "^7.3.1", - "@types/node": "^10.12.18", - "web3-bzz": "1.0.0-beta.50", - "web3-core": "1.0.0-beta.50", - "web3-core-helpers": "1.0.0-beta.50", - "web3-core-method": "1.0.0-beta.50", - "web3-eth": "1.0.0-beta.50", - "web3-eth-personal": "1.0.0-beta.50", - "web3-net": "1.0.0-beta.50", - "web3-providers": "1.0.0-beta.50", - "web3-shh": "1.0.0-beta.50", - "web3-utils": "1.0.0-beta.50" + "bindings": "1.5.0", + "inherits": "2.0.4", + "nan": "2.14.0", + "safe-buffer": "5.2.0" } }, - "web3-bzz": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.0.0-beta.50.tgz", - "integrity": "sha512-0jD4/g+apH7t87cA9gXoZpvvVW7OqQtbu+X+olFKPrS9pKbkwfaKPdRwc1BNbjqvrRYN0K7koT9xV+Lzvyah6w==", + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "requires": { - "@babel/runtime": "^7.3.1", - "@types/node": "^10.12.18", - "lodash": "^4.17.11", - "swarm-js": "^0.1.39" + "p-locate": "2.0.0", + "path-exists": "3.0.0" } }, - "web3-core": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.50.tgz", - "integrity": "sha512-edOHdSnkRREi0vUXXNUsrbkTvXftCDroiF2tEvbPVyiBv0U6/VDYClFdHuZKdrrTRUcn/rUbvBqw8qCt3xgcuQ==", + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "requires": { - "@babel/runtime": "^7.3.1", - "@types/node": "^10.12.18", - "lodash": "^4.17.11", - "web3-utils": "1.0.0-beta.50" + "p-try": "1.0.0" } }, - "web3-core-helpers": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.50.tgz", - "integrity": "sha512-B1LMrlC9c5HEJYmBWUhsxHdJ78w5YGop/ptF1cFL8cHLwTCQqCFFKLgYUg+dax/554TP1xgJ2w/ArLpnPJ8dBg==", + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "requires": { - "@babel/runtime": "^7.3.1", - "lodash": "^4.17.11", - "web3-eth-iban": "1.0.0-beta.50", - "web3-utils": "1.0.0-beta.50" + "p-limit": "1.3.0" } }, - "web3-core-method": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.50.tgz", - "integrity": "sha512-0+L37KDT90DD1fcTye/ZWMyGOLiw0ZxX2vaC8qDSFvAV3scTEuZyEQuR+tCM2aGyUVihy8LdmZwioRwnTXgLwg==", - "requires": { - "@babel/runtime": "^7.3.1", - "eventemitter3": "3.1.0", - "lodash": "^4.17.11" - } + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" }, - "web3-core-subscriptions": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.50.tgz", - "integrity": "sha512-q2Jmuy/BCwcKCFjR6kc03hPbdC6sR0n3IhPVg98Sk7ewgRLur/v3lLDz0fQpY4xE6U0XOqrjxwzlqISkOcP5Kw==", - "requires": { - "@babel/runtime": "^7.3.1", - "eventemitter3": "^3.1.0", - "lodash": "^4.17.11" - } + "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=" }, - "web3-eth": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.50.tgz", - "integrity": "sha512-ojsddEclIdu+C3hfRrLVJK0rcxt2O+Yj7c3b4YEzZQ9+Kd/HaSZfeSpUgKojgmFhUUiCCRTEc2holWtQ+Lx4gQ==", - "requires": { - "@babel/runtime": "^7.3.1", - "eth-lib": "0.2.8", - "rxjs": "^6.4.0", - "web3-core": "1.0.0-beta.50", - "web3-core-helpers": "1.0.0-beta.50", - "web3-core-method": "1.0.0-beta.50", - "web3-core-subscriptions": "1.0.0-beta.50", - "web3-eth-abi": "1.0.0-beta.50", - "web3-eth-accounts": "1.0.0-beta.50", - "web3-eth-contract": "1.0.0-beta.50", - "web3-eth-ens": "1.0.0-beta.50", - "web3-eth-iban": "1.0.0-beta.50", - "web3-eth-personal": "1.0.0-beta.50", - "web3-net": "1.0.0-beta.50", - "web3-providers": "1.0.0-beta.50", - "web3-utils": "1.0.0-beta.50" - }, - "dependencies": { - "eth-lib": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", - "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", - "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" - } - } + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" } }, - "web3-eth-abi": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.50.tgz", - "integrity": "sha512-Nwm1HL3xBbrs43j/9V3gH1CJWWR7jyTDSE7PIkjYVjwgygAjlHPMHzuzGffoFMp2tSQ2DywCGmXAY5I5+vznZw==", + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "@babel/runtime": "^7.3.1", - "ethers": "^4.0.27", - "lodash": "^4.17.11", - "web3-utils": "1.0.0-beta.50" + "ansi-regex": "3.0.0" } }, - "web3-eth-accounts": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.50.tgz", - "integrity": "sha512-cUuYxKhymob87zCUYgw7ieZY6aVStMhClocblI3FKNdI1I8dczhdhZ97qMj5iavOganN7/OxLzeji7ksAoNAhg==", + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "requires": { - "@babel/runtime": "^7.3.1", - "crypto-browserify": "3.12.0", - "eth-lib": "0.2.8", - "lodash": "^4.17.11", - "scrypt.js": "0.2.0", - "uuid": "3.3.2", - "web3-core": "1.0.0-beta.50", - "web3-core-helpers": "1.0.0-beta.50", - "web3-core-method": "1.0.0-beta.50", - "web3-providers": "1.0.0-beta.50", - "web3-utils": "1.0.0-beta.50" + "string-width": "1.0.2", + "strip-ansi": "3.0.1" }, "dependencies": { - "eth-lib": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", - "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" + "number-is-nan": "1.0.1" } }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } } } }, - "web3-eth-contract": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.50.tgz", - "integrity": "sha512-X8R1+qIeD4Dbz1RmQa5m3K1suVFigNgd7EFMp6vVC3ULDjt4R6T0cRmFw/x51v3MQoT7s6Yd1KiEWIAt9IYG6w==", - "requires": { - "@babel/runtime": "^7.3.1", - "lodash": "^4.17.11", - "web3-core": "1.0.0-beta.50", - "web3-core-helpers": "1.0.0-beta.50", - "web3-core-method": "1.0.0-beta.50", - "web3-core-subscriptions": "1.0.0-beta.50", - "web3-eth-abi": "1.0.0-beta.50", - "web3-eth-accounts": "1.0.0-beta.50", - "web3-providers": "1.0.0-beta.50", - "web3-utils": "1.0.0-beta.50" - } - }, - "web3-eth-ens": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.0.0-beta.50.tgz", - "integrity": "sha512-UnhYcNuSNRBOBcbD5y8cTyRh5ENn65/GfZkxCDXAKBY6sD4GzMZNkD7kq+37/34cnZEzzQPPGd9jLZNLXOklyg==", - "requires": { - "@babel/runtime": "^7.3.1", - "eth-ens-namehash": "2.0.8", - "lodash": "^4.17.11", - "web3-core": "1.0.0-beta.50", - "web3-core-helpers": "1.0.0-beta.50", - "web3-core-method": "1.0.0-beta.50", - "web3-eth-abi": "1.0.0-beta.50", - "web3-eth-contract": "1.0.0-beta.50", - "web3-net": "1.0.0-beta.50", - "web3-providers": "1.0.0-beta.50", - "web3-utils": "1.0.0-beta.50" - } + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" }, - "web3-eth-iban": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.50.tgz", - "integrity": "sha512-rW5fpUUW3WaToPxBXNnqTfj5dh2BJ+9uognYAfThh2WWR1+EwWZethsKS/PyU6Jn9uA5p/kQoUIP0JKaeBm80Q==", - "requires": { - "@babel/runtime": "^7.3.1", - "bn.js": "4.11.8", - "web3-utils": "1.0.0-beta.50" + "yargs": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.1.tgz", + "integrity": "sha512-PRU7gJrJaXv3q3yQZ/+/X6KBswZiaQ+zOmdprZcouPYtQgvNU35i+68M4b1ZHLZtYFT5QObFLV+ZkmJYcwKdiw==", + "requires": { + "cliui": "4.1.0", + "decamelize": "1.2.0", + "find-up": "2.1.0", + "get-caller-file": "1.0.3", + "os-locale": "3.1.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "9.0.2" } }, - "web3-eth-personal": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.50.tgz", - "integrity": "sha512-52dS24YfJxx/Uy21RKj2m5rjag1kktdy5rY/R9vDwWZRrJkxfDf058CvtRF+QsD7A6QVxkHCZ9YwEWnLCLW9Cw==", + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", "requires": { - "@babel/runtime": "^7.3.1", - "web3-core": "1.0.0-beta.50", - "web3-core-helpers": "1.0.0-beta.50", - "web3-core-method": "1.0.0-beta.50", - "web3-net": "1.0.0-beta.50", - "web3-providers": "1.0.0-beta.50", - "web3-utils": "1.0.0-beta.50" + "camelcase": "4.1.0" } + } + } + }, + "solidity-coverage": { + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.6.7.tgz", + "integrity": "sha512-Ga0Er5b25sFhy1uaYrQ+jQisP9819nj3zP1pfyAfE8Skg+/OBQ+Ev3sOmYQy9qZMjDuFJ7PCjuFVXdqdBO3cZw==", + "requires": { + "death": "1.1.0", + "ethereumjs-testrpc-sc": "6.5.1-sc.1", + "istanbul": "0.4.5", + "keccakjs": "0.2.3", + "req-cwd": "1.0.1", + "shelljs": "0.8.3", + "sol-explore": "1.6.2", + "solidity-parser-antlr": "0.4.7", + "tree-kill": "1.2.2", + "web3": "1.2.1", + "web3-eth-abi": "1.0.0-beta.55" + }, + "dependencies": { + "@types/node": { + "version": "10.17.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.11.tgz", + "integrity": "sha512-dNd2pp8qTzzNLAs3O8nH3iU9DG9866KHq9L3ISPB7DOGERZN81nW/5/g/KzMJpCU8jrbCiMRBzV9/sCEdRosig==" }, - "web3-net": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.50.tgz", - "integrity": "sha512-T9aBrWYzCeqZTTJlljonTm8x1tEjHT1uBqcdvEYZoyCS1Xxc+zCNBqP4SBfdcfwCeGohhI7bRx9qX1JjYH3cRA==", + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", "requires": { - "@babel/runtime": "^7.3.1", - "lodash": "^4.17.11", - "web3-core": "1.0.0-beta.50", - "web3-core-helpers": "1.0.0-beta.50", - "web3-core-method": "1.0.0-beta.50", - "web3-providers": "1.0.0-beta.50", - "web3-utils": "1.0.0-beta.50" + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" } }, - "web3-shh": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.50.tgz", - "integrity": "sha512-a46Gz/YQdF3HJ4XK7rZh6bJiP3IEq+BDAvdxD1jW54yKM2k3RGarOY8hanC1crxKE7E9Q1UUkrp1Vjrj8XSQuQ==", + "web3": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.1.tgz", + "integrity": "sha512-nNMzeCK0agb5i/oTWNdQ1aGtwYfXzHottFP2Dz0oGIzavPMGSKyVlr8ibVb1yK5sJBjrWVnTdGaOC2zKDFuFRw==", "requires": { - "@babel/runtime": "^7.3.1", - "web3-core": "1.0.0-beta.50", - "web3-core-helpers": "1.0.0-beta.50", - "web3-core-method": "1.0.0-beta.50", - "web3-core-subscriptions": "1.0.0-beta.50", - "web3-net": "1.0.0-beta.50", - "web3-providers": "1.0.0-beta.50", - "web3-utils": "1.0.0-beta.50" + "web3-bzz": "1.2.1", + "web3-core": "1.2.1", + "web3-eth": "1.2.1", + "web3-eth-personal": "1.2.1", + "web3-net": "1.2.1", + "web3-shh": "1.2.1", + "web3-utils": "1.2.1" } }, - "web3-utils": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.50.tgz", - "integrity": "sha512-xGhM/YkepK2x0iMYUl/sws58LzTbodjMGlhZxrCZLZxJ0DoaDyk3UdmZ6aCSCwVTFg4hlVj3doaIhWnwGfhhpQ==", - "requires": { - "@babel/runtime": "^7.3.1", - "@types/bn.js": "^4.11.4", - "@types/node": "^10.12.18", - "bn.js": "4.11.8", - "eth-lib": "0.2.8", - "ethjs-unit": "^0.1.6", - "lodash": "^4.17.11", - "number-to-bn": "1.7.0", - "randomhex": "0.1.5", - "utf8": "2.1.1" + "web3-eth-abi": { + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.55.tgz", + "integrity": "sha512-3h1xnm/vYmKUXTOYAOP0OsB5uijQV76pNNRGKOB6Dq6GR1pbcbD3WrB/4I643YA8l91t5FRzFzUiA3S77R2iqw==", + "requires": { + "@babel/runtime": "7.7.7", + "ethers": "4.0.40", + "lodash": "4.17.15", + "web3-utils": "1.0.0-beta.55" }, "dependencies": { "eth-lib": { @@ -9374,26 +6199,57 @@ "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" + } + }, + "utf8": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.1.tgz", + "integrity": "sha1-LgHbAvfY0JRPdxBPFgnrDDBM92g=" + }, + "web3-utils": { + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.55.tgz", + "integrity": "sha512-ASWqUi8gtWK02Tp8ZtcoAbHenMpQXNvHrakgzvqTNNZn26wgpv+Q4mdPi0KOR6ZgHFL8R/9b5BBoUTglS1WPpg==", + "requires": { + "@babel/runtime": "7.7.7", + "@types/bn.js": "4.11.5", + "@types/node": "10.17.11", + "bn.js": "4.11.8", + "eth-lib": "0.2.8", + "ethjs-unit": "0.1.6", + "lodash": "4.17.15", + "number-to-bn": "1.7.0", + "randombytes": "2.1.0", + "utf8": "2.1.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==" + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } } } }, "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==", + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/solidity-parser-antlr/-/solidity-parser-antlr-0.4.7.tgz", + "integrity": "sha512-iVjNhgqkXw+o+0E+xoLcji+3KuXLe8Rm8omUuVGhsV14+ZsTwQ70nhBRXg8O3t9xwdS0iST1q9NJ5IqHnqpWkA==", "requires": { - "npm-check-updates": "^3.1.11" + "npm-check-updates": "3.2.2" } }, "source-map": { @@ -9401,54 +6257,32 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, - "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==", - "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" - } - }, "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": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "buffer-from": "1.1.1", + "source-map": "0.6.1" } }, - "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=" - }, - "sparkles": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", - "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==" - }, "spawn-please": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/spawn-please/-/spawn-please-0.3.0.tgz", "integrity": "sha1-2zOOxM/2Orxp8dDgjO6euL69nRE=" }, "spawn-wrap": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.2.tgz", - "integrity": "sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.3.tgz", + "integrity": "sha512-IgB8md0QW/+tWqcavuFgKYR/qIRvJkRLPJDFaoXtLLUaVcCDK0+HeFTkmQHj3eprcYhc+gOl0aEA1w7qZlYezw==", "dev": true, "requires": { - "foreground-child": "^1.5.6", - "mkdirp": "^0.5.0", - "os-homedir": "^1.0.1", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.2", - "which": "^1.3.0" + "foreground-child": "1.5.6", + "mkdirp": "0.5.1", + "os-homedir": "1.0.2", + "rimraf": "2.7.1", + "signal-exit": "3.0.2", + "which": "1.3.1" } }, "spdx-correct": { @@ -9456,8 +6290,8 @@ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.5" } }, "spdx-exceptions": { @@ -9470,22 +6304,14 @@ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "spdx-exceptions": "2.2.0", + "spdx-license-ids": "3.0.5" } }, "spdx-license-ids": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", - "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==" - }, - "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==", - "requires": { - "extend-shallow": "^3.0.0" - } + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" }, "sprintf-js": { "version": "1.0.3", @@ -9497,15 +6323,15 @@ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" + "asn1": "0.2.4", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.2", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.2", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "safer-buffer": "2.1.2", + "tweetnacl": "0.14.5" } }, "ssri": { @@ -9513,31 +6339,7 @@ "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", "requires": { - "figgy-pudding": "^3.5.1" - } - }, - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.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=", - "requires": { - "is-descriptor": "^0.1.0" - } - } + "figgy-pudding": "3.5.1" } }, "statuses": { @@ -9550,19 +6352,14 @@ "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" + "end-of-stream": "1.4.4", + "stream-shift": "1.0.1" } }, - "stream-exhaust": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", - "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==" - }, "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" }, "strict-uri-encode": { "version": "1.1.0", @@ -9570,23 +6367,33 @@ "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=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "emoji-regex": "7.0.3", + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "5.2.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=", + "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": { + "define-properties": "1.1.3", + "function-bind": "1.1.1" + } + }, + "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": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.0", - "function-bind": "^1.0.2" + "define-properties": "1.1.3", + "function-bind": "1.1.1" } }, "string_decoder": { @@ -9594,7 +6401,7 @@ "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" + "safe-buffer": "5.1.2" }, "dependencies": { "safe-buffer": { @@ -9605,27 +6412,24 @@ } }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "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": "^2.0.0" + "ansi-regex": "4.1.0" } }, "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "requires": { - "is-utf8": "^0.2.0" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" }, "strip-dirs": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", "requires": { - "is-natural-number": "^4.0.1" + "is-natural-number": "4.0.1" } }, "strip-eof": { @@ -9642,66 +6446,100 @@ } }, "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=" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==" }, "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" - } - }, - "sver-compat": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", - "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=", - "requires": { - "es6-iterator": "^2.0.1", - "es6-symbol": "^3.1.1" + "has-flag": "1.0.0" } }, "swarm-js": { - "version": "0.1.37", - "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.37.tgz", - "integrity": "sha512-G8gi5fcXP/2upwiuOShJ258sIufBVztekgobr3cVgYXObZwJ5AXLqZn52AI+/ffft29pJexF9WNdUxjlkVehoQ==", - "requires": { - "bluebird": "^3.5.0", - "buffer": "^5.0.5", - "decompress": "^4.0.0", - "eth-lib": "^0.1.26", - "fs-extra": "^2.1.2", - "fs-promise": "^2.0.0", - "got": "^7.1.0", - "mime-types": "^2.1.16", - "mkdirp-promise": "^5.0.1", - "mock-fs": "^4.1.0", - "setimmediate": "^1.0.5", - "tar.gz": "^1.0.5", - "xhr-request-promise": "^0.1.2" + "version": "0.1.39", + "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.39.tgz", + "integrity": "sha512-QLMqL2rzF6n5s50BptyD6Oi0R1aWlJC5Y17SRIVXRj6OR1DRIPM7nepvrxxkjA1zNzFz6mUOMjfeqeDaWB7OOg==", + "requires": { + "bluebird": "3.7.2", + "buffer": "5.4.3", + "decompress": "4.2.0", + "eth-lib": "0.1.29", + "fs-extra": "4.0.3", + "got": "7.1.0", + "mime-types": "2.1.25", + "mkdirp-promise": "5.0.1", + "mock-fs": "4.10.4", + "setimmediate": "1.0.5", + "tar": "4.4.13", + "xhr-request-promise": "0.1.2" }, "dependencies": { - "fs-extra": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", - "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "got": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "requires": { + "decompress-response": "3.3.0", + "duplexer3": "0.1.4", + "get-stream": "3.0.0", + "is-plain-obj": "1.1.0", + "is-retry-allowed": "1.2.0", + "is-stream": "1.1.0", + "isurl": "1.0.0", + "lowercase-keys": "1.0.1", + "p-cancelable": "0.3.0", + "p-timeout": "1.2.1", + "safe-buffer": "5.2.0", + "timed-out": "4.0.1", + "url-parse-lax": "1.0.0", + "url-to-options": "1.0.1" + } + }, + "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==" + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0" + "prepend-http": "1.0.4" } } } }, "tar": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", - "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", - "requires": { - "block-stream": "*", - "fstream": "^1.0.12", - "inherits": "2" + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "requires": { + "chownr": "1.1.3", + "fs-minipass": "1.2.7", + "minipass": "2.9.0", + "minizlib": "1.3.3", + "mkdirp": "0.5.1", + "safe-buffer": "5.2.0", + "yallist": "3.1.1" } }, "tar-stream": { @@ -9709,13 +6547,13 @@ "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" + "bl": "1.2.2", + "buffer-alloc": "1.2.0", + "end-of-stream": "1.4.4", + "fs-constants": "1.0.0", + "readable-stream": "2.3.6", + "to-buffer": "1.1.1", + "xtend": "4.0.2" } }, "tar.gz": { @@ -9723,17 +6561,27 @@ "resolved": "https://registry.npmjs.org/tar.gz/-/tar.gz-1.0.7.tgz", "integrity": "sha512-uhGatJvds/3diZrETqMj4RxBR779LKlIE74SsMcn5JProZsfs9j0QBwWO1RW+IWNJxS2x8Zzra1+AW6OQHWphg==", "requires": { - "bluebird": "^2.9.34", - "commander": "^2.8.1", - "fstream": "^1.0.8", - "mout": "^0.11.0", - "tar": "^2.1.1" + "bluebird": "2.11.0", + "commander": "2.8.1", + "fstream": "1.0.12", + "mout": "0.11.1", + "tar": "2.2.2" }, "dependencies": { "bluebird": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=" + }, + "tar": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", + "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.12", + "inherits": "2.0.4" + } } } }, @@ -9742,162 +6590,72 @@ "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", "requires": { - "execa": "^0.7.0" - } - }, - "test-exclude": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", - "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", - "dev": true, - "requires": { - "glob": "^7.1.3", - "minimatch": "^3.0.4", - "read-pkg-up": "^4.0.0", - "require-main-filename": "^2.0.0" + "execa": "0.7.0" }, "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==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "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", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "lru-cache": "4.1.5", + "shebang-command": "1.2.0", + "which": "1.3.1" } }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "requires": { - "pify": "^3.0.0" + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" } }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "read-pkg": { + "get-stream": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" }, - "read-pkg-up": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", - "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", - "dev": true, + "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": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" + "pseudomap": "1.0.2", + "yallist": "2.1.2" } }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" } } }, + "test-exclude": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", + "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", + "dev": true, + "requires": { + "glob": "7.1.6", + "minimatch": "3.0.4", + "read-pkg-up": "4.0.0", + "require-main-filename": "2.0.0" + } + }, "thenify": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", "requires": { - "any-promise": "^1.0.0" + "any-promise": "1.3.0" } }, "thenify-all": { @@ -9905,7 +6663,7 @@ "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", "requires": { - "thenify": ">= 3.1.0 < 4" + "thenify": "3.3.0" } }, "through": { @@ -9918,44 +6676,30 @@ "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" - } - }, - "through2-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", - "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", - "requires": { - "through2": "~2.0.0", - "xtend": "~4.0.0" + "readable-stream": "2.3.6", + "xtend": "4.0.2" } }, - "time-stamp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", - "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=" - }, "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=" }, + "timers-ext": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", + "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "requires": { + "es5-ext": "0.10.53", + "next-tick": "1.0.0" + } + }, "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-absolute-glob": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", - "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", - "requires": { - "is-absolute": "^1.0.0", - "is-negated-glob": "^1.0.0" + "os-tmpdir": "1.0.2" } }, "to-buffer": { @@ -9969,62 +6713,11 @@ "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, - "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=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "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==", - "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=", - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "to-through": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", - "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", - "requires": { - "through2": "^2.0.3" - } - }, "toidentifier": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", @@ -10035,8 +6728,8 @@ "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" + "psl": "1.6.0", + "punycode": "1.4.1" }, "dependencies": { "punycode": { @@ -10047,59 +6740,46 @@ } }, "tree-kill": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.1.tgz", - "integrity": "sha512-4hjqbObwlh2dLyW4tcz0Ymw0ggoaVDMveUB9w8kFSQScdRLo0gxO9J7WFcUBo+W3C1TLdFIEwNOWebgZZ0RH9Q==" - }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==" }, "truffle": { - "version": "5.0.26", - "resolved": "https://registry.npmjs.org/truffle/-/truffle-5.0.26.tgz", - "integrity": "sha512-gf3Khot59ZM2Tegqb2md0lpr1SXGUHKJkSajCyXsiFCiiHUbX6NpXn/mgJgk1SXt7FAHpL0zYdLI1pYfqzvBFw==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/truffle/-/truffle-5.1.5.tgz", + "integrity": "sha512-9zloOGyY/+kj+lqX6S9eCARrBvCLPlT1y+q41SPP2dfieRLsfXYDmBqgzCh5dSpccABlqkCUvE4nedhqi6Qggg==", "requires": { - "app-module-path": "^2.2.0", + "app-module-path": "2.2.0", "mocha": "5.2.0", "original-require": "1.0.1" }, "dependencies": { - "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==" - }, "commander": { "version": "2.15.1", "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } }, "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" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.4", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==" - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -10123,36 +6803,36 @@ "supports-color": "5.4.0" } }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, "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" + "has-flag": "3.0.0" } } } }, - "truffle-blockchain-utils": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/truffle-blockchain-utils/-/truffle-blockchain-utils-0.0.10.tgz", - "integrity": "sha512-gVvagLCvYD0QXfnkxy6I48P6O+d7TEY0smc2VFuwldl1/clLVWE+KfBO/jFMaAz+nupTQeKvPhNTeyh3JAsCeA==" - }, "truffle-contract": { - "version": "4.0.24", - "resolved": "https://registry.npmjs.org/truffle-contract/-/truffle-contract-4.0.24.tgz", - "integrity": "sha512-Zcv6rr2iMJWtQo+GbSHTtih13rLh3VU1SLMiT7odDd0fNiin2lBlLnJlIU2Xpfh06CP9240LAU2r6H0g81uCAA==", - "requires": { - "bignumber.js": "^7.2.1", - "ethers": "^4.0.0-beta.1", - "truffle-blockchain-utils": "^0.0.10", - "truffle-contract-schema": "^3.0.11", - "truffle-error": "^0.0.5", - "truffle-interface-adapter": "^0.2.0", - "web3": "1.0.0-beta.37", - "web3-core-promievent": "1.0.0-beta.37", - "web3-eth-abi": "1.0.0-beta.37", - "web3-utils": "1.0.0-beta.37" + "version": "4.0.31", + "resolved": "https://registry.npmjs.org/truffle-contract/-/truffle-contract-4.0.31.tgz", + "integrity": "sha512-u3q+p1wiX5C2GpnluGx/d2iaJk7bcWshk2/TohiJyA2iQiTfkS7M4n9D9tY3JqpXR8PmD/TrA69RylO0RhITFA==", + "requires": { + "@truffle/blockchain-utils": "0.0.11", + "@truffle/contract-schema": "3.0.20", + "@truffle/error": "0.0.6", + "bignumber.js": "7.2.1", + "ethers": "4.0.40", + "truffle-interface-adapter": "0.2.5", + "web3": "1.2.1", + "web3-core-promievent": "1.2.1", + "web3-eth-abi": "1.2.1", + "web3-utils": "1.2.1" }, "dependencies": { "bignumber.js": { @@ -10160,168 +6840,169 @@ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" + } + }, "web3": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.37.tgz", - "integrity": "sha512-8XLgUspdzicC/xHG82TLrcF/Fxzj2XYNJ1KTYnepOI77bj5rvpsxxwHYBWQ6/JOjk0HkZqoBfnXWgcIHCDhZhQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.1.tgz", + "integrity": "sha512-nNMzeCK0agb5i/oTWNdQ1aGtwYfXzHottFP2Dz0oGIzavPMGSKyVlr8ibVb1yK5sJBjrWVnTdGaOC2zKDFuFRw==", "requires": { - "web3-bzz": "1.0.0-beta.37", - "web3-core": "1.0.0-beta.37", - "web3-eth": "1.0.0-beta.37", - "web3-eth-personal": "1.0.0-beta.37", - "web3-net": "1.0.0-beta.37", - "web3-shh": "1.0.0-beta.37", - "web3-utils": "1.0.0-beta.37" + "web3-bzz": "1.2.1", + "web3-core": "1.2.1", + "web3-eth": "1.2.1", + "web3-eth-personal": "1.2.1", + "web3-net": "1.2.1", + "web3-shh": "1.2.1", + "web3-utils": "1.2.1" + } + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" } } } }, - "truffle-contract-schema": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/truffle-contract-schema/-/truffle-contract-schema-3.0.11.tgz", - "integrity": "sha512-YcgSOlrufi6VtnXg8LU5Ma7JHzHpnZQxzB1PSWnb+JOTc1nL02XRoCWTgEO7PkJnFgf6yrwOpW0ajSwHk3zQ7Q==", + "truffle-hdwallet-provider": { + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/truffle-hdwallet-provider/-/truffle-hdwallet-provider-1.0.17.tgz", + "integrity": "sha512-s6DvSP83jiIAc6TUcpr7Uqnja1+sLGJ8og3X7n41vfyC4OCaKmBtXL5HOHf+SsU3iblOvnbFDgmN6Y1VBL/fsg==", "requires": { - "ajv": "^6.10.0", - "crypto-js": "^3.1.9-1", - "debug": "^4.1.0" + "any-promise": "1.3.0", + "bindings": "1.5.0", + "web3": "1.2.1", + "websocket": "1.0.31" }, "dependencies": { - "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=" - }, "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "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" + } + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", "requires": { - "ms": "^2.1.1" + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "truffle-error": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/truffle-error/-/truffle-error-0.0.5.tgz", - "integrity": "sha512-JpzPLMPSCE0vaZ3vH5NO5u42GpMj/Y1SRBkQ6b69PSw3xMSH1umApN32cEcg1nnh8q5FNYc5FnKu0m4tiBffyQ==" - }, - "truffle-hdwallet-provider": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/truffle-hdwallet-provider/-/truffle-hdwallet-provider-1.0.14.tgz", - "integrity": "sha512-C/WRdgQjQCrWYblnyTTEkQsl1Kc4XzcbNiEshzzFm5/fEqTcBskWEvhxIrJcZPB5nNmwZ5fcjUDGVHMGQK7GKQ==", - "requires": { - "any-promise": "^1.3.0", - "bindings": "^1.3.1", - "web3": "1.0.0-beta.37", - "websocket": "^1.0.28" - }, - "dependencies": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, "web3": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.37.tgz", - "integrity": "sha512-8XLgUspdzicC/xHG82TLrcF/Fxzj2XYNJ1KTYnepOI77bj5rvpsxxwHYBWQ6/JOjk0HkZqoBfnXWgcIHCDhZhQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.1.tgz", + "integrity": "sha512-nNMzeCK0agb5i/oTWNdQ1aGtwYfXzHottFP2Dz0oGIzavPMGSKyVlr8ibVb1yK5sJBjrWVnTdGaOC2zKDFuFRw==", "requires": { - "web3-bzz": "1.0.0-beta.37", - "web3-core": "1.0.0-beta.37", - "web3-eth": "1.0.0-beta.37", - "web3-eth-personal": "1.0.0-beta.37", - "web3-net": "1.0.0-beta.37", - "web3-shh": "1.0.0-beta.37", - "web3-utils": "1.0.0-beta.37" + "web3-bzz": "1.2.1", + "web3-core": "1.2.1", + "web3-eth": "1.2.1", + "web3-eth-personal": "1.2.1", + "web3-net": "1.2.1", + "web3-shh": "1.2.1", + "web3-utils": "1.2.1" + } + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + }, + "websocket": { + "version": "1.0.31", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.31.tgz", + "integrity": "sha512-VAouplvGKPiKFDTeCCO65vYHsyay8DqoBSlzIO3fayrfOgU94lQN5a1uWVnFrMLceTJw/+fQXR5PGbUVRaHshQ==", + "requires": { + "debug": "2.6.9", + "es5-ext": "0.10.53", + "nan": "2.14.0", + "typedarray-to-buffer": "3.1.5", + "yaeti": "0.0.6" } } } }, "truffle-interface-adapter": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/truffle-interface-adapter/-/truffle-interface-adapter-0.2.0.tgz", - "integrity": "sha512-NMj2gGr96/Ny5P2CvVzvkMAYXFjZfkdLCLt0kOiYGltoTt7EVP+HVLpYUfvxHjmEYytGdjXjrt/1srCfbPbAsQ==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/truffle-interface-adapter/-/truffle-interface-adapter-0.2.5.tgz", + "integrity": "sha512-EL39OpP8FcZ99ne1Rno3jImfb92Nectd4iVsZzoEUCBfbwHe7sr0k+i45guoruSoP8nMUE81Mov2s8I5pi6d9Q==", "requires": { - "bn.js": "^4.11.8", - "ethers": "^4.0.32", - "web3": "1.0.0-beta.37" + "bn.js": "4.11.8", + "ethers": "4.0.40", + "lodash": "4.17.15", + "web3": "1.2.1" }, "dependencies": { - "@types/node": { - "version": "10.14.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.12.tgz", - "integrity": "sha512-QcAKpaO6nhHLlxWBvpc4WeLrTvPqlHOvaj0s5GriKkA1zq+bsFBPpfYCvQhLqLgYlIko8A9YrPdaMHCo5mBcpg==" - }, - "elliptic": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", - "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "inherits": "^2.0.1" - } - }, - "ethers": { - "version": "4.0.33", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.33.tgz", - "integrity": "sha512-lAHkSPzBe0Vj+JrhmkEHLtUEKEheVktIjGDyE9gbzF4zf1vibjYgB57LraDHu4/ItqWVkztgsm8GWqcDMN+6vQ==", + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", "requires": { - "@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.4", - "setimmediate": "1.0.4", - "uuid": "2.0.1", - "xmlhttprequest": "1.8.0" + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" } }, - "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==", + "web3": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.1.tgz", + "integrity": "sha512-nNMzeCK0agb5i/oTWNdQ1aGtwYfXzHottFP2Dz0oGIzavPMGSKyVlr8ibVb1yK5sJBjrWVnTdGaOC2zKDFuFRw==", "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.0" + "web3-bzz": "1.2.1", + "web3-core": "1.2.1", + "web3-eth": "1.2.1", + "web3-eth-personal": "1.2.1", + "web3-net": "1.2.1", + "web3-shh": "1.2.1", + "web3-utils": "1.2.1" } }, - "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.4", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", - "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==" - }, - "setimmediate": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" - }, - "uuid": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" - }, - "web3": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.37.tgz", - "integrity": "sha512-8XLgUspdzicC/xHG82TLrcF/Fxzj2XYNJ1KTYnepOI77bj5rvpsxxwHYBWQ6/JOjk0HkZqoBfnXWgcIHCDhZhQ==", + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", "requires": { - "web3-bzz": "1.0.0-beta.37", - "web3-core": "1.0.0-beta.37", - "web3-eth": "1.0.0-beta.37", - "web3-eth-personal": "1.0.0-beta.37", - "web3-net": "1.0.0-beta.37", - "web3-shh": "1.0.0-beta.37", - "web3-utils": "1.0.0-beta.37" + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" } } } @@ -10332,7 +7013,7 @@ "integrity": "sha512-ZCtJK8WXxHNbFNjvUKQIXZby/+ybQQkaBcM/3QhBQUfwjpdGFE9F6iWsHhF5ifQNFV/lWiOODi2VMD5AyPcQyg==", "requires": { "ts-node": "7.0.1", - "tsconfig-paths": "^3.5.0" + "tsconfig-paths": "3.9.0" } }, "ts-node": { @@ -10340,14 +7021,14 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz", "integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==", "requires": { - "arrify": "^1.0.0", - "buffer-from": "^1.1.0", - "diff": "^3.1.0", - "make-error": "^1.1.1", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", - "source-map-support": "^0.5.6", - "yn": "^2.0.0" + "arrify": "1.0.1", + "buffer-from": "1.1.1", + "diff": "3.5.0", + "make-error": "1.3.5", + "minimist": "1.2.0", + "mkdirp": "0.5.1", + "source-map-support": "0.5.12", + "yn": "2.0.0" }, "dependencies": { "minimist": { @@ -10358,43 +7039,39 @@ } }, "tsconfig-paths": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.8.0.tgz", - "integrity": "sha512-zZEYFo4sjORK8W58ENkRn9s+HmQFkkwydDG7My5s/fnfr2YYCaiyXe/HBUcIgU8epEKOXwiahOO+KZYjiXlWyQ==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", "optional": true, "requires": { - "@types/json5": "^0.0.29", - "deepmerge": "^2.0.1", - "json5": "^1.0.1", - "minimist": "^1.2.0", - "strip-bom": "^3.0.0" + "@types/json5": "0.0.29", + "json5": "1.0.1", + "minimist": "1.2.0", + "strip-bom": "3.0.0" }, "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "optional": true, + "requires": { + "minimist": "1.2.0" + } + }, "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "optional": true - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "optional": true + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" } } }, - "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" - }, "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" + "safe-buffer": "5.2.0" } }, "tweetnacl": { @@ -10409,16 +7086,16 @@ "dev": true }, "type": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz", - "integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw==" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" }, "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" + "prelude-ls": "1.1.2" } }, "type-detect": { @@ -10437,7 +7114,7 @@ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "requires": { "media-typer": "0.3.0", - "mime-types": "~2.1.24" + "mime-types": "2.1.25" } }, "typedarray": { @@ -10450,23 +7127,31 @@ "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "requires": { - "is-typedarray": "^1.0.0" + "is-typedarray": "1.0.0" } }, "typescript": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", - "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.3.tgz", + "integrity": "sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==", "dev": true }, "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==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.2.tgz", + "integrity": "sha512-uhRwZcANNWVLrxLfNFEdltoPNhECUR3lc+UdJoG9CBpMcSnKyWA94tc3eAujB1GcMY5Uwq8ZMp4qWpxWYDQmaA==", "optional": true, "requires": { - "commander": "~2.20.0", - "source-map": "~0.6.1" + "commander": "2.20.3", + "source-map": "0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "optional": true + } } }, "ultron": { @@ -10479,58 +7164,21 @@ "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz", "integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==", "requires": { - "buffer": "^5.2.1", - "through": "^2.3.8" + "buffer": "5.4.3", + "through": "2.3.8" } }, - "unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=" - }, "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - }, - "undertaker": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.1.tgz", - "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", - "requires": { - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "bach": "^1.0.0", - "collection-map": "^1.0.0", - "es6-weak-map": "^2.0.1", - "last-run": "^1.1.0", - "object.defaults": "^1.0.0", - "object.reduce": "^1.0.0", - "undertaker-registry": "^1.0.0" - } - }, - "undertaker-registry": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", - "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=" - }, - "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==", - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } + "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==" }, "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" + "unique-slug": "2.0.2" } }, "unique-slug": { @@ -10538,16 +7186,7 @@ "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", "requires": { - "imurmurhash": "^0.1.4" - } - }, - "unique-stream": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", - "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", - "requires": { - "json-stable-stringify-without-jsonify": "^1.0.1", - "through2-filter": "^3.0.0" + "imurmurhash": "0.1.4" } }, "unique-string": { @@ -10555,7 +7194,7 @@ "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", "requires": { - "crypto-random-string": "^1.0.0" + "crypto-random-string": "1.0.0" } }, "universalify": { @@ -10574,64 +7213,23 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "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=", - "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=" - } - } - }, - "upath": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", - "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==" - }, "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" + "boxen": "3.2.0", + "chalk": "2.4.2", + "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.1.0", + "semver-diff": "2.1.0", + "xdg-basedir": "3.0.0" } }, "uri-js": { @@ -10639,29 +7237,15 @@ "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=" - }, - "url-parse": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.4.tgz", - "integrity": "sha512-/92DTTorg4JjktLNLe6GPS2/RvAd/RGr6LuktmWSMLEOa6rjnlrFXNgSbSmkNvCoL2T028A0a1JaJLzRMlFoHg==", - "requires": { - "querystringify": "^2.0.0", - "requires-port": "^1.0.0" + "punycode": "2.1.1" } }, "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "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": "^1.0.1" + "prepend-http": "2.0.0" } }, "url-set-query": { @@ -10674,15 +7258,10 @@ "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=" }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" - }, "utf8": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.1.tgz", - "integrity": "sha1-LgHbAvfY0JRPdxBPFgnrDDBM92g=" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" }, "util-deprecate": { "version": "1.0.2", @@ -10695,25 +7274,17 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - }, - "v8flags": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz", - "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==", - "requires": { - "homedir-polyfill": "^1.0.1" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" }, "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" + "spdx-correct": "3.1.0", + "spdx-expression-parse": "3.0.0" } }, "validate-npm-package-name": { @@ -10721,14 +7292,9 @@ "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" + "builtins": "1.0.3" } }, - "value-or-function": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", - "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=" - }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -10739,60 +7305,9 @@ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", - "requires": { - "clone": "^2.1.1", - "clone-buffer": "^1.0.0", - "clone-stats": "^1.0.0", - "cloneable-readable": "^1.0.0", - "remove-trailing-separator": "^1.0.1", - "replace-ext": "^1.0.0" - } - }, - "vinyl-fs": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", - "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", - "requires": { - "fs-mkdirp-stream": "^1.0.0", - "glob-stream": "^6.1.0", - "graceful-fs": "^4.0.0", - "is-valid-glob": "^1.0.0", - "lazystream": "^1.0.0", - "lead": "^1.0.0", - "object.assign": "^4.0.4", - "pumpify": "^1.3.5", - "readable-stream": "^2.3.3", - "remove-bom-buffer": "^3.0.0", - "remove-bom-stream": "^1.2.0", - "resolve-options": "^1.1.0", - "through2": "^2.0.0", - "to-through": "^2.0.0", - "value-or-function": "^3.0.0", - "vinyl": "^2.0.0", - "vinyl-sourcemap": "^1.1.0" - } - }, - "vinyl-sourcemap": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", - "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", - "requires": { - "append-buffer": "^1.0.2", - "convert-source-map": "^1.5.0", - "graceful-fs": "^4.1.6", - "normalize-path": "^2.1.1", - "now-and-later": "^2.0.0", - "remove-bom-buffer": "^3.0.0", - "vinyl": "^2.0.0" + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" } }, "web3": { @@ -10807,127 +7322,787 @@ "web3-net": "1.0.0-beta.37", "web3-shh": "1.0.0-beta.37", "web3-utils": "1.0.0-beta.37" + }, + "dependencies": { + "@types/node": { + "version": "10.17.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.11.tgz", + "integrity": "sha512-dNd2pp8qTzzNLAs3O8nH3iU9DG9866KHq9L3ISPB7DOGERZN81nW/5/g/KzMJpCU8jrbCiMRBzV9/sCEdRosig==" + }, + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" + }, + "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" + } + }, + "ethers": { + "version": "4.0.0-beta.1", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.1.tgz", + "integrity": "sha512-SoYhktEbLxf+fiux5SfCEwdzWENMvgIbMZD90I62s4GZD9nEjgEWy8ZboI3hck193Vs0bDoTohDISx84f2H2tw==", + "requires": { + "@types/node": "10.17.11", + "aes-js": "3.0.0", + "bn.js": "4.11.6", + "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": { + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "requires": { + "bn.js": "4.11.6", + "brorand": "1.1.0", + "hash.js": "1.1.3", + "inherits": "2.0.4" + } + }, + "setimmediate": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" + } + } + }, + "eventemitter3": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.1.1.tgz", + "integrity": "sha1-R3hr2qCHyvext15zq8XH1UAVjNA=" + }, + "fs-extra": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", + "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", + "requires": { + "graceful-fs": "4.2.3", + "jsonfile": "2.4.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "got": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "requires": { + "decompress-response": "3.3.0", + "duplexer3": "0.1.4", + "get-stream": "3.0.0", + "is-plain-obj": "1.1.0", + "is-retry-allowed": "1.2.0", + "is-stream": "1.1.0", + "isurl": "1.0.0", + "lowercase-keys": "1.0.1", + "p-cancelable": "0.3.0", + "p-timeout": "1.2.1", + "safe-buffer": "5.2.0", + "timed-out": "4.0.1", + "url-parse-lax": "1.0.0", + "url-to-options": "1.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==", + "requires": { + "inherits": "2.0.4", + "minimalistic-assert": "1.0.1" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "requires": { + "graceful-fs": "4.2.3" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "oboe": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.3.tgz", + "integrity": "sha1-K0hl29Rr6BIlcT9Om/5Lz09oCk8=", + "requires": { + "http-https": "1.0.0" + } + }, + "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==" + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" + }, + "scrypt-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", + "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=" + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "swarm-js": { + "version": "0.1.37", + "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.37.tgz", + "integrity": "sha512-G8gi5fcXP/2upwiuOShJ258sIufBVztekgobr3cVgYXObZwJ5AXLqZn52AI+/ffft29pJexF9WNdUxjlkVehoQ==", + "requires": { + "bluebird": "3.7.2", + "buffer": "5.4.3", + "decompress": "4.2.0", + "eth-lib": "0.1.29", + "fs-extra": "2.1.2", + "fs-promise": "2.0.3", + "got": "7.1.0", + "mime-types": "2.1.25", + "mkdirp-promise": "5.0.1", + "mock-fs": "4.10.4", + "setimmediate": "1.0.5", + "tar.gz": "1.0.7", + "xhr-request-promise": "0.1.2" + } + }, + "underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "requires": { + "prepend-http": "1.0.4" + } + }, + "utf8": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.1.tgz", + "integrity": "sha1-LgHbAvfY0JRPdxBPFgnrDDBM92g=" + }, + "web3-bzz": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.0.0-beta.37.tgz", + "integrity": "sha512-E+dho49Nsm/QpQvYWOF35YDsQrMvLB19AApENxhlQsu6HpWQt534DQul0t3Y/aAh8rlKD6Kanxt8LhHDG3vejQ==", + "requires": { + "got": "7.1.0", + "swarm-js": "0.1.37", + "underscore": "1.8.3" + } + }, + "web3-core": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.37.tgz", + "integrity": "sha512-cIwEqCj7OJyefQNauI0HOgW4sSaOQ98V99H2/HEIlnCZylsDzfw7gtQUdwnRFiIyIxjbWy3iWsjwDPoXNPZBYg==", + "requires": { + "web3-core-helpers": "1.0.0-beta.37", + "web3-core-method": "1.0.0-beta.37", + "web3-core-requestmanager": "1.0.0-beta.37", + "web3-utils": "1.0.0-beta.37" + } + }, + "web3-core-helpers": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.37.tgz", + "integrity": "sha512-efaLOzN28RMnbugnyelgLwPWWaSwElQzcAJ/x3PZu+uPloM/lE5x0YuBKvIh7/PoSMlHqtRWj1B8CpuQOUQ5Ew==", + "requires": { + "underscore": "1.8.3", + "web3-eth-iban": "1.0.0-beta.37", + "web3-utils": "1.0.0-beta.37" + } + }, + "web3-core-method": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.37.tgz", + "integrity": "sha512-pKWFUeqnVmzx3VrZg+CseSdrl/Yrk2ioid/HzolNXZE6zdoITZL0uRjnsbqXGEzgRRd1Oe/pFndpTlRsnxXloA==", + "requires": { + "underscore": "1.8.3", + "web3-core-helpers": "1.0.0-beta.37", + "web3-core-promievent": "1.0.0-beta.37", + "web3-core-subscriptions": "1.0.0-beta.37", + "web3-utils": "1.0.0-beta.37" + } + }, + "web3-core-promievent": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.37.tgz", + "integrity": "sha512-GTF2r1lP8nJBeA5Gxq5yZpJy9l8Fb9CXGZPfF8jHvaRdQHtm2Z+NDhqYmF833lcdkokRSyfPcXlz1mlWeClFpg==", + "requires": { + "any-promise": "1.3.0", + "eventemitter3": "1.1.1" + } + }, + "web3-core-requestmanager": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.37.tgz", + "integrity": "sha512-66VUqye5BGp1Zz1r8psCxdNH+GtTjaFwroum2Osx+wbC5oRjAiXkkadiitf6wRb+edodjEMPn49u7B6WGNuewQ==", + "requires": { + "underscore": "1.8.3", + "web3-core-helpers": "1.0.0-beta.37", + "web3-providers-http": "1.0.0-beta.37", + "web3-providers-ipc": "1.0.0-beta.37", + "web3-providers-ws": "1.0.0-beta.37" + } + }, + "web3-core-subscriptions": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.37.tgz", + "integrity": "sha512-FdXl8so9kwkRRWziuCSpFsAuAdg9KvpXa1fQlT16uoGcYYfxwFO/nkwyBGQzkZt7emShI2IRugcazyPCZDwkOA==", + "requires": { + "eventemitter3": "1.1.1", + "underscore": "1.8.3", + "web3-core-helpers": "1.0.0-beta.37" + } + }, + "web3-eth": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.37.tgz", + "integrity": "sha512-Eb3aGtkz3G9q+Z9DKgSQNbn/u8RtcZQQ0R4sW9hy5KK47GoT6vab5c6DiD3QWzI0BzitHzR5Ji+3VHf/hPUGgw==", + "requires": { + "underscore": "1.8.3", + "web3-core": "1.0.0-beta.37", + "web3-core-helpers": "1.0.0-beta.37", + "web3-core-method": "1.0.0-beta.37", + "web3-core-subscriptions": "1.0.0-beta.37", + "web3-eth-abi": "1.0.0-beta.37", + "web3-eth-accounts": "1.0.0-beta.37", + "web3-eth-contract": "1.0.0-beta.37", + "web3-eth-ens": "1.0.0-beta.37", + "web3-eth-iban": "1.0.0-beta.37", + "web3-eth-personal": "1.0.0-beta.37", + "web3-net": "1.0.0-beta.37", + "web3-utils": "1.0.0-beta.37" + } + }, + "web3-eth-abi": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.37.tgz", + "integrity": "sha512-g9DKZGM2OqwKp/tX3W/yihcj7mQCtJ6CXyZXEIZfuDyRBED/iSEIFfieDOd+yo16sokLMig6FG7ADhhu+19hdA==", + "requires": { + "ethers": "4.0.0-beta.1", + "underscore": "1.8.3", + "web3-utils": "1.0.0-beta.37" + } + }, + "web3-eth-accounts": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.37.tgz", + "integrity": "sha512-uvbHL62/zwo4GDmwKdqH9c/EgYd8QVnAfpVw8D3epSISpgbONNY7Hr4MRMSd/CqAP12l2Ls9JVQGLhhC83bW6g==", + "requires": { + "any-promise": "1.3.0", + "crypto-browserify": "3.12.0", + "eth-lib": "0.2.7", + "scrypt.js": "0.2.0", + "underscore": "1.8.3", + "uuid": "2.0.1", + "web3-core": "1.0.0-beta.37", + "web3-core-helpers": "1.0.0-beta.37", + "web3-core-method": "1.0.0-beta.37", + "web3-utils": "1.0.0-beta.37" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "4.11.6", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" + } + } + } + }, + "web3-eth-contract": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.37.tgz", + "integrity": "sha512-h1B3A8Z/C7BlnTCHkrWbXZQTViDxfR12lKMeTkT8Sqj5phFmxrBlPE4ORy4lf1Dk5b23mZYE0r/IRACx4ThCrQ==", + "requires": { + "underscore": "1.8.3", + "web3-core": "1.0.0-beta.37", + "web3-core-helpers": "1.0.0-beta.37", + "web3-core-method": "1.0.0-beta.37", + "web3-core-promievent": "1.0.0-beta.37", + "web3-core-subscriptions": "1.0.0-beta.37", + "web3-eth-abi": "1.0.0-beta.37", + "web3-utils": "1.0.0-beta.37" + } + }, + "web3-eth-ens": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.0.0-beta.37.tgz", + "integrity": "sha512-dR3UkrVzdRrJhfP57xBPx0CMiVnCcYFvh+u2XMkGydrhHgupSUkjqGr89xry/j1T0BkuN9mikpbyhdCVMXqMbg==", + "requires": { + "eth-ens-namehash": "2.0.8", + "underscore": "1.8.3", + "web3-core": "1.0.0-beta.37", + "web3-core-helpers": "1.0.0-beta.37", + "web3-core-promievent": "1.0.0-beta.37", + "web3-eth-abi": "1.0.0-beta.37", + "web3-eth-contract": "1.0.0-beta.37", + "web3-utils": "1.0.0-beta.37" + } + }, + "web3-eth-iban": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.37.tgz", + "integrity": "sha512-WQRniGJFxH/XCbd7miO6+jnUG+6bvuzfeufPIiOtCbeIC1ypp1kSqER8YVBDrTyinU1xnf1U5v0KBZ2yiWBJxQ==", + "requires": { + "bn.js": "4.11.6", + "web3-utils": "1.0.0-beta.37" + } + }, + "web3-eth-personal": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.37.tgz", + "integrity": "sha512-B4dZpGbD+nGnn48i6nJBqrQ+HB7oDmd+Q3wGRKOsHSK5HRWO/KwYeA7wgwamMAElkut50lIsT9EJl4Apfk3G5Q==", + "requires": { + "web3-core": "1.0.0-beta.37", + "web3-core-helpers": "1.0.0-beta.37", + "web3-core-method": "1.0.0-beta.37", + "web3-net": "1.0.0-beta.37", + "web3-utils": "1.0.0-beta.37" + } + }, + "web3-net": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.37.tgz", + "integrity": "sha512-xG/uBtMdDa1UMXw9KjDUgf3fXA/fDEJUYUS0TDn+U9PMgngA+UVECHNNvQTrVVDxEky38V3sahwIDiopNsQdsw==", + "requires": { + "web3-core": "1.0.0-beta.37", + "web3-core-method": "1.0.0-beta.37", + "web3-utils": "1.0.0-beta.37" + } + }, + "web3-providers-http": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.0.0-beta.37.tgz", + "integrity": "sha512-FM/1YDB1jtZuTo78habFj7S9tNHoqt0UipdyoQV29b8LkGKZV9Vs3is8L24hzuj1j/tbwkcAH+ewIseHwu0DTg==", + "requires": { + "web3-core-helpers": "1.0.0-beta.37", + "xhr2-cookies": "1.1.0" + } + }, + "web3-providers-ipc": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.37.tgz", + "integrity": "sha512-NdRPRxYMIU0C3u18NI8u4bwbhI9pCg5nRgDGYcmSAx5uOBxiYcQy+hb0WkJRRhBoyIXJmy+s26FoH8904+UnPg==", + "requires": { + "oboe": "2.1.3", + "underscore": "1.8.3", + "web3-core-helpers": "1.0.0-beta.37" + } + }, + "web3-providers-ws": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.37.tgz", + "integrity": "sha512-8p6ZLv+1JYa5Vs8oBn33Nn3VGFBbF+wVfO+b78RJS1Qf1uIOzjFVDk3XwYDD7rlz9G5BKpxhaQw+6EGQ7L02aw==", + "requires": { + "underscore": "1.8.3", + "web3-core-helpers": "1.0.0-beta.37", + "websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2" + } + }, + "web3-shh": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.37.tgz", + "integrity": "sha512-h5STG/xqZNQWtCLYOu7NiMqwqPea8SfkKQUPUFxXKIPVCFVKpHuQEwW1qcPQRJMLhlQIv17xuoUe1A+RzDNbrw==", + "requires": { + "web3-core": "1.0.0-beta.37", + "web3-core-method": "1.0.0-beta.37", + "web3-core-subscriptions": "1.0.0-beta.37", + "web3-net": "1.0.0-beta.37" + } + }, + "web3-utils": { + "version": "1.0.0-beta.37", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.37.tgz", + "integrity": "sha512-kA1fyhO8nKgU21wi30oJQ/ssvu+9srMdjOTKbHYbQe4ATPcr5YNwwrxG3Bcpbu1bEwRUVKHCkqi+wTvcAWBdlQ==", + "requires": { + "bn.js": "4.11.6", + "eth-lib": "0.1.27", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.8.3", + "utf8": "2.1.1" + }, + "dependencies": { + "eth-lib": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.27.tgz", + "integrity": "sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA==", + "requires": { + "bn.js": "4.11.6", + "elliptic": "6.5.2", + "keccakjs": "0.2.3", + "nano-json-stream-parser": "0.1.2", + "servify": "0.1.12", + "ws": "3.3.3", + "xhr-request-promise": "0.1.2" + } + } + } + }, + "websocket": { + "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", + "requires": { + "debug": "2.6.9", + "nan": "2.14.0", + "typedarray-to-buffer": "3.1.5", + "yaeti": "0.0.6" + } + } } }, "web3-bzz": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.0.0-beta.37.tgz", - "integrity": "sha512-E+dho49Nsm/QpQvYWOF35YDsQrMvLB19AApENxhlQsu6HpWQt534DQul0t3Y/aAh8rlKD6Kanxt8LhHDG3vejQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.1.tgz", + "integrity": "sha512-LdOO44TuYbGIPfL4ilkuS89GQovxUpmLz6C1UC7VYVVRILeZS740FVB3j9V4P4FHUk1RenaDfKhcntqgVCHtjw==", "requires": { - "got": "7.1.0", - "swarm-js": "0.1.37", - "underscore": "1.8.3" + "got": "9.6.0", + "swarm-js": "0.1.39", + "underscore": "1.9.1" } }, "web3-core": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.37.tgz", - "integrity": "sha512-cIwEqCj7OJyefQNauI0HOgW4sSaOQ98V99H2/HEIlnCZylsDzfw7gtQUdwnRFiIyIxjbWy3iWsjwDPoXNPZBYg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.1.tgz", + "integrity": "sha512-5ODwIqgl8oIg/0+Ai4jsLxkKFWJYE0uLuE1yUKHNVCL4zL6n3rFjRMpKPokd6id6nJCNgeA64KdWQ4XfpnjdMg==", "requires": { - "web3-core-helpers": "1.0.0-beta.37", - "web3-core-method": "1.0.0-beta.37", - "web3-core-requestmanager": "1.0.0-beta.37", - "web3-utils": "1.0.0-beta.37" + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-core-requestmanager": "1.2.1", + "web3-utils": "1.2.1" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" + } + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-core-helpers": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.37.tgz", - "integrity": "sha512-efaLOzN28RMnbugnyelgLwPWWaSwElQzcAJ/x3PZu+uPloM/lE5x0YuBKvIh7/PoSMlHqtRWj1B8CpuQOUQ5Ew==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.1.tgz", + "integrity": "sha512-Gx3sTEajD5r96bJgfuW377PZVFmXIH4TdqDhgGwd2lZQCcMi+DA4TgxJNJGxn0R3aUVzyyE76j4LBrh412mXrw==", "requires": { - "underscore": "1.8.3", - "web3-eth-iban": "1.0.0-beta.37", - "web3-utils": "1.0.0-beta.37" + "underscore": "1.9.1", + "web3-eth-iban": "1.2.1", + "web3-utils": "1.2.1" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" + } + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-core-method": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.37.tgz", - "integrity": "sha512-pKWFUeqnVmzx3VrZg+CseSdrl/Yrk2ioid/HzolNXZE6zdoITZL0uRjnsbqXGEzgRRd1Oe/pFndpTlRsnxXloA==", - "requires": { - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.37", - "web3-core-promievent": "1.0.0-beta.37", - "web3-core-subscriptions": "1.0.0-beta.37", - "web3-utils": "1.0.0-beta.37" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.1.tgz", + "integrity": "sha512-Ghg2WS23qi6Xj8Od3VCzaImLHseEA7/usvnOItluiIc5cKs00WYWsNy2YRStzU9a2+z8lwQywPYp0nTzR/QXdQ==", + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.1", + "web3-core-promievent": "1.2.1", + "web3-core-subscriptions": "1.2.1", + "web3-utils": "1.2.1" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" + } + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-core-promievent": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.37.tgz", - "integrity": "sha512-GTF2r1lP8nJBeA5Gxq5yZpJy9l8Fb9CXGZPfF8jHvaRdQHtm2Z+NDhqYmF833lcdkokRSyfPcXlz1mlWeClFpg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.1.tgz", + "integrity": "sha512-IVUqgpIKoeOYblwpex4Hye6npM0aMR+kU49VP06secPeN0rHMyhGF0ZGveWBrGvf8WDPI7jhqPBFIC6Jf3Q3zw==", "requires": { "any-promise": "1.3.0", - "eventemitter3": "1.1.1" + "eventemitter3": "3.1.2" } }, "web3-core-requestmanager": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.37.tgz", - "integrity": "sha512-66VUqye5BGp1Zz1r8psCxdNH+GtTjaFwroum2Osx+wbC5oRjAiXkkadiitf6wRb+edodjEMPn49u7B6WGNuewQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.1.tgz", + "integrity": "sha512-xfknTC69RfYmLKC+83Jz73IC3/sS2ZLhGtX33D4Q5nQ8yc39ElyAolxr9sJQS8kihOcM6u4J+8gyGMqsLcpIBg==", "requires": { - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.37", - "web3-providers-http": "1.0.0-beta.37", - "web3-providers-ipc": "1.0.0-beta.37", - "web3-providers-ws": "1.0.0-beta.37" + "underscore": "1.9.1", + "web3-core-helpers": "1.2.1", + "web3-providers-http": "1.2.1", + "web3-providers-ipc": "1.2.1", + "web3-providers-ws": "1.2.1" } }, "web3-core-subscriptions": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.37.tgz", - "integrity": "sha512-FdXl8so9kwkRRWziuCSpFsAuAdg9KvpXa1fQlT16uoGcYYfxwFO/nkwyBGQzkZt7emShI2IRugcazyPCZDwkOA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.1.tgz", + "integrity": "sha512-nmOwe3NsB8V8UFsY1r+sW6KjdOS68h8nuh7NzlWxBQT/19QSUGiERRTaZXWu5BYvo1EoZRMxCKyCQpSSXLc08g==", "requires": { - "eventemitter3": "1.1.1", - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.37" + "eventemitter3": "3.1.2", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.1" } }, "web3-eth": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.37.tgz", - "integrity": "sha512-Eb3aGtkz3G9q+Z9DKgSQNbn/u8RtcZQQ0R4sW9hy5KK47GoT6vab5c6DiD3QWzI0BzitHzR5Ji+3VHf/hPUGgw==", - "requires": { - "underscore": "1.8.3", - "web3-core": "1.0.0-beta.37", - "web3-core-helpers": "1.0.0-beta.37", - "web3-core-method": "1.0.0-beta.37", - "web3-core-subscriptions": "1.0.0-beta.37", - "web3-eth-abi": "1.0.0-beta.37", - "web3-eth-accounts": "1.0.0-beta.37", - "web3-eth-contract": "1.0.0-beta.37", - "web3-eth-ens": "1.0.0-beta.37", - "web3-eth-iban": "1.0.0-beta.37", - "web3-eth-personal": "1.0.0-beta.37", - "web3-net": "1.0.0-beta.37", - "web3-utils": "1.0.0-beta.37" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.1.tgz", + "integrity": "sha512-/2xly4Yry5FW1i+uygPjhfvgUP/MS/Dk+PDqmzp5M88tS86A+j8BzKc23GrlA8sgGs0645cpZK/999LpEF5UdA==", + "requires": { + "underscore": "1.9.1", + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-core-subscriptions": "1.2.1", + "web3-eth-abi": "1.2.1", + "web3-eth-accounts": "1.2.1", + "web3-eth-contract": "1.2.1", + "web3-eth-ens": "1.2.1", + "web3-eth-iban": "1.2.1", + "web3-eth-personal": "1.2.1", + "web3-net": "1.2.1", + "web3-utils": "1.2.1" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" + } + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-eth-abi": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.37.tgz", - "integrity": "sha512-g9DKZGM2OqwKp/tX3W/yihcj7mQCtJ6CXyZXEIZfuDyRBED/iSEIFfieDOd+yo16sokLMig6FG7ADhhu+19hdA==", + "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": { - "ethers": "4.0.0-beta.1", - "underscore": "1.8.3", - "web3-utils": "1.0.0-beta.37" + "ethers": "4.0.0-beta.3", + "underscore": "1.9.1", + "web3-utils": "1.2.1" + }, + "dependencies": { + "@types/node": { + "version": "10.17.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.11.tgz", + "integrity": "sha512-dNd2pp8qTzzNLAs3O8nH3iU9DG9866KHq9L3ISPB7DOGERZN81nW/5/g/KzMJpCU8jrbCiMRBzV9/sCEdRosig==" + }, + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.3", + "inherits": "2.0.4" + } + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" + }, + "dependencies": { + "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==", + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.3", + "hmac-drbg": "1.0.1", + "inherits": "2.0.4", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.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==", + "requires": { + "@types/node": "10.17.11", + "aes-js": "3.0.0", + "bn.js": "4.11.8", + "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.4", + "minimalistic-assert": "1.0.1" + } + }, + "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=" + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-eth-accounts": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.37.tgz", - "integrity": "sha512-uvbHL62/zwo4GDmwKdqH9c/EgYd8QVnAfpVw8D3epSISpgbONNY7Hr4MRMSd/CqAP12l2Ls9JVQGLhhC83bW6g==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.1.tgz", + "integrity": "sha512-26I4qq42STQ8IeKUyur3MdQ1NzrzCqPsmzqpux0j6X/XBD7EjZ+Cs0lhGNkSKH5dI3V8CJasnQ5T1mNKeWB7nQ==", "requires": { "any-promise": "1.3.0", "crypto-browserify": "3.12.0", "eth-lib": "0.2.7", - "scrypt.js": "0.2.0", - "underscore": "1.8.3", - "uuid": "2.0.1", - "web3-core": "1.0.0-beta.37", - "web3-core-helpers": "1.0.0-beta.37", - "web3-core-method": "1.0.0-beta.37", - "web3-utils": "1.0.0-beta.37" + "scryptsy": "2.1.0", + "semver": "6.2.0", + "underscore": "1.9.1", + "uuid": "3.3.2", + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-utils": "1.2.1" }, "dependencies": { "eth-lib": { @@ -10935,157 +8110,255 @@ "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" } }, + "semver": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", + "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==" + }, "uuid": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } } } }, "web3-eth-contract": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.37.tgz", - "integrity": "sha512-h1B3A8Z/C7BlnTCHkrWbXZQTViDxfR12lKMeTkT8Sqj5phFmxrBlPE4ORy4lf1Dk5b23mZYE0r/IRACx4ThCrQ==", - "requires": { - "underscore": "1.8.3", - "web3-core": "1.0.0-beta.37", - "web3-core-helpers": "1.0.0-beta.37", - "web3-core-method": "1.0.0-beta.37", - "web3-core-promievent": "1.0.0-beta.37", - "web3-core-subscriptions": "1.0.0-beta.37", - "web3-eth-abi": "1.0.0-beta.37", - "web3-utils": "1.0.0-beta.37" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.1.tgz", + "integrity": "sha512-kYFESbQ3boC9bl2rYVghj7O8UKMiuKaiMkxvRH5cEDHil8V7MGEGZNH0slSdoyeftZVlaWSMqkRP/chfnKND0g==", + "requires": { + "underscore": "1.9.1", + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-core-promievent": "1.2.1", + "web3-core-subscriptions": "1.2.1", + "web3-eth-abi": "1.2.1", + "web3-utils": "1.2.1" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" + } + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-eth-ens": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.0.0-beta.37.tgz", - "integrity": "sha512-dR3UkrVzdRrJhfP57xBPx0CMiVnCcYFvh+u2XMkGydrhHgupSUkjqGr89xry/j1T0BkuN9mikpbyhdCVMXqMbg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.1.tgz", + "integrity": "sha512-lhP1kFhqZr2nnbu3CGIFFrAnNxk2veXpOXBY48Tub37RtobDyHijHgrj+xTh+mFiPokyrapVjpFsbGa+Xzye4Q==", "requires": { "eth-ens-namehash": "2.0.8", - "underscore": "1.8.3", - "web3-core": "1.0.0-beta.37", - "web3-core-helpers": "1.0.0-beta.37", - "web3-core-promievent": "1.0.0-beta.37", - "web3-eth-abi": "1.0.0-beta.37", - "web3-eth-contract": "1.0.0-beta.37", - "web3-utils": "1.0.0-beta.37" + "underscore": "1.9.1", + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-promievent": "1.2.1", + "web3-eth-abi": "1.2.1", + "web3-eth-contract": "1.2.1", + "web3-utils": "1.2.1" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" + } + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-eth-iban": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.37.tgz", - "integrity": "sha512-WQRniGJFxH/XCbd7miO6+jnUG+6bvuzfeufPIiOtCbeIC1ypp1kSqER8YVBDrTyinU1xnf1U5v0KBZ2yiWBJxQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.1.tgz", + "integrity": "sha512-9gkr4QPl1jCU+wkgmZ8EwODVO3ovVj6d6JKMos52ggdT2YCmlfvFVF6wlGLwi0VvNa/p+0BjJzaqxnnG/JewjQ==", "requires": { - "bn.js": "4.11.6", - "web3-utils": "1.0.0-beta.37" + "bn.js": "4.11.8", + "web3-utils": "1.2.1" }, "dependencies": { - "bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" + } + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } + } + }, + "web3-eth-personal": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.1.tgz", + "integrity": "sha512-RNDVSiaSoY4aIp8+Hc7z+X72H7lMb3fmAChuSBADoEc7DsJrY/d0R5qQDK9g9t2BO8oxgLrLNyBP/9ub2Hc6Bg==", + "requires": { + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-net": "1.2.1", + "web3-utils": "1.2.1" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" + } + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } } } }, - "web3-eth-personal": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.37.tgz", - "integrity": "sha512-B4dZpGbD+nGnn48i6nJBqrQ+HB7oDmd+Q3wGRKOsHSK5HRWO/KwYeA7wgwamMAElkut50lIsT9EJl4Apfk3G5Q==", - "requires": { - "web3-core": "1.0.0-beta.37", - "web3-core-helpers": "1.0.0-beta.37", - "web3-core-method": "1.0.0-beta.37", - "web3-net": "1.0.0-beta.37", - "web3-utils": "1.0.0-beta.37" - } - }, "web3-net": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.37.tgz", - "integrity": "sha512-xG/uBtMdDa1UMXw9KjDUgf3fXA/fDEJUYUS0TDn+U9PMgngA+UVECHNNvQTrVVDxEky38V3sahwIDiopNsQdsw==", - "requires": { - "web3-core": "1.0.0-beta.37", - "web3-core-method": "1.0.0-beta.37", - "web3-utils": "1.0.0-beta.37" - } - }, - "web3-providers": { - "version": "1.0.0-beta.50", - "resolved": "https://registry.npmjs.org/web3-providers/-/web3-providers-1.0.0-beta.50.tgz", - "integrity": "sha512-p2xtr6N72pdXvND5dLdK1G9T/9qCQiKC2EYDPmimnqvoHWixmM3tlBl042swkHspHHVL60vXPKxB4UDaQE2hWQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.1.tgz", + "integrity": "sha512-Yt1Bs7WgnLESPe0rri/ZoPWzSy55ovioaP35w1KZydrNtQ5Yq4WcrAdhBzcOW7vAkIwrsLQsvA+hrOCy7mNauw==", "requires": { - "@babel/runtime": "^7.3.1", - "@types/node": "^10.12.18", - "eventemitter3": "3.1.0", - "lodash": "^4.17.11", - "url-parse": "1.4.4", - "websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", - "xhr2-cookies": "1.1.0" + "web3-core": "1.2.1", + "web3-core-method": "1.2.1", + "web3-utils": "1.2.1" }, "dependencies": { - "@types/node": { - "version": "10.14.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.15.tgz", - "integrity": "sha512-CBR5avlLcu0YCILJiDIXeU2pTw7UK/NIxfC63m7d7CVamho1qDEzXKkOtEauQRPMy6MI8mLozth+JJkas7HY6g==" - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", "requires": { - "ms": "2.0.0" + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" } }, - "eventemitter3": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", - "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==" - }, - "websocket": { - "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", - "from": "websocket@git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", "requires": { - "debug": "^2.2.0", - "nan": "^2.3.3", - "typedarray-to-buffer": "^3.1.2", - "yaeti": "^0.0.6" + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" } } } }, "web3-providers-http": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.0.0-beta.37.tgz", - "integrity": "sha512-FM/1YDB1jtZuTo78habFj7S9tNHoqt0UipdyoQV29b8LkGKZV9Vs3is8L24hzuj1j/tbwkcAH+ewIseHwu0DTg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.1.tgz", + "integrity": "sha512-BDtVUVolT9b3CAzeGVA/np1hhn7RPUZ6YYGB/sYky+GjeO311Yoq8SRDUSezU92x8yImSC2B+SMReGhd1zL+bQ==", "requires": { - "web3-core-helpers": "1.0.0-beta.37", + "web3-core-helpers": "1.2.1", "xhr2-cookies": "1.1.0" } }, "web3-providers-ipc": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.37.tgz", - "integrity": "sha512-NdRPRxYMIU0C3u18NI8u4bwbhI9pCg5nRgDGYcmSAx5uOBxiYcQy+hb0WkJRRhBoyIXJmy+s26FoH8904+UnPg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.1.tgz", + "integrity": "sha512-oPEuOCwxVx8L4CPD0TUdnlOUZwGBSRKScCz/Ws2YHdr9Ium+whm+0NLmOZjkjQp5wovQbyBzNa6zJz1noFRvFA==", "requires": { - "oboe": "2.1.3", - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.37" + "oboe": "2.1.4", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.1" } }, "web3-providers-ws": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.37.tgz", - "integrity": "sha512-8p6ZLv+1JYa5Vs8oBn33Nn3VGFBbF+wVfO+b78RJS1Qf1uIOzjFVDk3XwYDD7rlz9G5BKpxhaQw+6EGQ7L02aw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.1.tgz", + "integrity": "sha512-oqsQXzu+ejJACVHy864WwIyw+oB21nw/pI65/sD95Zi98+/HQzFfNcIFneF1NC4bVF3VNX4YHTNq2I2o97LAiA==", "requires": { - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.37", - "websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2" + "underscore": "1.9.1", + "web3-core-helpers": "1.2.1", + "websocket": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e" }, "dependencies": { "debug": { @@ -11096,65 +8369,68 @@ "ms": "2.0.0" } }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, "websocket": { - "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", - "from": "websocket@git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", + "version": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e", "requires": { - "debug": "^2.2.0", - "nan": "^2.3.3", - "typedarray-to-buffer": "^3.1.2", - "yaeti": "^0.0.6" + "debug": "2.6.9", + "es5-ext": "0.10.53", + "nan": "2.14.0", + "typedarray-to-buffer": "3.1.5", + "yaeti": "0.0.6" } } } }, "web3-shh": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.37.tgz", - "integrity": "sha512-h5STG/xqZNQWtCLYOu7NiMqwqPea8SfkKQUPUFxXKIPVCFVKpHuQEwW1qcPQRJMLhlQIv17xuoUe1A+RzDNbrw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.1.tgz", + "integrity": "sha512-/3Cl04nza5kuFn25bV3FJWa0s3Vafr5BlT933h26xovQ6HIIz61LmvNQlvX1AhFL+SNJOTcQmK1SM59vcyC8bA==", "requires": { - "web3-core": "1.0.0-beta.37", - "web3-core-method": "1.0.0-beta.37", - "web3-core-subscriptions": "1.0.0-beta.37", - "web3-net": "1.0.0-beta.37" + "web3-core": "1.2.1", + "web3-core-method": "1.2.1", + "web3-core-subscriptions": "1.2.1", + "web3-net": "1.2.1" } }, "web3-utils": { - "version": "1.0.0-beta.37", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.37.tgz", - "integrity": "sha512-kA1fyhO8nKgU21wi30oJQ/ssvu+9srMdjOTKbHYbQe4ATPcr5YNwwrxG3Bcpbu1bEwRUVKHCkqi+wTvcAWBdlQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.4.tgz", + "integrity": "sha512-+S86Ip+jqfIPQWvw2N/xBQq5JNqCO0dyvukGdJm8fEWHZbckT4WxSpHbx+9KLEWY4H4x9pUwnoRkK87pYyHfgQ==", "requires": { - "bn.js": "4.11.6", - "eth-lib": "0.1.27", + "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", - "randomhex": "0.1.5", - "underscore": "1.8.3", - "utf8": "2.1.1" + "randombytes": "2.1.0", + "underscore": "1.9.1", + "utf8": "3.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=" - }, - "utf8": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.1.tgz", - "integrity": "sha1-LgHbAvfY0JRPdxBPFgnrDDBM92g=" + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.5.2", + "xhr-request-promise": "0.1.2" + } } } }, "websocket": { - "version": "1.0.29", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.29.tgz", - "integrity": "sha512-WhU8jKXC8sTh6ocLSqpZRlOKMNYGwUvjA5+XcIgIk/G3JCaDfkZUr0zA19sVSxJ0TEvm0i5IBzr54RZC4vzW7g==", - "requires": { - "debug": "^2.2.0", - "gulp": "^4.0.2", - "nan": "^2.11.0", - "typedarray-to-buffer": "^3.1.5", - "yaeti": "^0.0.6" + "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", + "requires": { + "debug": "2.6.9", + "nan": "2.14.0", + "typedarray-to-buffer": "3.1.5", + "yaeti": "0.0.6" }, "dependencies": { "debug": { @@ -11164,6 +8440,11 @@ "requires": { "ms": "2.0.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" } } }, @@ -11172,13 +8453,13 @@ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "requires": { - "isexe": "^2.0.0" + "isexe": "2.0.0" } }, "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, "wide-align": { "version": "1.1.3", @@ -11186,7 +8467,34 @@ "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "requires": { - "string-width": "^1.0.2 || 2" + "string-width": "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 + }, + "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" + } + } } }, "widest-line": { @@ -11194,7 +8502,7 @@ "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", "requires": { - "string-width": "^2.1.1" + "string-width": "2.1.1" }, "dependencies": { "ansi-regex": { @@ -11202,18 +8510,13 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" }, - "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=" - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" } }, "strip-ansi": { @@ -11221,23 +8524,29 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "3.0.0" } } } }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" }, "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "ansi-styles": "3.2.1", + "string-width": "3.1.0", + "strip-ansi": "5.2.0" } }, "wrappy": { @@ -11250,9 +8559,9 @@ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" + "graceful-fs": "4.2.3", + "imurmurhash": "0.1.4", + "signal-exit": "3.0.2" } }, "ws": { @@ -11260,9 +8569,9 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" + "async-limiter": "1.0.1", + "safe-buffer": "5.1.2", + "ultron": "1.1.1" }, "dependencies": { "safe-buffer": { @@ -11282,10 +8591,10 @@ "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.5.0.tgz", "integrity": "sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ==", "requires": { - "global": "~4.3.0", - "is-function": "^1.0.1", - "parse-headers": "^2.0.0", - "xtend": "^4.0.0" + "global": "4.3.2", + "is-function": "1.0.1", + "parse-headers": "2.0.3", + "xtend": "4.0.2" } }, "xhr-request": { @@ -11293,13 +8602,13 @@ "resolved": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz", "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", "requires": { - "buffer-to-arraybuffer": "^0.0.5", - "object-assign": "^4.1.1", - "query-string": "^5.0.1", - "simple-get": "^2.7.0", - "timed-out": "^4.0.1", - "url-set-query": "^1.0.0", - "xhr": "^2.0.4" + "buffer-to-arraybuffer": "0.0.5", + "object-assign": "4.1.1", + "query-string": "5.1.1", + "simple-get": "2.8.1", + "timed-out": "4.0.1", + "url-set-query": "1.0.0", + "xhr": "2.5.0" } }, "xhr-request-promise": { @@ -11307,7 +8616,7 @@ "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.2.tgz", "integrity": "sha1-NDxE0e53JrhkgGloLQ+EDIO0Jh0=", "requires": { - "xhr-request": "^1.0.1" + "xhr-request": "1.1.0" } }, "xhr2-cookies": { @@ -11315,7 +8624,7 @@ "resolved": "https://registry.npmjs.org/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz", "integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=", "requires": { - "cookiejar": "^2.1.1" + "cookiejar": "2.1.2" } }, "xmlhttprequest": { @@ -11329,9 +8638,9 @@ "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=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" }, "yaeti": { "version": "0.0.6", @@ -11339,232 +8648,64 @@ "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" }, "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + }, + "yargs": { + "version": "13.2.4", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", + "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", + "requires": { + "cliui": "5.0.0", + "find-up": "3.0.0", + "get-caller-file": "2.0.5", + "os-locale": "3.1.0", + "require-directory": "2.1.1", + "require-main-filename": "2.0.0", + "set-blocking": "2.0.0", + "string-width": "3.1.0", + "which-module": "2.0.0", + "y18n": "4.0.0", + "yargs-parser": "13.1.1" + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "requires": { + "camelcase": "5.3.1", + "decamelize": "1.2.0" + } }, "yargs-unparser": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", - "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", "dev": true, "requires": { - "flat": "^4.1.0", - "lodash": "^4.17.11", - "yargs": "^12.0.5" + "flat": "4.1.0", + "lodash": "4.17.15", + "yargs": "13.3.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": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "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" - } - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "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" - } - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "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 - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.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==", - "dev": true, - "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==", - "dev": true, - "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==", - "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=", - "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" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - } - }, - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "dev": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "cliui": "5.0.0", + "find-up": "3.0.0", + "get-caller-file": "2.0.5", + "require-directory": "2.1.1", + "require-main-filename": "2.0.0", + "set-blocking": "2.0.0", + "string-width": "3.1.0", + "which-module": "2.0.0", + "y18n": "4.0.0", + "yargs-parser": "13.1.1" } } } @@ -11574,8 +8715,8 @@ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" + "buffer-crc32": "0.2.13", + "fd-slicer": "1.1.0" } }, "yn": { diff --git a/package.json b/package.json index a21149b..ba3f87b 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,15 @@ "scripts": { "compile": "./node_modules/.bin/truffle compile --all", "coverage": "scripts/run_coverage.sh", - "test": "scripts/run_tests.sh all refresh", - "test-reuse": "scripts/run_tests.sh all use-existing", - "test-single": "scripts/run_tests.sh single", - "test-single-reuse": "scripts/run_tests.sh single use-existing", + "test": "npm run test-validator && npm run test-solc", + "test-solc": "scripts/run_solc.sh all refresh", + "test-validator": "scripts/run_js.sh all refresh js", + "test-random": "scripts/run_random.sh all refresh", + "test-fixed": "scripts/run_fixed.sh all refresh", "testToHtml": "scripts/testOutputToHtml.sh", "start-all-rpcs": "scripts/rpcs/start_all.sh", - "stop-all-rpcs": "scripts/rpcs/stop_all.sh" + "stop-all-rpcs": "scripts/rpcs/stop_all.sh", + "merge-contracts": "sol-merger './contracts/*.sol' ./contracts-merged" }, "preinstall": "rm -rf node_modules/*/.git/", "bin": { @@ -45,14 +47,17 @@ "dateformat": "^3.0.3", "ethereumjs-abi": "^0.6.7", "ethereumjs-util": "^6.1.0", - "ganache-cli": "6.4.4", + "ganache-cli": "git://github.com/mickys/ganache-cli.git#8e64c2e8f782d8c7e5f855d819001e74bdf48732", + "lodash": "^4.17.15", "openzeppelin-test-helpers": "^0.4.0", + "sol-merger": "^1.1.1", "solc": "0.5.10", "solidity-coverage": "^0.6.4", "truffle": "^5.0.26", "truffle-hdwallet-provider": "^1.0.14", "ts-mocha": "^6.0.0", - "web3": "1.0.0-beta.37" + "web3": "1.0.0-beta.37", + "websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2" }, "devDependencies": { "@types/chai": "^4.1.7", diff --git a/rICO-config.js b/rICO-config.js new file mode 100644 index 0000000..74b1491 --- /dev/null +++ b/rICO-config.js @@ -0,0 +1,36 @@ +const {BN} = require("openzeppelin-test-helpers"); + +const tokenDecimals = 18; +const ether = 1000000000000000000; // 1 ether in wei +const etherBN = new BN(ether.toString()); + +module.exports = { + settings: { + rico: { + startBlockDelay: 6450, // currentBlock number + delay for commitPhaseStartBlock + blocksPerDay: 6450, + commitPhaseDays: 22, + stageCount: 12, + stageDays: 30, + commitPhasePrice: ether * 0.002, // uint256 _commitPhasePrice in wei + stagePriceIncrease: ether * 0.0001 // uint256 _StagePriceIncrease in wei + }, + token: { + name: "LYXeToken", + symbol: "LYXe", + decimals: tokenDecimals, + supply: new BN(100) // 100 milion + .mul( new BN("10").pow(new BN("6")) ) + .mul( + // 10^18 to account for decimals + new BN("10").pow(new BN( tokenDecimals )) + ), + sale: new BN(15) // 15 milion + .mul( new BN("10").pow(new BN("6")) ) + .mul( + // 10^18 to account for decimals + new BN("10").pow(new BN( tokenDecimals )) + ) + } + } +} \ No newline at end of file diff --git a/scripts/run_all.sh b/scripts/run_all.sh new file mode 100755 index 0000000..6215ec9 --- /dev/null +++ b/scripts/run_all.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +scripts/run_js.sh all refresh +scripts/run_solc.sh all refresh diff --git a/scripts/run_fixed.sh b/scripts/run_fixed.sh new file mode 100755 index 0000000..0cfdc57 --- /dev/null +++ b/scripts/run_fixed.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e + +./scripts/rpcs/start_all.sh $2 +echo "" +echo "--------------------------------------------------------------------" + +if [[ "$1" = "all" ]]; then + echo " Running all tests in \"test\" folder:" +else + echo " Running tests in path \"$3\"" +fi + +echo "--------------------------------------------------------------------" +./node_modules/.bin/truffle compile + +node test/run_solc_fixed_tests.js $1 $2 $3 $4 + +echo "--------------------------------------------------------------------" +echo "" +sh scripts/rpcs/stop_all.sh $2 +echo "" diff --git a/scripts/run_js.sh b/scripts/run_js.sh new file mode 100755 index 0000000..7790639 --- /dev/null +++ b/scripts/run_js.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# set -e + +./scripts/rpcs/start_all.sh $2 +echo "" +echo "--------------------------------------------------------------------" + +echo " Running all tests in \"test/js_validator_tests\" folder:" + +echo "--------------------------------------------------------------------" + +node test/run_js_validator_tests.js $1 $2 $3 $4 + +echo "--------------------------------------------------------------------" +echo "" +sh scripts/rpcs/stop_all.sh $2 +echo "" \ No newline at end of file diff --git a/scripts/run_random.sh b/scripts/run_random.sh new file mode 100755 index 0000000..8fb96ef --- /dev/null +++ b/scripts/run_random.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e + +./scripts/rpcs/start_all.sh $2 +echo "" +echo "--------------------------------------------------------------------" + +if [[ "$1" = "all" ]]; then + echo " Running all tests in \"test\" folder:" +else + echo " Running tests in path \"$3\"" +fi + +echo "--------------------------------------------------------------------" +./node_modules/.bin/truffle compile + +node test/run_solc_random_tests.js $1 $2 $3 $4 + +echo "--------------------------------------------------------------------" +echo "" +sh scripts/rpcs/stop_all.sh $2 +echo "" diff --git a/scripts/run_tests.sh b/scripts/run_solc.sh similarity index 93% rename from scripts/run_tests.sh rename to scripts/run_solc.sh index cc7aa18..b5f7a2e 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_solc.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e ./scripts/rpcs/start_all.sh $2 echo "" echo "--------------------------------------------------------------------" @@ -12,7 +13,7 @@ fi echo "--------------------------------------------------------------------" ./node_modules/.bin/truffle compile -node test/run_tests.js $1 $2 $3 $4 +node test/run_solc_tests.js $1 $2 $3 $4 #if [[ "$1" = "all" ]]; then # ./node_modules/.bin/truffle test --network development diff --git a/scripts/testOutputToHtml.sh b/scripts/testOutputToHtml.sh index db37409..6b1e724 100755 --- a/scripts/testOutputToHtml.sh +++ b/scripts/testOutputToHtml.sh @@ -1 +1 @@ -time npm run test > output/test.log && aha --black -f output/test.log > output/test.html \ No newline at end of file +time npm run test > output/test.log && aha --black -f output/test.log > output/test.html diff --git a/simple.js b/simple.js new file mode 100644 index 0000000..34f5618 --- /dev/null +++ b/simple.js @@ -0,0 +1,97 @@ + + +class rICO +{ + constructor() { + + this.block = 1; + this.blockCount = 100; + this.balances = []; + } + + setBlock(block) { + this.block = block; + } + + getRatio() { + return this.block * 100 / this.blockCount; + } + + commit(address, eth) { + + // do not allocate to project. + // contract eth just increases, and ProjectAvailable will include it + + this.balances[address] = eth; + + // increase number of tokens + } + + withdraw(address, amount) { + // do not allocate to project. + // based on tokens we return, get eth to return + // decrease number of tokens + + + // allocated_by_withdraw + } + + projectAvailable() { + + /* + + pending_in_contract = total_received - total_commited - withdrawn; + + available_in_contract = total_commited (accepted contributions total) - withdrawn; + + + allocated_by_commit + allocated_by_withdraw + + + var unlockedPercentage = this.block / (buyEndBlock - buyStartBlock) (duration); + var unlockedPercentage = this.block / (buyEndBlock - lastWithdrawBlock)(duration); + + unlocked = (available_in_contract - allocated) * unlockedPercentage + + available = allocated - withdrawn_by_project + unlocked; + + + + + global + + + + */ + + } + + projectWithdraw(amount) { + // + + } + +} + + +/* + user commits 50 at block 50 + - project available = 25 + - user available = 25 + + user withdraws 25 + - project available is 12.5 -> should be 25.. + + * allocate "unlocked amount" to project + * subtract unlocked amount from global available + + + + + + allocatedEthAmount + + + */ + diff --git a/test/helpers/utils.bbx.js b/test/helpers/utils.bbx.js deleted file mode 100644 index 11a7b42..0000000 --- a/test/helpers/utils.bbx.js +++ /dev/null @@ -1,1327 +0,0 @@ -const web3util = require('web3-utils'); -const dateFormat = require('dateformat'); -/* - ascii escape codes - - Black 0;30 Dark Gray 1;30 - Red 0;31 Light Red 1;31 - Green 0;32 Light Green 1;32 - Brown/Orange 0;33 Yellow 1;33 - Blue 0;34 Light Blue 1;34 - Purple 0;35 Light Purple 1;35 - Cyan 0;36 Light Cyan 1;36 - Light Gray 0;37 White 1;37 - - */ - -let colors = { - none: "\x1B[0m", - black: '\x1B[0;30m', - dark_gray: '\x1B[1;30m', - red: '\x1B[0;31m', - light_red: '\x1B[1;31m', - green: '\x1B[0;32m', - light_green: '\x1B[1;32m', - orange: '\x1B[0;33m', - yellow: '\x1B[1;33m', - blue: '\x1B[0;34m', - light_blue: '\x1B[1;34m', - purple: '\x1B[0;35m', - light_purple: '\x1B[1;35m', - cyan: '\x1B[0;36m', - light_cyan: '\x1B[1;36m', - light_gray: '\x1B[0;37m', - white: '\x1B[1;37m' -}; - -let logPre = " "; - - -let FundingStageStates = [ - { key: 0, name: "NONE"}, - { key: 1, name: "NEW"}, - { key: 2, name: "IN_PROGRESS"}, - { key: 3, name: "FINAL"} -]; - -let FundingEntityStates = [ - { key: 0, name: "NONE"}, - { key: 1, name: "NEW"}, - { key: 2, name: "WAITING"}, - { key: 3, name: "IN_PROGRESS"}, - { key: 4, name: "COOLDOWN"}, - { key: 5, name: "FUNDING_ENDED"}, - { key: 6, name: "FAILED"}, - { key: 7, name: "FAILED_FINAL"}, - { key: 8, name: "SUCCESSFUL"}, - { key: 9, name: "SUCCESSFUL_FINAL"}, -]; - -let FundingMethodIds = [ - "NONE", - "DIRECT_ONLY", - "MILESTONE_ONLY", - "DIRECT_AND_MILESTONE" -]; - -let StateArray = { - "Funding": [ - { key: 0, name: "NONE"}, - { key: 1, name: "NEW"}, - { key: 2, name: "WAITING"}, - { key: 3, name: "IN_PROGRESS"}, - { key: 4, name: "COOLDOWN"}, - { key: 5, name: "FUNDING_ENDED"}, - { key: 6, name: "FAILED"}, - { key: 7, name: "FAILED_FINAL"}, - { key: 8, name: "SUCCESSFUL"}, - { key: 9, name: "SUCCESSFUL_FINAL"}, - ], - "FundingManager": [ - {key: 0, name: "NONE"}, - {key: 1, name: "NEW"}, - {key: 2, name: "WAITING"}, - {key: 10, name: "FUNDING_FAILED_START"}, - {key: 11, name: "FUNDING_FAILED_PROGRESS"}, - {key: 12, name: "FUNDING_FAILED_DONE"}, - {key: 20, name: "FUNDING_SUCCESSFUL_START"}, - {key: 21, name: "FUNDING_SUCCESSFUL_PROGRESS"}, - {key: 22, name: "FUNDING_SUCCESSFUL_DONE"}, - {key: 25, name: "FUNDING_SUCCESSFUL_ALLOCATE"}, - - {key: 30, name: "MILESTONE_PROCESS_START"}, - {key: 31, name: "MILESTONE_PROCESS_PROGRESS"}, - {key: 32, name: "MILESTONE_PROCESS_DONE"}, - {key: 40, name: "EMERGENCY_PROCESS_START"}, - {key: 41, name: "EMERGENCY_PROCESS_PROGRESS"}, - {key: 42, name: "EMERGENCY_PROCESS_DONE"}, - {key: 100, name: "COMPLETE_PROCESS_START"}, - {key: 101, name: "COMPLETE_PROCESS_PROGRESS"}, - {key: 102, name: "COMPLETE_PROCESS_DONE"}, - ], - "Milestones": [ - {key: 0, name: "NONE"}, - {key: 1, name: "NEW"}, - {key: 2, name: "WAITING"}, - {key: 5, name: "IN_DEVELOPMENT"}, - - {key: 10, name: "WAITING_MEETING_TIME"}, - {key: 11, name: "DEADLINE_MEETING_TIME_YES"}, - {key: 12, name: "DEADLINE_MEETING_TIME_FAILED"}, - - {key: 20, name: "VOTING_IN_PROGRESS"}, - {key: 22, name: "VOTING_ENDED_YES"}, - {key: 23, name: "VOTING_ENDED_NO"}, - {key: 25, name: "VOTING_ENDED_NO_FINAL"}, - {key: 30, name: "VOTING_FUNDS_PROCESSED"}, - {key: 50, name: "FINAL"}, - - {key: 99, name: "CASHBACK_OWNER_MIA"}, - {key: 250, name: "DEVELOPMENT_COMPLETE"}, - ], - "ApplicationEntity": [ - {key: 0, name: "NONE"}, - {key: 1, name: "NEW"}, - {key: 2, name: "WAITING"}, - {key: 3, name: "IN_FUNDING"}, - - {key: 5, name: "IN_DEVELOPMENT"}, - {key: 50, name: "IN_CODE_UPGRADE"}, - {key: 100, name: "UPGRADED"}, - {key: 150, name: "IN_GLOBAL_CASHBACK"}, - {key: 200, name: "LOCKED"}, - {key: 250, name: "DEVELOPMENT_COMPLETE"}, - ], -}; - - -let RecordArray = { - "Funding": [ - { key: 0, name: "NONE"}, - { key: 1, name: "NEW"}, - { key: 2, name: "IN_PROGRESS"}, - { key: 3, name: "FINAL"} - ], - "FundingManager": [], - "Milestones":[ - { key: 0, name: "NONE"}, - { key: 1, name: "NEW"}, - { key: 2, name: "IN_PROGRESS"}, - { key: 3, name: "FINAL"} - ], - "Proposals":[ - { key: 0, name: "NONE"}, - { key: 1, name: "NEW"}, - { key: 2, name: "ACCEPTING_VOTES"}, - { key: 3, name: "VOTING_ENDED"}, - { key: 10, name: "VOTING_RESULT_YES"}, - { key: 20, name: "VOTING_RESULT_NO"}, - ], -}; - -let ActionArray = { - "Proposals":[ - { key: 1, name: "MILESTONE_DEADLINE"}, - { key: 2, name: "MILESTONE_POSTPONING"}, - { key: 60, name: "EMERGENCY_FUND_RELEASE"}, - { key: 50, name: "IN_DEVELOPMENT_CODE_UPGRADE"}, - { key: 51, name: "AFTER_COMPLETE_CODE_UPGRADE"}, - { key: 75, name: "PROJECT_DELISTING"}, - ], -}; - - -module.exports = { - hasEvent(tx, eventNamePlusReturn) { - let eventSig = web3util.sha3(eventNamePlusReturn); - return tx.receipt.logs.filter(x => x.topics[0] === eventSig); - }, - getEventArgs(tx) { - // tx.receipt.logs[0].topics[2]; - }, - getProposalRequestId(receipt) { - return web3util.toDecimal( receipt[0].topics[2] ); - }, - getProposalEventData(receipt) { - - let eventMapping = [ - { - name: "EventAddVoteIntoResult(uint256,bool,uint256)", - sha: web3util.sha3("EventAddVoteIntoResult(uint256,bool,uint256)"), - type: 1 - }, - { - name: "EventProcessVoteTotals(uint256,uint256,uint256)", - sha: web3util.sha3("EventProcessVoteTotals(uint256,uint256,uint256)"), - type: 2 - } - ]; - - let result = []; - for(let i = 0; i < receipt.logs.length; i++) - { - let event = receipt.logs[i]; - let current = eventMapping.filter(x => x.sha === event.topics[0])[0]; - - if(current.type === 2) { - console.log( - "EventProcessVoteTotals( ", - web3util.toDecimal( event.topics[1] ), ",", - web3util.toDecimal( event.topics[2] ), ",", - web3util.toDecimal( event.topics[3] ), - " )" - ); - } - - else if(current.type === 1) { - - console.log( - "EventAddVoteIntoResult( ", - web3util.toDecimal( event.topics[1] ), ",", - web3util.toDecimal( event.topics[2] ), ",", - web3util.fromWei(event.topics[3], "ether"), - " )" - ); - } - } - - return result; - }, - colors, - toLog( what ) { - console.log(colors.white, what, colors.none); - }, - toDate(seconds) { - return dateFormat(parseInt(seconds) * 1000, "yyyy-mm-dd, HH:MM:ss TT"); - }, - topicToAddress(hexString) { - return hexString.replace("0x000000000000000000000000", "0x"); - }, - toDateFromHex(hex) { - return this.toDate( web3util.toDecimal(hex) ); - }, - getBalance(artifacts, address) { - let solAccUtils = artifacts.require('SolidityAccountUtils'); - return solAccUtils.new().then(function(instance){ return instance.getBalance.call(address) }); - }, - transferTo(artifacts, _val, _from, _to) { - let solAccUtils = artifacts.require('SolidityAccountUtils'); - return solAccUtils.new().then(function(instance){ return instance.transferTo(_to, {value: _val, from: _from}) }); - }, - - /* - This is useless for testing.. time is going to really depend on testrpc internal time, - and we can't do anything about going back to test multiple things. - - instead we mock time in both ApplicationEntity and Assets - */ - /* - async timeTravelTo(helpers, time) { - console.log("timeTravelTo: ", helpers.utils.toDate(time) ); - let now = new Date().getTime() / 1000; // seconds - let difference = parseInt(time).toFixed(0) - parseInt(now).toFixed(0); - if(difference > 0) { - return new Promise((resolve, reject) => { - helpers.web3.currentProvider.sendAsync({ - jsonrpc: "2.0", - method: "evm_increaseTime", - params: [difference], - id: new Date().getTime() - }, (err, result) => { - if (err) { - return reject(err) - } - return resolve(result) - }); - }) - } else { - return ; - } - }, - */ - async showContractDebug(helpers, assetContract) { - - helpers.utils.toLog("\n" + logPre + " Debug: "); - helpers.utils.toLog( - logPre + "-----------------------------------------------------------" - ); - - // purchaseRecords - let RecordsNum = await assetContract.purchaseRecordsNum.call(); - - helpers.utils.toLog( - logPre + "Puchase Record Count: "+ - helpers.utils.colors.orange+ - RecordsNum - ); - - if (RecordsNum > 0) { - - for (let i = 1; i <= RecordsNum; i++) { - let Record = await assetContract.purchaseRecords.call(i); - helpers.utils.toLog(logPre + "Record ID: " + i); // uint16 - helpers.utils.toLog(logPre + " unix_time: " + helpers.utils.toDateFromHex(Record[0])); // uint256 - helpers.utils.toLog(logPre + " payment_method: " + helpers.web3util.toDecimal(Record[1])); // uint8 - helpers.utils.toLog(logPre + " amount: " + helpers.web3util.fromWei(Record[2], "ether")); // uint256 - helpers.utils.toLog(logPre + " index: " + helpers.web3util.toDecimal(Record[3])); // uint16 - helpers.utils.toLog(""); - } - } - helpers.utils.toLog( - logPre + "-----------------------------------------------------------" - ); - - let amountDirect = await assetContract.amount_direct.call(); - let amountDirectInEther = helpers.web3util.fromWei(amountDirect, "ether"); - helpers.utils.toLog( - logPre + "Direct balance: "+amountDirectInEther - ); - - let amountMilestone = await assetContract.amount_milestone.call(); - let amountMilestoneInEther = helpers.web3util.fromWei(amountMilestone, "ether"); - helpers.utils.toLog( - logPre + "Milestone balance: "+amountMilestoneInEther - ); - - await showContractBalance(helpers, assetContract); - - helpers.utils.toLog( - logPre + "-----------------------------------------------------------" - ); - helpers.utils.toLog(""); - }, - async showAccountBalances(helpers, accounts) { - helpers.utils.toLog(logPre + " TestRPC Balances: "); - for (let i = 0; i < accounts.length; i++) { - let balance = await helpers.utils.getBalance(helpers.artifacts, accounts[i]); - helpers.utils.toLog( - logPre + - "["+i+"] "+accounts[i]+ ": "+ helpers.web3util.fromWei(balance, "ether") - ); - } - }, - async showContractBalance(helpers, contract) { - helpers.utils.toLog("\n" + logPre + " Contract Balances: "); - let balance = await helpers.utils.getBalance(helpers.artifacts, contract.address.toString()); - helpers.utils.toLog( - logPre + - contract.address.toString()+ ": "+ helpers.web3util.fromWei(balance, "ether") - ); - }, - async showGasUsage(helpers, tx, name) { - helpers.utils.toLog(name + " GAS USAGE: " + - helpers.utils.colors.purple + - tx.receipt.cumulativeGasUsed - ); - }, - async getGasPrice(helpers) { - let stub = await helpers.getContract("EmptyStub"); - return stub.class_defaults.gasPrice; - }, - async getGasUsage(helpers, tx, name) { - return(name + "GAS USAGE: " + - helpers.utils.colors.purple + - tx.receipt.cumulativeGasUsed - ); - }, - - async showFundingState(helpers, assetContract) { - await helpers.utils.showDebugSettings(helpers, assetContract); - await helpers.utils.showDebugFundingStages(helpers, assetContract); - // await helpers.utils.showDebugFundingStageStateRequiredChanges(helpers, assetContract); - await helpers.utils.showDebugRequiredStateChanges(helpers, assetContract); - - }, - async showCurrentState(helpers, assetContract) { - await helpers.utils.showGeneralRequiredStateChanges(helpers, assetContract); - }, - - async showApplicationAssetTable(helpers, TestBuilder) { - - // console.log("Application Entity Asset Setup Table: ") - let ApplicationEntity = await TestBuilder.getDeployedByName("ApplicationEntity"); - - let table = new helpers.Table({ - head: ["Name", "Initialized", "Settings Locked"], - colWidths: [20, 15, 15] - }); - - let AssetCollectionNum = await ApplicationEntity.AssetCollectionNum.call(); - - for (let i = 0; i < AssetCollectionNum.toString(); i++) { - - let assetNameBytes = await ApplicationEntity.AssetCollectionIdToName.call(i); - let assetName = await helpers.web3util.toUtf8(assetNameBytes); - - let object = await TestBuilder.getDeployedByName(assetName); - - let initialized = await object._initialized.call(); - let settingsApplied = await object._settingsApplied.call(); - - - table.push([ - assetName, - initialized.toString(), - settingsApplied.toString(), - ] - ); - } - - console.log(table.toString()); - // console.log(""); - - - - }, - async showAllStates(helpers, TestBuilder) { - - // console.log("Application Entity Asset State Table: ") - - let ApplicationEntity = await TestBuilder.getDeployedByName("ApplicationEntity"); - - let Funding = await TestBuilder.getDeployedByName("Funding"); - let FundingManager = await TestBuilder.getDeployedByName("FundingManager"); - let Milestones = await TestBuilder.getDeployedByName("Milestones"); - let Proposals = await TestBuilder.getDeployedByName("Proposals"); - - let table = new helpers.Table({ - head: ["Name", "CHGS", "Current", "Required", "Rec Cur", "Rec Req", "Extra 1", "Extra 2"], - colWidths: [20, 7, 32, 32, 20, 20, 14, 10] - }); - - table.push(await helpers.utils.getApplicationRequiredStateChanges( helpers, ApplicationEntity) ); - table.push(await helpers.utils.getOneLineRequiredStateChanges( helpers, Funding) ); - table.push(await helpers.utils.getOneLineRequiredStateChanges( helpers, FundingManager) ); - table.push(await helpers.utils.getOneLineRequiredStateChanges( helpers, Milestones) ); - table.push(await helpers.utils.getOneLineRequiredStateChanges( helpers, Proposals) ); - - return table.toString(); - }, - - async getOneLineRequiredStateChanges(helpers, assetContract) { - - let contractTimeStamp = await assetContract.getTimestamp.call(); - let assetName = await assetContract.assetName.call(); - let contractType = await helpers.web3util.toUtf8(assetName); - - let logLine = ""; - let logColor = helpers.utils.colors.white; - let color; - - let cols = []; - - cols.push(contractType); - - let reqChanges = await assetContract.getRequiredStateChanges.call(); - let hasChanges = await assetContract.hasRequiredStateChanges.call(); - - if (hasChanges.toString() === "false") { - color = helpers.utils.colors.green; - } else { - color = helpers.utils.colors.red; - } - - cols.push(color+hasChanges.toString()); - - if(contractType === "Funding" || contractType === "Milestones" ) { - - - let CurrentRecordState = helpers.utils.getRecordStateNameById(contractType, helpers.web3util.toDecimal(reqChanges[0])); - let RecordStateRequired = helpers.utils.getRecordStateNameById(contractType, helpers.web3util.toDecimal(reqChanges[1])); - let EntityStateRequired = helpers.utils.getEntityStateNameById(contractType, helpers.web3util.toDecimal(reqChanges[2])); - - let CurrentEntityStateReq = await assetContract.CurrentEntityState.call(); - let CurrentEntityState = await helpers.web3util.toDecimal(CurrentEntityStateReq); - - // cols.push(helpers.utils.colors.green + "[" + CurrentEntityState + "] " + helpers.utils.getEntityStateNameById(contractType, CurrentEntityState)); - cols.push(helpers.utils.colors.green + helpers.utils.getEntityStateNameById(contractType, CurrentEntityState)); - - if (reqChanges[2].toString() === "0") { - color = helpers.utils.colors.green; - } else { - color = helpers.utils.colors.red; - } - - // cols.push(color + "[" + reqChanges[2].toString() + "] " + EntityStateRequired); - cols.push(color + EntityStateRequired); - - // cols.push(helpers.utils.colors.green + "[" + reqChanges[0] + "] " + CurrentRecordState); - cols.push(helpers.utils.colors.green + CurrentRecordState); - - color = helpers.utils.colors.red; - let stateChangeInt = helpers.web3util.toDecimal(reqChanges[1]); - if (stateChangeInt === 0) { - color = helpers.utils.colors.green; - } - //cols.push(color + "[" + stateChangeInt + "] " + RecordStateRequired); - cols.push(color + RecordStateRequired); - - - if (contractType === "Funding") { - - let FundingStageNum = await assetContract.FundingStageNum.call(); - let currentFundingStage = await assetContract.currentFundingStage.call(); - -// cols.push(logColor + "Stages: " + helpers.utils.colors.orange + FundingStageNum); -// cols.push(logColor + "Current: " + helpers.utils.colors.orange + currentFundingStage); - cols.push(logColor + "Rec:" + helpers.utils.colors.orange + FundingStageNum); - cols.push(logColor + "Cur:" + helpers.utils.colors.orange + currentFundingStage); - - } else if (contractType === "Milestones") { - - let RecordNum = await assetContract.RecordNum.call(); - let currentRecord = await assetContract.currentRecord.call(); - -// cols.push(logColor + "Stages: " + helpers.utils.colors.orange + RecordNum); -// cols.push(logColor + "Current: " + helpers.utils.colors.orange + currentRecord); - cols.push(logColor + "Rec:" + helpers.utils.colors.orange + RecordNum); - cols.push(logColor + "Cur:" + helpers.utils.colors.orange + currentRecord); - - } else { - cols.push(""); - cols.push(""); - } - - - - } - else if(contractType === "FundingManager") { - - let CurrentEntityStateID = helpers.web3util.toDecimal(reqChanges[0]); - let RequiredEntityStateID = helpers.web3util.toDecimal(reqChanges[1]); - - let CurrentEntityStateName = helpers.utils.getEntityStateNameById(contractType, CurrentEntityStateID); - let RequiredEntityStateName = helpers.utils.getEntityStateNameById(contractType, RequiredEntityStateID); - - color = helpers.utils.colors.red; -// cols.push(helpers.utils.colors.green + "[" + CurrentEntityStateID + "] " + CurrentEntityStateName); - cols.push(helpers.utils.colors.green + CurrentEntityStateName); - - if (RequiredEntityStateID.toString() === "0") { - color = helpers.utils.colors.green; - } -// cols.push(color + "[" + RequiredEntityStateID + "] " + RequiredEntityStateName); - cols.push(color + RequiredEntityStateName); - - let vaultNum = await assetContract.vaultNum.call(); - let lastProcessedVaultId = await assetContract.lastProcessedVaultId.call(); - - cols.push(""); - cols.push(""); -// cols.push(logColor+"vaultNum: " + helpers.utils.colors.orange + vaultNum); - cols.push(logColor+"VNum:" + helpers.utils.colors.orange + vaultNum); -// cols.push(logColor+"Last Processed: " + helpers.utils.colors.orange + lastProcessedVaultId); - cols.push(logColor+"Last:" + helpers.utils.colors.orange + lastProcessedVaultId); - - } else if (contractType === "Proposals") { - - // quite different from other assets. We list the ids of proposals that require processing before finalisation - - let NumberOfActiveProposals = await helpers.web3util.toDecimal(reqChanges); - - if(hasChanges === true) { - - if (NumberOfActiveProposals > 0) { - - let ProposalIdWithChanges = []; - - for(let i = 0; i < NumberOfActiveProposals; i++) { - - let ActiveProposalId = await assetContract.ActiveProposalIds.call(i); - // let ProposalRecord = await assetContract.ProposalsById.call(ActiveProposalId); - let canEndVoting = await assetContract.canEndVoting(ActiveProposalId); - if(canEndVoting === true) { - ProposalIdWithChanges.push(ActiveProposalId); - } - } - cols.push( helpers.utils.colors.red + ProposalIdWithChanges.join(", ") ); - } - } else { - cols.push( helpers.utils.colors.green + "NONE" ); - } - - let RecordNum = await assetContract.RecordNum.call(); - - cols.push(""); - cols.push(""); - cols.push(""); - cols.push(logColor+"Num:" + helpers.utils.colors.orange + RecordNum); - cols.push(logColor+"Act:" + helpers.utils.colors.orange + NumberOfActiveProposals); - } - return cols; - }, - - async getApplicationRequiredStateChanges(helpers, assetContract) { - - let contractTimeStamp = await assetContract.getTimestamp.call(); - let assetName = "ApplicationEntity"; - - let cols = []; - cols.push(assetName); - let color; - - let hasChanges = await assetContract.hasRequiredStateChanges.call(); - let changes = "false"; - if(hasChanges) { - changes = "true"; - } - - if (hasChanges === false) { - color = helpers.utils.colors.green; - } else { - color = helpers.utils.colors.red; - } - cols.push(color+changes); - - let reqChanges = await assetContract.getRequiredStateChanges.call(); - - let CurrentEntityStateID = helpers.web3util.toDecimal(reqChanges[0]); - let RequiredEntityStateID = helpers.web3util.toDecimal(reqChanges[1]); - - let CurrentEntityStateName = helpers.utils.getEntityStateNameById(assetName, CurrentEntityStateID); - let RequiredEntityStateName = helpers.utils.getEntityStateNameById(assetName, RequiredEntityStateID); - -// cols.push( helpers.utils.colors.green + "[" + CurrentEntityStateID + "] " + CurrentEntityStateName ); - cols.push( helpers.utils.colors.green + CurrentEntityStateName ); - - if (RequiredEntityStateID.toString() === "0") { - color = helpers.utils.colors.green; - } else { - color = helpers.utils.colors.red; - } - - // cols.push( color + "[" + RequiredEntityStateID + "] " + RequiredEntityStateName ); - cols.push( color + RequiredEntityStateName ); - cols.push(""); - cols.push(""); - cols.push( helpers.utils.toDate(contractTimeStamp) ); - - let ApplicationEntityLocked = await assetContract._locked.call(); - if(ApplicationEntityLocked) { - cols.push( "LOCKED" ); - } else { - cols.push( "" ); - } - - - return cols; - }, - - - - async showGeneralRequiredStateChanges(helpers, assetContract) { - - helpers.utils.toLog("\n" + logPre + " Debug - Required State Changes: "); - helpers.utils.toLog( - logPre + "-----------------------------------------------------------" - ); - - let contractTimeStamp = await assetContract.getTimestamp.call(); - let assetName = await assetContract.assetName.call(); - let contractType = helpers.web3util.toUtf8(assetName); - - - helpers.utils.toLog( - logPre + "Asset Name: " + contractType - ); - - helpers.utils.toLog( - logPre + "Contract Time and Date: " + helpers.utils.toDate(contractTimeStamp) - ); - - let reqChanges = await assetContract.getRequiredStateChanges.call(); - - if(contractType === "Funding" ) { - - let CurrentRecordState = helpers.utils.getRecordStateNameById(contractType, helpers.web3util.toDecimal(reqChanges[0])); - let RecordStateRequired = helpers.utils.getRecordStateNameById(contractType, helpers.web3util.toDecimal(reqChanges[1])); - let EntityStateRequired = helpers.utils.getEntityStateNameById(contractType,helpers.web3util.toDecimal(reqChanges[2])); - - let CurrentEntityStateReq = await assetContract.CurrentEntityState.call(); - let CurrentEntityState = helpers.web3util.toDecimal(CurrentEntityStateReq); - - - let stageId = helpers.web3util.toDecimal(await assetContract.currentFundingStage.call()); - - helpers.utils.toLog( - logPre + "Current stage id: " + stageId - ); - - helpers.utils.toLog( - logPre + "Received RECORD state: " + - helpers.utils.colors.green + - "[" + reqChanges[0] + "] " + - CurrentRecordState - ); - - let color = helpers.utils.colors.red; - - let stateChangeInt = helpers.web3util.toDecimal(reqChanges[1]); - if (stateChangeInt == 0) { - color = helpers.utils.colors.green; - } - - helpers.utils.toLog( - logPre + "Required RECORD change: " + - color + - "[" + stateChangeInt + "] " + - RecordStateRequired - ); - - color = helpers.utils.colors.red; - - - helpers.utils.toLog( - logPre + "Current ENTITY: " + - helpers.utils.colors.green + - "[" + CurrentEntityState + "] " + - helpers.utils.getEntityStateNameById(contractType, CurrentEntityState) - ); - - if (reqChanges[2] == 0) { - color = helpers.utils.colors.green; - } - helpers.utils.toLog( - logPre + "Required ENTITY change: " + - color + - "[" + reqChanges[2] + "] " + - EntityStateRequired - ); - - } else if(contractType === "Milestones") { - - let CurrentRecordState = helpers.utils.getRecordStateNameById(contractType, helpers.web3util.toDecimal(reqChanges[0])); - let RecordStateRequired = helpers.utils.getRecordStateNameById(contractType, helpers.web3util.toDecimal(reqChanges[1])); - let EntityStateRequired = helpers.utils.getEntityStateNameById(contractType,helpers.web3util.toDecimal(reqChanges[2])); - - let CurrentEntityStateReq = await assetContract.CurrentEntityState.call(); - let CurrentEntityState = helpers.web3util.toDecimal(CurrentEntityStateReq); - - - let currentRecordId = helpers.web3util.toDecimal(await assetContract.currentRecord.call()); - - helpers.utils.toLog( - logPre + "Current record id: " + currentRecordId - ); - - helpers.utils.toLog( - logPre + "Received RECORD state: " + - helpers.utils.colors.green + - "[" + reqChanges[0] + "] " + - CurrentRecordState - ); - - let color = helpers.utils.colors.red; - - let stateChangeInt = helpers.web3util.toDecimal(reqChanges[1]); - if (stateChangeInt == 0) { - color = helpers.utils.colors.green; - } - - helpers.utils.toLog( - logPre + "Required RECORD change: " + - color + - "[" + stateChangeInt + "] " + - RecordStateRequired - ); - - color = helpers.utils.colors.red; - - - helpers.utils.toLog( - logPre + "Current ENTITY: " + - helpers.utils.colors.green + - "[" + CurrentEntityState + "] " + - helpers.utils.getEntityStateNameById(contractType, CurrentEntityState) - ); - - if (reqChanges[2] == 0) { - color = helpers.utils.colors.green; - } - helpers.utils.toLog( - logPre + "Required ENTITY change: " + - color + - "[" + reqChanges[2] + "] " + - EntityStateRequired - ); - - - } else if(contractType === "FundingManager") { - - - let vaultNum = await assetContract.vaultNum.call(); - let lastProcessedVaultId = await assetContract.lastProcessedVaultId.call(); - let hasRequiredStateChanges = await assetContract.hasRequiredStateChanges.call(); - - helpers.utils.toLog( - logPre + "Number of Vaults: " + - helpers.utils.colors.orange + - vaultNum - ); - helpers.utils.toLog( - logPre + "Last Processed Vault ID " + - helpers.utils.colors.orange + - lastProcessedVaultId - ); - helpers.utils.toLog( - logPre + "Required State Changes " + - helpers.utils.colors.green + - hasRequiredStateChanges - ); - - - let CurrentEntityStateID = helpers.web3util.toDecimal(reqChanges[0]); - let RequiredEntityStateID = helpers.web3util.toDecimal(reqChanges[1]); - - let CurrentEntityStateName = helpers.utils.getEntityStateNameById(contractType, CurrentEntityStateID); - let RequiredEntityStateName = helpers.utils.getEntityStateNameById(contractType, RequiredEntityStateID); - - if (CurrentEntityStateID === 0) { - color = helpers.utils.colors.green; - } - - color = helpers.utils.colors.red; - helpers.utils.toLog( - logPre + "Current ENTITY: " + - helpers.utils.colors.green + - "[" + CurrentEntityStateID + "] " + - CurrentEntityStateName - ); - - if (CurrentEntityStateID === 0) { - color = helpers.utils.colors.green; - } - helpers.utils.toLog( - logPre + "Required ENTITY change: " + - color + - "[" + RequiredEntityStateID + "] " + - RequiredEntityStateName - ); - - } - helpers.utils.toLog(""); - }, - - - async showApplicationRequiredStateChanges(helpers, assetContract) { - - helpers.utils.toLog("\n" + logPre + " Debug - ApplicationEntity Required State Changes: "); - helpers.utils.toLog( - logPre + "-----------------------------------------------------------" - ); - - let contractTimeStamp = await assetContract.getTimestamp.call(); - let assetName = "ApplicationEntity"; - - helpers.utils.toLog( - logPre + "Contract Time and Date: " + helpers.utils.toDate(contractTimeStamp) - ); - - let reqChanges = await assetContract.getRequiredStateChanges.call(); - let hasRequiredStateChanges = await assetContract.hasRequiredStateChanges.call(); - - helpers.utils.toLog( - logPre + "Required State Changes " + - helpers.utils.colors.green + - hasRequiredStateChanges - ); - - let CurrentEntityStateID = helpers.web3util.toDecimal(reqChanges[0]); - let RequiredEntityStateID = helpers.web3util.toDecimal(reqChanges[1]); - - let CurrentEntityStateName = helpers.utils.getEntityStateNameById(assetName, CurrentEntityStateID); - let RequiredEntityStateName = helpers.utils.getEntityStateNameById(assetName, RequiredEntityStateID); - - if (CurrentEntityStateID === 0) { - color = helpers.utils.colors.green; - } - - color = helpers.utils.colors.red; - helpers.utils.toLog( - logPre + "Current ENTITY: " + - helpers.utils.colors.green + - "[" + CurrentEntityStateID + "] " + - CurrentEntityStateName - ); - - if (CurrentEntityStateID === 0) { - color = helpers.utils.colors.green; - } - helpers.utils.toLog( - logPre + "Required ENTITY change: " + - color + - "[" + RequiredEntityStateID + "] " + - RequiredEntityStateName - ); - - - helpers.utils.toLog(""); - }, - - async runStateChanger(helpers, assetContract) { - - let hasChanges = await assetContract.hasStateChanges.call(); - if (hasChanges === true) { - - helpers.utils.toLog(logPre + helpers.utils.colors.purple + "Running doStateChanges ..."); - tx = await assetContract.doStateChanges(true); - - for (let log of tx.logs) { - if (log.event === "DebugRecordRequiredChanges") { - console.log(logPre + " Record C: " + helpers.utils.getFundingStageStateNameById(helpers.web3util.toDecimal(log.args._current))); - console.log(logPre + " Record R: " + helpers.utils.getFundingStageStateNameById(helpers.web3util.toDecimal(log.args._required))); - } else if (log.event === "DebugEntityRequiredChanges") { - console.log(logPre + " Entity C: " + helpers.utils.getFundingEntityStateNameById(helpers.web3util.toDecimal(log.args._current))); - console.log(logPre + " Entity R: " + helpers.utils.getFundingEntityStateNameById(helpers.web3util.toDecimal(log.args._required))); - } else if (log.event === "DebugCallAgain") { - let whoAr = [0, "Entity", "Record"]; - let who = helpers.web3util.toDecimal(log.args._who); - console.log(logPre + " DebugCallAgain: " + whoAr[who]); - } else if (log.event === "EventEntityProcessor") { - console.log(logPre + " EventEntityProcessor: state:" + helpers.utils.getFundingEntityStateNameById(helpers.web3util.toDecimal(log.args._state)) ); - } - - } - - await helpers.utils.showGasUsage(helpers, tx); - await helpers.utils.showDebugRequiredStateChanges(helpers, assetContract); - } - }, - async showDebugRequiredStateChanges(helpers, assetContract) { - - helpers.utils.toLog("\n" + logPre + " Debug - Required State Changes: "); - helpers.utils.toLog( - logPre + "-----------------------------------------------------------" - ); - - let contractTimeStamp = await assetContract.getTimestamp.call(); - helpers.utils.toLog( - logPre + "Contract Time and Date: " + helpers.utils.toDate(contractTimeStamp) - ); - - let reqChanges = await assetContract.getRequiredStateChanges.call(); - - let CurrentFundingStageState = helpers.utils.getFundingStageStateNameById(helpers.web3util.toDecimal(reqChanges[0])); - let FundingStageStateRequired = helpers.utils.getFundingStageStateNameById(helpers.web3util.toDecimal(reqChanges[1])); - let EntityStateRequired = helpers.utils.getFundingEntityStateNameById(helpers.web3util.toDecimal(reqChanges[2])); - - - let CurrentEntityStateReq = await assetContract.CurrentEntityState.call(); - let CurrentEntityState = helpers.web3util.toDecimal(CurrentEntityStateReq); - - - let stageId = helpers.web3util.toDecimal( await assetContract.currentFundingStage.call() ); - - helpers.utils.toLog( - logPre + "Current stage id: " + stageId - ); - - helpers.utils.toLog( - logPre + "Received RECORD state: " + - helpers.utils.colors.green + - "["+reqChanges[0]+"] "+ - CurrentFundingStageState - ); - - let color = helpers.utils.colors.red; - - let stateChangeInt = helpers.web3util.toDecimal(reqChanges[1]); - if(stateChangeInt == 0) { - color = helpers.utils.colors.green; - } - - helpers.utils.toLog( - logPre + "Required RECORD change: " + - color + - "["+stateChangeInt+"] "+ - FundingStageStateRequired - ); - - color = helpers.utils.colors.red; - - - helpers.utils.toLog( - logPre + "Current ENTITY: " + - helpers.utils.colors.green + - "["+CurrentEntityState+"] "+ - helpers.utils.getFundingEntityStateNameById(CurrentEntityState) - ); - - if(reqChanges[2] == 0 ) { - color = helpers.utils.colors.green; - } - helpers.utils.toLog( - logPre + "Required ENTITY change: " + - color + - "["+reqChanges[2]+"] "+ - EntityStateRequired - ); - - // FundingStageStates - // let FundingStage = await assetContract.Collection.call(stageId); - // helpers.utils.displayFundingStageStruct(helpers, FundingStage); - - helpers.utils.toLog(""); - }, - async showDebugFundingStageStateRequiredChanges(helpers, assetContract) { - - helpers.utils.toLog("\n" + logPre + " Debug - FundingStage Required State Changes: "); - helpers.utils.toLog( - logPre + "-----------------------------------------------------------" - ); - - let contractTimeStamp = await assetContract.getTimestamp.call(); - helpers.utils.toLog( - logPre + "Contract Time and Date: " + helpers.utils.toDate(contractTimeStamp) - ); - - let stageId = helpers.web3util.toDecimal( await assetContract.currentFundingStage.call() ); - - helpers.utils.toLog( - logPre + "Current stage id: " + stageId - ); - - let FundingStage = await assetContract.Collection.call(stageId); - helpers.utils.toLog( - logPre + "Current state: " + - helpers.utils.colors.green + - helpers.utils.getFundingStageStateNameById(helpers.web3util.toDecimal(FundingStage[2])) - ); - - let stateChanges = await assetContract.getRequiredStateChanges.call(); - let RecordStateRequired = stateChanges[1]; - let EntityStateRequired = stateChanges[2]; - - - let stateChangeInt = helpers.web3util.toDecimal(RecordStateRequired); - if(stateChangeInt !== 0) { - helpers.utils.toLog( - logPre + "Required record change: " + - helpers.utils.colors.red + - helpers.utils.getFundingStageStateNameById(stateChangeInt) - ); - } else { - helpers.utils.toLog( - logPre + "Required record change: " + - helpers.utils.colors.green + - helpers.utils.getFundingStageStateNameById(stateChangeInt) - ); - } - - // FundingStageStates - - // let FundingStage = await assetContract.Collection.call(stageId); - // helpers.utils.displayFundingStageStruct(helpers, FundingStage); - - - helpers.utils.toLog(""); - }, - async showCurrentSettings(helpers, assetContract) { - - helpers.utils.toLog("\n" + logPre + " Debug - Current Settings: "); - helpers.utils.toLog( - logPre + "-----------------------------------------------------------" - ); - - let AmountRaised = await assetContract.AmountRaised.call(); - let AmountCapSoft = await assetContract.AmountCapSoft.call(); - let AmountCapHard = await assetContract.AmountCapHard.call(); - helpers.utils.toLog(logPre + "AmountRaised ether: " + helpers.web3util.fromWei(AmountRaised, "ether")); - helpers.utils.toLog(logPre + "AmountCapSoft ether: " + helpers.web3util.fromWei(AmountCapSoft, "ether")); - helpers.utils.toLog(logPre + "AmountCapHard ether: " + helpers.web3util.fromWei(AmountCapHard, "ether")); - - let stageId = helpers.web3util.toDecimal( await assetContract.currentFundingStage.call() ); - - helpers.utils.toLog( - logPre + - "Current STAGE id: " + stageId - ); - - let FundingStage = await assetContract.Collection.call(stageId); - - helpers.utils.toLog( - logPre + - "time_start: " + - helpers.utils.toDateFromHex(FundingStage[3]) - ); - - helpers.utils.toLog( - logPre + - "time_end: " + - helpers.utils.toDateFromHex(FundingStage[4]) - ); - - helpers.utils.toLog( - logPre + - "amount_cap_soft: " + - helpers.web3util.fromWei(FundingStage[5], "ether") - ); - helpers.utils.toLog( - logPre + - "amount_cap_hard: " + - helpers.web3util.fromWei(FundingStage[6], "ether") - ); - - - let Contract_current_timestamp = await assetContract.getTimestamp.call(); - - helpers.utils.toLog( - logPre + - "CURRENT DATE: " + - helpers.utils.toDate(Contract_current_timestamp) - ); - - }, - async showDebugSettings(helpers, assetContract) { - - helpers.utils.toLog("\n" + logPre + " Debug - Settings: "); - helpers.utils.toLog( - logPre + "-----------------------------------------------------------" - ); - let AmountRaised = await assetContract.AmountRaised.call(); - let AmountCapSoft = await assetContract.GlobalAmountCapSoft.call(); - let AmountCapHard = await assetContract.GlobalAmountCapHard.call(); - let TokenSellPercentage = await assetContract.TokenSellPercentage.call(); - - let Contract_current_timestamp = await assetContract.getTimestamp.call(); - let Funding_Setting_funding_time_start = await assetContract.Funding_Setting_funding_time_start.call(); - let Funding_Setting_funding_time_end = await assetContract.Funding_Setting_funding_time_end.call(); - let Funding_Setting_cashback_time_start = await assetContract.Funding_Setting_cashback_time_start.call(); - let Funding_Setting_cashback_time_end = await assetContract.Funding_Setting_cashback_time_end.call(); - - helpers.utils.toLog(logPre + "AmountRaised ether: " + helpers.web3util.fromWei(AmountRaised, "ether")); - helpers.utils.toLog(logPre + "AmountCapSoft ether: " + helpers.web3util.fromWei(AmountCapSoft, "ether")); - helpers.utils.toLog(logPre + "AmountCapHard ether: " + helpers.web3util.fromWei(AmountCapHard, "ether")); - helpers.utils.toLog(logPre + "TokenSellPercentage %: " + helpers.web3util.toDecimal(TokenSellPercentage)); - - - helpers.utils.toLog( - logPre + "CURRENT DATE: " + helpers.utils.toDate(Contract_current_timestamp) - ); - helpers.utils.toLog( - logPre + "Funding Start DATE: " + helpers.utils.toDate(Funding_Setting_funding_time_start) - ); - helpers.utils.toLog( - logPre + "Funding End DATE: " + helpers.utils.toDate(Funding_Setting_funding_time_end) - ); - - helpers.utils.toLog( - logPre + "CashBack Start DATE: " + helpers.utils.toDate(Funding_Setting_cashback_time_start) - ); - helpers.utils.toLog( - logPre + "CashBack End DATE: " + helpers.utils.toDate(Funding_Setting_cashback_time_end) - ); - - helpers.utils.toLog( - logPre + "-----------------------------------------------------------" - ); - helpers.utils.toLog(""); - } - , - async showDebugFundingStages(helpers, assetContract) { - - helpers.utils.toLog("\n" + logPre + " Debug - Funding Stages: "); - helpers.utils.toLog( - logPre + "-----------------------------------------------------------" - ); - - let FundingStageNum = await assetContract.FundingStageNum.call(); - if (FundingStageNum > 0) { - helpers.utils.toLog(logPre + - "[" + - helpers.utils.colors.orange + - FundingStageNum + - helpers.utils.colors.none + - "] Funding Stages: "); - - for (let i = 1; i <= FundingStageNum; i++) { - let stageId = i; - helpers.utils.toLog(logPre + "Checking stage id: " + stageId); - - let FundingStage = await assetContract.Collection.call(stageId); - helpers.utils.displayFundingStageStruct(helpers, FundingStage); - - } - } else { - helpers.utils.toLog(logPre + "None Found"); - } - helpers.utils.toLog( - logPre + "-----------------------------------------------------------" - ); - helpers.utils.toLog(""); - }, - displayFundingStageStruct(helpers, struct) { - - // helpers.utils.toLog(struct); - helpers.utils.toLog(logPre + "name: " + helpers.web3util.toAscii(struct[0])); // bytes32 - helpers.utils.toLog(logPre + "description: " + helpers.web3util.toAscii(struct[1])); // bytes32 - helpers.utils.toLog(logPre + "state: " + helpers.web3util.toDecimal(struct[2])); // uint8 - helpers.utils.toLog(logPre + "time_start: " + helpers.utils.toDateFromHex(struct[3])); // uint256 - helpers.utils.toLog(logPre + "time_end: " + helpers.utils.toDateFromHex(struct[4])); // uint256 - helpers.utils.toLog(logPre + "amount_cap_soft: " + helpers.web3util.fromWei(struct[5], "ether")); // uint256 - helpers.utils.toLog(logPre + "amount_cap_hard: " + helpers.web3util.fromWei(struct[6], "ether")); // uint256 - helpers.utils.toLog(logPre + "amount_raised: " + helpers.web3util.fromWei(struct[7], "ether")); // uint256 - helpers.utils.toLog(logPre + "minimum_entry: " + helpers.web3util.fromWei(struct[8], "ether")); // uint256 - helpers.utils.toLog(logPre + "methods: " + helpers.web3util.toDecimal(struct[9])); // uint8 - helpers.utils.toLog(logPre + "fixed_tokens: " + helpers.web3util.toDecimal(struct[10])); // uint256 - helpers.utils.toLog(logPre + "use_parity: " + struct[11]); // bool - helpers.utils.toLog(logPre + "token_share_perc: " + helpers.web3util.toDecimal(struct[12])); // uint8 - helpers.utils.toLog(logPre + "index: " + helpers.web3util.toDecimal(struct[13])); // uint8 - helpers.utils.toLog(""); - }, - - async displayProposal(helpers, ProposalsAsset, ProposalId) { - - helpers.utils.toLog(logPre + "Proposal Id ["+ProposalId+"]" ); - let ProposalRecord = await ProposalsAsset.ProposalsById.call( ProposalId ); - - helpers.utils.toLog(logPre + "creator: "+ ProposalRecord[0].toString()); - helpers.utils.toLog(logPre + "name: "+ helpers.web3util.toUtf8(ProposalRecord[1])); - helpers.utils.toLog(logPre + "actionType: "+ helpers.utils.getActionNameById("Proposals", ProposalRecord[2].toNumber() ) ); - helpers.utils.toLog(logPre + "state: "+ helpers.utils.getRecordStateNameById("Proposals", ProposalRecord[3].toNumber() ) ); - helpers.utils.toLog(logPre + "hash: "+ ProposalRecord[4].toString()); - helpers.utils.toLog(logPre + "addr: "+ ProposalRecord[5].toString()); - helpers.utils.toLog(logPre + "sourceCodeUrl: "+ helpers.web3util.toUtf8(ProposalRecord[6])); - helpers.utils.toLog(logPre + "extra: "+ ProposalRecord[7].toString()); - helpers.utils.toLog(logPre + "time_start: "+ helpers.utils.toDateFromHex(ProposalRecord[8])); - helpers.utils.toLog(logPre + "time_end: "+ helpers.utils.toDateFromHex(ProposalRecord[9])); - helpers.utils.toLog(logPre + "index: "+ ProposalRecord[10].toString()); - - let ProposalResultRecord = await ProposalsAsset.ResultsByProposalId.call( ProposalId ); - - helpers.utils.toLog(logPre + "" ); - helpers.utils.toLog(logPre + "Result Record:" ); - helpers.utils.toLog(logPre + "totalAvailable: "+ helpers.utils.getInTotal(helpers, ProposalResultRecord[0]) ); - helpers.utils.toLog(logPre + "requiredForResult: "+ helpers.utils.getInTotal(helpers, ProposalResultRecord[1]) ); - helpers.utils.toLog(logPre + "totalSoFar: "+ helpers.utils.getInTotal(helpers, ProposalResultRecord[2]) ); - helpers.utils.toLog(logPre + "yes: "+ helpers.utils.getInTotal(helpers, ProposalResultRecord[3]) ); - helpers.utils.toLog(logPre + "no: "+ helpers.utils.getInTotal(helpers, ProposalResultRecord[4]) ); - helpers.utils.toLog(logPre + "requiresCounting: "+ ProposalResultRecord[5].toString()); - helpers.utils.toLog(logPre + "" ); - - let hasRequiredStateChanges = await ProposalsAsset.hasRequiredStateChanges.call(); - helpers.utils.toLog(logPre + "RequiredStateChanges:"+ hasRequiredStateChanges.toString() ); - - let ActiveProposalNum = await ProposalsAsset.ActiveProposalNum.call(); - helpers.utils.toLog(logPre + "ActiveProposalNum: "+ ActiveProposalNum.toString() ); - - let ActiveProposalId = await ProposalsAsset.ActiveProposalIds.call(0); - helpers.utils.toLog(logPre + "ActiveProposalIds[0]:"+ ActiveProposalId.toString() ); - - let needsProcessing = await ProposalsAsset.needsProcessing.call( ActiveProposalId ); - helpers.utils.toLog(logPre + "needsProcessing: "+ needsProcessing.toString() ); - - let expiryChangesState = await ProposalsAsset.expiryChangesState.call( ActiveProposalId ); - helpers.utils.toLog(logPre + "expiryChangesState: "+ expiryChangesState.toString() ); - - helpers.utils.toLog(logPre + "" ); - - }, - async displayCashBackStatus(helpers, TestBuildHelper, wallet) { - - let vault = await TestBuildHelper.getMyVaultAddress(wallet); - let canCashBack = await vault.canCashBack.call(); - - let checkFundingStateFailed = await vault.checkFundingStateFailed.call(); - let checkOwnerFailedToSetTimeOnMeeting = await vault.checkOwnerFailedToSetTimeOnMeeting.call(); - let checkMilestoneStateInvestorVotedNoVotingEndedNo = await vault.checkMilestoneStateInvestorVotedNoVotingEndedNo.call(); - - let etherBalance = await helpers.utils.getBalance(helpers.artifacts, vault.address); - let etherBalanceInFull = helpers.web3util.fromWei(etherBalance, "ether"); - - console.log("canCashBack: ", canCashBack.toString()); - console.log("checkFundingStateFailed: ", checkFundingStateFailed.toString()); - console.log("checkOwnerFailedToSetTime: ", checkOwnerFailedToSetTimeOnMeeting.toString()); - console.log("checkMVotedNoVotingEndedNo:", checkMilestoneStateInvestorVotedNoVotingEndedNo.toString()); - console.log("ether balance: ", etherBalanceInFull.toString()); - - }, - getInTotal( helpers, bigNumber ) { - let result = helpers.web3util.fromWei(bigNumber, "ether"); - return result.toString(); - }, - getFundingStageStateNameById(_id) { - return FundingStageStates.filter(x => x.key === _id)[0].name; - }, - getFundingStageStateIdByName(_name) { - return FundingStageStates.filter(x => x.name === _name)[0].key; - }, - getFundingEntityStateNameById(_id) { - return FundingEntityStates.filter(x => x.key === _id)[0].name; - }, - getFundingEntityStateIdByName(_name) { - return FundingEntityStates.filter(x => x.name === _name)[0].key; - }, - getEntityStateNameById(_type, _id) { - return StateArray[_type].filter(x => x.key === _id)[0].name; - }, - getEntityStateIdByName(_type, _name) { - return StateArray[_type].filter(x => x.name === _name)[0].key; - }, - getRecordStateNameById(_type, _id) { - return RecordArray[_type].filter(x => x.key === _id)[0].name; - }, - getRecordStateIdByName(_type, _name) { - return RecordArray[_type].filter(x => x.name === _name)[0].key; - }, - getActionNameById(_type, _id) { - return ActionArray[_type].filter(x => x.key === _id)[0].name; - }, - getActionIdByName(_type, _name) { - return ActionArray[_type].filter(x => x.name === _name)[0].key; - }, - getSetupClone(setup, newSettings) { - return { - helpers: setup.helpers, - contracts: setup.contracts, - assetContractNames: setup.assetContractNames, - settings: newSettings - }; - }, - async getContractBalance(helpers, address) { - return await helpers.utils.getBalance(helpers.artifacts, address); - }, - getAssetContractByName(array, name) { - return array.filter(x => x.name === name)[0]; - }, -}; diff --git a/test/init.js b/test/init.js new file mode 100644 index 0000000..3ad165b --- /dev/null +++ b/test/init.js @@ -0,0 +1,267 @@ +async function runSetup() { + + const Web3 = require("web3"); + let web3Instance, network; + + if (process.argv[3] == "coverage") { + network = process.argv[3]; + } else { + // Network name we're using to run the tests + network = process.argv[4]; + } + + if (!network || network === "js") { + network = "development"; + } + + // load truffle config + const truffleConfig = require("../truffle-config.js"); + + let accounts; + let networkConfig = truffleConfig.networks[network]; + + if (truffleConfig.networks[network]) { + web3Instance = await new Web3(truffleConfig.networks[network].provider()); + if(process.argv[4] === "js") { + accounts = []; + } else { + accounts = await web3Instance.eth.getAccounts(); + } + } else { + console.log( + "Specified Network [" + network + "] not found in truffle-config." + ); + process.exit(1); + } + + // global required by openzeppelin-test-helpers + global.web3 = web3Instance; + + const { + BN, + constants, + expectRevert, + expectEvent + } = require("openzeppelin-test-helpers"); + + // const BN = require("bignumber.js"); + const { MAX_UINT256 } = constants; + const web3util = require("web3-utils"); + const Table = require("cli-table"); + const utils = require("./solc_tests/helpers/utils"); + const safeUtils = require("./solc_tests/helpers/safeUtils"); + const { assert, expect } = require("chai"); + const { assertInvalidOpcode } = require("./solc_tests/helpers/assertThrow"); + + utils.toLog( + " ----------------------------------------------------------------\n" + + " Step 1 - Setting up helpers and globals \n" + + " ----------------------------------------------------------------" + ); + + const ether = 1000000000000000000; // 1 ether in wei + const etherBN = new BN(ether.toString()); + + const solidity = { + ether: ether, + etherBN: etherBN, + gwei: 1000000000 + }; + + // https://github.com/0xjac/ERC1820 + const ERC1820 = { + RawTx: + "0xf90a388085174876e800830c35008080b909e5608060405234801561001057600080fd5b506109c5806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a5576000357c010000000000000000000000000000000000000000000000000000000090048063a41e7d5111610078578063a41e7d51146101d4578063aabbb8ca1461020a578063b705676514610236578063f712f3e814610280576100a5565b806329965a1d146100aa5780633d584063146100e25780635df8122f1461012457806365ba36c114610152575b600080fd5b6100e0600480360360608110156100c057600080fd5b50600160a060020a038135811691602081013591604090910135166102b6565b005b610108600480360360208110156100f857600080fd5b5035600160a060020a0316610570565b60408051600160a060020a039092168252519081900360200190f35b6100e06004803603604081101561013a57600080fd5b50600160a060020a03813581169160200135166105bc565b6101c26004803603602081101561016857600080fd5b81019060208101813564010000000081111561018357600080fd5b82018360208201111561019557600080fd5b803590602001918460018302840111640100000000831117156101b757600080fd5b5090925090506106b3565b60408051918252519081900360200190f35b6100e0600480360360408110156101ea57600080fd5b508035600160a060020a03169060200135600160e060020a0319166106ee565b6101086004803603604081101561022057600080fd5b50600160a060020a038135169060200135610778565b61026c6004803603604081101561024c57600080fd5b508035600160a060020a03169060200135600160e060020a0319166107ef565b604080519115158252519081900360200190f35b61026c6004803603604081101561029657600080fd5b508035600160a060020a03169060200135600160e060020a0319166108aa565b6000600160a060020a038416156102cd57836102cf565b335b9050336102db82610570565b600160a060020a031614610339576040805160e560020a62461bcd02815260206004820152600f60248201527f4e6f7420746865206d616e616765720000000000000000000000000000000000604482015290519081900360640190fd5b6103428361092a565b15610397576040805160e560020a62461bcd02815260206004820152601a60248201527f4d757374206e6f7420626520616e204552433136352068617368000000000000604482015290519081900360640190fd5b600160a060020a038216158015906103b85750600160a060020a0382163314155b156104ff5760405160200180807f455243313832305f4143434550545f4d4147494300000000000000000000000081525060140190506040516020818303038152906040528051906020012082600160a060020a031663249cb3fa85846040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182600160a060020a0316600160a060020a031681526020019250505060206040518083038186803b15801561047e57600080fd5b505afa158015610492573d6000803e3d6000fd5b505050506040513d60208110156104a857600080fd5b5051146104ff576040805160e560020a62461bcd02815260206004820181905260248201527f446f6573206e6f7420696d706c656d656e742074686520696e74657266616365604482015290519081900360640190fd5b600160a060020a03818116600081815260208181526040808320888452909152808220805473ffffffffffffffffffffffffffffffffffffffff19169487169485179055518692917f93baa6efbd2244243bfee6ce4cfdd1d04fc4c0e9a786abd3a41313bd352db15391a450505050565b600160a060020a03818116600090815260016020526040812054909116151561059a5750806105b7565b50600160a060020a03808216600090815260016020526040902054165b919050565b336105c683610570565b600160a060020a031614610624576040805160e560020a62461bcd02815260206004820152600f60248201527f4e6f7420746865206d616e616765720000000000000000000000000000000000604482015290519081900360640190fd5b81600160a060020a031681600160a060020a0316146106435780610646565b60005b600160a060020a03838116600081815260016020526040808220805473ffffffffffffffffffffffffffffffffffffffff19169585169590951790945592519184169290917f605c2dbf762e5f7d60a546d42e7205dcb1b011ebc62a61736a57c9089d3a43509190a35050565b600082826040516020018083838082843780830192505050925050506040516020818303038152906040528051906020012090505b92915050565b6106f882826107ef565b610703576000610705565b815b600160a060020a03928316600081815260208181526040808320600160e060020a031996909616808452958252808320805473ffffffffffffffffffffffffffffffffffffffff19169590971694909417909555908152600284528181209281529190925220805460ff19166001179055565b600080600160a060020a038416156107905783610792565b335b905061079d8361092a565b156107c357826107ad82826108aa565b6107b85760006107ba565b815b925050506106e8565b600160a060020a0390811660009081526020818152604080832086845290915290205416905092915050565b6000808061081d857f01ffc9a70000000000000000000000000000000000000000000000000000000061094c565b909250905081158061082d575080155b1561083d576000925050506106e8565b61084f85600160e060020a031961094c565b909250905081158061086057508015155b15610870576000925050506106e8565b61087a858561094c565b909250905060018214801561088f5750806001145b1561089f576001925050506106e8565b506000949350505050565b600160a060020a0382166000908152600260209081526040808320600160e060020a03198516845290915281205460ff1615156108f2576108eb83836107ef565b90506106e8565b50600160a060020a03808316600081815260208181526040808320600160e060020a0319871684529091529020549091161492915050565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff161590565b6040517f01ffc9a7000000000000000000000000000000000000000000000000000000008082526004820183905260009182919060208160248189617530fa90519096909550935050505056fea165627a7a72305820377f4a2d4301ede9949f163f319021a6e9c687c292a5e2b2c4734c126b524e6c00291ba01820182018201820182018201820182018201820182018201820182018201820a01820182018201820182018201820182018201820182018201820182018201820", + SenderAddress: "0xa990077c3205cbDf861e17Fa532eeB069cE9fF96", + ContractAddress: "0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24", + sig: { + v: "0x1b", // 27 + r: "0x1820182018201820182018201820182018201820182018201820182018201820", + s: "0x1820182018201820182018201820182018201820182018201820182018201820" + }, + deploymentCost: solidity.ether * 0.08, + + // edit this to change "funds supplier address" + FundsSupplierAddress: accounts[10], + abi: [ + { + constant: false, + inputs: [ + { name: "_addr", type: "address" }, + { name: "_interfaceHash", type: "bytes32" }, + { name: "_implementer", type: "address" } + ], + name: "setInterfaceImplementer", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: true, + inputs: [{ name: "_addr", type: "address" }], + name: "getManager", + outputs: [{ name: "", type: "address" }], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { name: "_addr", type: "address" }, + { name: "_newManager", type: "address" } + ], + name: "setManager", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: true, + inputs: [{ name: "_interfaceName", type: "string" }], + name: "interfaceHash", + outputs: [{ name: "", type: "bytes32" }], + payable: false, + stateMutability: "pure", + type: "function" + }, + { + constant: false, + inputs: [ + { name: "_contract", type: "address" }, + { name: "_interfaceId", type: "bytes4" } + ], + name: "updateERC165Cache", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: true, + inputs: [ + { name: "_addr", type: "address" }, + { name: "_interfaceHash", type: "bytes32" } + ], + name: "getInterfaceImplementer", + outputs: [{ name: "", type: "address" }], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { name: "_contract", type: "address" }, + { name: "_interfaceId", type: "bytes4" } + ], + name: "implementsERC165InterfaceNoCache", + outputs: [{ name: "", type: "bool" }], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { name: "_contract", type: "address" }, + { name: "_interfaceId", type: "bytes4" } + ], + name: "implementsERC165Interface", + outputs: [{ name: "", type: "bool" }], + payable: false, + stateMutability: "view", + type: "function" + }, + { + anonymous: false, + inputs: [ + { indexed: true, name: "addr", type: "address" }, + { indexed: true, name: "interfaceHash", type: "bytes32" }, + { indexed: true, name: "implementer", type: "address" } + ], + name: "InterfaceImplementerSet", + type: "event" + }, + { + anonymous: false, + inputs: [ + { indexed: true, name: "addr", type: "address" }, + { indexed: true, name: "newManager", type: "address" } + ], + name: "ManagerChanged", + type: "event" + } + ], + instance: false + }; + + function toIntVal(val) { + return parseInt(val); + } + + // https://web3js.readthedocs.io/en/v1.2.1/web3.html#extend + web3.extend({ + property: "evm", + methods: [ + { + name: "snapshot", + call: "evm_snapshot", + params: 0, + outputFormatter: toIntVal + }, + { + name: "revert", + call: "evm_revert", + params: 1, + inputFormatter: [toIntVal] + } + ] + }); + + const rICOConfig = require("../rICO-config.js"); + + const setup = { + network: network, + globals: {}, + helpers: { + networkName: network, + networkConfig: networkConfig, + assertInvalidOpcode: assertInvalidOpcode, + utils: utils, + safeUtils: safeUtils, + web3util: web3util, + web3: web3, + web3Instance: web3Instance, + Table: Table, + BN: BN, + constants: constants, + expectRevert: expectRevert, + expectEvent: expectEvent, + MAX_UINT256: MAX_UINT256, + expect: expect, + assert: assert, + solidity: solidity, + ERC1820: ERC1820, + addresses: { + ERC1820: "0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24", + Token: null, + Rico: null + } + }, + settings: rICOConfig.settings + }; + + global.setup = setup; + global.helpers = setup.helpers; + global.accounts = accounts; + global.assert = assert; + + return global; +} + +module.exports = { + runSetup: runSetup +} diff --git a/test/js_validator_tests/1_js_validator.js b/test/js_validator_tests/1_js_validator.js new file mode 100644 index 0000000..a4dc76c --- /dev/null +++ b/test/js_validator_tests/1_js_validator.js @@ -0,0 +1,1001 @@ +const { + conditional, + clone, + BN, + MAX_UINT256, + expect, + expectThrow +} = require("./_test.utils.js"); + +const validatorHelper = require("./assets/validator.js"); + +describe("Javascript Validator - Tests", function () { + let Validator; + + before(function () { + Validator = new validatorHelper(setup.settings); + }); + + describe("Integrity checking", function () { + + beforeEach(async function () { + Validator = new validatorHelper(setup.settings); + }); + + describe("Settings are assigned correctly", function () { + + it("commitPhaseStartBlock is correct", function() { + expect(Validator.commitPhaseStartBlock, "commitPhaseStartBlock not correct").is.equal( + Validator.block + setup.settings.rico.startBlockDelay + ); + }); + + it("commitPhaseBlockCount is correct", function() { + expect(Validator.commitPhaseBlockCount, "commitPhaseBlockCount not correct").is.equal( + setup.settings.rico.blocksPerDay * setup.settings.rico.commitPhaseDays + ); + }); + + it("commitPhaseEndBlock is correct", function() { + expect(Validator.commitPhaseEndBlock, "commitPhaseEndBlock not correct").is.equal( + // commitPhaseStartBlock ( current block + delay ) + (Validator.block + setup.settings.rico.startBlockDelay) + + // commitPhaseBlockCount + ( setup.settings.rico.commitPhaseDays * setup.settings.rico.blocksPerDay ) + // subtract 1 so both start and end blocks are in the block count range + - 1 + ); + }); + + it("buyPhaseStartBlock is correct", function() { + expect(Validator.buyPhaseStartBlock, "buyPhaseStartBlock not correct").is.equal( + Validator.getStage(1).startBlock + ); + }); + + it("buyPhaseEndBlock is correct", function() { + expect(Validator.buyPhaseEndBlock, "buyPhaseEndBlock not correct").is.equal( + Validator.getStage(Validator.stageCount).endBlock + ); + }); + + it("buyPhaseBlockCount is correct", function() { + expect(Validator.buyPhaseBlockCount, "buyPhaseBlockCount not correct").is.equal( + Validator.buyPhaseEndBlock - Validator.buyPhaseStartBlock + 1 + ); + }); + + it("blocksPerDay is correct", function() { + expect(Validator.blocksPerDay, "blocksPerDay not correct").is.equal(setup.settings.rico.blocksPerDay); + }); + + it("commitPhaseDays is correct", function() { + expect(Validator.commitPhaseDays, "commitPhaseDays not correct").is.equal(setup.settings.rico.commitPhaseDays); + }); + + it("stageDays is correct", function() { + expect(Validator.stageDays, "stageDays not correct").is.equal(setup.settings.rico.stageDays); + }); + + it("commitPhasePrice is 0.002", function() { + expect( + Validator.toEth(Validator.commitPhasePrice), + "commitPhasePrice not correct" + ).is.equal("0.002"); + }); + + it("stagePriceIncrease is 0.0001", function() { + expect( + Validator.toEth(Validator.stagePriceIncrease), + "stagePriceIncrease not correct" + ).is.equal("0.0001"); + }); + + + }); + + describe("getCurrentBlockNumber()", function () { + it("returns default block correctly", function() { + expect(Validator.getCurrentBlockNumber()).is.equal(0); + }); + }); + + describe("setBlockNumber()", function () { + it("sets block correctly", function() { + Validator.setBlockNumber(2); + expect(Validator.getCurrentBlockNumber()).is.equal(2); + }); + }); + }); + + describe("Initialization", function () { + + describe("stage generation", function () { + + it("stageCount is correct", function() { + expect(Validator.stageCount).is.equal(setup.settings.rico.stageCount); + }); + + it("pricing increases by 10% for each stage", function() { + + let expectedPrice = Validator.commitPhasePrice; + let validCount = 0; + for(let i = 0; i < setup.settings.rico.stageCount; i++) { + const stageData = Validator.getStage(i); + expect(stageData.tokenPrice.toString(), "Expected stage pricing is wrong.").is.equal(expectedPrice.toString()); + expectedPrice = stageData.tokenPrice.add( Validator.stagePriceIncrease ); + validCount++; + } + expect(validCount, "At least one stage pricing is wrong.").is.equal(setup.settings.rico.stageCount); + }); + }); + }); + + describe("Stage Methods", function () { + + describe("getStageAtBlock(_blockNumber)", function () { + + describe("stage 0", function () { + let stageId = 0; + + it("should return correct stageId using startBlock", function() { + const blockInStage = Validator.getStage(stageId).startBlock; + const resultingStageId = Validator.getStageAtBlock(blockInStage); + expect(resultingStageId.toString(), "Incorrect stage id returned").is.equal( stageId.toString() ); + }); + + it("should return correct stageId using endBlock", function() { + const blockInStage = Validator.getStage(stageId).endBlock; + const resultingStageId = Validator.getStageAtBlock(blockInStage); + expect(resultingStageId.toString(), "Incorrect stage id returned").is.equal( stageId.toString() ); + }); + }); + + describe("stage 1", function () { + let stageId = 1; + + it("should return correct stageId using startBlock", function() { + const blockInStage = Validator.getStage(stageId).startBlock; + const resultingStageId = Validator.getStageAtBlock(blockInStage); + expect(resultingStageId.toString(), "Incorrect stage id returned").is.equal( stageId.toString() ); + }); + + it("should return correct stageId using endBlock", function() { + const blockInStage = Validator.getStage(stageId).endBlock; + const resultingStageId = Validator.getStageAtBlock(blockInStage); + expect(resultingStageId.toString(), "Incorrect stage id returned").is.equal( stageId.toString() ); + }); + }); + + describe("stage 6", function () { + let stageId = 6; + + it("should return correct stageId using startBlock", function() { + const blockInStage = Validator.getStage(stageId).startBlock; + const resultingStageId = Validator.getStageAtBlock(blockInStage); + expect(resultingStageId.toString(), "Incorrect stage id returned").is.equal( stageId.toString() ); + }); + + it("should return correct stageId using endBlock", function() { + const blockInStage = Validator.getStage(stageId).endBlock; + const resultingStageId = Validator.getStageAtBlock(blockInStage); + expect(resultingStageId.toString(), "Incorrect stage id returned").is.equal( stageId.toString() ); + }); + }); + + describe("last stage", function () { + let stageId; + before(function () { + stageId = Validator.stageCount; + }); + + it("should return correct stageId using startBlock", function() { + const blockInStage = Validator.getStage(stageId).startBlock; + const resultingStageId = Validator.getStageAtBlock(blockInStage); + expect(resultingStageId.toString(), "Incorrect stage id returned").is.equal( stageId.toString() ); + }); + + it("should return correct stageId using endBlock", function() { + const blockInStage = Validator.getStage(stageId).endBlock; + const resultingStageId = Validator.getStageAtBlock(blockInStage); + expect(resultingStageId.toString(), "Incorrect stage id returned").is.equal( stageId.toString() ); + }); + }); + + describe("1 block before 0", function () { + let stageId = 0; + it("should throw \"Block outside of rICO period.\"", function() { + const blockInStage = Validator.getStage(stageId).startBlock - 1; + expectThrow(() => { + Validator.getStageAtBlock(blockInStage); + }, "Block outside of rICO period."); + }); + }); + + describe("1 block after last stage", function () { + let stageId; + before(function () { + stageId = Validator.stageCount; + }); + + it("should throw \"Block outside of rICO period.\"", function() { + const blockInStage = Validator.getStage(stageId).endBlock + 1; + expectThrow(() => { + Validator.getStageAtBlock(blockInStage); + }, "Block outside of rICO period."); + }); + }); + }); + }); + + + describe("Price Methods", function () { + + describe("getPriceAtBlock(_blockNumber)", function () { + let _blockNumber = 0; + + describe("edge of commit and buy block range", function () { + + describe("before commitPhaseStartBlock", function () { + + before(function () { + _blockNumber = Validator.getStage(0).startBlock - 1; + expect(_blockNumber, "Incorrect block").is.equal(Validator.commitPhaseStartBlock - 1); + }); + + it("should throw \"Block outside of rICO period.\"", function() { + expectThrow(() => { + const price = Validator.getPriceAtBlock(_blockNumber); + }, "Block outside of rICO period."); + }); + }); + + describe("at commitPhaseStartBlock", function () { + + before(function () { + _blockNumber = Validator.getStage(0).startBlock; + expect(_blockNumber, "Incorrect block").is.equal(Validator.commitPhaseStartBlock); + }); + + it("should return commitPhasePrice", function() { + const price = Validator.getPriceAtBlock(_blockNumber); + expect(price.toString(), "Incorrect price returned").is.equal( + Validator.getStage(0).tokenPrice.toString() + ); + }); + }); + + describe("at buyPhaseEndBlock", function () { + + before(function () { + _blockNumber = Validator.getStage(Validator.stageCount).endBlock; + expect(_blockNumber, "Incorrect block").is.equal(Validator.buyPhaseEndBlock); + }); + + it("should return commitPhasePrice", function() { + const price = Validator.getPriceAtBlock(_blockNumber); + expect(price.toString(), "Incorrect price returned").is.equal( + Validator.getStage(Validator.stageCount).tokenPrice.toString() + ); + }); + }); + + describe("after buyPhaseEndBlock", function () { + + before(function () { + _blockNumber = Validator.getStage(Validator.stageCount).endBlock + 1; + expect(_blockNumber, "Incorrect block").is.equal(Validator.buyPhaseEndBlock + 1); + }); + + it("should throw \"Block outside of rICO period.\"", function() { + expectThrow(() => { + const price = Validator.getPriceAtBlock(_blockNumber); + }, "Block outside of rICO period."); + }); + + }); + }); + + describe("first stage", function () { + let startPrice, endPrice; + const stageId = 0; + describe("startBlock", function () { + + before(function () { + _blockNumber = Validator.getStage(stageId).startBlock; + expect(_blockNumber, "Incorrect block").is.equal(Validator.commitPhaseStartBlock); + }); + + it("should return commitPhasePrice", function() { + const price = Validator.getPriceAtBlock(_blockNumber); + expect(price.toString(), "Incorrect price returned").is.equal( + Validator.getStage(stageId).tokenPrice.toString() + ); + startPrice = price; + }); + }); + + describe("endBlock", function () { + + before(function () { + _blockNumber = Validator.getStage(stageId).startBlock; + expect(_blockNumber, "Incorrect block").is.equal(Validator.commitPhaseStartBlock); + }); + + it("should return commitPhasePrice", function() { + const price = Validator.getPriceAtBlock(_blockNumber); + expect(price.toString(), "Incorrect price returned").is.equal( + Validator.getStage(stageId).tokenPrice.toString() + ); + endPrice = price; + }); + }); + + describe("StartBlock price and EndBlock price", function () { + it("should be higher than 0 and match", function() { + expect(startPrice).is.bignumber.gt(new BN(0)); + expect(endPrice).is.bignumber.gt(new BN(0)); + expect(startPrice.toString(), "Start and end prices do not match").is.equal(endPrice.toString()); + }); + }); + }); + + describe("stage 6", function () { + let startPrice, endPrice; + const stageId = 6; + describe("startBlock", function () { + + before(function () { + _blockNumber = Validator.getStage(stageId).startBlock; + }); + + it("should return stage tokenPrice", function() { + const price = Validator.getPriceAtBlock(_blockNumber); + expect(price.toString(), "Incorrect price returned").is.equal( + Validator.getStage(stageId).tokenPrice.toString() + ); + startPrice = price; + }); + }); + + describe("endBlock", function () { + + before(function () { + _blockNumber = Validator.getStage(stageId).startBlock; + }); + + it("should return stage tokenPrice", function() { + const price = Validator.getPriceAtBlock(_blockNumber); + expect(price.toString(), "Incorrect price returned").is.equal( + Validator.getStage(stageId).tokenPrice.toString() + ); + endPrice = price; + }); + }); + + describe("StartBlock price and EndBlock price", function () { + it("should be higher than 0 and match", function() { + expect(startPrice).is.bignumber.gt(new BN(0)); + expect(endPrice).is.bignumber.gt(new BN(0)); + expect(startPrice.toString(), "Start and end prices do not match").is.equal(endPrice.toString()); + }); + }); + }); + + describe("last stage", function () { + let startPrice, endPrice; + let stageId; + + before(function () { + stageId = Validator.stageCount; + }); + + describe("startBlock", function () { + + before(function () { + _blockNumber = Validator.getStage(stageId).startBlock; + }); + + it("should return stage tokenPrice", function() { + const price = Validator.getPriceAtBlock(_blockNumber); + expect(price.toString(), "Incorrect price returned").is.equal( + Validator.getStage(stageId).tokenPrice.toString() + ); + startPrice = price; + }); + }); + + describe("endBlock", function () { + + before(function () { + _blockNumber = Validator.getStage(stageId).startBlock; + }); + + it("should return stage tokenPrice", function() { + const price = Validator.getPriceAtBlock(_blockNumber); + expect(price.toString(), "Incorrect price returned").is.equal( + Validator.getStage(stageId).tokenPrice.toString() + ); + endPrice = price; + }); + }); + + describe("StartBlock price and EndBlock price", function () { + it("should be higher than 0 and match", function() { + expect(startPrice).is.bignumber.gt(new BN(0)); + expect(endPrice).is.bignumber.gt(new BN(0)); + expect(startPrice.toString(), "Start and end prices do not match").is.equal(endPrice.toString()); + }); + }); + }); + }); + + describe("getTokenAmountForEthAtStage()", function () { + + describe("1 eth", function () { + let ethAmount; + + before(function () { + ethAmount = Validator.getOneEtherBn(); + }); + + describe("stage 0", function () { + let stageId = 0; + + it("should return 500 tokens", function() { + const TokenAmount = Validator.getTokenAmountForEthAtStage(ethAmount, stageId); + expect(Validator.toEth(TokenAmount), "Incorrect token amount returned").is.equal("500"); + }); + }); + + describe("stage 1", function () { + let stageId = 1; + + it("should return 476.190476190476190476 tokens", function() { + const TokenAmount = Validator.getTokenAmountForEthAtStage(ethAmount, stageId); + expect(Validator.toEth(TokenAmount), "Incorrect token amount returned").is.equal("476.190476190476190476"); + }); + }); + + describe("stage 6", function () { + let stageId = 6; + + it("should return 384.615384615384615384 tokens", function() { + const TokenAmount = Validator.getTokenAmountForEthAtStage(ethAmount, stageId); + expect(Validator.toEth(TokenAmount), "Incorrect token amount returned").is.equal("384.615384615384615384"); + }); + }); + + describe("last stage", function () { + let stageId; + before(function () { + stageId = Validator.stageCount; + }); + + it("should return 312.5 tokens", function() { + const TokenAmount = Validator.getTokenAmountForEthAtStage(ethAmount, stageId); + expect(Validator.toEth(TokenAmount), "Incorrect token amount returned").is.equal("312.5"); + }); + }); + + }); + + }); + + describe("getEthAmountForTokensAtStage()", function () { + + describe("1 eth worth of tokens", function () { + let ethAmount; + + before(function () { + ethAmount = Validator.getOneEtherBn(); + }); + + describe("stage 0", function () { + let stageId = 0; + + it("should return 1 eth", function() { + const TokenAmount = Validator.getTokenAmountForEthAtStage(ethAmount, stageId); + const returnedEthAmount = Validator.getEthAmountForTokensAtStage(TokenAmount, stageId); + expect(returnedEthAmount.toString(), "Incorrect eth amount returned").is.equal( ethAmount.toString() ); + }); + }); + + describe("stage 1", function () { + let stageId = 1; + + it("should return 1 eth minus 1 wei", function() { + const TokenAmount = Validator.getTokenAmountForEthAtStage(ethAmount, stageId); + const returnedEthAmount = Validator.getEthAmountForTokensAtStage(TokenAmount, stageId); + expect(returnedEthAmount.toString(), "Incorrect eth amount returned").is.equal( ethAmount.sub(new BN(1)).toString() ); + }); + }); + + describe("stage 6", function () { + let stageId = 6; + + it("should return 1 eth minus 1 wei", function() { + const TokenAmount = Validator.getTokenAmountForEthAtStage(ethAmount, stageId); + const returnedEthAmount = Validator.getEthAmountForTokensAtStage(TokenAmount, stageId); + expect(returnedEthAmount.toString(), "Incorrect eth amount returned").is.equal( ethAmount.sub(new BN(1)).toString() ); + }); + }); + + describe("last stage", function () { + let stageId; + before(function () { + stageId = Validator.stageCount; + }); + + it("should return 1 eth", function() { + const TokenAmount = Validator.getTokenAmountForEthAtStage(ethAmount, stageId); + const returnedEthAmount = Validator.getEthAmountForTokensAtStage(TokenAmount, stageId); + expect(returnedEthAmount.toString(), "Incorrect eth amount returned").is.equal( ethAmount.toString() ); + }); + }); + + }); + + }); + + + describe("getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow)", function () { + + describe("precisionPow = 2 ( 10 ** 2 => 100 )", function () { + let precisionPow, precisionNumber; + + before(function () { + precisionPow = 2; + precisionNumber = new BN(10).pow(new BN(precisionPow)); + }); + + describe("_currentBlock in range", function () { + + describe("_currentBlock = 1, _startBlock = 1, _endBlock = 100", function () { + const _currentBlock = 1; + const _startBlock = 1; + const _endBlock = 100; + + it("should return 0.01", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "0.01" ); + }); + }); + + describe("_currentBlock = 101, _startBlock = 101, _endBlock = 200", function () { + const _currentBlock = 101; + const _startBlock = 101; + const _endBlock = 200; + + it("should return 0.01", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "0.01" ); + }); + }); + + describe("_currentBlock = 2, _startBlock = 1, _endBlock = 100", function () { + const _currentBlock = 2; + const _startBlock = 1; + const _endBlock = 100; + + it("should return 0.02", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "0.02" ); + }); + }); + + describe("_currentBlock = 102, _startBlock = 101, _endBlock = 200", function () { + const _currentBlock = 102; + const _startBlock = 101; + const _endBlock = 200; + + it("should return 0.02", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "0.02" ); + }); + }); + + describe("_currentBlock = 50, _startBlock = 1, _endBlock = 100", function () { + const _currentBlock = 50; + const _startBlock = 1; + const _endBlock = 100; + + it("should return 0.5", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "0.5" ); + }); + }); + + describe("_currentBlock = 100, _startBlock = 1, _endBlock = 100", function () { + const _currentBlock = 100; + const _startBlock = 1; + const _endBlock = 100; + + it("should return 1", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "1" ); + }); + }); + }); + + describe("_currentBlock ouside range", function () { + + describe("before range => _currentBlock = 0, _startBlock = 1, _endBlock = 100", function () { + const _currentBlock = 0; + const _startBlock = 1; + const _endBlock = 100; + + it("should return 0", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "0" ); + }); + }); + + describe("after range => _currentBlock = 101, _startBlock = 1, _endBlock = 100", function () { + const _currentBlock = 101; + const _startBlock = 1; + const _endBlock = 100; + + it("should return 1", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "1" ); + }); + }); + + }); + }); + + describe("precisionPow = 20 ( 10 ** 20 => 100000000000000000000 )", function () { + let precisionPow, precisionNumber; + + before(function () { + precisionPow = 20; + precisionNumber = new BN(10).pow(new BN(precisionPow)); + }); + + describe("_currentBlock in range", function () { + + describe("_currentBlock = 1, _startBlock = 1, _endBlock = 100", function () { + const _currentBlock = 1; + const _startBlock = 1; + const _endBlock = 100; + + it("should return 0.01", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "0.01" ); + }); + }); + + describe("_currentBlock = 101, _startBlock = 101, _endBlock = 200", function () { + const _currentBlock = 101; + const _startBlock = 101; + const _endBlock = 200; + + it("should return 0.01", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "0.01" ); + }); + }); + + describe("_currentBlock = 2, _startBlock = 1, _endBlock = 100", function () { + const _currentBlock = 2; + const _startBlock = 1; + const _endBlock = 100; + + it("should return 0.02", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "0.02" ); + }); + }); + + describe("_currentBlock = 102, _startBlock = 101, _endBlock = 200", function () { + const _currentBlock = 102; + const _startBlock = 101; + const _endBlock = 200; + + it("should return 0.02", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "0.02" ); + }); + }); + + describe("_currentBlock = 50, _startBlock = 1, _endBlock = 100", function () { + const _currentBlock = 50; + const _startBlock = 1; + const _endBlock = 100; + + it("should return 0.5", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "0.5" ); + }); + }); + + describe("_currentBlock = 100, _startBlock = 1, _endBlock = 100", function () { + const _currentBlock = 100; + const _startBlock = 1; + const _endBlock = 100; + + it("should return 1", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "1" ); + }); + }); + }); + + describe("_currentBlock ouside range", function () { + + describe("before range => _currentBlock = 0, _startBlock = 1, _endBlock = 100", function () { + const _currentBlock = 0; + const _startBlock = 1; + const _endBlock = 100; + + it("should return 0", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "0" ); + }); + }); + + describe("after range => _currentBlock = 101, _startBlock = 1, _endBlock = 100", function () { + const _currentBlock = 101; + const _startBlock = 1; + const _endBlock = 100; + + it("should return 1", function() { + let percentage = Validator.getUnlockPercentage(_currentBlock, _startBlock, _endBlock, precisionPow); + percentage = percentage.mul(new BN(1000)).div(precisionNumber); + percentage = percentage.toNumber() / 1000; + expect( percentage.toString(), "Incorrect percentage returned").is.equal( "1" ); + }); + }); + + }); + }); + }); + + describe("getLockedTokenAmountAtBlock(_tokenAmount, _blockNumber, precisionPow) ", function () { + let precisionPow, CustomSettingsValidator; + + const CustomSettings = { + token: setup.settings.token, + rico: { + startBlockDelay: 10, + blocksPerDay: 10, + commitPhaseDays: 10, + stageCount: 1, + stageDays: 10, + commitPhasePrice: setup.settings.rico.commitPhasePrice, + stagePriceIncrease: setup.settings.rico.stagePriceIncrease + } + }; + + before(function () { + precisionPow = new BN("20"); + CustomSettingsValidator = new validatorHelper(CustomSettings, 100); + }); + + describe("_blockNumber in range", function () { + + describe("_tokenAmount = 100, _blockNumber = startBlock", function () { + let _tokenAmount = 100; + it("should return 99", function() { + const rangeStartblock = CustomSettingsValidator.getStage(1).startBlock; + let locked = CustomSettingsValidator.getLockedTokenAmountAtBlock(_tokenAmount, rangeStartblock, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( "99" ); + }); + }); + + describe("_tokenAmount = 100, _blockNumber = (range * 0.25) - 1", function () { + let _tokenAmount = 100; + it("should return 75", function() { + const rangeStartblock = CustomSettingsValidator.getStage(1).startBlock - 1; + const middleBlock = rangeStartblock + ( CustomSettingsValidator.buyPhaseBlockCount * 0.25 ); + let locked = CustomSettingsValidator.getLockedTokenAmountAtBlock(_tokenAmount, middleBlock, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( "75" ); + }); + }); + + describe("_tokenAmount = 100, _blockNumber = (range * 0.50) - 1 ( middle of the range )", function () { + let _tokenAmount = 100; + it("should return 50", function() { + const rangeStartblock = CustomSettingsValidator.getStage(1).startBlock - 1; + const middleBlock = rangeStartblock + ( CustomSettingsValidator.buyPhaseBlockCount * 0.5 ); + let locked = CustomSettingsValidator.getLockedTokenAmountAtBlock(_tokenAmount, middleBlock, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( "50" ); + }); + }); + + describe("_tokenAmount = 100, _blockNumber = (range * 0.75) - 1", function () { + let _tokenAmount = 100; + it("should return 25", function() { + const rangeStartblock = CustomSettingsValidator.getStage(1).startBlock - 1; + const middleBlock = rangeStartblock + ( CustomSettingsValidator.buyPhaseBlockCount * 0.75 ); + let locked = CustomSettingsValidator.getLockedTokenAmountAtBlock(_tokenAmount, middleBlock, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( "25" ); + }); + }); + + describe("_tokenAmount = 100, _blockNumber = endBlock", function () { + let _tokenAmount = 100; + it("should return 0", function() { + const rangeStartblock = CustomSettingsValidator.getStage(1).endBlock; + let locked = CustomSettingsValidator.getLockedTokenAmountAtBlock(_tokenAmount, rangeStartblock, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( "0" ); + }); + }); + + }); + + describe("_blockNumber outside range", function () { + + describe("block before buyPhaseStartBlock", function () { + const _tokenAmount = 1000; + let _blockNumber; + + before(function () { + _blockNumber = CustomSettingsValidator.buyPhaseStartBlock - 1; + }); + + it("should return full amount", function() { + let locked = CustomSettingsValidator.getLockedTokenAmountAtBlock(_tokenAmount, _blockNumber, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( _tokenAmount.toString() ); + }); + }); + + describe("block after buyPhaseEndBlock", function () { + const _tokenAmount = 1000; + let _blockNumber; + + before(function () { + _blockNumber = CustomSettingsValidator.buyPhaseEndBlock + 1; + }); + + it("should return 0", function() { + let locked = CustomSettingsValidator.getLockedTokenAmountAtBlock(_tokenAmount, _blockNumber, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( "0" ); + }); + }); + + }); + + }); + + describe("getUnockedTokensForBoughtAmountAtBlock(_tokenAmount, _blockNumber, precisionPow) ", function () { + let precisionPow, CustomSettingsValidator; + + const CustomSettings = { + token: setup.settings.token, + rico: { + startBlockDelay: 10, + blocksPerDay: 10, + commitPhaseDays: 10, + stageCount: 1, + stageDays: 10, + commitPhasePrice: setup.settings.rico.commitPhasePrice, + stagePriceIncrease: setup.settings.rico.stagePriceIncrease + } + }; + + before(function () { + precisionPow = new BN("20"); + CustomSettingsValidator = new validatorHelper(CustomSettings, 100); + }); + + describe("_blockNumber in range", function () { + + describe("_tokenAmount = 100, _blockNumber = startBlock", function () { + let _tokenAmount = 100; + it("should return 1", function() { + const rangeStartblock = CustomSettingsValidator.getStage(1).startBlock; + let locked = CustomSettingsValidator.getUnockedTokensForBoughtAmountAtBlock(_tokenAmount, rangeStartblock, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( "1" ); + }); + }); + + describe("_tokenAmount = 100, _blockNumber = (range * 0.25) - 1", function () { + let _tokenAmount = 100; + it("should return 25", function() { + const rangeStartblock = CustomSettingsValidator.getStage(1).startBlock - 1; + const middleBlock = rangeStartblock + ( CustomSettingsValidator.buyPhaseBlockCount * 0.25 ); + let locked = CustomSettingsValidator.getUnockedTokensForBoughtAmountAtBlock(_tokenAmount, middleBlock, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( "25" ); + }); + }); + + describe("_tokenAmount = 100, _blockNumber = (range * 0.50) - 1 ( middle of the range )", function () { + let _tokenAmount = 100; + it("should return 50", function() { + const rangeStartblock = CustomSettingsValidator.getStage(1).startBlock - 1; + const middleBlock = rangeStartblock + ( CustomSettingsValidator.buyPhaseBlockCount * 0.5 ); + let locked = CustomSettingsValidator.getUnockedTokensForBoughtAmountAtBlock(_tokenAmount, middleBlock, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( "50" ); + }); + }); + + describe("_tokenAmount = 100, _blockNumber = (range * 0.75) - 1", function () { + let _tokenAmount = 100; + it("should return 75", function() { + const rangeStartblock = CustomSettingsValidator.getStage(1).startBlock - 1; + const middleBlock = rangeStartblock + ( CustomSettingsValidator.buyPhaseBlockCount * 0.75 ); + let locked = CustomSettingsValidator.getUnockedTokensForBoughtAmountAtBlock(_tokenAmount, middleBlock, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( "75" ); + }); + }); + + describe("_tokenAmount = 100, _blockNumber = endBlock", function () { + let _tokenAmount = 100; + it("should return 100", function() { + const rangeStartblock = CustomSettingsValidator.getStage(1).endBlock; + let locked = CustomSettingsValidator.getUnockedTokensForBoughtAmountAtBlock(_tokenAmount, rangeStartblock, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( "100" ); + }); + }); + + }); + + describe("_blockNumber outside range", function () { + + describe("block before buyPhaseStartBlock", function () { + const _tokenAmount = 100; + let _blockNumber; + + before(function () { + _blockNumber = CustomSettingsValidator.buyPhaseStartBlock - 1; + }); + + it("should return 0", function() { + let locked = CustomSettingsValidator.getUnockedTokensForBoughtAmountAtBlock(_tokenAmount, _blockNumber, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( "0" ); + }); + }); + + describe("block after buyPhaseEndBlock", function () { + const _tokenAmount = 100; + let _blockNumber; + + before(function () { + _blockNumber = CustomSettingsValidator.buyPhaseEndBlock + 1; + }); + + it("should return full amount", function() { + let locked = CustomSettingsValidator.getUnockedTokensForBoughtAmountAtBlock(_tokenAmount, _blockNumber, precisionPow); + expect( locked.toString(), "Incorrect locked amount returned").is.equal( _tokenAmount.toString() ); + }); + }); + + }); + + }); + + }); + +}); \ No newline at end of file diff --git a/test/js_validator_tests/_test.utils.js b/test/js_validator_tests/_test.utils.js new file mode 100644 index 0000000..70fcab9 --- /dev/null +++ b/test/js_validator_tests/_test.utils.js @@ -0,0 +1,55 @@ +const helpers = setup.helpers; +const BN = helpers.BN; +const MAX_UINT256 = helpers.MAX_UINT256; +const expect = helpers.expect + +// to decrease verbosity of the tests output, set this to false, +// and the suite will disable "does not change" tests +runDoesNotChangeChecks = true; + +// with this enabled, the suite will run all tests on all sub objects it can +// else a generic test that ensures the "before" block is run. +runAllSubTests = true; + +function conditional(typeOrBool, title, callback, elseCallBack = null) { + if (typeOrBool === "doesNotChange" && runDoesNotChangeChecks) { + it(title, callback); + } else if (typeOrBool === "AllSubTests") { + if(runAllSubTests) { + callback(); + } else if (typeof elseCallBack === "function") { + elseCallBack(); + } else { + throw ("missing else callback will result in 'before' block not being executed."); + } + } else if (typeOrBool === true) { + it(title, callback); + } + +} + +const _ = require('lodash'); + +function clone(_what) { + return _.cloneDeep(_what); +} + +function expectThrow(block, message) { + let thrown = false; + try { + block(); + } catch (e) { + thrown = true; + expect(e, "Thrown message did not match").is.equal(message); + } + expect(thrown, "Should have thrown.").to.be.equal(true); +} + +module.exports = { + conditional, + clone, + BN, + MAX_UINT256, + expect, + expectThrow +}; \ No newline at end of file diff --git a/test/js_validator_tests/_wip.js b/test/js_validator_tests/_wip.js new file mode 100644 index 0000000..8806c54 --- /dev/null +++ b/test/js_validator_tests/_wip.js @@ -0,0 +1,152 @@ +const { + conditional, + clone, + BN, + MAX_UINT256, + expect, + expectThrow +} = require("./_test.utils.js"); + +const contractHelper = require("./assets/ricoContract.js"); + +const { + shouldHaveValidStateAfterWhitelistModeWithNoContributions, + shouldHaveValidStateAfterWhitelistMode, + shouldHaveValidStateAfterAcceptContributionsForAddress, + shouldHaveValidStateAfterCancelContributionsForAddress, +} = require('./whitelist.behavior'); + +const { + shouldHaveValidStateAfterFirstContributionFromParticipant, + shouldHaveValidStateAfterContributionFromExistingParticipant, + shouldHaveValidStateAfterOneNewContribution, + testBalanceChange, +} = require('./commit.behavior'); + +const { + shouldHavePendingEth, + shouldNotHavePendingEth, +} = require('./withdraw.behavior'); + + +describe("Javascript Contract - Work in progress", function () { + + before(function () { + this.JSContract = new contractHelper(setup.settings); + }); + + describe("Scenario: Stage:0, Participant contributes then gets whitelisted then withdraws full amount", function () { + + const address = "participant_1_address"; + const _accept = true; + const testStage = 0; + const expectedTokenBalance = "500000000000000000000"; + + before(function () { + this.JSContract = new contractHelper(setup.settings); + + // navigate contract to testStage startBlock + this.JSContract.setBlockNumber( + this.JSContract.stages[testStage].startBlock + ); + + // set initial balance for address to 10 eth + this.JSContract.BalanceContractInstance.set( + address, this.JSContract.getOneEtherBn().mul(new BN("10")) + ); + + this.value = this.JSContract.getOneEtherBn(); + }); + + describe("- Participant commits 1 eth", function () { + const genericCallbackTitle = "Contract State changes are valid after first contribution by Participant"; + + before(function () { + this.oldState = clone(this.JSContract); + this.JSContract.commit(address, this.value); + + // set variables so we can test balances. + this.BalanceTestValue = this.value; + this.CommitTestValue = this.value; + }); + + conditional("AllSubTests", genericCallbackTitle, function() { + // _accept is false since the participant is not already whitelisted + shouldHaveValidStateAfterFirstContributionFromParticipant(address, testStage, false); + }, function() { + it(genericCallbackTitle, function() { + + }); + }); + + shouldHavePendingEth(address); + + }); + + describe("- Participant gets whitelisted", function () { + + before(function () { + this.oldState = clone(this.JSContract); + this.JSContract.whitelist(address, _accept); + + // set variables so we can test balances. + this.BalanceTestValue = this.value; + this.CommitTestValue = this.value; + }); + + it("Participant token balance is " + contractHelper.toEth(expectedTokenBalance), function () { + const balance = this.JSContract.TokenContractInstance.balanceOf(address); + expect( + balance.toString() + ).is.equal( + expectedTokenBalance.toString() + ); + + const advertisedBalance = this.JSContract.getTokenAmountForEthAtStage(this.value, testStage); + expect( + balance.toString() + ).is.equal( + advertisedBalance.toString() + ); + }); + + shouldHaveValidStateAfterWhitelistMode(address, testStage, _accept); + shouldNotHavePendingEth(address); + + }); + + + // describe("- Participant withdraws full amount", function () { + + // before(function () { + // this.oldState = clone(this.JSContract); + // this.JSContract.whitelist(address, _accept); + + // // set variables so we can test balances. + // this.BalanceTestValue = this.value; + // this.CommitTestValue = this.value; + // }); + + + // it("Participant token balance is " + contractHelper.toEth(expectedTokenBalance), function () { + // const balance = this.JSContract.TokenContractInstance.balanceOf(address); + // expect( + // balance.toString() + // ).is.equal( + // expectedTokenBalance.toString() + // ); + + // const advertisedBalance = this.JSContract.getTokenAmountForEthAtStage(this.value, testStage); + // expect( + // balance.toString() + // ).is.equal( + // advertisedBalance.toString() + // ); + // }); + + // shouldHaveValidStateAfterWhitelistMode(address, testStage, _accept); + // }); + + }); + +}); diff --git a/test/js_validator_tests/_wip_old.js b/test/js_validator_tests/_wip_old.js new file mode 100644 index 0000000..75180b7 --- /dev/null +++ b/test/js_validator_tests/_wip_old.js @@ -0,0 +1,161 @@ +const helpers = setup.helpers; +const BN = helpers.BN; +const MAX_UINT256 = helpers.MAX_UINT256; +const expect = helpers.expect + +const { + conditional, + settings, + clone, +} = require("./_test.utils.js"); + +const contractHelper = require("./assets/ricoContract.js"); + +describe("Javascript Contract - Work in progress", function () { + + before(function () { + this.JSContract = new contractHelper(settings); + }); + + describe("Participant - commits 1 eth", function () { + const address = "participant_1_address"; + const testStage = 0; + + before(function () { + + // set initial balance for address to 10 eth + this.JSContract.BalanceContractInstance.set( + address, this.JSContract.getOneEtherBn().mul(new BN("10")) + ); + + this.oldState = clone(this.JSContract); + this.value = this.JSContract.getOneEtherBn(); + this.JSContract.commit(address, this.value); + + // set variable so we can test balances. + this.BalanceTestValue = this.value; + this.CommitTestValue = this.value; + }); + + shouldRunOrig(address, testStage, false); + shouldRunMod(address, testStage, false); + }); + +}); + +function initTests(grouping) { + + + describe(grouping[0], function () { + // tests + if(typeof grouping[1] === "function") { + before(grouping[1]()); + } + + // tests + const tests = grouping[2]; + + for(let i = 0; i < tests.length; i++) { + it(tests[i][0], tests[i][1]); + } + + // describes + const subtests = grouping[3]; + if(subtests) { + for(let i = 0; i < subtests.length; i++) { + initTests(subtests[i]); + } + } + }); + +} + +function shouldRunMod(_address, _testStage, _whitelisted = false) { + + const tests = [ + "State changes after first contribution by a Participant", // title + null, // before + // it tests + [ + [ + "Contract.participantsById indexes the participant id => address", function () { + expect(this.JSContract.participantsById[this.JSContract.participantCount]).is.equal(_address); + } + ], + + [ + "Contract.participantCount increases by 1", function () { + const oldParticipantCount = this.oldState.participantCount; + const newParticipantCount = this.JSContract.participantCount; + expect(newParticipantCount).is.equal(oldParticipantCount + 1); + } + ], + ], + // describe + [ + [ + "ParticipantRecord", // title + null, // before + // tests + [ + [ + "contributionsCount is 1", function () { + const newParticipantRecord = this.JSContract.participantsByAddress[_address]; + expect(newParticipantRecord.contributionsCount).is.equal(1); + } + ] + ] + ], + [ + "ParticipantRecord 2", // title + null, // before + // tests + [ + [ + "contributionsCount is 1", function () { + const newParticipantRecord = this.JSContract.participantsByAddress[_address]; + expect(newParticipantRecord.contributionsCount).is.equal(1); + } + ], + ], + ], + ] + ]; + + initTests(tests); +} + + +function shouldRunOrig(_address, _testStage, _whitelisted = false) { + + describe("State changes after first contribution by a Participant", function () { + + it("Contract.participantsById indexes the participant id => address", function () { + expect(this.JSContract.participantsById[this.JSContract.participantCount]).is.equal(_address); + }); + + it("Contract.participantCount increases by 1", function () { + const oldParticipantCount = this.oldState.participantCount; + const newParticipantCount = this.JSContract.participantCount; + expect(newParticipantCount).is.equal(oldParticipantCount + 1); + }); + + describe("ParticipantRecord", function () { + + it("contributionsCount is 1", function () { + const newParticipantRecord = this.JSContract.participantsByAddress[_address]; + expect(newParticipantRecord.contributionsCount).is.equal(1); + }); + + }); + + describe("ParticipantRecord 2", function () { + + it("contributionsCount is 1", function () { + const newParticipantRecord = this.JSContract.participantsByAddress[_address]; + expect(newParticipantRecord.contributionsCount).is.equal(1); + }); + + }); + }); +} \ No newline at end of file diff --git a/test/js_validator_tests/assets/balanceContract.js b/test/js_validator_tests/assets/balanceContract.js new file mode 100644 index 0000000..f8bf80f --- /dev/null +++ b/test/js_validator_tests/assets/balanceContract.js @@ -0,0 +1,58 @@ +/* + * The test token tracker class. + * + * @author Micky Socaci , Fabian Vogelsteller <@frozeman> +*/ + +const { BN } = require("openzeppelin-test-helpers"); + +class BalanceContract { + + // set the defaults + constructor() { + this.balances = {}; + } + + set(_address, value) { + this.balances[_address] = new BN(value.toString()); + } + + balanceOf(_address) { + const balance = this.balances[_address]; + if (BN.isBN(balance)) { + return balance; + } + return new BN("0"); + } + + transferWithFromAndTo(_from, _to, _amount) { + _amount = new BN(_amount.toString()); + const senderBalance = this.balanceOf(_from); + const receiverBalance = this.balanceOf(_to); + if (senderBalance.gte(_amount)) { + this.balances[_from] = senderBalance.sub(_amount); + this.balances[_to] = receiverBalance.add(_amount); + } else { + throw "[" + _from + "] has insufficient balance. \n" + + "balance: [" + this.balances[_from].toString() + "]\n" + + "amount: [" + _amount.toString() + "]"; + } + } + + setTo(_address) { + this._to = _address; + } + + setFrom(_address) { + this._from = _address; + } + + transfer(_amount) { + return this.transferWithFromAndTo(this._from, this._to, _amount); + } + + + +} + +module.exports = BalanceContract; diff --git a/test/js_validator_tests/assets/ricoContract.js b/test/js_validator_tests/assets/ricoContract.js new file mode 100644 index 0000000..e03c1cf --- /dev/null +++ b/test/js_validator_tests/assets/ricoContract.js @@ -0,0 +1,582 @@ +/* + * The rico validator class. + * + * @author Micky Socaci , Fabian Vogelsteller <@frozeman> +*/ + +const _ = require('lodash'); +function clone(_what) { + return _.cloneDeep(_what); +} + +const { BN, constants } = require("openzeppelin-test-helpers"); + +const { MAX_UINT256 } = constants; +const web3util = require("web3-utils"); + +const ether = 1000000000000000000; // 1 ether in wei +const etherBN = new BN(ether.toString()); + +const solidity = { + ether: ether, + etherBN: etherBN, + gwei: 1000000000 +}; + +const Participant = { + whitelisted: false, + contributionsCount: 0, + totalReceivedETH: new BN("0"), // Total amount of ETH received by the smart contract. + returnedETH: new BN("0"), // totalReceivedETH - committedETH + committedETH: new BN("0"), // lower than msg.value if maxCap already reached + withdrawnETH: new BN("0"), // cancel() / withdraw() + allocatedETH: new BN("0"), // allocated to project when contributing or exiting + reservedTokens: new BN("0"), // total tokens bought in all stages + boughtTokens: new BN("0"), // total tokens already sent to the participant in all stages + returnedTokens: new BN("0"), // total tokens returned by participant to contract in all stages + byStage: [], +} + +const ParticipantDetailsByStage = { + totalReceivedETH: new BN("0"), // Total amount of ETH received by the smart contract. + returnedETH: new BN("0"), // totalReceivedETH - committedETH + committedETH: new BN("0"), // lower than msg.value if maxCap already reached + withdrawnETH: new BN("0"), // withdrawn from current stage + allocatedETH: new BN("0"), // allocated to project when contributing or exiting + reservedTokens: new BN("0"), // tokens bought in this stage + boughtTokens: new BN("0"), // tokens already sent to the participant in this stage + returnedTokens: new BN("0"), // tokens returned by participant to contract +} + + +const Validator = require("./validator.js"); +const TokenContract = require("./tokenContract.js"); +const BalanceContract = require("./balanceContract.js"); + +class Contract extends Validator { + + // set the defaults + constructor(settings, currentBlock = 0) { + super(settings, currentBlock); + + this.participantsByAddress = {}; + this.participantsById = []; + this.participantCount = 0; + + this.projectAllocatedETH = new BN("0"); + this.projectWithdrawnETH = new BN("0"); + this.committedETH = new BN("0"); + this.withdrawnETH = new BN("0"); + this.totalReceivedETH = new BN("0"); + this.returnedETH = new BN("0"); + + this.ApplicationEventTypes = { + "NOT_SET": 0, + "CONTRIBUTION_NEW": 1, + "CONTRIBUTION_CANCEL": 2, + "PARTICIPANT_CANCEL": 3, + "COMMITMENT_ACCEPTED": 4, + "WHITELIST_APPROVE": 5, + "WHITELIST_REJECT": 6, + "PROJECT_WITHDRAW": 7 + } + + this.TransferTypes = { + "NOT_SET": 0, + "AUTOMATIC_RETURN": 1, + "WHITELIST_REJECT": 2, + "PARTICIPANT_CANCEL": 3, + "PARTICIPANT_WITHDRAW": 4, + "PROJECT_WITHDRAW": 5 + } + + this.contractAddress = "ricoContractAddress"; + this.deployerAddress = "deployerAddress"; + + this.TokenContractInstance = new TokenContract( + settings.token.supply, + this.deployerAddress + ); + + this.BalanceContractInstance = new BalanceContract(); + + this.TokenContractInstance.send( + this.deployerAddress, + this.contractAddress, + settings.token.sale, + ); + + } + + commit(msg_sender, msg_value) { + + // @js-only + this.BalanceContractInstance.transferWithFromAndTo(msg_sender, this.contractAddress, msg_value); + + // Add the received value to totalReceivedETH + this.totalReceivedETH = this.totalReceivedETH.add(msg_value); + + // Participant initial state record + let participantRecord = this.getParticipantRecordByAddress(msg_sender); + + // Check if participant has previous contributions + if (participantRecord.contributionsCount == 0) { + // increase participant count + this.participantCount++; + + // index + this.participantsById[this.participantCount] = msg_sender; + } + + // Record contribution into current stage totals for the participant + this.recordNewContribution(msg_sender, msg_value); + + // If whitelisted, process the contribution automatically + if (participantRecord.whitelisted == true) { + this.acceptContributionsForAddress(msg_sender, this.ApplicationEventTypes.COMMITMENT_ACCEPTED); + } + } + + cancelByEth() { + // amount does not matter + + } + + cancelByTokens(amount) { + // amount required + + } + + recordNewContribution(_from, _receivedValue) { + const currentStage = this.getCurrentStage(); + const participantRecord = this.getParticipantRecordByAddress(_from); + + // Update participant's total stats + participantRecord.contributionsCount++; + participantRecord.totalReceivedETH = participantRecord.totalReceivedETH.add(_receivedValue); + + // Update participant's per-stage stats + const byStage = participantRecord.byStage[currentStage]; + byStage.totalReceivedETH = byStage.totalReceivedETH.add(_receivedValue); + + // Get the equivalent amount in tokens + const newTokenAmount = this.getTokenAmountForEthAtStage( + _receivedValue, currentStage + ); + + // Update participant's reserved tokens + byStage.reservedTokens = byStage.reservedTokens.add(newTokenAmount); + participantRecord.reservedTokens = participantRecord.reservedTokens.add(newTokenAmount); + + this.ApplicationEvent( + this.ApplicationEventTypes.CONTRIBUTION_NEW, + participantRecord.contributionsCount, + _from, + _receivedValue + ); + } + + acceptContributionsForAddress(_from, _eventType) { + + + const participantRecord = this.getParticipantRecordByAddress(_from); + const currentStage = this.getCurrentStage(); + + for (let i = 0; i <= currentStage; i++) { + + const stageId = i; + const byStage = participantRecord.byStage[stageId]; + const processedTotals = participantRecord.committedETH.add(participantRecord.returnedETH); + + if (processedTotals.lt(participantRecord.totalReceivedETH)) { + + // handle the case when we have reserved more tokens than globally available + participantRecord.reservedTokens = participantRecord.reservedTokens.sub(byStage.reservedTokens); + byStage.reservedTokens = 0; + + // the maximum amount is equal to the total available ETH at the current stage + const maxAcceptableValue = this.availableEthAtStage(currentStage); + + // the per stage accepted amount: totalReceivedETH - committedETH + let newAcceptedValue = byStage.totalReceivedETH.sub(byStage.committedETH); + let returnValue = new BN("0"); + + // if incomming value is higher than what we can accept, + // just accept the difference and return the rest + if (newAcceptedValue.gt(maxAcceptableValue)) { + newAcceptedValue = maxAcceptableValue; + returnValue = byStage.totalReceivedETH + .sub(byStage.returnedETH) + .sub(byStage.committedETH) + .sub(byStage.withdrawnETH) + .sub(newAcceptedValue); + + // update return values + this.returnedETH = this.returnedETH.add(returnValue); + participantRecord.returnedETH = participantRecord.returnedETH.add(returnValue); + byStage.returnedETH = returnValue; + } + + if (newAcceptedValue.gt(new BN("0"))) { + + // update values by adding the new accepted amount + this.committedETH = this.committedETH.add(newAcceptedValue); + participantRecord.committedETH = participantRecord.committedETH.add(newAcceptedValue); + byStage.committedETH = byStage.committedETH.add(newAcceptedValue); + + // calculate the equivalent token amount + const newTokenAmount = this.getTokenAmountForEthAtStage( + newAcceptedValue, stageId + ); + + // update participant's token amounts + participantRecord.boughtTokens = participantRecord.boughtTokens.add(newTokenAmount); + byStage.boughtTokens = byStage.boughtTokens.add(newTokenAmount); + + // allocate tokens to participant + this.IERC777().send(this.contractAddress, _from, newTokenAmount); + } + + // if the incoming amount is too big to accept, then... + // ... we must tranfer back the difference. + if (returnValue.gt(new BN("0"))) { + this.address(this.uint160(_from)).transfer(returnValue); + this.TransferEvent(this.TransferTypes.AUTOMATIC_RETURN, _from, returnValue); + } + + this.ApplicationEvent(_eventType, stageId, _from, newAcceptedValue); + } + } + } + + availableEthAtStage(_stage) { + return this.availableEthAtStageForTokenBalance( + this.IERC777().balanceOf(this.contractAddress), + _stage + ); + } + + getProjectAvailableEth() { + + let remainingFromAllocation = new BN("0"); + // Calculate the amount of allocated ETH, not withdrawn yet + if (this.projectAllocatedETH.gt(this.projectWithdrawnETH)) { + remainingFromAllocation = projectAllocatedETH.sub(projectWithdrawnETH); + } + + // Calculate ETH that is globally available: + // Available = accepted - withdrawn - projectWithdrawn - projectNotWithdrawn + let globalAvailable = this.committedETH + .sub(this.withdrawnETH) + .sub(this.projectWithdrawnETH) + .sub(this.remainingFromAllocation); + + // Multiply the available ETH with the percentage that belongs to the project now + let unlocked = globalAvailable.mul( + getCurrentUnlockPercentage() + ).div(10 ** 20); + + // Available = unlocked + projectNotWithdrawn + return unlocked.add(remainingFromAllocation); + } + + whitelist(_address, _approve) { + const participantRecord = this.getParticipantRecordByAddress(_address); + + if (_approve) { + // If participants are approved: whitelist them and accept their contributions + participantRecord.whitelisted = true; + this.acceptContributionsForAddress(_address, this.ApplicationEventTypes.WHITELIST_APPROVE); + } else { + // If participants are not approved: remove them from whitelist and cancel their contributions + participantRecord.whitelisted = false; + this.cancelContributionsForAddress(_address, 0, this.ApplicationEventTypes.WHITELIST_REJECT); + } + } + + getLockedTokenAmount(_address) { + const participantRecord = this.getParticipantRecordByAddress(_address); + + // Since we want to display token amounts even when they are not already + // transferred to their accounts, we use reserved + bought + return this.getLockedTokenAmountAtBlock( + participantRecord.reservedTokens.add(participantRecord.boughtTokens), + this.getCurrentBlockNumber() + ).sub(participantRecord.returnedTokens); + } + + getCancelModes(_address) { + const participantRecord = this.getParticipantRecordByAddress(_address); + + if (participantRecord.whitelisted == true) { + // byEth remains false as they need to send tokens back. + byTokens = this.canWithdraw(_address); + } else { + // byTokens remains false as the participant should have no tokens to send back anyway. + byEth = this.hasPendingETH(_address); + } + + return { + byTokens: byTokens, + byEth: byEth + } + } + + canWithdraw(_address) { + if (this.getLockedTokenAmount(_address).gt(new BN("0"))) { + return true; + } + return false; + } + + hasPendingETH(_address) { + const participantAvailableETH = this.getParticipantPendingETH(_address); + if(participantAvailableETH > 0) { + return true; + } + return false; + } + + getParticipantPendingETH(_from) { + const participantRecord = this.getParticipantRecordByAddress(_from); + return participantRecord.committedETH.sub(participantRecord.withdrawnETH); + } + + cancelContributionsForAddress(_from, _value, _eventType) { + + // Participant should only be able to cancel if they haven't been whitelisted yet... + // ...but just to make sure take withdrawn and returned into account. + // This is to handle the case when whitelist controller whitelists someone, then rejects... + // ...then whitelists them again. + const participantRecord = this.getParticipantRecordByAddress(_from); + + // Calculate participant's available ETH i.e. committed - withdrawnETH - returnedETH + const participantAvailableETH = participantRecord.totalReceivedETH + .sub(participantRecord.withdrawnETH) + .sub(participantRecord.returnedETH); + + if (participantAvailableETH.gt(new BN("0"))) { + // update total ETH returned + // since this balance was never actually "accepted" it counts as returned... + // ...so it does not interfere with project withdraw calculations + this.returnedETH = this.returnedETH.add(participantAvailableETH); + + // update participant's audit values + participantRecord.reservedTokens = 0; + participantRecord.withdrawnETH = participantRecord.withdrawnETH.add(participantAvailableETH); + + // transfer ETH back to participant including received value + this.address(this.uint160(_from)).transfer(participantAvailableETH.add(new BN(_value))); + + let currentTransferEventType; + if (_eventType == this.ApplicationEventTypes.WHITELIST_REJECT) { + currentTransferEventType = this.TransferTypes.WHITELIST_REJECT; + } else if (_eventType == this.ApplicationEventTypes.PARTICIPANT_CANCEL) { + currentTransferEventType = this.TransferTypes.PARTICIPANT_CANCEL; + } + + // event emission + this.TransferEvent(currentTransferEventType, _from, participantAvailableETH); + this.ApplicationEvent( + _eventType, + participantRecord.contributionsCount, + _from, + participantAvailableETH + ); + + } else { + throw ("Participant has no available ETH to withdraw."); + } + } + + withdraw( _from, _returnedTokenAmount) { + + // Whitelisted contributor sends tokens back to the rICO contract. + // - unlinke cancel() method, this allows variable amounts. + // - latest contributions get returned first. + + const participantRecord = this.getParticipantRecordByAddress(_from); + + // This is needed otherwise participants that can call cancel() and bypass! + if (participantRecord.whitelisted == true) { + + const currentBlockNumber = getCurrentBlockNumber(); + + // Contributors can send more tokens than they have locked, + // thus make sure we only try to return for said amount + let remainingTokenAmount = _returnedTokenAmount; + const maxLocked = this.getLockedTokenAmount(_from); + let returnTokenAmount; + let allocatedEthAmount; + + // if returned amount is greater than the locked amount... + // set it equal to locked, keep track of the overflow tokens (remainingTokenAmount) + if (remainingTokenAmount.gt(maxLocked)) { + returnTokenAmount = remainingTokenAmount.sub(maxLocked); + remainingTokenAmount = maxLocked; + } + + // decrease the total allocated ETH by the equivalent participant's allocated amount + this.projectAllocatedETH = projectAllocatedETH.sub(participantRecord.allocatedETH); + + if (remainingTokenAmount.gt(new BN("0"))) { + + // go through stages starting with current stage + // take stage token amount and remove from "amount participant wants to return" + // get ETH amount in said stage for that token amount + // set stage tokens to 0 + // if stage tokens < remaining tokens to process, just subtract remaining from stage + // this way we can receive tokens in current stage / later stages and process them again. + + let returnETHAmount; + // defaults to 0 + + const currentStageNumber = getCurrentStage(); + + for (let stageId = currentStageNumber; stageId >= 0; stageId--) { + + // total participant tokens at the current stage i.e. reserved + bought - returned + const totalInStage = participantRecord.byStage[stageId].reservedTokens + .add(participantRecord.byStage[stageId].boughtTokens) + .sub(participantRecord.byStage[stageId].returnedTokens); + + // calculate how many tokens are actually locked at this stage... + // ...(at the current block number) and use only those for returning. + // reserved + bought - returned (at currentStage & currentBlock) + let tokensInStage = getLockedTokenAmountAtBlock( + participantRecord.byStage[stageId].reservedTokens.add(participantRecord.byStage[stageId].boughtTokens), + currentBlockNumber + ).sub(participantRecord.byStage[stageId].returnedTokens); + + // only try to process stages that the participant has actually reserved tokens. + if (tokensInStage.gt(new BN("0"))) { + + // if the remaining amount is less than the amount available in the current stage + if (remainingTokenAmount.lt(tokensInStage)) { + tokensInStage = remainingTokenAmount; + } + //get the equivalent amount of returned tokens in ETH + const currentETHAmount = this.getEthAmountForTokensAtStage(tokensInStage, stageId); + + //increase the returned tokens counters accordingly + participantRecord.returnedTokens = participantRecord.returnedTokens.add(tokensInStage); + participantRecord.byStage[stageId].returnedTokens = participantRecord.byStage[stageId].returnedTokens.add(tokensInStage); + + // increase the corresponding ETH counters + returnETHAmount = returnETHAmount.add(currentETHAmount); + participantRecord.byStage[stageId].withdrawnETH = participantRecord.byStage[stageId].withdrawnETH.add(currentETHAmount); + + // allocated to project + const unlockedETHAmount = getEthAmountForTokensAtStage( + totalInStage.sub(tokensInStage), // unlocked token amount + stageId + ); + + this.allocatedEthAmount = this.allocatedEthAmount.add(unlockedETHAmount); + participantRecord.byStage[stageId].allocatedETH = unlockedETHAmount; + + // remove processed token amount from requested amount + remainingTokenAmount = remainingTokenAmount.sub(tokensInStage); + + // break loop if remaining amount = 0 + if (remainingTokenAmount == 0) { + break; + } + } + } + + // return overflow tokens received + if (returnTokenAmount.gt(new BN("0"))) { + // send tokens back to participant + IERC777(tokenContractAddress).send(_from, returnTokenAmount, null); + } + + // increase participant's withdrawnETH counter + participantRecord.withdrawnETH = participantRecord.withdrawnETH.add(returnETHAmount); + + // Update total ETH withdrawn + this.withdrawnETH = this.withdrawnETH.add(returnETHAmount); + + // allocate remaining ETH to project directly + participantRecord.allocatedETH = allocatedEthAmount; + this.projectAllocatedETH = this.projectAllocatedETH.add(participantRecord.allocatedETH); + + // transfer ETH back to participant + address(uint160(_from)).transfer(returnETHAmount); + TransferEvent( TransferTypes.PARTICIPANT_WITHDRAW, _from, returnETHAmount); + return; + } + } + // If address is not Whitelisted a call to this results in a revert + throw("Withdraw not possible. Participant has no locked tokens."); + } + + projectWithdraw(_ethAmount) { + + // Get project unlocked ETH (available for withdrawing) + const unlocked = this.getProjectAvailableEth(); + + // Update stats: number of project withdrawals, total amount withdrawn by the project + this.projectWithdrawCount++; + this.projectWithdrawnETH = this.projectWithdrawnETH.add(_ethAmount); + + // Transfer ETH to project wallet + address(uint160(projectWalletAddress)).transfer(_ethAmount); + + // Event emission + ApplicationEvent( + ApplicationEventTypes.PROJECT_WITHDRAW, + projectWithdrawCount, + projectWalletAddress, + _ethAmount + ); + TransferEvent( + TransferTypes.PROJECT_WITHDRAW, + projectWalletAddress, + _ethAmount + ); + } + + IERC777(_address = null) { + return this.TokenContractInstance; + } + + uint160(_from) { + return _from; + } + + address(_to) { + this.BalanceContractInstance.setFrom(this.contractAddress); + this.BalanceContractInstance.setTo(_to); + return this.BalanceContractInstance; + } + + setupNewParticipant() { + const variable = clone(Participant); + for (let i = 0; i <= this.stageCount; i++) { + variable.byStage[i] = clone(ParticipantDetailsByStage); + } + return variable; + } + + getParticipantRecordByAddress(_address) { + const record = this.participantsByAddress[_address]; + if (!record) { + this.participantsByAddress[_address] = this.setupNewParticipant(); + } + return this.participantsByAddress[_address]; + } + + TransferEvent(_type, _address, _value) { + // call listeners for _type + // console.log("TransferEvent: ", _type, _address, _value); + } + + ApplicationEvent(_type, _id, _address, _value) { + // call listeners for _type + // console.log("ApplicationEvent: ", _type, _id, _address, _value); + } + +} + +module.exports = Contract; diff --git a/test/js_validator_tests/assets/tokenContract.js b/test/js_validator_tests/assets/tokenContract.js new file mode 100644 index 0000000..d0c8560 --- /dev/null +++ b/test/js_validator_tests/assets/tokenContract.js @@ -0,0 +1,37 @@ +/* + * The test token tracker class. + * + * @author Micky Socaci , Fabian Vogelsteller <@frozeman> +*/ + +const { BN, web3, constants } = require("openzeppelin-test-helpers"); + +class TokenContract { + + // set the defaults + constructor(_initialSupply, _deployerAddress) { + this.balances = {}; + this.balances[_deployerAddress] = new BN(_initialSupply); + } + + balanceOf(_address) { + const balance = this.balances[_address]; + if(BN.isBN(balance)) { + return balance; + } + return new BN("0"); + } + + send(_from, _to, newTokenAmount, data = null) { + newTokenAmount = new BN(newTokenAmount.toString()); + const senderBalance = this.balanceOf(_from); + const receiverBalance = this.balanceOf(_to); + if(senderBalance.gte(newTokenAmount)) { + this.balances[_from] = senderBalance.sub(newTokenAmount); + this.balances[_to] = receiverBalance.add(newTokenAmount); + } + } + +} + +module.exports = TokenContract; diff --git a/test/js_validator_tests/assets/validator.js b/test/js_validator_tests/assets/validator.js new file mode 100644 index 0000000..740353b --- /dev/null +++ b/test/js_validator_tests/assets/validator.js @@ -0,0 +1,263 @@ +/* + * The contract validator base class. + * + * @author Micky Socaci , Fabian Vogelsteller <@frozeman> +*/ + +const { BN, constants } = require("openzeppelin-test-helpers"); +const { MAX_UINT256 } = constants; +const web3util = require("web3-utils"); + +const ether = 1000000000000000000; // 1 ether in wei +const etherBN = new BN(ether.toString()); + +const solidity = { + ether: ether, + etherBN: etherBN, + gwei: 1000000000 +}; + +class Validator { + + // set the defaults + constructor(settings, currentBlock = 0) { + this.block = currentBlock; + + this.commitPhaseStartBlock = this.block + settings.rico.startBlockDelay; + this.blocksPerDay = settings.rico.blocksPerDay; // 6450 + this.commitPhaseDays = settings.rico.commitPhaseDays; // 22 + this.stageCount = settings.rico.stageCount; // 12 + this.stageDays = settings.rico.stageDays; // 30 + this.commitPhasePrice = new BN(settings.rico.commitPhasePrice); // 0.002 + this.stagePriceIncrease = new BN(settings.rico.stagePriceIncrease); // 0.0001 + + this.stages = []; + + this.init(); + } + + init() { + this.commitPhaseBlockCount = this.blocksPerDay * this.commitPhaseDays; + this.commitPhaseEndBlock = this.commitPhaseStartBlock + this.commitPhaseBlockCount - 1; + this.stageBlockCount = this.blocksPerDay * this.stageDays; + + // Generate stage data + this.stages[0] = { + startBlock: this.commitPhaseStartBlock, + endBlock: this.commitPhaseEndBlock, + tokenPrice: this.commitPhasePrice, + }; + + let lastStageBlockEnd = this.stages[0].endBlock; + + for (let i = 1; i <= this.stageCount; i++) { + + const startBlock = lastStageBlockEnd + 1; + this.stages[i] = { + startBlock: startBlock, + endBlock: lastStageBlockEnd + this.stageBlockCount, + tokenPrice: this.commitPhasePrice.add( + this.stagePriceIncrease.mul( + new BN(i) + ) + ), + }; + + lastStageBlockEnd = this.stages[i].endBlock; + } + + // The buy phase starts on the subsequent block of the commitPhase's (stage0) endBlock + this.buyPhaseStartBlock = this.commitPhaseEndBlock + 1; + this.buyPhaseEndBlock = lastStageBlockEnd; + + // The duration of buyPhase in blocks + this.buyPhaseBlockCount = lastStageBlockEnd - this.buyPhaseStartBlock + 1; + } + + getTokenAmountForEthAtStage(ethValue, stageId) { + if(typeof this.stages[stageId] === "undefined") { + throw "Stage " + stageId + " not found."; + } + + return new BN(ethValue.toString()).mul( + new BN("10").pow( new BN("18") ) + ).div( + this.stages[stageId].tokenPrice + ); + } + + getEthAmountForTokensAtStage(tokenAmount, stageId) { + if(typeof this.stages[stageId] === "undefined") { + throw "Stage " + stageId + " not found."; + } + + return new BN(tokenAmount.toString()).mul( + this.stages[stageId].tokenPrice + ).div( + new BN("10").pow( new BN("18") ) + ); + } + + getCurrentUnlockPercentage() { + const currentBlock = new BN( this.getCurrentBlockNumber() ); + const BuyPhaseStartBlock = new BN( this.buyPhaseStartBlock ); + const BuyPhaseEndBlock = new BN( this.buyPhaseEndBlock ); + const precision = new BN(20); + return this.getUnlockPercentage(currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, precision); + } + + getUnlockPercentage(_currentBlock, _startBlock, _endBlock, _precision) { + + const currentBlock = new BN( _currentBlock ); + const startBlock = new BN( _startBlock ); + const endBlock = new BN( _endBlock ); + const precision = new BN( _precision ); + + if(precision.lt(new BN("2")) && precision.gt(new BN("20"))) { + throw "Precision should be higher than 1 and lower than 20"; + } + + // currentBlock >= startBlock && currentBlock <= endBlock + if(currentBlock.gte(startBlock) && currentBlock.lte(endBlock)) + { + const blockCount = endBlock.sub(startBlock).add( new BN(1) ); + const passedBlocks = currentBlock.sub(startBlock).add( new BN(1) ); // add 1 since start block needs to return higher than 0 + + return passedBlocks.mul( + new BN(10).pow(precision) + ).div(blockCount); + + } else if (currentBlock.gt(endBlock)) { + return new BN(10).pow(precision); + } else { + // lower than or equal to start block + return new BN(0); + }s + } + + getCurrentStage() { + return this.getStageAtBlock(this.getCurrentBlockNumber()); + } + + getStageAtBlock(_blockNumber) { + this.require( + _blockNumber >= this.commitPhaseStartBlock && _blockNumber <= this.buyPhaseEndBlock, + "Block outside of rICO period." + ); + + // Return commit phase (stage 0) + if (_blockNumber <= this.commitPhaseEndBlock) { + return 0; + } + + // This is the number of blocks starting from the first stage. + const distance = _blockNumber - (this.commitPhaseEndBlock + 1); + // Get the stageId (1..stageCount), commitPhase is stage 0 + // e.g. distance = 5, stageBlockCount = 5, stageID = 2 + const stageID = 1 + (distance / this.stageBlockCount); + + return Math.floor(stageID); + } + + getCurrentPrice() { + return this.getPriceAtBlock(this.getCurrentBlockNumber()); + } + + getPriceAtBlock(_blockNumber) { + const stage = this.getStageAtBlock(_blockNumber); + if (stage <= this.stageCount) { + return this.getStage(stage).tokenPrice; + } + return 0; + } + + getLockedTokenAmountAtBlock(_tokenAmount, _blockNumber, _precision = null) { + + if(_precision == null) { + _precision = 20; + } + _precision = new BN(_precision); + + const tokenAmount = new BN(_tokenAmount); + + if(tokenAmount.gt(new BN(0))) { + + if(_blockNumber < this.buyPhaseStartBlock) { + // before buy phase.. return full amount + return tokenAmount; + } else if(_blockNumber <= this.buyPhaseEndBlock) { + // in buy phase + + const percentage = this.getUnlockPercentage( + _blockNumber, + this.buyPhaseStartBlock, + this.buyPhaseEndBlock, + _precision + ); + + const unlocked = tokenAmount.mul(percentage).div( + new BN("10").pow( + _precision + ) + ); + + return tokenAmount.sub(unlocked); + } + // after buyPhase's end + return new BN("0"); + } + return new BN("0"); + } + + getUnockedTokensForBoughtAmountAtBlock(_tokenAmount, _blockNumber, precision) { + return new BN(_tokenAmount).sub( + this.getLockedTokenAmountAtBlock( + _tokenAmount, + _blockNumber, + precision + ) + ); + } + + availableEthAtStageForTokenBalance(_contractTokenBalance, _stage) { + // Multiply the number of tokens held by the contract with the token price + // at the specified stage and perform precision adjustments(div). + return _contractTokenBalance.mul( + this.stages[_stage].tokenPrice + ).div( + new BN("10").pow(new BN("18")) + ); + } + + getStage(id) { + return this.stages[id]; + } + + setBlockNumber(block) { + this.block = parseInt(block, 10); + } + + getCurrentBlockNumber() { + return this.block; + } + + toEth(amount) { + return web3util.fromWei(amount, "ether"); + } + + static toEth(amount) { + return web3util.fromWei(amount, "ether"); + } + + getOneEtherBn() { + return etherBN; + } + + require(statement, message) { + if(!statement) { + throw message; + } + } +} + +module.exports = Validator; diff --git a/test/js_validator_tests/commit.behavior.js b/test/js_validator_tests/commit.behavior.js new file mode 100644 index 0000000..6d35ae6 --- /dev/null +++ b/test/js_validator_tests/commit.behavior.js @@ -0,0 +1,387 @@ +const { + conditional, + clone, + BN, + MAX_UINT256, + expect, + expectThrow +} = require("./_test.utils.js"); + +function shouldHaveValidStateAfterFirstContributionFromParticipant(_address, _testStage, _whitelisted = false) { + + describe("State changes after first contribution by a Participant", function () { + + it("Contract.participantsById indexes the participant id => address", function () { + expect(this.JSContract.participantsById[this.JSContract.participantCount]).is.equal(_address); + }); + + it("Contract.participantCount increases by 1", function () { + const oldParticipantCount = this.oldState.participantCount; + const newParticipantCount = this.JSContract.participantCount; + expect(newParticipantCount).is.equal(oldParticipantCount + 1); + }); + + describe("ParticipantRecord", function () { + + it("contributionsCount is 1", function () { + const newParticipantRecord = this.JSContract.participantsByAddress[_address]; + expect(newParticipantRecord.contributionsCount).is.equal(1); + }); + + }); + + }); + + shouldHaveValidStateAfterOneNewContribution(_address, _testStage, _whitelisted); +} + +function shouldHaveValidStateAfterContributionFromExistingParticipant(_address, _testStage, _whitelisted = false) { + + describe("Contract State changes after contribution from existing Participant", function () { + + it("Contract.participantCount does not change", function () { + const oldParticipantCount = this.oldState.participantCount; + const newParticipantCount = this.JSContract.participantCount; + expect(newParticipantCount).is.equal(oldParticipantCount); + }); + + }); + + shouldHaveValidStateAfterOneNewContribution(_address, _testStage, _whitelisted); +} + + +function shouldHaveValidStateAfterOneNewContribution(_address, _testStage, _whitelisted = false) { + + describe("State changes after a new contribution", function () { + + it("Contract.totalReceivedETH increases by commited value", function () { + const difference = new BN(this.JSContract.totalReceivedETH.toString()) + .sub(new BN(this.oldState.totalReceivedETH.toString())); + expect(difference.toString()).is.equal(this.CommitTestValue.toString()); + }); + + describe("ParticipantRecord", function () { + let oldParticipantRecord, newParticipantRecord, oldbyStage, newbyStage, reservedTokens; + + before(function () { + + oldParticipantRecord = this.oldState.participantsByAddress[_address]; + if (!oldParticipantRecord) { + oldParticipantRecord = this.oldState.setupNewParticipant(); + } + newParticipantRecord = this.JSContract.participantsByAddress[_address]; + + oldbyStage = oldParticipantRecord.byStage[_testStage]; + newbyStage = newParticipantRecord.byStage[_testStage]; + + reservedTokens = this.oldState.getTokenAmountForEthAtStage( + this.CommitTestValue.toString(), _testStage + ); + + }); + + it("contributionsCount increases by 1", function () { + expect( + newParticipantRecord.contributionsCount + ).is.equal( + oldParticipantRecord.contributionsCount + 1 + ); + }); + + it("totalReceivedETH increases by commited value", function () { + const difference = new BN(newParticipantRecord.totalReceivedETH.toString()) + .sub(new BN(oldParticipantRecord.totalReceivedETH.toString())); + expect(difference.toString()).is.equal(this.CommitTestValue.toString()); + }); + + conditional("doesNotChange", "returnedETH does not change", function () { + expect(newParticipantRecord.returnedETH.toString()) + .is.equal(oldParticipantRecord.returnedETH.toString()); + }); + + conditional("doesNotChange", "withdrawnETH does not change", function () { + expect(newParticipantRecord.withdrawnETH.toString()) + .is.equal(oldParticipantRecord.withdrawnETH.toString()); + }); + + conditional("doesNotChange", "allocatedETH does not change", function () { + expect(newParticipantRecord.allocatedETH.toString()) + .is.equal(oldParticipantRecord.allocatedETH.toString()); + }); + + conditional("doesNotChange", "returnedTokens does not change", function () { + expect(newParticipantRecord.returnedTokens.toString()) + .is.equal(oldParticipantRecord.returnedTokens.toString()); + }); + + + if (_whitelisted) { + + it("committedETH increases by commit value", function () { + const difference = new BN(newParticipantRecord.committedETH.toString()) + .sub(new BN(oldParticipantRecord.committedETH.toString())); + expect(difference.toString()).is.equal(this.CommitTestValue.toString()); + }); + + it("reservedTokens is 0", function () { + expect(newParticipantRecord.reservedTokens.toString()).is.equal("0"); + }); + + it("boughtTokens increases by getTokenAmountForEthAtStage(value)", function () { + const difference = new BN(newParticipantRecord.boughtTokens.toString()) + .sub(new BN(oldParticipantRecord.boughtTokens.toString())); + expect(difference.toString()).is.equal(reservedTokens.toString()); + }); + + } else { + + conditional("doesNotChange", "committedETH does not change", function () { + expect(newParticipantRecord.committedETH.toString()) + .is.equal(oldParticipantRecord.committedETH.toString()); + }); + + conditional("doesNotChange", "boughtTokens does not change", function () { + expect(newParticipantRecord.boughtTokens.toString()) + .is.equal(oldParticipantRecord.boughtTokens.toString()); + }); + + it("reservedTokens increases by getTokenAmountForEthAtStage(value)", function () { + const difference = new BN(newParticipantRecord.reservedTokens.toString()) + .sub(new BN(oldParticipantRecord.reservedTokens.toString())); + expect(difference.toString()).is.equal(reservedTokens.toString()); + }); + } + + describe("currentStageRecord", function () { + + it("totalReceivedETH increases by commited value", function () { + const difference = new BN(newbyStage.totalReceivedETH.toString()) + .sub(new BN(oldbyStage.totalReceivedETH.toString())); + expect(difference.toString()).is.equal(this.CommitTestValue.toString()); + }); + + conditional("doesNotChange", "returnedETH does not change", function () { + expect(newbyStage.returnedETH.toString()).is.equal(oldbyStage.returnedETH.toString()); + }); + + if (_whitelisted) { + + it("committedETH increases by commit value", function () { + const difference = new BN(newbyStage.committedETH.toString()) + .sub(new BN(oldbyStage.committedETH.toString())); + expect(difference.toString()).is.equal(this.CommitTestValue.toString()); + }); + + } else { + + conditional("doesNotChange", "committedETH does not change", function () { + expect(newbyStage.committedETH.toString()).is.equal(oldbyStage.committedETH.toString()); + }); + + } + + conditional("doesNotChange", "withdrawnETH does not change", function () { + expect(newbyStage.withdrawnETH.toString()).is.equal(oldbyStage.withdrawnETH.toString()); + }); + + conditional("doesNotChange", "allocatedETH does not change", function () { + expect(newbyStage.allocatedETH.toString()).is.equal(oldbyStage.allocatedETH.toString()); + }); + + + if (_whitelisted) { + + it("reservedTokens is 0", function () { + expect(newbyStage.reservedTokens.toString()).is.equal("0"); + }); + + it("boughtTokens increases by getTokenAmountForEthAtStage(value)", function () { + const difference = new BN(newbyStage.boughtTokens.toString()) + .sub(new BN(oldbyStage.boughtTokens.toString())); + expect(difference.toString()).is.equal(reservedTokens.toString()); + }); + + } else { + + it("reservedTokens increases by getTokenAmountForEthAtStage(value)", function () { + const difference = new BN(newbyStage.reservedTokens.toString()) + .sub(new BN(oldbyStage.reservedTokens.toString())); + expect(difference.toString()).is.equal(reservedTokens.toString()); + }); + + conditional("doesNotChange", "boughtTokens does not change", function () { + expect(newbyStage.boughtTokens.toString()).is.equal(oldbyStage.boughtTokens.toString()); + }); + + } + + conditional("doesNotChange", "returnedTokens does not change", function () { + expect(newbyStage.returnedTokens.toString()).is.equal(oldbyStage.returnedTokens.toString()); + }); + + }); + + if (_testStage > 0) { + + describe("Each Previous StageRecord (" + (_testStage - 1) + ")", function () { + + conditional("doesNotChange", "totalReceivedETH does not change", function () { + for(let i = _testStage - 1; i >= 0; i--) { + expect( + newParticipantRecord.byStage[i].totalReceivedETH.toString() + ).is.equal( + oldParticipantRecord.byStage[i].totalReceivedETH.toString() + ); + } + }); + + conditional("doesNotChange", "returnedETH does not change", function () { + for(let i = _testStage - 1; i >= 0; i--) { + expect( + newParticipantRecord.byStage[i].returnedETH.toString() + ).is.equal( + oldParticipantRecord.byStage[i].returnedETH.toString() + ); + } + }); + + conditional("doesNotChange", "committedETH does not change", function () { + for(let i = _testStage - 1; i >= 0; i--) { + expect( + newParticipantRecord.byStage[i].committedETH.toString() + ).is.equal( + oldParticipantRecord.byStage[i].committedETH.toString() + ); + } + }); + + conditional("doesNotChange", "withdrawnETH does not change", function () { + for(let i = _testStage - 1; i >= 0; i--) { + expect( + newParticipantRecord.byStage[i].withdrawnETH.toString() + ).is.equal( + oldParticipantRecord.byStage[i].withdrawnETH.toString() + ); + } + }); + + if (_whitelisted) { + + conditional("doesNotChange", "reservedTokens is 0", function () { + for(let i = _testStage - 1; i >= 0; i--) { + expect(oldParticipantRecord.byStage[i].reservedTokens.toString()).is.equal("0"); + expect(newParticipantRecord.byStage[i].reservedTokens.toString()).is.equal("0"); + } + }); + + } else { + + conditional("doesNotChange", "reservedTokens does not change", function () { + for(let i = _testStage - 1; i >= 0; i--) { + expect( + newParticipantRecord.byStage[i].reservedTokens.toString() + ).is.equal( + oldParticipantRecord.byStage[i].reservedTokens.toString() + ); + } + }); + + } + conditional("doesNotChange", "boughtTokens does not change", function () { + for(let i = _testStage - 1; i >= 0; i--) { + expect( + newParticipantRecord.byStage[i].boughtTokens.toString() + ).is.equal( + oldParticipantRecord.byStage[i].boughtTokens.toString() + ); + } + }); + + conditional("doesNotChange", "returnedTokens does not change", function () { + for(let i = _testStage - 1; i >= 0; i--) { + expect( + newParticipantRecord.byStage[i].returnedTokens.toString() + ).is.equal( + oldParticipantRecord.byStage[i].returnedTokens.toString() + ); + } + }); + + conditional("doesNotChange", "allocatedETH does not change", function () { + for(let i = _testStage - 1; i >= 0; i--) { + expect( + newParticipantRecord.byStage[i].allocatedETH.toString() + ).is.equal( + oldParticipantRecord.byStage[i].allocatedETH.toString() + ); + } + }); + + }); + } + + }); + + testBalanceChange("sentToContract", "commit value", _address); + }); +} + + +function testBalanceChange(mode, name, _address) { + + describe("ETH Balances:", function () { + + let titleOne, titleTwo; + if (mode == "sentToContract") { + titleOne = "increases by " + name; + titleTwo = "decreases by " + name; + } else if (mode == "sentByContract") { + titleOne = "decreases by " + name; + titleTwo = "increases by " + name; + } else if (mode == "same") { + titleOne = "does not change"; + titleTwo = "does not change"; + } + + it("Contract ETH balance " + titleOne, function () { + const oldBalance = this.oldState.BalanceContractInstance.balanceOf(this.oldState.contractAddress); + const newBalance = this.JSContract.BalanceContractInstance.balanceOf(this.JSContract.contractAddress); + + if (mode == "sentToContract") { + const expectedBalance = oldBalance.add(this.BalanceTestValue); + expect(newBalance.toString()).is.equal(expectedBalance.toString()); + } else if (mode == "sentByContract") { + const expectedBalance = oldBalance.sub(this.BalanceTestValue); + expect(newBalance.toString()).is.equal(expectedBalance.toString()); + } else if (mode == "same") { + expect(oldBalance.toString()).is.equal(newBalance.toString()); + } + }); + + it("Participant ETH balance " + titleTwo, function () { + const oldBalance = this.oldState.BalanceContractInstance.balanceOf(_address); + const newBalance = this.JSContract.BalanceContractInstance.balanceOf(_address); + + if (mode == "sentToContract") { + const expectedBalance = oldBalance.sub(this.BalanceTestValue); + expect(newBalance.toString()).is.equal(expectedBalance.toString()); + } else if (mode == "sentByContract") { + const expectedBalance = oldBalance.add(this.BalanceTestValue); + expect(newBalance.toString()).is.equal(expectedBalance.toString()); + } else if (mode == "same") { + expect(oldBalance.toString()).is.equal(newBalance.toString()); + } + }); + + }); + +} + +module.exports = { + shouldHaveValidStateAfterFirstContributionFromParticipant, + shouldHaveValidStateAfterContributionFromExistingParticipant, + shouldHaveValidStateAfterOneNewContribution, + testBalanceChange +}; + diff --git a/test/js_validator_tests/commit.test.js b/test/js_validator_tests/commit.test.js new file mode 100644 index 0000000..3c16e49 --- /dev/null +++ b/test/js_validator_tests/commit.test.js @@ -0,0 +1,132 @@ +const { + conditional, + clone, + BN, + MAX_UINT256, + expect, + expectThrow +} = require("./_test.utils.js"); + +const contractHelper = require("./assets/ricoContract.js"); + +const { + shouldHaveValidStateAfterFirstContributionFromParticipant, + shouldHaveValidStateAfterContributionFromExistingParticipant, + shouldHaveValidStateAfterOneNewContribution, +} = require('./commit.behavior'); + +describe("Javascript Validator - Contract - commit()", function () { + + before(function () { + this.JSContract = new contractHelper(setup.settings); + }); + + describe("Participant - commits 1 eth", function () { + const address = "participant_1_address"; + const testStage = 0; + + before(function () { + + // navigate contract to testStage startBlock + this.JSContract.setBlockNumber( + this.JSContract.stages[testStage].startBlock + ); + + // set initial balance for address to 10 eth + this.JSContract.BalanceContractInstance.set( + address, this.JSContract.getOneEtherBn().mul(new BN("10")) + ); + + this.oldState = clone(this.JSContract); + this.value = this.JSContract.getOneEtherBn(); + this.JSContract.commit(address, this.value); + + // set variable so we can test balances. + this.BalanceTestValue = this.value; + this.CommitTestValue = this.value; + }); + + shouldHaveValidStateAfterFirstContributionFromParticipant(address, testStage); + + }); + + + describe("Participant - commits 1 eth - second time", function () { + const address = "participant_1_address"; + const testStage = 0; + + before(function () { + + // set initial balance for address to 10 eth + this.JSContract.BalanceContractInstance.set( + address, this.JSContract.getOneEtherBn().mul(new BN("10")) + ); + + this.oldState = clone(this.JSContract); + this.value = this.JSContract.getOneEtherBn(); + this.JSContract.commit(address, this.value); + + // set variable so we can test balances. + this.BalanceTestValue = this.value; + this.CommitTestValue = this.value; + }); + + shouldHaveValidStateAfterContributionFromExistingParticipant(address, testStage); + + }); + + + describe("Participant - commits 1 eth - third time", function () { + const address = "participant_1_address"; + const testStage = 0; + + before(function () { + + // set initial balance for address to 10 eth + this.JSContract.BalanceContractInstance.set( + address, this.JSContract.getOneEtherBn().mul(new BN("10")) + ); + + this.oldState = clone(this.JSContract); + this.value = this.JSContract.getOneEtherBn(); + this.JSContract.commit(address, this.value); + + // set variable so we can test balances. + this.BalanceTestValue = this.value; + this.CommitTestValue = this.value; + }); + + shouldHaveValidStateAfterContributionFromExistingParticipant(address, testStage); + + }); + + + describe("Participant 2 - commits 1 eth", function () { + const address = "participant_2_address"; + const testStage = 0; + + before(function () { + + // set initial balance for address to 10 eth + this.JSContract.BalanceContractInstance.set( + address, this.JSContract.getOneEtherBn().mul(new BN("10")) + ); + + this.oldState = clone(this.JSContract); + this.value = this.JSContract.getOneEtherBn(); + this.JSContract.commit(address, this.value); + + // set variable so we can test balances. + this.BalanceTestValue = this.value; + this.CommitTestValue = this.value; + }); + + shouldHaveValidStateAfterFirstContributionFromParticipant(address, testStage); + + it("Contract.participantCount is 2", function () { + expect(this.JSContract.participantCount).is.equal(2); + }); + + }); + +}); \ No newline at end of file diff --git a/test/js_validator_tests/stages.test.js b/test/js_validator_tests/stages.test.js new file mode 100644 index 0000000..ec35ce4 --- /dev/null +++ b/test/js_validator_tests/stages.test.js @@ -0,0 +1,258 @@ +const { + conditional, + clone, + BN, + MAX_UINT256, + expect, + expectThrow +} = require("./_test.utils.js"); + +const validatorHelper = require("./assets/validator.js"); + +function shouldReturnTheSameResult(instance1, instance2, stageId, getterName, blockDifference) { + const result1 = shouldReturnExpectedStageId(instance1, stageId, getterName, blockDifference); + const result2 = shouldReturnExpectedStageId(instance2, stageId, getterName, blockDifference); + expect(result1.toString(), "Returned stage ids do not match").is.equal( result2.toString() ); +} + +function shouldReturnExpectedStageId(instance, stageId, getterName, blockDifference) { + const blockInStage = instance.getStage(stageId)[getterName] + blockDifference; + const resultingStageId = instance.getStageAtBlock(blockInStage); + expect(resultingStageId.toString(), "Incorrect stage id returned").is.equal( stageId.toString() ); + return resultingStageId; +} + +describe("Javascript Validator - Tests", function () { + let Validator, CustomSettingsValidator, startBlock = 100; + + const CustomSettings = { + token: setup.settings.token, + rico: { + startBlockDelay: 10, + blocksPerDay: 10, + commitPhaseDays: 10, + stageCount: 12, + stageDays: 10, + commitPhasePrice: setup.settings.rico.commitPhasePrice, + stagePriceIncrease: setup.settings.rico.stagePriceIncrease + } + }; + + before(function () { + Validator = new validatorHelper(setup.settings); + CustomSettingsValidator = new validatorHelper(CustomSettings, startBlock); + }); + + describe("Stage initialisation", function () { + + before(function () { + console.log(" Settings:"); + console.log(" startBlock: ", startBlock); + console.log(" startBlockDelay: ", CustomSettings.rico.startBlockDelay); + console.log(" blocksPerDay: ", CustomSettings.rico.blocksPerDay); + console.log(" commitPhaseDays: ", CustomSettings.rico.commitPhaseDays); + console.log(" stageCount: ", CustomSettings.rico.stageCount); + console.log(" stageDays: ", CustomSettings.rico.stageDays); + }); + + describe("Stage[0]", function () { + let currentStageData; + let currentStageId = 0; + + before(function () { + currentStageData = CustomSettingsValidator.stages[currentStageId]; + }); + + it("stage[0] startBlock is 110", function () { + expect(currentStageData.startBlock, "startBlock incorrect").is.equal( 110 ); + expect(currentStageData.startBlock, "startBlock incorrect").is.equal( startBlock + CustomSettings.rico.startBlockDelay ); + }); + + it("stage[0] duration is 99 ( endBlock - startBlock )", function () { + const duration = currentStageData.endBlock - currentStageData.startBlock; + expect(duration, "duration incorrect").is.equal( 99 ); + expect(duration, "duration incorrect").is.equal( CustomSettings.rico.stageDays * CustomSettings.rico.commitPhaseDays - 1 ); + }); + + it("stage[0] endBlock is 209 ( startBlock=110 + duration ) => 209", function () { + expect(currentStageData.endBlock, "endBlock incorrect").is.equal( 209 ); + const duration = currentStageData.endBlock - currentStageData.startBlock; + expect(currentStageData.endBlock, "endBlock incorrect").is.equal( startBlock + CustomSettings.rico.startBlockDelay + duration ); + }); + + it("stage[0] stagePriceIncrease is correct", function () { + const price = CustomSettings.rico.commitPhasePrice + ( currentStageId * CustomSettings.rico.stagePriceIncrease ); + expect(currentStageData.tokenPrice.toString(), "tokenPrice incorrect").is.equal( price.toString() ); + }); + }); + + + describe("Stage[1]", function () { + let currentStageData; + let currentStageId = 1; + + before(function () { + currentStageData = CustomSettingsValidator.stages[currentStageId]; + }); + + it("stage[1] startBlock is 210", function () { + expect(currentStageData.startBlock, "startBlock incorrect").is.equal( 210 ); + }); + + it("stage[1] duration is 99 ( endBlock - startBlock )", function () { + const duration = currentStageData.endBlock - currentStageData.startBlock; + expect(duration, "duration incorrect").is.equal( 99 ); + expect(duration, "duration incorrect").is.equal( CustomSettings.rico.stageDays * CustomSettings.rico.blocksPerDay - 1 ); + }); + + it("stage[1] endBlock is 309 ( startBlock=110 + duration ) => 309", function () { + expect(currentStageData.endBlock, "endBlock incorrect").is.equal( 309 ); + }); + + it("stage[1] stagePriceIncrease is correct", function () { + const price = CustomSettings.rico.commitPhasePrice + ( currentStageId * CustomSettings.rico.stagePriceIncrease ); + expect(currentStageData.tokenPrice.toString(), "tokenPrice incorrect").is.equal( price.toString() ); + }); + }); + + describe("Stage[12]", function () { + let currentStageData; + let currentStageId = 12; + + before(function () { + currentStageData = CustomSettingsValidator.stages[currentStageId]; + }); + + it("stage[12] startBlock is 1310", function () { + expect(currentStageData.startBlock, "startBlock incorrect").is.equal( 1310 ); + }); + + it("stage[12] duration is 99 ( endBlock - startBlock )", function () { + const duration = currentStageData.endBlock - currentStageData.startBlock; + expect(duration, "duration incorrect").is.equal( 99 ); + expect(duration, "duration incorrect").is.equal( CustomSettings.rico.stageDays * CustomSettings.rico.blocksPerDay - 1 ); + }); + + it("stage[12] endBlock is 1409 ( startBlock=110 + duration ) => 1409", function () { + expect(currentStageData.endBlock, "endBlock incorrect").is.equal( 1409 ); + }); + + it("stage[12] stagePriceIncrease is correct", function () { + const price = CustomSettings.rico.commitPhasePrice + ( currentStageId * CustomSettings.rico.stagePriceIncrease ); + expect(currentStageData.tokenPrice.toString(), "tokenPrice incorrect").is.equal( price.toString() ); + }); + }); + + }); + + describe("Stage Methods", function () { + + it("stage count matches for both test instances", function() { + expect(Validator.stageCount, "stageCount does not match").is.equal( CustomSettingsValidator.stageCount ); + expect(Validator.stageCount, "stageCount does not match").is.equal( CustomSettings.rico.stageCount ); + }); + + describe("getStageAtBlock(_blockNumber)", function () { + + describe("stage 0", function () { + let stageId = 0; + + it("should return 0 when called using using stage[0].startBlock", function() { + shouldReturnTheSameResult(Validator, CustomSettingsValidator, stageId, "startBlock", 0); + }); + + it("should return 0 when called using using stage[0].endBlock", function() { + shouldReturnTheSameResult(Validator, CustomSettingsValidator, stageId, "endBlock", 0); + }); + }); + + describe("stage 1", function () { + let stageId = 1; + + it("should return 1 when called using using stage[1].startBlock", function() { + shouldReturnTheSameResult(Validator, CustomSettingsValidator, stageId, "startBlock", 0); + }); + + it("should return 1 when called using using stage[1].endBlock", function() { + shouldReturnTheSameResult(Validator, CustomSettingsValidator, stageId, "endBlock", 0); + }); + }); + + describe("stage 6", function () { + let stageId = 6; + + it("should return 6 when called using using stage[6].startBlock", function() { + shouldReturnTheSameResult(Validator, CustomSettingsValidator, stageId, "startBlock", 0); + }); + + it("should return 6 when called using using stage[6].endBlock", function() { + shouldReturnTheSameResult(Validator, CustomSettingsValidator, stageId, "endBlock", 0); + }); + }); + + describe("last stage", function () { + let stageId; + before(function () { + stageId = Validator.stageCount; + }); + + it("should return stageCount when called using using stage[stageCount].startBlock", function() { + shouldReturnTheSameResult(Validator, CustomSettingsValidator, stageId, "startBlock", 0); + }); + + it("should return stageCount when called using using stage[stageCount].endBlock", function() { + shouldReturnTheSameResult(Validator, CustomSettingsValidator, stageId, "endBlock", 0); + }); + }); + + describe("1 block before 0", function () { + let stageId = 0; + it("should throw \"Block outside of rICO period.\"", function() { + let blockInStage = Validator.getStage(stageId).startBlock - 1; + expectThrow(() => { + Validator.getStageAtBlock(blockInStage); + }, "Block outside of rICO period."); + + blockInStage = CustomSettingsValidator.getStage(stageId).startBlock - 1; + expectThrow(() => { + CustomSettingsValidator.getStageAtBlock(blockInStage); + }, "Block outside of rICO period."); + }); + }); + + describe("1 block after last stage", function () { + let stageId; + before(function () { + stageId = Validator.stageCount; + }); + + it("should throw \"Block outside of rICO period.\"", function() { + let blockInStage = Validator.getStage(stageId).endBlock + 1; + expectThrow(() => { + Validator.getStageAtBlock(blockInStage); + }, "Block outside of rICO period."); + + blockInStage = CustomSettingsValidator.getStage(stageId).endBlock + 1; + expectThrow(() => { + CustomSettingsValidator.getStageAtBlock(blockInStage); + }, "Block outside of rICO period."); + }); + }); + + // describe("test", function () { + // let stageId = 0; + // it("test", function() { + + // const blockInStage = Validator.getStage(stageId).startBlock; + // console.log("blockInStage: ", blockInStage); + // const resultingStageId = Validator.getStageAtBlock(blockInStage); + // console.log("resultingStageId: ", resultingStageId); + + // }); + // }); + + }); + }); + + +}); \ No newline at end of file diff --git a/test/js_validator_tests/whitelist.behavior.js b/test/js_validator_tests/whitelist.behavior.js new file mode 100644 index 0000000..0302607 --- /dev/null +++ b/test/js_validator_tests/whitelist.behavior.js @@ -0,0 +1,232 @@ +const { + conditional, + clone, + BN, + MAX_UINT256, + expect, + expectThrow +} = require("./_test.utils.js"); + +const { + shouldHaveValidStateAfterFirstContributionFromParticipant, + shouldHaveValidStateAfterContributionFromExistingParticipant, + shouldHaveValidStateAfterOneNewContribution, + testBalanceChange, +} = require('./commit.behavior'); + + +function shouldHaveValidStateAfterWhitelistModeWithNoContributions(_address, _accept) { + + describe("Contract State changes after whitelisting of Participant with no contributions", function () { + + describe("ParticipantRecord", function () { + let newParticipantRecord; + + before(function () { + newParticipantRecord = this.JSContract.participantsByAddress[_address]; + }); + + it("whitelisted is " + _accept.toString(), function () { + expect(newParticipantRecord.whitelisted).is.equal(_accept); + }); + }); + + testBalanceChange("same", "", _address); + }); + +} + +function shouldHaveValidStateAfterWhitelistMode(_address, _testStage, _accept) { + + describe("State changes after whitelist mode: " + _accept.toString(), function () { + + describe("ParticipantRecord", function () { + let newParticipantRecord; + + before(function () { + newParticipantRecord = this.JSContract.participantsByAddress[_address]; + }); + + it("whitelisted is " + _accept.toString(), function () { + expect(newParticipantRecord.whitelisted).is.equal(_accept); + }); + }); + + if (_accept) { + shouldHaveValidStateAfterAcceptContributionsForAddress(_address, _testStage, _accept); + } else { + shouldHaveValidStateAfterCancelContributionsForAddress(_address, _testStage, _accept); + } + + }); + +} + +function shouldHaveValidStateAfterAcceptContributionsForAddress(_address, _testStage, _accept) { + + describe("acceptContributionsForAddress()", function () { + + let oldParticipantRecord, newParticipantRecord, oldStateParticipantAvailableETH, newStateParticipantAvailableETH; + + before(function () { + oldParticipantRecord = this.oldState.participantsByAddress[_address]; + newParticipantRecord = this.JSContract.participantsByAddress[_address]; + + oldStateParticipantAvailableETH = oldParticipantRecord.totalReceivedETH + .sub(oldParticipantRecord.withdrawnETH) + .sub(oldParticipantRecord.returnedETH); + + newStateParticipantAvailableETH = newParticipantRecord.totalReceivedETH + .sub(newParticipantRecord.withdrawnETH) + .sub(newParticipantRecord.returnedETH); + }); + + describe("Contract:", function () { + + conditional("doesNotChange", "returnedETH does not change", function () { + expect(this.oldState.returnedETH.toString()).is.equal(this.JSContract.returnedETH.toString()); + }); + + it("committedETH increases by commit value", function () { + const difference = new BN(this.JSContract.committedETH.toString()) + .sub(new BN(this.oldState.committedETH.toString())); + expect(difference.toString()).is.equal(this.CommitTestValue.toString()); + }); + + }); + + describe("ParticipantRecord:", function () { + + let newParticipantRecord; + + before(function () { + newParticipantRecord = this.JSContract.participantsByAddress[_address]; + }); + + it("whitelisted is " + _accept.toString(), function () { + expect(newParticipantRecord.whitelisted).is.equal(_accept); + }); + + it("ParticipantAvailableETH is commit value", function () { + expect(newStateParticipantAvailableETH.toString()).is.equal(this.CommitTestValue.toString()); + }); + + it("committedETH increases by commit value", function () { + const difference = new BN(newParticipantRecord.committedETH.toString()) + .sub(new BN(oldParticipantRecord.committedETH.toString())); + expect(difference.toString()).is.equal(this.CommitTestValue.toString()); + }); + + }); + + + describe("Tokens:", function () { + + it("Participant token balance is oldState.ParticipantRecord.reservedTokens", function () { + const expectedBalance = this.oldState.participantsByAddress[_address].reservedTokens; + const balance = this.JSContract.TokenContractInstance.balanceOf(_address); + expect( + balance.toString() + ).is.equal( + expectedBalance.toString() + ); + }); + + it("ParticipantRecord.reservedTokens is 0", function () { + expect(newParticipantRecord.reservedTokens.toString()).is.equal("0"); + }); + + }); + }); + + testBalanceChange("same", "", _address); + +} + + +function shouldHaveValidStateAfterCancelContributionsForAddress(_address, _accept) { + + describe("cancelContributionsForAddress()", function () { + + let oldParticipantRecord, newParticipantRecord, oldStateParticipantAvailableETH, newStateParticipantAvailableETH; + + before(function () { + oldParticipantRecord = this.oldState.participantsByAddress[_address]; + newParticipantRecord = this.JSContract.participantsByAddress[_address]; + + oldStateParticipantAvailableETH = oldParticipantRecord.totalReceivedETH + .sub(oldParticipantRecord.withdrawnETH) + .sub(oldParticipantRecord.returnedETH); + + newStateParticipantAvailableETH = newParticipantRecord.totalReceivedETH + .sub(newParticipantRecord.withdrawnETH) + .sub(newParticipantRecord.returnedETH); + }); + + describe("Contract:", function () { + + conditional("doesNotChange", "committedETH does not change", function () { + expect(this.JSContract.committedETH.toString()).is.equal(this.oldState.committedETH.toString()); + }); + + it("returnedETH increases by oldState.ParticipantAvailableETH value", function () { + const difference = new BN(this.JSContract.returnedETH.toString()) + .sub(new BN(this.oldState.returnedETH.toString())); + expect(difference.toString()).is.equal(oldStateParticipantAvailableETH.toString()); + }); + + }); + + describe("ParticipantRecord:", function () { + + it("ParticipantAvailableETH is 0", function () { + expect(newStateParticipantAvailableETH.toString()).is.equal("0"); + }); + + it("whitelisted is false", function () { + expect(newParticipantRecord.whitelisted).is.equal(false); + }); + + it("reservedTokens is 0", function () { + expect(newParticipantRecord.reservedTokens.toString()).is.equal("0"); + }); + + it("withdrawnETH increases by oldState.ParticipantAvailableETH", function () { + const difference = new BN(newParticipantRecord.withdrawnETH.toString()) + .sub(new BN(oldParticipantRecord.withdrawnETH.toString())); + expect(difference.toString()).is.equal(oldStateParticipantAvailableETH.toString()); + }); + + }); + + describe("Tokens:", function () { + + it("Participant token balance does not change", function () { + const oldBalance = this.oldState.TokenContractInstance.balanceOf(_address); + const newBalance = this.JSContract.TokenContractInstance.balanceOf(_address); + expect( + oldBalance.toString() + ).is.equal( + newBalance.toString() + ); + }); + + it("ParticipantRecord.reservedTokens is 0", function () { + expect(newParticipantRecord.reservedTokens.toString()).is.equal("0"); + }); + + }); + + testBalanceChange("sentByContract", "oldState.ParticipantAvailableETH", _address); + + }); + +} + +module.exports = { + shouldHaveValidStateAfterWhitelistModeWithNoContributions, + shouldHaveValidStateAfterWhitelistMode, + shouldHaveValidStateAfterAcceptContributionsForAddress, + shouldHaveValidStateAfterCancelContributionsForAddress, +}; + diff --git a/test/js_validator_tests/whitelist.test.js b/test/js_validator_tests/whitelist.test.js new file mode 100644 index 0000000..67684a1 --- /dev/null +++ b/test/js_validator_tests/whitelist.test.js @@ -0,0 +1,220 @@ +const { + conditional, + clone, + BN, + MAX_UINT256, + expect, + expectThrow +} = require("./_test.utils.js"); + +const contractHelper = require("./assets/ricoContract.js"); + +const { + shouldHaveValidStateAfterFirstContributionFromParticipant, + shouldHaveValidStateAfterContributionFromExistingParticipant, + shouldHaveValidStateAfterOneNewContribution, +} = require('./commit.behavior'); + +const { + shouldHaveValidStateAfterWhitelistModeWithNoContributions, + shouldHaveValidStateAfterWhitelistMode, + shouldHaveValidStateAfterAcceptContributionsForAddress, + shouldHaveValidStateAfterCancelContributionsForAddress, +} = require('./whitelist.behavior'); + + + +describe("Javascript Validator - Contract - whitelist()", function () { + + describe("Scenario: Stage:0, Participant gets whitelisted then contributes", function () { + const address = "participant_1_address"; + const _accept = true; + const testStage = 0; + + before(function () { + this.JSContract = new contractHelper(setup.settings); + + // navigate contract to testStage startBlock + this.JSContract.setBlockNumber( + this.JSContract.stages[testStage].startBlock + ); + + // set initial balance for address to 10 eth + this.JSContract.BalanceContractInstance.set( + address, this.JSContract.getOneEtherBn().mul(new BN("10")) + ); + }); + + describe("- Participant gets whitelisted", function () { + + before(function () { + this.oldState = clone(this.JSContract); + this.JSContract.whitelist(address, _accept); + }); + + shouldHaveValidStateAfterWhitelistModeWithNoContributions(address, _accept); + + }); + + describe("- Participant commits 1 eth", function () { + const genericCallbackTitle = "Contract State changes are valid after whitelisting of Participant with no contributions"; + + before(function () { + this.oldState = clone(this.JSContract); + this.value = this.JSContract.getOneEtherBn(); + this.JSContract.commit(address, this.value); + + // set variable so we can test balances. + this.BalanceTestValue = this.value; + this.CommitTestValue = this.value; + }); + + conditional("AllSubTests", "", function() { + shouldHaveValidStateAfterFirstContributionFromParticipant(address, testStage, _accept); + }, function() { + it(genericCallbackTitle, function() { + + }) + }); + + }); + + }); + + describe("Scenario: Stage:0, Participant contributes then gets whitelisted", function () { + const address = "participant_1_address"; + const _accept = true; + const testStage = 0; + const expectedTokenBalance = "500000000000000000000"; + + before(function () { + this.JSContract = new contractHelper(setup.settings); + + // navigate contract to testStage startBlock + this.JSContract.setBlockNumber( + this.JSContract.stages[testStage].startBlock + ); + + // set initial balance for address to 10 eth + this.JSContract.BalanceContractInstance.set( + address, this.JSContract.getOneEtherBn().mul(new BN("10")) + ); + + this.value = this.JSContract.getOneEtherBn(); + }); + + describe("- Participant commits 1 eth", function () { + const genericCallbackTitle = "Contract State changes are valid after first contribution by Participant"; + + before(function () { + this.oldState = clone(this.JSContract); + this.JSContract.commit(address, this.value); + + // set variables so we can test balances. + this.BalanceTestValue = this.value; + this.CommitTestValue = this.value; + }); + + + conditional("AllSubTests", genericCallbackTitle, function() { + // _accept is false since the participant is not already whitelisted + shouldHaveValidStateAfterFirstContributionFromParticipant(address, testStage, false); + }, function() { + it(genericCallbackTitle, function() { + + }) + }); + }); + + describe("- Participant gets whitelisted", function () { + + before(function () { + this.oldState = clone(this.JSContract); + this.JSContract.whitelist(address, _accept); + + // set variables so we can test balances. + this.BalanceTestValue = this.value; + this.CommitTestValue = this.value; + }); + + + it("Participant token balance is " + contractHelper.toEth(expectedTokenBalance), function () { + const balance = this.JSContract.TokenContractInstance.balanceOf(address); + expect( + balance.toString() + ).is.equal( + expectedTokenBalance.toString() + ); + + const advertisedBalance = this.JSContract.getTokenAmountForEthAtStage(this.value, testStage); + expect( + balance.toString() + ).is.equal( + advertisedBalance.toString() + ); + }); + + shouldHaveValidStateAfterWhitelistMode(address, testStage, _accept); + }); + + }); + + describe("Scenario: Stage:6, Participant contributes then gets rejected", function () { + const address = "participant_1_address"; + const _accept = false; + const testStage = 6; + + before(function () { + this.JSContract = new contractHelper(setup.settings); + + // navigate contract to testStage startBlock + this.JSContract.setBlockNumber( + this.JSContract.stages[testStage].startBlock + ); + + // set initial balance for address to 10 eth + this.JSContract.BalanceContractInstance.set( + address, this.JSContract.getOneEtherBn().mul(new BN("10")) + ); + }); + + describe("- Participant commits 1 eth", function () { + + before(function () { + this.oldState = clone(this.JSContract); + this.value = this.JSContract.getOneEtherBn(); + this.JSContract.commit(address, this.value); + + // set variable so we can test balances. + this.BalanceTestValue = this.value; + this.CommitTestValue = this.value; + }); + + conditional("AllSubTests", "Contract State changes are valid after first contribution by Participant", function() { + shouldHaveValidStateAfterFirstContributionFromParticipant(address, testStage, false); + }); + + }); + + describe("- Participant gets rejected", function () { + + before(function () { + this.oldState = clone(this.JSContract); + this.JSContract.whitelist(address, _accept); + + const oldParticipantRecord = this.oldState.participantsByAddress[address]; + const oldStateParticipantAvailableETH = oldParticipantRecord.totalReceivedETH + .sub(oldParticipantRecord.withdrawnETH) + .sub(oldParticipantRecord.returnedETH); + + // set variable so we can test balances. + this.BalanceTestValue = oldStateParticipantAvailableETH; + this.CommitTestValue = this.value; + }); + + shouldHaveValidStateAfterWhitelistMode(address, testStage, _accept); + }); + + }); + +}); \ No newline at end of file diff --git a/test/js_validator_tests/withdraw.behavior.js b/test/js_validator_tests/withdraw.behavior.js new file mode 100644 index 0000000..c65a1f8 --- /dev/null +++ b/test/js_validator_tests/withdraw.behavior.js @@ -0,0 +1,81 @@ +const { + conditional, + clone, + BN, + MAX_UINT256, + expect, + expectThrow +} = require("./_test.utils.js"); + +// function shouldHavePendingEth(_address) { + +// describe("Should have pending Eth", function () { +// let cancelModes, hasPendingETH, canWithdraw; + +// before(function() { +// cancelModes = this.JSContract.getCancelModes(_address); +// hasPendingETH = this.JSContract.hasPendingETH(_address); +// canWithdraw = this.JSContract.canWithdraw(_address); +// }) + +// it("hasPendingETH returns true", function () { +// expect(hasPendingETH).is.equal(true); +// }); +// }); +// } + +// function shouldHavePendingEth(_address) { + +// describe("Should have pending Eth", function () { +// let canWithdraw; + +// before(function() { +// canWithdraw = this.JSContract.canWithdraw(_address); +// }) + +// it("canWithdraw returns true", function () { +// expect(canWithdraw).is.equal(true); +// }); +// }); +// } + +function shouldHavePendingEth(_address) { + + describe("Should have pending Eth", function () { + let hasPendingETH; + + before(function() { + hasPendingETH = this.JSContract.hasPendingETH(_address); + }) + + it("hasPendingETH returns true", function () { + expect(hasPendingETH).is.equal(true); + }); + }); +} + +function shouldNotHavePendingEth(_address) { + + describe("Should not have pending Eth", function () { + let hasPendingETH; + + before(function() { + hasPendingETH = this.JSContract.hasPendingETH(_address); + }) + + it("hasPendingETH returns false", function () { + expect(hasPendingETH).is.equal(false); + }); + }); +} + + + + + + +module.exports = { + shouldHavePendingEth, + shouldNotHavePendingEth, +}; + diff --git a/test/run_js_validator_tests.js b/test/run_js_validator_tests.js new file mode 100644 index 0000000..d01fbae --- /dev/null +++ b/test/run_js_validator_tests.js @@ -0,0 +1,59 @@ +const setup = require("./init.js"); +(async function() { + try { + const init = await setup.runSetup(); + await runTests(init); + } catch (e) { + console.log("error:", e); + } +})(); + +async function runTests(init) { + + const tests = [ + "1_js_validator", + "stages.test", + "commit.test", + "whitelist.test", + // "_wip" + ]; + + init.helpers.utils.toLog( + " ----------------------------------------------------------------\n" + + " Step 2 - Run tests \n" + + " ----------------------------------------------------------------" + ); + + if (tests.length > 0) { + const Mocha = require("mocha"); + + // Instantiate a Mocha instance. + const mocha = new Mocha(); + + mocha.useColors(true); + mocha.slow(5); + mocha.timeout(600000); + + for (let i = 0; i < tests.length; i++) { + try { + mocha.addFile("test/js_validator_tests/" + tests[i] + ".js"); + } catch (e) { + console.log("error:", e); + } + } + + // Run the tests. + const runner = mocha.run( + function(failures) { + process.exitCode = failures ? 1 : 0; // exit with non-zero status if there were failures + }, + true // delay execution of root suite until ready. + ); + + runner.on("end", e => { + console.log("Done"); + process.exit(process.exitCode); + }); + } +} + diff --git a/test/run_solc_fixed_tests.js b/test/run_solc_fixed_tests.js new file mode 100644 index 0000000..6520c15 --- /dev/null +++ b/test/run_solc_fixed_tests.js @@ -0,0 +1,24 @@ +const setup = require("./init.js"); +(async function() { + try { + const init = await setup.runSetup(); + // console.log(init.setup); + console.log(" Running on", init.setup.helpers.networkName, "network."); + console.log(" Provider: ", init.setup.helpers.networkConfig.provider); + await runTests(init); + } catch (e) { + console.log("error:", e); + } +})(); + +async function runTests(init) { + + let tests = require("./solc_random_tests/fixed-tests.js"); + await tests.run(init); + + console.log("Done"); + // TODO exit with 1 on failure + process.exit(0); + +} + diff --git a/test/run_solc_random_tests.js b/test/run_solc_random_tests.js new file mode 100644 index 0000000..93e00b3 --- /dev/null +++ b/test/run_solc_random_tests.js @@ -0,0 +1,23 @@ +const setup = require("./init.js"); +(async function() { + try { + const init = await setup.runSetup(); + // console.log(init.setup); + console.log(" Running on", init.setup.helpers.networkName, "network."); + console.log(" Provider: ", init.setup.helpers.networkConfig.provider); + await runTests(init); + } catch (e) { + console.log("error:", e); + } +})(); + +async function runTests(init) { + + let tests = require("./solc_random_tests/random-tests.js"); + await tests.run(init); + + console.log("Done"); + process.exit(0); + +} + diff --git a/test/run_solc_tests.js b/test/run_solc_tests.js new file mode 100644 index 0000000..9b6d395 --- /dev/null +++ b/test/run_solc_tests.js @@ -0,0 +1,72 @@ +const setup = require("./init.js"); +(async function() { + try { + const init = await setup.runSetup(); + await runTests(init); + } catch (e) { + console.log("error:", e); + } +})(); + +async function runTests(init) { + + const tests = [ + "external/SafeMath", + "1_ERC1820", + "2_ERC777_Token", + "3_ERC20Token", + "rework/phases", + "rework/methods/stages", + "rework/methods/tokens", + // next ones need to be reworked + "5_Cancel", + "5_Contributions", + "5_Whitelist", + "5_Flows", + "10_ProjectWithdraw", + + // // "5_ProjectWithdraw", + // // "6_Gnosis-Safe", + // // "7_Website", + + ]; + + init.helpers.utils.toLog( + " ----------------------------------------------------------------\n" + + " Step 2 - Run tests \n" + + " ----------------------------------------------------------------" + ); + + if (tests.length > 0) { + const Mocha = require("mocha"); + + // Instantiate a Mocha instance. + const mocha = new Mocha(); + + mocha.useColors(true); + mocha.slow(15); + mocha.timeout(600000); + + for (let i = 0; i < tests.length; i++) { + try { + mocha.addFile("test/solc_tests/" + tests[i] + ".js"); + } catch (e) { + console.log("error:", e); + } + } + + // Run the tests. + const runner = mocha.run( + function(failures) { + process.exitCode = failures ? 1 : 0; // exit with non-zero status if there were failures + }, + true // delay execution of root suite until ready. + ); + + runner.on("end", e => { + console.log("Done"); + process.exit(process.exitCode); + }); + } +} + diff --git a/test/run_tests.js b/test/run_tests.js deleted file mode 100644 index 02e0eb5..0000000 --- a/test/run_tests.js +++ /dev/null @@ -1,346 +0,0 @@ -async function runTests() { - const Web3 = require("web3"); - let web3Instance, network; - - if (process.argv[3] == "coverage") { - network = process.argv[3]; - } else { - // Network name we're using to run the tests - network = process.argv[4]; - } - - if (!network) { - network = "development"; - } - - // load truffle config - const truffleConfig = require("../truffle-config.js"); - - let accounts; - let networkConfig = truffleConfig.networks[network]; - - if (truffleConfig.networks[network]) { - web3Instance = await new Web3(truffleConfig.networks[network].provider()); - accounts = await web3Instance.eth.getAccounts(); - } else { - console.log( - "Specified Network [" + network + "] not found in truffle-config." - ); - process.exit(1); - } - - // global required by openzeppelin-test-helpers - global.web3 = web3Instance; - - const { - BN, - constants, - expectRevert, - expectEvent - } = require("openzeppelin-test-helpers"); - const { MAX_UINT256 } = constants; - const web3util = require("web3-utils"); - const Table = require("cli-table"); - const utils = require("./helpers/utils"); - const safeUtils = require("./helpers/safeUtils"); - const { assert, expect } = require("chai"); - const { assertInvalidOpcode } = require("./helpers/assertThrow"); - - utils.toLog( - " ----------------------------------------------------------------\n" + - " Step 1 - Setting up helpers and globals \n" + - " ----------------------------------------------------------------" - ); - - const ether = 1000000000000000000; // 1 ether in wei - const etherBN = new BN(ether.toString()); - - const solidity = { - ether: ether, - etherBN: etherBN, - gwei: 1000000000 - }; - - // https://github.com/0xjac/ERC1820 - const ERC1820 = { - RawTx: - "0xf90a388085174876e800830c35008080b909e5608060405234801561001057600080fd5b506109c5806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a5576000357c010000000000000000000000000000000000000000000000000000000090048063a41e7d5111610078578063a41e7d51146101d4578063aabbb8ca1461020a578063b705676514610236578063f712f3e814610280576100a5565b806329965a1d146100aa5780633d584063146100e25780635df8122f1461012457806365ba36c114610152575b600080fd5b6100e0600480360360608110156100c057600080fd5b50600160a060020a038135811691602081013591604090910135166102b6565b005b610108600480360360208110156100f857600080fd5b5035600160a060020a0316610570565b60408051600160a060020a039092168252519081900360200190f35b6100e06004803603604081101561013a57600080fd5b50600160a060020a03813581169160200135166105bc565b6101c26004803603602081101561016857600080fd5b81019060208101813564010000000081111561018357600080fd5b82018360208201111561019557600080fd5b803590602001918460018302840111640100000000831117156101b757600080fd5b5090925090506106b3565b60408051918252519081900360200190f35b6100e0600480360360408110156101ea57600080fd5b508035600160a060020a03169060200135600160e060020a0319166106ee565b6101086004803603604081101561022057600080fd5b50600160a060020a038135169060200135610778565b61026c6004803603604081101561024c57600080fd5b508035600160a060020a03169060200135600160e060020a0319166107ef565b604080519115158252519081900360200190f35b61026c6004803603604081101561029657600080fd5b508035600160a060020a03169060200135600160e060020a0319166108aa565b6000600160a060020a038416156102cd57836102cf565b335b9050336102db82610570565b600160a060020a031614610339576040805160e560020a62461bcd02815260206004820152600f60248201527f4e6f7420746865206d616e616765720000000000000000000000000000000000604482015290519081900360640190fd5b6103428361092a565b15610397576040805160e560020a62461bcd02815260206004820152601a60248201527f4d757374206e6f7420626520616e204552433136352068617368000000000000604482015290519081900360640190fd5b600160a060020a038216158015906103b85750600160a060020a0382163314155b156104ff5760405160200180807f455243313832305f4143434550545f4d4147494300000000000000000000000081525060140190506040516020818303038152906040528051906020012082600160a060020a031663249cb3fa85846040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182600160a060020a0316600160a060020a031681526020019250505060206040518083038186803b15801561047e57600080fd5b505afa158015610492573d6000803e3d6000fd5b505050506040513d60208110156104a857600080fd5b5051146104ff576040805160e560020a62461bcd02815260206004820181905260248201527f446f6573206e6f7420696d706c656d656e742074686520696e74657266616365604482015290519081900360640190fd5b600160a060020a03818116600081815260208181526040808320888452909152808220805473ffffffffffffffffffffffffffffffffffffffff19169487169485179055518692917f93baa6efbd2244243bfee6ce4cfdd1d04fc4c0e9a786abd3a41313bd352db15391a450505050565b600160a060020a03818116600090815260016020526040812054909116151561059a5750806105b7565b50600160a060020a03808216600090815260016020526040902054165b919050565b336105c683610570565b600160a060020a031614610624576040805160e560020a62461bcd02815260206004820152600f60248201527f4e6f7420746865206d616e616765720000000000000000000000000000000000604482015290519081900360640190fd5b81600160a060020a031681600160a060020a0316146106435780610646565b60005b600160a060020a03838116600081815260016020526040808220805473ffffffffffffffffffffffffffffffffffffffff19169585169590951790945592519184169290917f605c2dbf762e5f7d60a546d42e7205dcb1b011ebc62a61736a57c9089d3a43509190a35050565b600082826040516020018083838082843780830192505050925050506040516020818303038152906040528051906020012090505b92915050565b6106f882826107ef565b610703576000610705565b815b600160a060020a03928316600081815260208181526040808320600160e060020a031996909616808452958252808320805473ffffffffffffffffffffffffffffffffffffffff19169590971694909417909555908152600284528181209281529190925220805460ff19166001179055565b600080600160a060020a038416156107905783610792565b335b905061079d8361092a565b156107c357826107ad82826108aa565b6107b85760006107ba565b815b925050506106e8565b600160a060020a0390811660009081526020818152604080832086845290915290205416905092915050565b6000808061081d857f01ffc9a70000000000000000000000000000000000000000000000000000000061094c565b909250905081158061082d575080155b1561083d576000925050506106e8565b61084f85600160e060020a031961094c565b909250905081158061086057508015155b15610870576000925050506106e8565b61087a858561094c565b909250905060018214801561088f5750806001145b1561089f576001925050506106e8565b506000949350505050565b600160a060020a0382166000908152600260209081526040808320600160e060020a03198516845290915281205460ff1615156108f2576108eb83836107ef565b90506106e8565b50600160a060020a03808316600081815260208181526040808320600160e060020a0319871684529091529020549091161492915050565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff161590565b6040517f01ffc9a7000000000000000000000000000000000000000000000000000000008082526004820183905260009182919060208160248189617530fa90519096909550935050505056fea165627a7a72305820377f4a2d4301ede9949f163f319021a6e9c687c292a5e2b2c4734c126b524e6c00291ba01820182018201820182018201820182018201820182018201820182018201820a01820182018201820182018201820182018201820182018201820182018201820", - SenderAddress: "0xa990077c3205cbDf861e17Fa532eeB069cE9fF96", - ContractAddress: "0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24", - sig: { - v: "0x1b", // 27 - r: "0x1820182018201820182018201820182018201820182018201820182018201820", - s: "0x1820182018201820182018201820182018201820182018201820182018201820" - }, - deploymentCost: solidity.ether * 0.08, - - // edit this to change "funds supplier address" - FundsSupplierAddress: accounts[10], - abi: [ - { - constant: false, - inputs: [ - { name: "_addr", type: "address" }, - { name: "_interfaceHash", type: "bytes32" }, - { name: "_implementer", type: "address" } - ], - name: "setInterfaceImplementer", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [{ name: "_addr", type: "address" }], - name: "getManager", - outputs: [{ name: "", type: "address" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: false, - inputs: [ - { name: "_addr", type: "address" }, - { name: "_newManager", type: "address" } - ], - name: "setManager", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [{ name: "_interfaceName", type: "string" }], - name: "interfaceHash", - outputs: [{ name: "", type: "bytes32" }], - payable: false, - stateMutability: "pure", - type: "function" - }, - { - constant: false, - inputs: [ - { name: "_contract", type: "address" }, - { name: "_interfaceId", type: "bytes4" } - ], - name: "updateERC165Cache", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [ - { name: "_addr", type: "address" }, - { name: "_interfaceHash", type: "bytes32" } - ], - name: "getInterfaceImplementer", - outputs: [{ name: "", type: "address" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: true, - inputs: [ - { name: "_contract", type: "address" }, - { name: "_interfaceId", type: "bytes4" } - ], - name: "implementsERC165InterfaceNoCache", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: true, - inputs: [ - { name: "_contract", type: "address" }, - { name: "_interfaceId", type: "bytes4" } - ], - name: "implementsERC165Interface", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "addr", type: "address" }, - { indexed: true, name: "interfaceHash", type: "bytes32" }, - { indexed: true, name: "implementer", type: "address" } - ], - name: "InterfaceImplementerSet", - type: "event" - }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "addr", type: "address" }, - { indexed: true, name: "newManager", type: "address" } - ], - name: "ManagerChanged", - type: "event" - } - ], - instance: false - }; - - function toIntVal(val) { - return parseInt(val); - } - - // https://web3js.readthedocs.io/en/v1.2.1/web3.html#extend - web3.extend({ - property: "evm", - methods: [ - { - name: "snapshot", - call: "evm_snapshot", - params: 0, - outputFormatter: toIntVal - }, - { - name: "revert", - call: "evm_revert", - params: 1, - inputFormatter: [toIntVal] - } - ] - }); - - const setup = { - network: network, - globals: {}, - helpers: { - networkName: network, - networkConfig: networkConfig, - assertInvalidOpcode: assertInvalidOpcode, - utils: utils, - safeUtils: safeUtils, - web3util: web3util, - web3: web3, - web3Instance: web3Instance, - Table: Table, - BN: BN, - constants: constants, - expectRevert: expectRevert, - expectEvent: expectEvent, - MAX_UINT256: MAX_UINT256, - expect: expect, - assert: assert, - solidity: solidity, - ERC1820: ERC1820, - addresses: { - ERC1820: "0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24", - Token: null, - Rico: null - } - }, - settings: { - token: { - name: "LYXeToken", - symbol: "LYXe", - decimals: 18, - supply: new BN(100) - .mul( - // 100 milions - new BN("10").pow(new BN("6")) - ) - .mul( - // 10^18 to account for decimals - new BN("10").pow(new BN("18")) - ), - sale: new BN(15) - .mul( - // 15 milions - new BN("10").pow(new BN("6")) - ) - .mul( - // 10^18 to account for decimals - new BN("10").pow(new BN("18")) - ) - } - } - }; - - global.setup = setup; - global.helpers = setup.helpers; - global.accounts = accounts; - global.assert = assert; - - const tests = [ - "external/SafeMath", - "1_ERC1820", - "2_ERC777_Token", - "3_ERC20Token", - "4_ReversibleICO", - "5_Cancel", - "5_Contributions", - "5_Flows", - // "6_Gnosis-Safe", - "7_Website", - "5_ProjectWithdraw", - // "5_Contributions", - ]; - - utils.toLog( - " ----------------------------------------------------------------\n" + - " Step 2 - Run tests \n" + - " ----------------------------------------------------------------" - ); - - if (tests.length > 0) { - const Mocha = require("mocha"); - - // Instantiate a Mocha instance. - const mocha = new Mocha(); - - mocha.useColors(true); - mocha.slow(15); - mocha.timeout(600000); - - for (let i = 0; i < tests.length; i++) { - try { - mocha.addFile("test/tests/" + tests[i] + ".js"); - } catch (e) { - console.log("error:", e); - } - } - - // Run the tests. - const runner = mocha.run( - function(failures) { - process.exitCode = failures ? 1 : 0; // exit with non-zero status if there were failures - }, - true // delay execution of root suite until ready. - ); - - runner.on("end", e => { - // display stats - /* - try { - const initStats = require('./tests/stats.js'); - initStats(setup); - } catch(e) { - console.log("error:", e); - } - */ - - console.log("Done"); - // terminate process - process.exit(process.exitCode); - }); - } -} - -try { - runTests(); -} catch (e) { - console.log("error:", e); -} diff --git a/test/solc_random_tests/actorBase.js b/test/solc_random_tests/actorBase.js new file mode 100644 index 0000000..9d7ea27 --- /dev/null +++ b/test/solc_random_tests/actorBase.js @@ -0,0 +1,28 @@ +/* + * The actors base class for the project and participants. + * + * @author Fabian Vogelsteller <@frozeman>, Micky Socaci +*/ + +class Actor { + constructor() { + // set also block number? + // the less we need to set on the actors sides, the better. + // lets treat the actors like they know nothing about the rICO, besides which stage they are in + + this.stage = 0; + this.tokenPrice = 0; + } + + // sets the current stage, so that the actor can calculate its expected balances + setStage(stage, tokenPrice) { + this.stage = stage; + this.tokenPrice = tokenPrice; + } + + toEth(value) { + return this.helpers.utils.toEth(this.helpers, value.toString()) + } +} + +module.exports = Actor; diff --git a/test/solc_random_tests/deployer.js b/test/solc_random_tests/deployer.js new file mode 100644 index 0000000..a8e328b --- /dev/null +++ b/test/solc_random_tests/deployer.js @@ -0,0 +1,388 @@ +/* + * The deployer + * + * @author Fabian Vogelsteller <@frozeman>, Micky Socaci +*/ + +const Participant = require("./participant.js"); + +module.exports = { + async run (init, settings) { + + const helpers = init.setup.helpers; + const expect = helpers.expect; + + const ContractsDeployer = settings.ContractsDeployer; + const whitelistControllerAddress = settings.whitelistControllerAddress; + const projectWalletAddress = settings.projectWalletAddress; + const blocksPerDay = settings.blocksPerDay // 6450; + const commitPhaseDays = settings.commitPhaseDays // 22; + const StageDays = settings.StageDays // 30; + + const RicoSaleSupply = init.setup.settings.token.sale.toString(); + const ERC777data = helpers.web3Instance.utils.sha3('777TestData'); + + /* + * Deployment - ERC1820 + */ + console.log(" Deploying ERC1820 Contract"); + let deploymentTx = await this.deployERC1820 (init); + console.log(" Gas used for deployment:", deploymentTx.gasUsed); + console.log(" Contract Address:", deploymentTx.contractAddress); + console.log(""); + + /* + * Deployment - rICO Token Contract + */ + console.log(" Deploying rICO Token Contract"); + deploymentTx = await this.deployrICOToken(init, ContractsDeployer); + console.log(" Gas used for deployment:", deploymentTx.gasUsed); + console.log(" Contract Address:", deploymentTx.contractAddress); + console.log(""); + + /* + * Deployment - rICO Contract + */ + + console.log(" Deploying rICO Contract"); + deploymentTx = await this.deployrICO(init, ContractsDeployer); + console.log(" Gas used for deployment:", deploymentTx.gasUsed); + console.log(" Contract Address:", deploymentTx.contractAddress); + console.log(""); + + + /* + * Setup - Token + */ + // Add rICO contract into token contract + const rICOToken = await helpers.utils.getContractInstance(helpers, "RicoToken", helpers.addresses.Token); + await rICOToken.methods.setup( + helpers.addresses.Rico + ).send({ + from: ContractsDeployer, // initial token supply holder + }); + + /* + * Setup - rICO - 1 - add Settings + */ + const rICO = await helpers.utils.getContractInstance(helpers, "ReversibleICOMock", helpers.addresses.Rico); + + const currentBlock = await helpers.web3Instance.eth.getBlockNumber(); + + // starts in one day + const commitPhaseStartBlock = parseInt(currentBlock, 10) + blocksPerDay * 1; + + // 22 days allocation + const commitPhaseBlockCount = blocksPerDay * commitPhaseDays; + const commitPhasePrice = helpers.solidity.ether * 0.002; + + // 12 x 30 day periods for distribution + const StageCount = 12; + const StageBlockCount = blocksPerDay * StageDays; + const StagePriceIncrease = helpers.solidity.ether * 0.0001; + + await rICO.methods.init( + helpers.addresses.Token, // address _tokenContractAddress + whitelistControllerAddress, // address _whitelistControllerAddress + projectWalletAddress, // address _projectWalletAddress + commitPhaseStartBlock, // uint256 _commitPhaseStartBlock + commitPhaseBlockCount, // uint256 _commitPhaseBlockCount, + commitPhasePrice, // uint256 _commitPhasePrice in wei + StageCount, // uint8 _stageCount + StageBlockCount, // uint256 _stageBlockCount + 0 // StagePriceIncrease // uint256 _stagePriceIncrease in wei + ).send({ + from: ContractsDeployer, // deployer + gas: 3000000 + }); + + expect(await rICO.methods.initialized().call()).to.be.equal(true); + + /* + * Setup - rICO - 2 - add Tokens + */ + // send all tokens to projectWalletAddress + await rICOToken.methods.send( + projectWalletAddress, + init.setup.settings.token.supply.toString(), + ERC777data + ).send({ + from: ContractsDeployer, // initial token supply holder + gas: 100000 + }); + + // send sale supply to rico + await rICOToken.methods.send( + helpers.addresses.Rico, + RicoSaleSupply, + ERC777data + ).send({ + from: projectWalletAddress, // initial token supply holder + gas: 100000 + }); + + return { + addresses: { + ContractsDeployer: ContractsDeployer, + whitelistControllerAddress: whitelistControllerAddress, + projectWalletAddress: projectWalletAddress, + }, + contracts: { + rICOToken:rICOToken, + rICO:rICO + }, + cache: { + commitPhaseStartBlock: await rICO.methods.commitPhaseStartBlock().call(), + commitPhaseEndBlock: await rICO.methods.commitPhaseEndBlock().call(), + buyPhaseStartBlock: await rICO.methods.buyPhaseStartBlock().call(), + buyPhaseEndBlock: await rICO.methods.buyPhaseEndBlock().call() + } + } + }, + async deployERC1820 (init) { + + const helpers = init.setup.helpers; + const expect = helpers.expect + + let ContractCode = await new helpers.web3Instance.eth.getCode(helpers.ERC1820.ContractAddress); + expect( ContractCode ).to.be.equal( "0x" ); + + let SenderBalance = await helpers.utils.getBalance(helpers, helpers.ERC1820.SenderAddress); + expect( SenderBalance ).to.be.bignumber.equal( '0' ); + + const SupplierBalance = await helpers.utils.getBalance(helpers, helpers.ERC1820.FundsSupplierAddress); + let deploymentCost = new helpers.BN( helpers.ERC1820.deploymentCost.toString() ); + expect( SupplierBalance ).to.be.bignumber.above( deploymentCost ); + + txGasPrice = 20000000000; // 20 gwei + const initialFundsSupplierBalance = await helpers.utils.getBalance(helpers, helpers.ERC1820.FundsSupplierAddress); + + // transfer deploymentCost from SupplierBalance to SenderAddress and validate + const valueTransferTx = await helpers.web3Instance.eth.sendTransaction({ + from: helpers.ERC1820.FundsSupplierAddress, + to: helpers.ERC1820.SenderAddress, + value: helpers.ERC1820.deploymentCost.toString(), + gasPrice: txGasPrice, + }); + + // FundsSupplier balance has deploymentCost + tx fee substracted + const newSupplierBalance = await helpers.utils.getBalance(helpers, helpers.ERC1820.FundsSupplierAddress); + // gas used + let combinedValue = new helpers.BN( valueTransferTx.gasUsed.toString() ) + // times gas price + combinedValue = combinedValue.mul( new helpers.BN( txGasPrice ) ); + // add value sent + combinedValue = combinedValue.add( new helpers.BN( helpers.ERC1820.deploymentCost.toString() ) ); + // initial minus sent + gas * gas price + const newCalculatedBalance = initialFundsSupplierBalance.sub(combinedValue); + expect( newSupplierBalance ).to.be.bignumber.equal( newCalculatedBalance ); + + + // SenderAddress balance is equal to deploymentCost + SenderBalance = await helpers.utils.getBalance(helpers, helpers.ERC1820.SenderAddress); + deploymentCost = new helpers.BN( helpers.ERC1820.deploymentCost.toString() ); + expect( SenderBalance ).to.be.bignumber.equal( deploymentCost ); + + // sendRawTransaction if upgrading to the latest web3 + const deploymentTx = await helpers.web3Instance.eth.sendSignedTransaction( helpers.ERC1820.RawTx ); + + // Transaction status + expect( deploymentTx.status ).to.be.equal( true ); + + // signature is valid + expect( deploymentTx.v ).to.be.equal( helpers.ERC1820.sig.v ); + expect( deploymentTx.r ).to.be.equal( helpers.ERC1820.sig.r ); + expect( deploymentTx.s ).to.be.equal( helpers.ERC1820.sig.s ); + + // from address is correct + expect( deploymentTx.from ).to.be.equal( helpers.ERC1820.SenderAddress.toLowerCase() ); + + // Contract address is 0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24 + expect( deploymentTx.contractAddress ).to.be.equal( helpers.ERC1820.ContractAddress ); + + // setup contract instance + helpers.ERC1820.instance = await new helpers.web3Instance.eth.Contract( helpers.ERC1820.abi, helpers.ERC1820.ContractAddress ); + + + // code at address exists + ContractCode = await new helpers.web3Instance.eth.getCode(helpers.ERC1820.ContractAddress); + expect( ContractCode.length ).to.be.equal( 5004 ); + + // contract has the getManager method which can be called + const getManager = await helpers.ERC1820.instance.methods.getManager( accounts[0] ).call(); + expect( getManager ).to.be.equal( accounts[0] ); + + return deploymentTx; + }, + async deployrICOToken(init, ContractsDeployer) { + + const helpers = init.setup.helpers; + const setup = init.setup; + const expect = helpers.expect + const defaultOperators = []; + + if (helpers.ERC1820.instance == false) { + console.log( + " Error: ERC1820.instance not found, please make sure to run it first." + ); + process.exit(); + } + + const rICOToken = await helpers.utils.deployNewContractInstance( + helpers, + "RicoToken", + { + from: ContractsDeployer, + arguments: [init.setup.settings.token.supply.toString(), defaultOperators], + gas: 6500000, + gasPrice: helpers.solidity.gwei * 10 + } + ); + + expect(await rICOToken.methods.name().call()).to.equal( + setup.settings.token.name + ); + expect(await rICOToken.methods.symbol().call()).to.equal( + setup.settings.token.symbol + ); + expect(await rICOToken.methods.granularity().call()).to.be.equal( + "1" + ); + expect(await rICOToken.methods.totalSupply().call()).to.be.equal( + setup.settings.token.supply.toString() + ); + + helpers.addresses.Token = rICOToken.receipt.contractAddress; + return rICOToken.receipt; + }, + async deployrICO(init, ContractsDeployer) { + + const helpers = init.setup.helpers; + const expect = helpers.expect + + if (helpers.ERC1820.instance == false) { + console.log( + " Error: ERC1820.instance not found, please make sure to run it first." + ); + process.exit(); + } + + const ReversibleICO = await helpers.utils.deployNewContractInstance( + helpers, "ReversibleICOMock", {from: ContractsDeployer} + ); + expect(await ReversibleICO.methods.deployerAddress().call()).to.be.equal(ContractsDeployer); + helpers.addresses.Rico = ReversibleICO.receipt.contractAddress; + + expect(await ReversibleICO.methods.initialized().call()).to.be.equal(false); + + return ReversibleICO.receipt; + }, + async createLightwallet(init, numAddresses) { + const helpers = init.setup.helpers; + const util = require("util"); + const lightwallet = require("eth-lightwallet"); + + // Create lightwallet accounts + const createVault = util + .promisify(lightwallet.keystore.createVault) + .bind(lightwallet.keystore); + const keystore = await createVault({ + hdPathString: "m/44'/60'/0'/0", + seedPhrase: + "pull rent tower word science patrol economy legal yellow kit frequent fat", + password: "test", + salt: "testsalt" + }); + const keyFromPassword = await util + .promisify(keystore.keyFromPassword) + .bind(keystore)("test"); + keystore.generateNewAddress(keyFromPassword, numAddresses); + + // convert signers to proper checksummed addresses + const accounts = keystore.getAddresses().map((value) => { + return { + address: helpers.web3.utils.toChecksumAddress(value), + pwDerivedKey: keyFromPassword, + privateKey: keystore.exportPrivateKey(value, keyFromPassword), + }; + }); + + return { + lightwallet: lightwallet, + keystore: keystore, + accounts: accounts, + passwords: keyFromPassword + }; + }, + async createParticipants(init, numberOfParticipants, participantTxBalance) { + + const helpers = init.setup.helpers; + const BN = helpers.BN; + const expect = helpers.expect + + console.log(" Creating "+numberOfParticipants+" participants"); + console.log(" Funding Addresses with ETH ranging from 1 to 50 ( +1 for tx gas costs )"); + + const wallet = await this.createLightwallet(init, numberOfParticipants); + const txGasPrice = 20000000000; // 20 gwei + const initialFundsSupplier = init.accounts[0]; + + const participants = []; + // since ganache is synchronous. no point in complicating things. + for(let i = 0; i < wallet.accounts.length; i++) { + const account = wallet.accounts[i]; + + let value; + if(i == 0 || i == 1) { + value = helpers.solidity.etherBN.mul( + new BN( 100 ) + // new BN( 100000 ) + ); + } else { + value = helpers.solidity.etherBN.mul( + new BN( Math.floor(Math.random() * 50) + 1 ) + ); + } + + const actualValue = value.add( + // add extra eth for tx costs + participantTxBalance + ); + + const initialAccountBalance = await helpers.utils.getBalance(helpers, account.address); + expect( initialAccountBalance ).to.be.bignumber.equal( '0', 'initialAccountBalance'); + + const initialFundsSupplierBalance = await helpers.utils.getBalance(helpers, initialFundsSupplier); + + // transfer ETH from initialFundsSupplier to Participant and validate + const valueTransferTx = await helpers.web3Instance.eth.sendTransaction({ + from: initialFundsSupplier, + to: account.address, + value: actualValue, + gasPrice: txGasPrice, + }); + + // validate supplier balance + const newSupplierBalance = await helpers.utils.getBalance(helpers, initialFundsSupplier); + let combinedValue = new helpers.BN( valueTransferTx.gasUsed.toString() ) + combinedValue = combinedValue.mul( new helpers.BN( txGasPrice ) ); + combinedValue = combinedValue.add( actualValue ); + const newCalculatedBalance = initialFundsSupplierBalance.sub(combinedValue); + expect( newSupplierBalance ).to.be.bignumber.equal( newCalculatedBalance, 'newCalculatedBalance'); + + // validate participant balance + const newAccountBalance = await helpers.utils.getBalance(helpers, account.address); + expect( newAccountBalance ).to.be.bignumber.equal( actualValue , 'newAccountBalance'); + + console.log(" ["+i+"]", account.address, helpers.utils.toEth(helpers, value) + " eth" ); + + participants.push( + new Participant( {init, wallet, account}, value, participantTxBalance) + ); + } + + return participants; + } + + +} \ No newline at end of file diff --git a/test/solc_random_tests/fixed-tests.js b/test/solc_random_tests/fixed-tests.js new file mode 100644 index 0000000..217beec --- /dev/null +++ b/test/solc_random_tests/fixed-tests.js @@ -0,0 +1,309 @@ +/* + * The test project class. + * + * @author Fabian Vogelsteller <@frozeman>, Micky Socaci +*/ + +const deployer = require("./deployer.js"); +const whitelister = require("./whitelister.js"); +const project = require("./project.js"); + +module.exports = { + async run (init) { + + const helpers = init.helpers; + const numberOfParticipants = 4; + // allocate 1 extra eth to each participant + const participantTxBalance = init.helpers.solidity.etherBN; + const rICOSettings = { + + ContractsDeployer: init.accounts[2], + whitelistControllerAddress: init.accounts[3], + projectWalletAddress: init.accounts[4], + + blocksPerDay: 5, // 6450; + commitPhaseDays: 4, // 22; + StageDays: 2, // 30; + }; + + helpers.utils.toLog( + " ----------------------------------------------------------------\n" + + " Step 2 - Initialize Participants \n" + + " ----------------------------------------------------------------" + ); + + init.deployment = { + addresses: { + ContractsDeployer: null, + whitelistControllerAddress: null, + projectWalletAddress: null, + }, + contracts: { + rICOToken: null, + rICO: null, + }, + whitelister: null, + project: null, + }; + + const participants = await deployer.createParticipants(init, numberOfParticipants, participantTxBalance); + + // console.log(participants); + + helpers.utils.toLog( + " ----------------------------------------------------------------\n" + + " Step 3 - Run Deployment \n" + + " ----------------------------------------------------------------" + ); + const deployment = await deployer.run(init, rICOSettings); + init.deployment = deployment; + + // contract instances + const rICOToken = deployment.contracts.rICOToken; + const rICO = deployment.contracts.rICO; + + // contract addresses + const addresses = deployment.addresses; + + const commitPhaseStartBlock = parseInt(await rICO.methods.commitPhaseStartBlock().call(), 10); + const commitPhaseEndBlock = parseInt(await rICO.methods.commitPhaseEndBlock().call(), 10); + const buyPhaseStartBlock = parseInt(await rICO.methods.buyPhaseStartBlock().call(), 10); + const buyPhaseEndBlock = parseInt(await rICO.methods.buyPhaseEndBlock().call(), 10); + const rICOBlockLength = buyPhaseEndBlock - commitPhaseStartBlock; + + console.log(" rICO Settings"); + console.log(" commitPhaseStartBlock:", commitPhaseStartBlock); + console.log(" commitPhaseEndBlock: ", commitPhaseEndBlock); + console.log(" buyPhaseStartBlock: ", buyPhaseStartBlock); + console.log(" buyPhaseDuration: ", (buyPhaseEndBlock - buyPhaseStartBlock + 1)); + console.log(" buyPhaseEndBlock: ", buyPhaseEndBlock); + console.log(""); + console.log(" rICO block length:", rICOBlockLength); + + const Whitelister = new whitelister(init, rICO, rICOSettings.whitelistControllerAddress); + init.deployment.whitelister = Whitelister; + console.log(" Whitelister:", Whitelister.address); + + const Project = new project(init, rICO, rICOSettings.projectWalletAddress); + init.deployment.project = Project; + console.log(" ProjectWallet:", Project.address); + + + helpers.utils.toLog( + " ----------------------------------------------------------------\n" + + " Step 4 - Run Tests \n" + + " ----------------------------------------------------------------" + ); + + // jump to allocation block + await helpers.utils.jumpToContractStage ( rICO, deployment.addresses.ContractsDeployer, 0 ); + + try { + + const displayValues = async () => { + + await participants[0].displayAllBalances(); + + // const byStage = await rICO.methods.getParticipantDetailsByStage(participants[0].address, 0).call(); + // console.log(byStage); + + const unlockedToken = new helpers.BN( await rICOToken.methods.getUnlockedBalance(participants[0].address).call() ); + const lockedToken = new helpers.BN( await rICOToken.methods.getLockedBalance(participants[0].address).call() ); + const balanceOf = new helpers.BN( await rICOToken.methods.balanceOf(participants[0].address).call() ); + + console.log("unlockedTokens: ", participants[0].toEth(unlockedToken)); + console.log("lockedTokens: ", participants[0].toEth(lockedToken)); + console.log("balanceOf: ", participants[0].toEth(balanceOf)); + + const getLockedTokenAmount = new helpers.BN( await rICO.methods.getLockedTokenAmount(participants[0].address, false).call() ); + console.log("getLockedTokenAmount: ", participants[0].toEth(getLockedTokenAmount)); + + const getLockedTokenAmount2 = new helpers.BN( await rICO.methods.getLockedTokenAmount(participants[0].address, true).call() ); + console.log("getLockedTokenAmount2: ", participants[0].toEth(getLockedTokenAmount2)); + + const getCurrentUnlockPercentage = new helpers.BN( await rICO.methods.getCurrentUnlockPercentage().call() ); + console.log("getCurrentUnlockPerc: ", participants[0].toEth(getCurrentUnlockPercentage)); + + } + + + // ---------------------------------------------------------------------------------------- + // replay code start + // + let block; + + /* + block = 15; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await participants[0].executeAction('commitHalfBalance'); + + block = 16; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await participants[0].executeAction('commitEntireBalance'); + + await Project.executeAction('withdrawHalf'); + + block = 19; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await participants[0].executeAction('withdrawByETH'); + + await Project.executeAction('withdrawHalf'); + + block = 20; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await participants[0].executeAction('commitHalfBalance'); + + block = 21; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await participants[0].executeAction('commitEntireBalance'); + + await Project.executeAction('withdrawHalf'); + + block = 22; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await participants[0].executeAction('whitelistApprove'); + + + block = 23; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await participants[0].executeAction('whitelistDeny'); + + */ + + block = 20; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await participants[0].executeAction('commitHalfBalance'); + + block = 24; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await participants[0].executeAction('whitelistApprove'); + + block = 26; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await displayValues(); + await participants[0].executeAction('sendHalfTokensBack'); + await displayValues(); + + /* + block = 27; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await participants[0].executeAction('commitEntireBalance'); + + + block = 29; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await participants[0].executeAction('sendAllTokensBack'); + + + block = 30; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await participants[0].executeAction('commitHalfBalance'); + */ + + block = 31; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + await participants[0].executeAction('whitelistDeny'); + + block = 32; + await setBlock(block, rICO, deployment, helpers); + + participants[0].setBlock(block); + + console.log("before"); + await displayValues(); + await participants[0].executeAction('commitHalfBalance', async () => { + console.log("after"); + await displayValues(); + }); + + + + // replay code end + // ---------------------------------------------------------------------------------------- + + // for(let block = commitPhaseStartBlock; block <= buyPhaseEndBlock; block++) { + // await setBlock(block, rICO, deployment, helpers); + // } + + } catch(e) { + console.log(e) + process.exit(1); + } + } +} + +async function setBlock(block, rICO, deployment, helpers) { + await rICO.methods.jumpToBlockNumber(block).send({from: deployment.addresses.ContractsDeployer, gas: 100000}); + const currentStage = await rICO.methods.getCurrentStage().call(); + const currentAvailableEthForPurchase = await rICO.methods.availableEthAtStage(currentStage).call(); + + console.log( + "#### ", + "block:", block, + "stage:", currentStage, + "eth:", helpers.utils.toEth(helpers, currentAvailableEthForPurchase) + " eth", + ); +} + +async function display(rICO, helpers, Project) { + + committedETH = new helpers.BN( await rICO.methods.committedETH().call() ); + withdrawnETH = new helpers.BN( await rICO.methods.withdrawnETH().call() ); + projectAllocatedETH = new helpers.BN( await rICO.methods.projectAllocatedETH().call() ); + projectWithdrawnETH = new helpers.BN( await rICO.methods.projectWithdrawnETH().call() ); + buyPhaseStartBlock = await rICO.methods.buyPhaseStartBlock().call(); + buyPhaseEndBlock = await rICO.methods.buyPhaseEndBlock().call(); + _currentBlock = await rICO.methods.getCurrentBlockNumber().call(); + + + const globalAvailable = committedETH + .sub(withdrawnETH) + .sub(projectAllocatedETH); + + const unlocked = globalAvailable.mul( + helpers.utils.getCurrentUnlockPercentage( + helpers, + _currentBlock, + buyPhaseStartBlock, + buyPhaseEndBlock, + 20 + ) + ).div( + new helpers.BN("10").pow( new helpers.BN("20")) + ); + + const result = unlocked.add(projectAllocatedETH).sub(projectWithdrawnETH); + const getProjectAvailableEth = await rICO.methods.getProjectAvailableEth().call() + + console.log(" > getProjectAvailableEth: calc ", Project.toEth(result) + " eth"); + console.log(" > getProjectAvailableEth: unlocked ", Project.toEth(new helpers.BN( getProjectAvailableEth )) + " eth"); + +} \ No newline at end of file diff --git a/test/solc_random_tests/participant.js b/test/solc_random_tests/participant.js new file mode 100644 index 0000000..86b2f5c --- /dev/null +++ b/test/solc_random_tests/participant.js @@ -0,0 +1,682 @@ +/* + * The test participant class. + * + * @author Fabian Vogelsteller <@frozeman>, Micky Socaci +*/ + +const helpers = setup.helpers; +const BN = helpers.BN; +const MAX_UINT256 = helpers.MAX_UINT256; +const expect = helpers.expect + +const Actor = require("./actorBase.js"); + +class Participant extends Actor { + + // set the defaults + constructor(properties, ETH, extraETH) { + super(); + + this.block = 0; + + this.properties = properties; + this.helpers = properties.init.setup.helpers; + this.expect = this.helpers.expect; + this.address = this.properties.account.address; + + this.wallet = this.properties.wallet; + this.extraETH = extraETH; + this.txCosts = new this.helpers.BN(0); + + this.actionLog = []; + + // should be add the tokenPrice? + // and do the calculation based on the current token price? + + this.currentBalances = { + ETH: ETH, + Token: new this.helpers.BN("0"), + withdrawableETH: new this.helpers.BN("0"), + unlockedToken: new this.helpers.BN("0"), + reservedTokens: new this.helpers.BN("0"), + allocatedETH: new this.helpers.BN("0"), + }; + + this.expectedBalances = { + ETH: ETH, + Token: new this.helpers.BN("0"), + withdrawableETH: new this.helpers.BN("0"), + unlockedToken: new this.helpers.BN("0"), + reservedTokens: new this.helpers.BN("0"), + }; + + this.whitelisted = false; + } + + /* External */ + + setBlock(block) { + this.block = block; + } + + availableScenarios() { + + /* + 1. Participant: Commit ETH + do nothing forever + 2. Participant: Commit ETH + send 0 value tx + 3. Participant: Commit ETH + project calls "cancel" + 4. Participant: Commit ETH + project whitelists + do nothing forever + 5. Participant: Commit ETH + project whitelists + send n tokens back + do nothing forever + 6. Participant: Commit ETH + project whitelists + send n tokens back + commit again + 7. Participant: Commit ETH + project whitelists + send all tokens back + do nothing forever + 8. Participant: Commit ETH + project whitelists + send all tokens back + 9. Participant: Commit ETH + project whitelists + commit again n times + refund x times (randomize both actions?) + 10. Participant Commit ETH + project whitelist + move unlocked tokens + refund + 11. Participant Commit ETH + project whitelist + move unlocked tokens + refund + refund x times + 12. Project: call withdraw n times + */ + + const FirstStage = Math.round(Math.rand() * 12); + + return [ + { + title: "Participant: Commit ETH + do nothing forever", actions: [ + { action: "commitEntireBalance", stage: FirstStage }, + ] + }, + { + title: "Participant: Commit ETH + send 0 value tx ( cancel )", actions: [ + { action: "commitEntireBalance", stage: FirstStage }, + { action: "withdrawByETH", stage: FirstStage + 1 }, + ] + }, + { + title: "Participant: Commit ETH + send 0 value tx ( cancel )", actions: [ + { action: "commitEntireBalance", stage: FirstStage }, + { action: "withdrawByETH", stage: 0 }, + ] + } + ] + } + + pickScenario() { + + } + + async getAvailableActions() { + let actions = []; + + let canCommit = false; + + const commitPhaseStartBlock = this.startAndEndBlocks.commitPhaseStartBlock; + const buyPhaseEndBlock = this.startAndEndBlocks.buyPhaseEndBlock; + + // are we in spending phase + if( this.block >= commitPhaseStartBlock && this.block <= buyPhaseEndBlock ) { + // do we have available ETH for spending ? + if( this.currentBalances.ETH.gt( new this.helpers.BN("0") ) ) { + canCommit = true; + } + } + + const cancelModes = await this.rICO.methods.getCancelModes(this.address).call(); + + if(canCommit) { + actions.push("commitEntireBalance"); + actions.push("commitHalfBalance"); + } + + if(cancelModes.byEth) { + actions.push("withdrawByETH"); + // actions.push("withdrawByETH_half"); // only full eth withdraw available. + } + + if(cancelModes.byTokens) { + actions.push("sendAllTokensBack"); + actions.push("sendHalfTokensBack"); + } + + if(this.whitelisted === false) { + actions.push("whitelistApprove"); + } else { + // if() + actions.push("whitelistDeny"); + } + + return actions; + } + + async getAvailableActionsWithNone() { + return ["nothing", ...await this.getAvailableActions()]; + } + + async executeRandomActionOrNone(callback = null) { + const availableActions = await this.getAvailableActionsWithNone(); + const rand = Math.floor( Math.random() * availableActions.length ); + await this.executeAction(availableActions[rand], callback); + } + + async executeAction(action, callback = null) { + const availableActions = await this.getAvailableActionsWithNone(); + + console.log(this.address, "Executing:", action, " / Available:", availableActions); + + // action execution + switch(action) { + case "commitEntireBalance": + await this.commitEntireBalance(); + break; + case "commitHalfBalance": + await this.commitHalfBalance(); + break; + case "withdrawByETH": + await this.withdrawByETH(); + break; + case "sendAllTokensBack": + await this.sendAllTokensBack(); + break; + case "sendHalfTokensBack": + await this.sendHalfTokensBack(); + break; + case "whitelistApprove": + await this.whitelistApprove(); + break; + case "whitelistDeny": + await this.whitelistDeny(); + break; + case "nothing": + this.actionLog.push( { type:"nothing", "value": null, valid: null } ); + // do nothing + break; + default: + throw("error at executeAction: action[" + action + "] not found."); + } + + if(callback) { + await callback(); + } + await this.test(); + + } + + async commitEntireBalance() { + await this.readBalances(); + const amount = this.currentBalances.ETH; + this.actionLog.push( { type:"commitEntireBalance", "value": amount, valid: null } ); + await this.commit( amount ); + } + + async commitHalfBalance() { + await this.readBalances(); + const amount = this.currentBalances.ETH.divRound( new this.helpers.BN(2) ); + this.actionLog.push( { type:"commitHalfBalance", "value": amount, valid: null } ); + await this.commit( amount ); + } + + // commit ETH to the rICO contract + async commit(ETH) { + + // transfer to rICO + await this.sendValueTx(ETH, this.helpers.addresses.Rico); + + const currentStage = await this.rICO.methods.getCurrentStage().call(); + const tokenAmount = await this.helpers.utils.getTokenAmountForEthAtStage( + this.helpers, + this.rICO, + ETH, + currentStage, + ); + + // contract processes and returns overflow amount + const maxAcceptableValue = new this.helpers.BN( await this.rICO.methods.availableEthAtStage(currentStage).call() ); + let acceptedValue ; + + if(ETH.gt(maxAcceptableValue)) { + acceptedValue = maxAcceptableValue; + } else { + acceptedValue = ETH; + } + + const isWhitelisted = await this.rICO.methods.isWhitelisted(this.address).call(); + if(isWhitelisted) { + + this.expectedBalances.ETH = this.currentBalances.ETH.sub(acceptedValue) ; + + const price = await this.rICO.methods.getCurrentPrice().call(); + + // token balance now includes reserved tokens for accepted amount + this.expectedBalances.Token = this.currentBalances.Token.add( + this.helpers.utils.getTokenAmountForEthAtValue(this.helpers, acceptedValue, price) + ); + + this.expectedBalances.reservedTokens = new this.helpers.BN(0); + + // @TODO: calculate expected withdrawable ETH. + this.expectedBalances.withdrawableETH = this.currentBalances.withdrawableETH.add(acceptedValue); + + } else { + + // contract accepts full sent value + this.expectedBalances.ETH = this.currentBalances.ETH.sub(ETH); + + this.expectedBalances.withdrawableETH = this.currentBalances.withdrawableETH; + this.expectedBalances.reservedTokens = this.currentBalances.reservedTokens.add(tokenAmount); + } + + + + const unlockPercentage = this.getCurrentUnlockPercentage(); + if(unlockPercentage.gt(new this.helpers.BN("0"))) { + this.expectedBalances.unlockedToken = this.expectedBalances.Token.mul(unlockPercentage).divRound( + new this.helpers.BN("10").pow( new this.helpers.BN(20) ) + ) + } else { + this.expectedBalances.unlockedToken = new this.helpers.BN("0"); + } + + console.log("this.expectedBalances.unlockedToken", this.expectedBalances.unlockedToken); + + } + + // withdraw ETH from the rICO contract by sending 0 value or value lower than minContribution transaction + async withdrawByETH() { + + const participantRecord = await this.getParticipantRecord(); + + // const pendingEth = participantRecord.totalReceivedETH.sub( + // participantRecord.committedETH.add( + // participantRecord.returnedETH + // ).add( + // participantRecord.withdrawnETH + // ) + // ); + + const pendingEth = participantRecord.totalReceivedETH + .sub(participantRecord.returnedETH) + .sub(participantRecord.committedETH); + + // expected balance includes value stored in contract that has not been procesed. + this.expectedBalances.ETH = this.currentBalances.ETH.add(pendingEth); + // reserved tokens are set to 0 + this.expectedBalances.reservedTokens = new this.helpers.BN("0"); + // token balance does not change + this.expectedBalances.Token = this.currentBalances.Token; + + this.actionLog.push( { type:"withdrawByETH", "value": pendingEth, valid: null } ); + + // send 0 value or minContribution value transaction in order to withdraw "by eth" + await this.sendValueTx(0, this.helpers.addresses.Rico); + + } + + async sendAllTokensBack() { + await this.readBalances(); + this.actionLog.push( { type:"sendAllTokensBack", "value": this.currentBalances.Token, valid: null } ); + return await this.withdrawByToken(this.currentBalances.Token); + } + + async sendHalfTokensBack() { + await this.readBalances(); + // send half the locked token balance back + const value = this.currentBalances.Token.sub(this.currentBalances.unlockedToken).divRound( new this.helpers.BN(2) ); + this.actionLog.push( { type:"sendHalfTokensBack", "value": value, valid: null } ); + return await this.withdrawByToken(value); + } + + async whitelistApprove() { + this.actionLog.push( { type:"whitelistApprove", "value": null, valid: null } ); + return await this.setWhitelist(true); + } + + async whitelistDeny() { + this.actionLog.push( { type:"whitelistDeny", "value": null, valid: null } ); + return await this.setWhitelist(false); + } + + async setWhitelist(mode) { + this.whitelisted = mode; + await this.readBalances(); + + // reserved tokens are set to 0 + this.expectedBalances.reservedTokens = new this.helpers.BN("0"); + + const participantRecord = await this.getParticipantRecord(); + + if(mode === true) { + // accept contribution + await this.whitelister.approve(this.address); + } else { + await this.whitelister.reject(this.address); + } + + + const currentStage = await this.rICO.methods.getCurrentStage().call(); + const maxAcceptableValue = new this.helpers.BN( await this.rICO.methods.availableEthAtStage(currentStage).call() ); + + let acceptedValue ; + + const claimableEth = participantRecord.totalReceivedETH + .sub(participantRecord.returnedETH) + .sub(participantRecord.committedETH); + + if(claimableEth.gt(maxAcceptableValue)) { + acceptedValue = maxAcceptableValue; + } else { + acceptedValue = claimableEth; + } + + const price = await this.rICO.methods.getCurrentPrice().call(); + const unlockPercentage = this.getCurrentUnlockPercentage(); + + if(mode === true) { + + this.expectedBalances.ETH = this.currentBalances.ETH.add(claimableEth.sub(acceptedValue)); + + // token balance now includes reserved tokens for accepted amount + this.expectedBalances.Token = this.currentBalances.Token.add( + this.helpers.utils.getTokenAmountForEthAtValue(this.helpers, acceptedValue, price) + ); + + if(unlockPercentage.gt(new this.helpers.BN("0"))) { + + this.expectedBalances.withdrawableETH = this.currentBalances.withdrawableETH.add( + acceptedValue.sub( + // divRound must be used here otherwise result will not be floored like solidity does. + acceptedValue.mul(unlockPercentage).divRound( + new this.helpers.BN("10").pow( new this.helpers.BN(20) ) + ) + ) + ); + + this.expectedBalances.unlockedToken = this.expectedBalances.Token.mul(unlockPercentage).divRound( + new this.helpers.BN("10").pow( new this.helpers.BN(20) ) + ) + + } else { + this.expectedBalances.withdrawableETH = this.currentBalances.withdrawableETH.add(acceptedValue); + this.expectedBalances.unlockedToken = new this.helpers.BN("0"); + } + + + } else { + + this.expectedBalances.ETH = this.currentBalances.ETH.add(claimableEth); + + // token balance does not change + this.expectedBalances.Token = this.currentBalances.Token; + + // this.expectedBalances.withdrawableETH + // is 0 since participant can only "cancel full amount" + // but we also test against "token" value + + + if(unlockPercentage.gt(new this.helpers.BN("0"))) { + + this.expectedBalances.unlockedToken = this.expectedBalances.Token.mul(unlockPercentage).divRound( + new this.helpers.BN("10").pow( new this.helpers.BN(20) ) + ) + + const lockedTokens = this.expectedBalances.Token.sub(this.expectedBalances.unlockedToken); + const calculation = await this.helpers.utils.getAvailableEthAndTokensForWithdraw(this.helpers, this.rICO, this.address, lockedTokens); + this.expectedBalances.withdrawableETH = calculation.eth; // this.currentBalances.withdrawableETH.add(calculation.eth); + + + } else { + this.expectedBalances.unlockedToken = new this.helpers.BN("0"); + + const calculation = await this.helpers.utils.getAvailableEthAndTokensForWithdraw(this.helpers, this.rICO, this.address, this.expectedBalances.Token); + this.expectedBalances.withdrawableETH = calculation.eth; // this.currentBalances.withdrawableETH.add(calculation.eth); + } + } + + // console.log("this.expectedBalances.withdrawableETH", this.toEth(this.expectedBalances.withdrawableETH)); + this.expectedBalances.reservedTokens = new this.helpers.BN(0); + await this.readBalances(); + } + + + // withdraw ETH from the rICO contract by sending tokens back + async withdrawByToken(TokenAmount = 0) { + // calculation will max out at max available ETH and tokens that can be returned. + // TokenAmount over max available will set calculation.returned_tokens + const calculation = await this.helpers.utils.getAvailableEthAndTokensForWithdraw(this.helpers, this.rICO, this.address, TokenAmount); + this.expectedBalances.ETH = this.currentBalances.ETH.add(calculation.eth); + this.expectedBalances.withdrawableETH = this.currentBalances.withdrawableETH.sub(calculation.eth); + this.expectedBalances.Token = this.currentBalances.Token.sub(calculation.withdrawn_tokens); + + await this.sendTokenTx(TokenAmount, this.helpers.addresses.Rico); + } + + async updateAfterWhitelisting(tokenAmount) { + this.expectedBalances.Token = this.expectedBalances.Token.add(tokenAmount); + } + + async displayAllBalances() { + await this.displayAggregatedStats(); + this.displayBalances(); + this.displayExpectedBalances(); + } + + async displayAggregatedStats() { + const aggregatedStats = await this.rICO.methods.participantAggregatedStats(this.address).call(); + console.log(" address: ", this.address); + console.log(" totalReceivedETH: ", this.toEth(aggregatedStats.totalReceivedETH) + " eth"); + console.log(" returnedETH: ", this.toEth(aggregatedStats.returnedETH) + " eth"); + console.log(" committedETH: ", this.toEth(aggregatedStats.committedETH) + " eth"); + console.log(" withdrawnETH: ", this.toEth(aggregatedStats.withdrawnETH) + " eth"); + console.log(" allocatedETH: ", this.toEth(aggregatedStats.allocatedETH) + " eth"); + console.log(" reservedTokens: ", this.toEth(aggregatedStats.reservedTokens) + " tokens"); + console.log(" boughtTokens: ", this.toEth(aggregatedStats.boughtTokens) + " tokens"); + console.log(" returnedTokens: ", this.toEth(aggregatedStats.returnedTokens) + " tokens"); + } + + displayBalances() { + console.log(" address: ", this.address); + console.log(" currentBalances.ETH: ", this.toEth(this.currentBalances.ETH) + " eth"); + console.log(" currentBalances.withdrawableETH: ", this.toEth(this.currentBalances.withdrawableETH) + " eth"); + console.log(" currentBalances.allocatedETH: ", this.toEth(this.currentBalances.allocatedETH) + " eth"); + console.log(" currentBalances.Token: ", this.toEth(this.currentBalances.Token) + " tokens"); + console.log(" currentBalances.unlockedToken: ", this.toEth(this.currentBalances.unlockedToken) + " tokens"); + console.log(" currentBalances.reservedTokens: ", this.toEth(this.currentBalances.reservedTokens) + " tokens"); + } + + displayExpectedBalances() { + console.log(" address: ", this.address); + console.log(" expectedBalances.ETH: ", this.toEth(this.expectedBalances.ETH) + " eth"); + console.log(" expectedBalances.withdrawableETH:", this.toEth(this.expectedBalances.withdrawableETH) + " eth"); + console.log(" expectedBalances.Token: ", this.toEth(this.expectedBalances.Token) + " tokens"); + console.log(" expectedBalances.unlockedToken: ", this.toEth(this.expectedBalances.unlockedToken) + " tokens"); + console.log(" expectedBalances.reservedTokens: ", this.toEth(this.expectedBalances.reservedTokens) + " tokens"); + } + + /* Internal */ + + async sendValueTx(value, to) { + + /* + Maybe run a tx estimation, to make sure we can actually send value. + + const estimate = await helpers.web3Instance.eth.estimateGas({ + from: this.account, + to: to, + value: value + }); + + */ + + const gasPrice = 1000000000; // 1 gwei + const nonce = await helpers.web3Instance.eth.getTransactionCount(this.address); + + const signedSendValueTx = this.wallet.lightwallet.signing.signTx( + this.wallet.keystore, + this.properties.account.pwDerivedKey, + this.wallet.lightwallet.txutils.valueTx({ + to: to, + gasLimit: 1000000, // 1m gas + gasPrice: gasPrice, + value: value, + nonce: nonce, + }), + this.address + ); + + const txResult = await helpers.web3Instance.eth.sendSignedTransaction(signedSendValueTx); + + if(!txResult.status) { + console.log("Error sending value transaction to rICO contract."); + console.log(txResult); + process.exit(1); + } + + this.txCosts = this.txCosts.add( + new this.helpers.BN(txResult.gasUsed).mul( + new this.helpers.BN(gasPrice) + ) + ); + + } + + async sendTokenTx(amount, to) { + + console.log("sendTokenTx balance:", this.toEth(amount), to ); + + const gasPrice = 1000000000; // 1 gwei + const nonce = await helpers.web3Instance.eth.getTransactionCount(this.address); + + var abi = [{ + "constant": false, + "inputs": [ + {"name": "recipient","type": "address"}, + {"name": "amount","type": "uint256"}, + {"name": "data","type": "bytes"} + ], + "name": "send", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }]; + + const signedSendTokenTx = this.wallet.lightwallet.signing.signTx( + this.wallet.keystore, + this.properties.account.pwDerivedKey, + this.wallet.lightwallet.txutils.functionTx( + abi, + 'send', + [to, amount.toString(), null], + { + to: this.helpers.addresses.Token, + gasLimit: 500000, // 500k gas + gasPrice: gasPrice, + value: 0, + nonce: nonce, + } + ), + this.address + ); + + const txResult = await helpers.web3Instance.eth.sendSignedTransaction(signedSendTokenTx); + + if(!txResult.status) { + console.log("Error sending token transaction to rICO contract."); + console.log(txResult); + process.exit(1); + } + + this.txCosts = this.txCosts.add( + new this.helpers.BN(txResult.gasUsed).mul( + new this.helpers.BN(gasPrice) + ) + ); + + } + + // read balances from rICO and Token contract + async readBalances() { + + const ActualEthBalance = await this.helpers.utils.getBalance(this.helpers, this.address); + + this.currentBalances.ETH = ActualEthBalance.sub( + this.extraETH.sub(this.txCosts) + ); + + this.currentBalances.Token = new this.helpers.BN( await this.rICOToken.methods.balanceOf(this.address).call() ); + this.currentBalances.unlockedToken = new this.helpers.BN( await this.rICOToken.methods.getUnlockedBalance(this.address).call() ); + + const AvailableForWithdraw = await helpers.utils.getAvailableEthAndTokensForWithdraw( + this.helpers, + this.rICO, + this.address, + this.currentBalances.Token // full amount + ); + + this.currentBalances.withdrawableETH = AvailableForWithdraw.eth; + const record = await this.getParticipantRecord(); + this.currentBalances.reservedTokens = record.reservedTokens; + this.currentBalances.allocatedETH = record.allocatedETH; + + } + + // check if the expected and current balances match + async test() { + + await this.readBalances(); + // this.displayBalances(); + // this.displayExpectedBalances(); + + this.expect(this.currentBalances.ETH.toString()).to.be.equal(this.expectedBalances.ETH.toString(), 'ETH balance is not as expected.'); + this.expect(this.currentBalances.Token.toString()).to.be.equal(this.expectedBalances.Token.toString(), 'Token balance is not as expected.'); + if(this.expectedBalances.withdrawableETH.toString() !== "false") { + this.expect(this.currentBalances.withdrawableETH.toString()).to.be.equal(this.expectedBalances.withdrawableETH.toString(), 'Withdrawable ETH balance is not as expected.'); + } + this.expect(this.currentBalances.unlockedToken.toString()).to.be.equal(this.expectedBalances.unlockedToken.toString(), 'Unlocked Token balance is not as expected.'); + this.expect(this.currentBalances.reservedTokens.toString()).to.be.equal(this.expectedBalances.reservedTokens.toString(), 'Reserved Token balance is not as expected.'); + + // get last item and set to valid + const item = this.actionLog[ this.actionLog.length - 1 ]; + item.valid = true; + } + + async getParticipantRecord() { + const rec = await this.rICO.methods.participantAggregatedStats(this.address).call(); + rec.totalReceivedETH = new this.helpers.BN(rec.totalReceivedETH); + rec.returnedETH = new this.helpers.BN(rec.returnedETH); + rec.committedETH = new this.helpers.BN(rec.committedETH); + rec.withdrawnETH = new this.helpers.BN(rec.withdrawnETH); + rec.allocatedETH = new this.helpers.BN(rec.allocatedETH); + rec.reservedTokens = new this.helpers.BN(rec.reservedTokens); + rec.boughtTokens = new this.helpers.BN(rec.boughtTokens); + rec.returnedTokens = new this.helpers.BN(rec.returnedTokens); + return rec; + } + + getCurrentUnlockPercentage() { + return this.helpers.utils.getCurrentUnlockPercentage( + this.helpers, this.block, this.startAndEndBlocks.buyPhaseStartBlock, this.startAndEndBlocks.buyPhaseEndBlock, 20 + ); + } + + getLastAction() { + return this.actionLog[this.actionLog.length - 1].type; + } + + /* Getters */ + + get rICO() { + return this.properties.init.deployment.contracts.rICO; + } + + get rICOToken() { + return this.properties.init.deployment.contracts.rICOToken; + } + + get startAndEndBlocks() { + return this.properties.init.deployment.cache; + } + + get whitelister() { + return this.properties.init.deployment.whitelister; + } +} + +module.exports = Participant; diff --git a/test/solc_random_tests/project.js b/test/solc_random_tests/project.js new file mode 100644 index 0000000..913530a --- /dev/null +++ b/test/solc_random_tests/project.js @@ -0,0 +1,221 @@ +/* + * The test project class. + * + * @author Fabian Vogelsteller <@frozeman>, Micky Socaci +*/ + +const helpers = setup.helpers; +const BN = helpers.BN; +const MAX_UINT256 = helpers.MAX_UINT256; +const expect = helpers.expect + +const Actor = require("./actorBase.js"); + +class Project extends Actor { + + constructor(init, contract, address) { + super(); + + this.init = init; + this.helpers = init.setup.helpers; + this.contract = contract; + this.address = address; + this.expect = this.init.helpers.expect; + this.txCosts = new this.helpers.BN(0); + + this.actionLog = []; + + this.currentBalances = { + ETH: new this.helpers.BN("0"), + withdrawableETH: new this.helpers.BN("0"), + }; + + this.expectedBalances = { + ETH: new this.helpers.BN("0"), + withdrawableETH: new this.helpers.BN("0"), + }; + } + + async withdrawFullAmount() { + await this.readBalances(); + const amount = this.currentBalances.withdrawableETH + this.actionLog.push( { type:"withdrawHalf", "value": amount, valid: null } ); + await this.withdraw( amount ); + } + + async withdrawHalf() { + await this.readBalances(); + const amount = this.currentBalances.withdrawableETH.divRound( new this.helpers.BN(2) ); + this.actionLog.push( { type:"withdrawHalf", "value": amount, valid: null } ); + await this.withdraw( amount ); + } + + async withdraw(amount) { + + console.log("withdraw:", this.toEth(amount) + " eth"); + + // await this.readBalances(); + // console.log(" > currentBalances.ETH: ", this.toEth(this.currentBalances.ETH) + " eth"); + // console.log(" > currentBalances.withdrawableETH: ", this.toEth(this.currentBalances.withdrawableETH) + " eth"); + + const gasPrice = 1000000000; // 1 gwei + + const txResult = await this.contract.methods.projectWithdraw(amount.toString()).send({ + from: this.address, + gasLimit: 500000, // 500k gas + gasPrice: gasPrice, + }); + + const gasCost = new this.helpers.BN(txResult.gasUsed).mul( + new this.helpers.BN(gasPrice) + ) + + this.expectedBalances.ETH = this.currentBalances.ETH.add( + amount.sub(gasCost) + ); + this.expectedBalances.withdrawableETH = this.currentBalances.withdrawableETH.sub(amount); + + // console.log(" > expectedBalances.ETH: ", this.toEth(this.expectedBalances.ETH) + " eth"); + // console.log(" > expectedBalances.withdrawableETH: ", this.toEth(this.expectedBalances.withdrawableETH) + " eth"); + + } + + async getAvailableActions() { + let actions = []; + + const getProjectAvailableEth = new this.helpers.BN( await this.contract.methods.getProjectAvailableEth().call() ); + if(getProjectAvailableEth.gt( new this.helpers.BN("0") )) { + actions.push("withdrawFullAmount"); + actions.push("withdrawHalf"); + } + + return actions; + } + + async getAvailableActionsWithNone() { + return ["nothing", ...await this.getAvailableActions()]; + } + + async executeRandomActionOrNone(callback = null) { + const availableActions = await this.getAvailableActionsWithNone(); + const rand = Math.floor( Math.random() * availableActions.length ); + await this.executeAction(availableActions[rand], callback); + } + + async executeAction(action, callback = null) { + const availableActions = await this.getAvailableActionsWithNone(); + console.log("Project Wallet", "Executing:", action, " / Available:", availableActions); + + // action execution + switch(action) { + case "withdrawFullAmount": + await this.withdrawFullAmount(); + break; + case "withdrawHalf": + await this.withdrawHalf(); + break; + case "nothing": + this.actionLog.push( { type:"nothing", "value": null, valid: null } ); + break; + default: + throw("error at executeRandomActionOrNone: action[" + action + "] not found."); + } + + if(callback) { + await callback(); + } + + if(action !== "nothing") { + await this.test(); + } + } + + // check if the expected and current balances match + async test() { + await this.readBalances(); + expect(this.currentBalances.ETH.toString()).to.be.equal(this.expectedBalances.ETH.toString(), 'ETH balance is not as expected.'); + expect(this.currentBalances.withdrawableETH.toString()).to.be.equal(this.expectedBalances.withdrawableETH.toString(), 'Withdrawable ETH is not as expected.'); + + // get last item and set to valid + const item = this.actionLog[ this.actionLog.length - 1 ]; + item.valid = true; + + } + + // read balances from rICO and Token contract + async readBalances() { + const getProjectAvailableEth = await this.contract.methods.getProjectAvailableEth().call() + this.currentBalances.ETH = await this.helpers.utils.getBalance(this.helpers, this.address); + this.currentBalances.withdrawableETH = new this.helpers.BN( getProjectAvailableEth ); + } + + displayBalances() { + console.log(" address: ", this.address); + console.log(" currentBalances.ETH: ", this.toEth(this.currentBalances.ETH) + " eth"); + console.log(" currentBalances.withdrawableETH: ", this.toEth(this.currentBalances.withdrawableETH) + " eth"); + } + + getLastAction() { + return this.actionLog[this.actionLog.length - 1].type; + } + +} + +module.exports = Project; + + + +/* +class Project extends Actor { + // set the defaults + constructor() { + + this.currentBalances = { + ETH: 0, + widthdrawCount: 0 + } + + this.expectedBalances = { + ETH: ETH, + widthdrawCount: 0 + } + } + + // withdraw ETH from the rICO contract + withdraw(ETH) { + + } + + // white list any number of addresses + whitelist(addresses) { + + } + + test() { + this.readBalances(); + this.recalculateExpectedBalances(); + + this.sanityCheck(); + } + + // read balances from rICO and Token contract + readBalances() { + + // set all values new + // this.currentBalances.ETH = ...; + // ... + } + + // recalculate expected balances + recalculateExpectedBalances() { + // ... + // this.expectedBalances.ETH = ...; + } + + // check if the expected and current balances match + sanityCheck() { + expect(this.expectedBalances.ETH).to.be.equal(this.currentBalances.ETH, 'ETH balance is not as expected.'); + expect(this.expectedBalances.widthdrawCount).to.be.equal(this.currentBalances.widthdrawCount, 'Widthdraw Count is not as expected.'); + } +} +*/ \ No newline at end of file diff --git a/test/solc_random_tests/random-tests.js b/test/solc_random_tests/random-tests.js new file mode 100644 index 0000000..fa136b2 --- /dev/null +++ b/test/solc_random_tests/random-tests.js @@ -0,0 +1,238 @@ +/* + * The test project class. + * + * @author Fabian Vogelsteller <@frozeman>, Micky Socaci +*/ + +const deployer = require("./deployer.js"); +const whitelister = require("./whitelister.js"); +const project = require("./project.js"); + +module.exports = { + async run (init) { + + const helpers = init.helpers; + const numberOfParticipants = 4; + // allocate 1 extra eth to each participant + const participantTxBalance = init.helpers.solidity.etherBN; + const rICOSettings = { + + ContractsDeployer: init.accounts[2], + whitelistControllerAddress: init.accounts[3], + projectWalletAddress: init.accounts[4], + + blocksPerDay: 5, // 6450; + commitPhaseDays: 4, // 22; + StageDays: 2, // 30; + }; + + helpers.utils.toLog( + " ----------------------------------------------------------------\n" + + " Step 2 - Initialize Participants \n" + + " ----------------------------------------------------------------" + ); + + init.deployment = { + addresses: { + ContractsDeployer: null, + whitelistControllerAddress: null, + projectWalletAddress: null, + }, + contracts: { + rICOToken: null, + rICO: null, + }, + whitelister: null, + project: null, + }; + + const participants = await deployer.createParticipants(init, numberOfParticipants, participantTxBalance); + + // console.log(participants); + + helpers.utils.toLog( + " ----------------------------------------------------------------\n" + + " Step 3 - Run Deployment \n" + + " ----------------------------------------------------------------" + ); + const deployment = await deployer.run(init, rICOSettings); + init.deployment = deployment; + + // contract instances + const rICOToken = deployment.contracts.rICOToken; + const rICO = deployment.contracts.rICO; + + // contract addresses + const addresses = deployment.addresses; + + const commitPhaseStartBlock = parseInt(await rICO.methods.commitPhaseStartBlock().call(), 10); + const commitPhaseEndBlock = parseInt(await rICO.methods.commitPhaseEndBlock().call(), 10); + const buyPhaseStartBlock = parseInt(await rICO.methods.buyPhaseStartBlock().call(), 10); + const buyPhaseEndBlock = parseInt(await rICO.methods.buyPhaseEndBlock().call(), 10); + const rICOBlockLength = buyPhaseEndBlock - commitPhaseStartBlock; + + console.log(" rICO Settings"); + console.log(" commitPhaseStartBlock:", commitPhaseStartBlock); + console.log(" commitPhaseEndBlock: ", commitPhaseEndBlock); + console.log(" buyPhaseStartBlock: ", buyPhaseStartBlock); + console.log(" buyPhaseDuration: ", (buyPhaseEndBlock - buyPhaseStartBlock + 1)); + console.log(" buyPhaseEndBlock: ", buyPhaseEndBlock); + console.log(""); + console.log(" rICO block length:", rICOBlockLength); + + const Whitelister = new whitelister(init, rICO, rICOSettings.whitelistControllerAddress); + init.deployment.whitelister = Whitelister; + console.log(" Whitelister:", Whitelister.address); + + const Project = new project(init, rICO, rICOSettings.projectWalletAddress); + init.deployment.project = Project; + console.log(" ProjectWallet:", Project.address); + + + helpers.utils.toLog( + " ----------------------------------------------------------------\n" + + " Step 4 - Run Tests \n" + + " ----------------------------------------------------------------" + ); + + // jump to allocation block + await helpers.utils.jumpToContractStage ( rICO, deployment.addresses.ContractsDeployer, 0 ); + + // record actions so we can reply the full scenario + const action_log = []; + + // randomise actions of actors and call `test()` on each actor after each action + + let lastAction; + + try { + for(let i = 0; i < rICOBlockLength + 1; i++) { + + // block relative to rICO start. + let block = commitPhaseStartBlock + i; + action_log.push({ "type": "block", "block": block } ); + await setBlock(block, rICO, deployment, helpers); + + // Loop participants and execute a random action. + for( let j = 0; j < participants.length; j++) { + participants[j].setBlock(block); + lastAction = function(){ + action_log.push({ "type": "participant", "id": j, "address": participants[j].address, "action": participants[j].getLastAction()} ); + } + await participants[j].executeRandomActionOrNone(lastAction); + } + lastAction = function(){ + action_log.push({ "type": "project", "action": Project.getLastAction()} ); + } + await Project.executeRandomActionOrNone(lastAction); + } + } catch(e) { + + lastAction(); + + console.log("Error:", e); + console.log(` + // ---------------------------------------------------------------------------------------- + // replay code start + // + let block; +`); + + for(let i = 0; i < action_log.length; i++) { + const currentLog = action_log[i]; + + // console.log("action_log.type", currentLog.type); + if(currentLog.type === "block") { + console.log(` block = `+currentLog.block+`; + await setBlock(block, rICO, deployment, helpers); +`); + + } else if(currentLog.type === "participant") { + // participants[j].setBlock(block); + console.log(` participants[` + currentLog.id + `].setBlock(block); + await participants[` + currentLog.id + `].executeAction('` + currentLog.action + `'); + `); + + } else if(currentLog.type === "project") { + console.log(` await Project.executeAction('`+currentLog.action+`'); +`); + + } + + } + + console.log(` /* + ` + e + ` + */ + `); + + console.log(` + // replay code end + // ---------------------------------------------------------------------------------------- +`); + + process.exit(1); + } + + // console.log(""); + // console.log("Project Wallet statistics:"); + + // Project.displayBalances(); + // await Project.withdrawFullAmount(); + // Project.displayBalances(); + + // console.log(""); + // console.log("Run summary:"); + // console.log("Participants:", participants.length); + + } +} + +async function setBlock(block, rICO, deployment, helpers) { + await rICO.methods.jumpToBlockNumber(block).send({from: deployment.addresses.ContractsDeployer, gas: 100000}); + const currentStage = await rICO.methods.getCurrentStage().call(); + const currentAvailableEthForPurchase = await rICO.methods.availableEthAtStage(currentStage).call(); + + console.log( + "#### ", + "block:", block, + "stage:", currentStage, + "eth:", helpers.utils.toEth(helpers, currentAvailableEthForPurchase) + " eth", + ); +} + + +async function display(rICO, helpers, Project) { + + committedETH = new helpers.BN( await rICO.methods.committedETH().call() ); + withdrawnETH = new helpers.BN( await rICO.methods.withdrawnETH().call() ); + projectAllocatedETH = new helpers.BN( await rICO.methods.projectAllocatedETH().call() ); + projectWithdrawnETH = new helpers.BN( await rICO.methods.projectWithdrawnETH().call() ); + buyPhaseStartBlock = await rICO.methods.buyPhaseStartBlock().call(); + buyPhaseEndBlock = await rICO.methods.buyPhaseEndBlock().call(); + _currentBlock = await rICO.methods.getCurrentBlockNumber().call(); + + + const globalAvailable = committedETH + .sub(withdrawnETH) + .sub(projectAllocatedETH); + + const unlocked = globalAvailable.mul( + helpers.utils.getCurrentUnlockPercentage( + helpers, + _currentBlock, + buyPhaseStartBlock, + buyPhaseEndBlock, + 20 + ) + ).div( + new helpers.BN("10").pow( new helpers.BN("20")) + ); + + const result = unlocked.add(projectAllocatedETH).sub(projectWithdrawnETH); + const getProjectAvailableEth = await rICO.methods.getProjectAvailableEth().call() + + console.log(" > getProjectAvailableEth: calc ", Project.toEth(result) + " eth"); + console.log(" > getProjectAvailableEth: unlocked ", Project.toEth(new helpers.BN( getProjectAvailableEth )) + " eth"); + +} \ No newline at end of file diff --git a/test/solc_random_tests/whitelister.js b/test/solc_random_tests/whitelister.js new file mode 100644 index 0000000..5cdd7a8 --- /dev/null +++ b/test/solc_random_tests/whitelister.js @@ -0,0 +1,31 @@ +/* + * The deployer + * + * @author Fabian Vogelsteller <@frozeman>, Micky Socaci +*/ + +class Whitelister { + + constructor(init, contract, address) { + this.init = init; + this.contract = contract; + this.address = address; + this.expect = this.init.helpers.expect; + } + + async approve(address) { + await this.callWhitelistMethod(address, true); + this.expect( await this.contract.methods.isWhitelisted(address).call(), true, "Address should be whitelisted."); + } + + async reject(address) { + await this.callWhitelistMethod(address, false); + this.expect( await this.contract.methods.isWhitelisted(address).call(), false, "Address should not be whitelisted."); + } + + async callWhitelistMethod(address, mode) { + return await this.contract.methods.whitelist([address], mode).send({ from: this.address }); + } +} + +module.exports = Whitelister; \ No newline at end of file diff --git a/test/solc_tests/10_ProjectWithdraw.js b/test/solc_tests/10_ProjectWithdraw.js new file mode 100644 index 0000000..b784eb2 --- /dev/null +++ b/test/solc_tests/10_ProjectWithdraw.js @@ -0,0 +1,960 @@ +const helpers = setup.helpers; +const BN = helpers.BN; +const MAX_UINT256 = helpers.MAX_UINT256; +const expect = helpers.expect + +const holder = accounts[10]; +const projectWalletAddress = holder; +const participant_1 = accounts[4]; +const participant_2 = accounts[5]; +const participant_3 = accounts[6]; +const participant_4 = accounts[7]; +const participant_5 = accounts[8]; +const participant_6 = accounts[9]; + +const RicoSaleSupply = setup.settings.token.sale.toString(); +const blocksPerDay = 5; // 6450; +const commitPhaseDays = 4; // 22; +const StageDays = 2; // 30; + + +const ApplicationEventTypes = { + NOT_SET:0, // will match default value of a mapping result + CONTRIBUTION_NEW:1, + CONTRIBUTION_CANCEL:2, + PARTICIPANT_CANCEL:3, + COMMITMENT_ACCEPTED:4, + WHITELIST_APPROVE:5, + WHITELIST_REJECT:6, + PROJECT_WITHDRAW:7 +} + +const TransferTypes = { + NOT_SET:0, + AUTOMATIC_RETURN:1, + WHITELIST_REJECT:2, + PARTICIPANT_CANCEL:3, + PARTICIPANT_WITHDRAW:4, + PROJECT_WITHDRAW:5 +} + + +const ERC777data = web3.utils.sha3('777TestData'); +const defaultOperators = []; // accounts[0] maybe +const data = web3.utils.sha3('OZ777TestData'); +const operatorData = web3.utils.sha3('OZ777TestOperatorData'); +const anyone = '0x0000000000000000000000000000000000000001'; + +let errorMessage; + +let SnapShotKey = "FlowTestInit"; +let snapshotsEnabled = true; +let snapshots = []; + +const deployerAddress = accounts[0]; +const whitelistControllerAddress = accounts[1]; + +let TokenContractAddress, ReversibleICOAddress, stageValidation = [], currentBlock, + commitPhaseStartBlock, commitPhaseBlockCount, commitPhasePrice, commitPhaseEndBlock, StageCount, + StageBlockCount, StagePriceIncrease, BuyPhaseEndBlock, TokenContractInstance, + TokenContractReceipt, ReversibleICOInstance, ReversibleICOReceipt; + +// clean these up +let buyPhaseStartBlock, buyPhaseEndBlock; + +async function revertToFreshDeployment() { + + // test requires ERC1820.instance + if (helpers.ERC1820.instance == false) { + console.log(" Error: ERC1820.instance not found, please make sure to run it first."); + process.exit(); + } + + if (typeof snapshots[SnapShotKey] !== "undefined" && snapshotsEnabled) { + // restore snapshot + await helpers.web3.evm.revert(snapshots[SnapShotKey]); + + // save again because whomever wrote test rpc had the impression no one would ever restore twice.. dafuq + snapshots[SnapShotKey] = await helpers.web3.evm.snapshot(); + + // reset account nonces.. + helpers.utils.resetAccountNonceCache(helpers); + } else { + + /* + * Deploy Token Contract + */ + TokenContractInstance = await helpers.utils.deployNewContractInstance( + helpers, "RicoToken", { + from: holder, + arguments: [ + setup.settings.token.supply.toString(), + defaultOperators + ], + gas: 6500000, + gasPrice: helpers.solidity.gwei * 10 + } + ); + TokenContractReceipt = TokenContractInstance.receipt; + TokenContractAddress = TokenContractInstance.receipt.contractAddress; + console.log(" TOKEN Gas used for deployment:", TokenContractInstance.receipt.gasUsed); + console.log(" Contract Address:", TokenContractAddress); + + /* + * Deploy RICO Contract + */ + ReversibleICOInstance = await helpers.utils.deployNewContractInstance(helpers, "ReversibleICOMock"); + ReversibleICOReceipt = ReversibleICOInstance.receipt; + ReversibleICOAddress = ReversibleICOInstance.receipt.contractAddress; + // helpers.addresses.Rico = ReversibleICOAddress; + + console.log(" RICO Gas used for deployment: ", ReversibleICOInstance.receipt.gasUsed); + console.log(" Contract Address:", ReversibleICOAddress); + console.log(""); + + await TokenContractInstance.methods.setup( + ReversibleICOAddress + ).send({ + from: holder, // initial token supply holder + }); + + + + /* + * Add RICO Settings + */ + currentBlock = await ReversibleICOInstance.methods.getCurrentBlockNumber().call(); + + // starts in one day + commitPhaseStartBlock = parseInt(currentBlock, 10) + blocksPerDay * 1; + + // 22 days allocation + commitPhaseBlockCount = blocksPerDay * commitPhaseDays; // 22 + commitPhasePrice = helpers.solidity.ether * 0.002; + + // 12 x 30 day periods for distribution + StageCount = 12; + StageBlockCount = blocksPerDay * StageDays; // 30 + StagePriceIncrease = helpers.solidity.ether * 0.0001; + commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount - 1; + + BuyPhaseEndBlock = commitPhaseEndBlock + ( (StageBlockCount + 1) * StageCount ); + + await ReversibleICOInstance.methods.init( + TokenContractAddress, // address _TokenContractAddress + whitelistControllerAddress, // address _whitelistControllerAddress + projectWalletAddress, // address _projectWalletAddress + commitPhaseStartBlock, // uint256 _StartBlock + commitPhaseBlockCount, // uint256 _commitPhaseBlockCount, + commitPhasePrice, // uint256 _commitPhasePrice in wei + StageCount, // uint8 _StageCount + StageBlockCount, // uint256 _StageBlockCount + StagePriceIncrease // uint256 _StagePriceIncrease in wei + ).send({ + from: deployerAddress, // deployer + gas: 3000000 + }); + + + buyPhaseStartBlock = parseInt(await ReversibleICOInstance.methods.buyPhaseStartBlock().call(), 10); + buyPhaseEndBlock = parseInt(await ReversibleICOInstance.methods.buyPhaseEndBlock().call(), 10); + + // transfer tokens to rico + await TokenContractInstance.methods.send( + ReversibleICOInstance.receipt.contractAddress, + RicoSaleSupply, + ERC777data + ).send({ + from: holder, // initial token supply holder + gas: 100000 + }); + + expect( + await TokenContractInstance.methods.balanceOf(ReversibleICOAddress).call() + ).to.be.equal(RicoSaleSupply.toString()); + + // create snapshot + if (snapshotsEnabled) { + snapshots[SnapShotKey] = await helpers.web3.evm.snapshot(); + } + } + + // reinitialize instances so revert works properly. + TokenContractInstance = await helpers.utils.getContractInstance(helpers, "RicoToken", TokenContractAddress); + TokenContractInstance.receipt = TokenContractReceipt; + ReversibleICOInstance = await helpers.utils.getContractInstance(helpers, "ReversibleICOMock", ReversibleICOAddress); + ReversibleICOInstance.receipt = ReversibleICOReceipt; + + // do some validation + expect( + await helpers.utils.getBalance(helpers, ReversibleICOAddress) + ).to.be.bignumber.equal( new BN(0) ); + + expect( + await TokenContractInstance.methods.balanceOf(ReversibleICOAddress).call() + ).to.be.equal(RicoSaleSupply.toString()); + + expect( + await ReversibleICOInstance.methods.tokenSupply().call() + ).to.be.equal( + await TokenContractInstance.methods.balanceOf(ReversibleICOAddress).call() + ); +}; + +async function commitFundsFromAddress(address, amount) { + + return await helpers.web3Instance.eth.sendTransaction({ + from: address, + to: ReversibleICOInstance.receipt.contractAddress, + value: amount.toString(), + gasPrice: helpers.networkConfig.gasPrice + }); +} + +async function whitelist(address) { + + return await ReversibleICOInstance.methods.whitelist( + [address], + true, + ).send({ + from: whitelistControllerAddress + }); +} + +describe("ProjectWithdraw Testing", function () { + + before(async function () { + await revertToFreshDeployment(); + }); + + describe("getProjectAvailableEth()", function () { + + const ContributionAmount = new BN("100").mul( helpers.solidity.etherBN ); + + describe("Scenario: One 100 ETH NOT whitelisted contribution in contract (Participant1)", async function () { + + before(async () => { + + await revertToFreshDeployment(); + + currentBlock = await helpers.utils.jumpToContractStage (ReversibleICOInstance, deployerAddress, 0); + + await commitFundsFromAddress(participant_1, ContributionAmount); + // await whitelist(participant_1); + + currentBlock = await helpers.utils.jumpToContractStage (ReversibleICOInstance, deployerAddress, 1, false, 1); + helpers.utils.resetAccountNonceCache(helpers); + + }); + + describe("- contract in commit phase ( stage 0 - last block )", async function () { + + before(async () => { + const stage = 0; + currentBlock = await helpers.utils.jumpToContractStage (ReversibleICOInstance, deployerAddress, stage, true, 0); + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 0 (since project cannot withdraw at this point)", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect(ProjectAvailableEth.toString()).to.equal("0"); + }); + + }); + + describe("- contract at 50% of the buy phase", async function () { + + before(async () => { + const middleBlock = buyPhaseStartBlock + Math.floor((buyPhaseEndBlock - buyPhaseStartBlock) / 2); + await ReversibleICOInstance.methods.jumpToBlockNumber(middleBlock).send({ + from: deployerAddress, gas: 100000 + }); + + currentBlock = middleBlock; + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 0 (since contribution is not whitelisted)", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + "0" + ); + }); + }); + + describe("- contract after end of rICO", async function () { + + before(async () => { + await ReversibleICOInstance.methods.jumpToBlockNumber(buyPhaseEndBlock).send({ + from: deployerAddress, gas: 100000 + }); + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 0 (since contribution is not whitelisted)", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + "0" + ); + }); + + }); + + }); + + describe("Scenario: One 100 ETH whitelisted contribution in contract (Participant1)", async function () { + + before(async () => { + + await revertToFreshDeployment(); + + currentBlock = await helpers.utils.jumpToContractStage (ReversibleICOInstance, deployerAddress, 0); + + await commitFundsFromAddress(participant_1, ContributionAmount); + await whitelist(participant_1); + + currentBlock = await helpers.utils.jumpToContractStage (ReversibleICOInstance, deployerAddress, 1, false, 1); + helpers.utils.resetAccountNonceCache(helpers); + + }); + + describe("- contract in commit phase ( stage 0 - last block )", async function () { + + before(async () => { + const stage = 0; + currentBlock = await helpers.utils.jumpToContractStage (ReversibleICOInstance, deployerAddress, stage, true, 0); + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 0 (since project cannot withdraw at this point)", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect(ProjectAvailableEth.toString()).to.equal("0"); + }); + + }); + + describe("- contract at 50% of the buy phase", async function () { + + before(async () => { + const middleBlock = buyPhaseStartBlock + Math.floor((buyPhaseEndBlock - buyPhaseStartBlock) / 2); + await ReversibleICOInstance.methods.jumpToBlockNumber(middleBlock).send({ + from: deployerAddress, gas: 100000 + }); + + currentBlock = middleBlock; + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 50 eth (project gets 50%)", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + new BN("50").mul( helpers.solidity.etherBN ).toString() + ); + }); + + }); + + + describe("- contract after end of rICO", async function () { + + before(async () => { + await ReversibleICOInstance.methods.jumpToBlockNumber(buyPhaseEndBlock).send({ + from: deployerAddress, gas: 100000 + }); + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 100 eth (project gets 100%)", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + ContributionAmount.toString() + ); + }); + + }); + + }); + + + describe("Scenario: One 100 ETH whitelisted contribution in contract (Participant1), Second 100 ETH contribution at middle block (Participant2)", async function () { + + before(async () => { + + await revertToFreshDeployment(); + + currentBlock = await helpers.utils.jumpToContractStage (ReversibleICOInstance, deployerAddress, 0); + + // contribution 1 + await commitFundsFromAddress(participant_1, ContributionAmount); + await whitelist(participant_1); + + // jump to middle block + const middleBlock = buyPhaseStartBlock + Math.floor((buyPhaseEndBlock - buyPhaseStartBlock) / 2); + await ReversibleICOInstance.methods.jumpToBlockNumber(middleBlock).send({ + from: deployerAddress, gas: 100000 + }); + + // contribution 2 + await commitFundsFromAddress(participant_2, ContributionAmount); + await whitelist(participant_2); + + currentBlock = middleBlock; + helpers.utils.resetAccountNonceCache(helpers); + + }); + + describe("- contract at 50% of the buy phase", async function () { + + it("returns 100 eth ( half of both contributions )", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + new BN("100").mul( helpers.solidity.etherBN ).toString() + ); + }); + + }); + + describe("- contract after end of rICO", async function () { + + before(async () => { + await ReversibleICOInstance.methods.jumpToBlockNumber(buyPhaseEndBlock).send({ + from: deployerAddress, gas: 100000 + }); + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 200 eth", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + new BN("200").mul( helpers.solidity.etherBN ).toString() + ); + }); + + }); + + }); + + describe("Scenario: One contribution at stage 0, project withdraw at middle", async function () { + + before(async () => { + + await revertToFreshDeployment(); + + currentBlock = await helpers.utils.jumpToContractStage (ReversibleICOInstance, deployerAddress, 0); + + // contribution 1 + await commitFundsFromAddress(participant_1, ContributionAmount); + await whitelist(participant_1); + + // jump to middle block + const middleBlock = buyPhaseStartBlock + Math.floor((buyPhaseEndBlock - buyPhaseStartBlock) / 2); + await ReversibleICOInstance.methods.jumpToBlockNumber(middleBlock).send({ + from: deployerAddress, gas: 100000 + }); + + // project withdraw + const AvailableForWithdraw = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + await ReversibleICOInstance.methods.projectWithdraw( + AvailableForWithdraw.toString() + ).send({ + from: projectWalletAddress + }); + + currentBlock = middleBlock; + helpers.utils.resetAccountNonceCache(helpers); + + }); + + describe("- contract at 50% of the buy phase", async function () { + + it("returns 0 (project withdrew the 50 that were available)", async function () { + + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal("0"); + }); + + }); + + describe("- contract at 75% of the buy phase", async function () { + + before(async () => { + const ThreeFourthsTheWayThere = buyPhaseStartBlock + Math.floor(((buyPhaseEndBlock - buyPhaseStartBlock) / 4) * 3); + await ReversibleICOInstance.methods.jumpToBlockNumber(ThreeFourthsTheWayThere).send({ + from: deployerAddress, gas: 100000 + }); + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 25 (project already withdrew the 50 that were available at middle)", async function () { + + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + new BN("25").mul( helpers.solidity.etherBN ).toString() + ); + }); + + }); + + describe("- contract after end of rICO", async function () { + + before(async () => { + await ReversibleICOInstance.methods.jumpToBlockNumber(buyPhaseEndBlock).send({ + from: deployerAddress, gas: 100000 + }); + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 50 eth ( that was remaining in contract )", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + new BN("50").mul( helpers.solidity.etherBN ).toString() + ); + }); + + }); + + }); + + + + describe("Scenario: One contribution at stage 0 (Participant1), contract at buy phase 50%, full token balance returned ( token withdraw )", async function () { + + before(async () => { + + await revertToFreshDeployment(); + + currentBlock = await helpers.utils.jumpToContractStage (ReversibleICOInstance, deployerAddress, 0); + + // contribution 1 + await commitFundsFromAddress(participant_1, ContributionAmount); + await whitelist(participant_1); + + // jump to middle block + const middleBlock = buyPhaseStartBlock + Math.floor((buyPhaseEndBlock - buyPhaseStartBlock) / 2); + await ReversibleICOInstance.methods.jumpToBlockNumber(middleBlock).send({ + from: deployerAddress, gas: 100000 + }); + + const ReturnTokenAmount = new BN( + await TokenContractInstance.methods.balanceOf(participant_1).call() + ); + + // send full token balance back to rico + await TokenContractInstance.methods.send( + ReversibleICOInstance.receipt.contractAddress, + ReturnTokenAmount.toString(), + ERC777data + ).send({ + from: participant_1, + gas: 1000000, + gasPrice: helpers.networkConfig.gasPrice + }); + + currentBlock = middleBlock; + helpers.utils.resetAccountNonceCache(helpers); + + }); + + + describe("- contract at 50% of the buy phase", async function () { + + it("returns 50 eth ( allocated by withdraw )", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + new BN("50").mul( helpers.solidity.etherBN ).toString() + ); + }); + + }); + + describe("- contract after end of rICO", async function () { + + before(async () => { + await ReversibleICOInstance.methods.jumpToBlockNumber(buyPhaseEndBlock).send({ + from: deployerAddress, gas: 100000 + }); + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 50 eth", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + new BN("50").mul( helpers.solidity.etherBN ).toString() + ); + }); + + }); + + }); + + + + describe("Scenario: One contribution at stage 0 (Participant1), contract at buy phase 50%, full token balance returned ( token withdraw ), project withdraw", async function () { + + let projectWalletBalanceBefore, projectWalletBalanceAfter, projectWithdrawTx; + + before(async () => { + + await revertToFreshDeployment(); + + currentBlock = await helpers.utils.jumpToContractStage (ReversibleICOInstance, deployerAddress, 0); + + // contribution 1 + await commitFundsFromAddress(participant_1, ContributionAmount); + await whitelist(participant_1); + + // jump to middle block + const middleBlock = buyPhaseStartBlock + Math.floor((buyPhaseEndBlock - buyPhaseStartBlock) / 2); + await ReversibleICOInstance.methods.jumpToBlockNumber(middleBlock).send({ + from: deployerAddress, gas: 100000 + }); + + const ReturnTokenAmount = new BN( + await TokenContractInstance.methods.balanceOf(participant_1).call() + ); + + // send full token balance back to rico + await TokenContractInstance.methods.send( + ReversibleICOInstance.receipt.contractAddress, + ReturnTokenAmount.toString(), + ERC777data + ).send({ + from: participant_1, + gas: 1000000, + gasPrice: helpers.networkConfig.gasPrice + }); + + projectWalletBalanceBefore = await helpers.utils.getBalance(helpers, projectWalletAddress); + + // project withdraw + const AvailableForWithdraw = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + projectWithdrawTx = await ReversibleICOInstance.methods.projectWithdraw( + AvailableForWithdraw.toString() + ).send({ + from: projectWalletAddress, + gasPrice: helpers.networkConfig.gasPrice.toString() + }); + + projectWalletBalanceAfter = await helpers.utils.getBalance(helpers, projectWalletAddress); + + currentBlock = middleBlock; + helpers.utils.resetAccountNonceCache(helpers); + + }); + + + describe("- contract at 50% of the buy phase", async function () { + + it("returns 0 eth ( since balance was already withdrawn )", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + "0" + ); + }); + + it("projectWallet balance increased by 50 ETH", async function () { + + let projectWithdrawTxGasCost = new BN(projectWithdrawTx.gasUsed).mul( + new BN( helpers.networkConfig.gasPrice.toString() ) + ); + + const projectWalletBalanceValidation = projectWalletBalanceBefore + // subtract project withdraw tx cost + .sub(projectWithdrawTxGasCost) + // add how much eth we're expecting to withdraw + .add(new BN("50").mul( helpers.solidity.etherBN )) + + expect( + projectWalletBalanceAfter.toString() + ).to.equal( + projectWalletBalanceValidation.toString() + ); + }); + + }); + + describe("- contract after end of rICO", async function () { + + before(async () => { + await ReversibleICOInstance.methods.jumpToBlockNumber(buyPhaseEndBlock).send({ + from: deployerAddress, gas: 100000 + }); + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 0 eth ( since balance was already withdrawn )", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + "0" + ); + }); + }); + }); + + + describe("Scenario: One 100 ETH contribution at stage 0 (Participant1), project withdraw at middle, then new 100 ETH contribution (Participant2)", async function () { + + before(async () => { + + await revertToFreshDeployment(); + + currentBlock = await helpers.utils.jumpToContractStage (ReversibleICOInstance, deployerAddress, 0); + + // contribution 1 + await commitFundsFromAddress(participant_1, ContributionAmount); + await whitelist(participant_1); + + // jump to middle block + const middleBlock = buyPhaseStartBlock + Math.floor((buyPhaseEndBlock - buyPhaseStartBlock) / 2); + await ReversibleICOInstance.methods.jumpToBlockNumber(middleBlock).send({ + from: deployerAddress, gas: 100000 + }); + + // project withdraw + const AvailableForWithdraw = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + await ReversibleICOInstance.methods.projectWithdraw( + AvailableForWithdraw.toString() + ).send({ + from: projectWalletAddress + }); + + // contribution 2 + await commitFundsFromAddress(participant_2, ContributionAmount); + await whitelist(participant_2); + + currentBlock = middleBlock; + helpers.utils.resetAccountNonceCache(helpers); + + }); + + + describe("- contract at 50% of the buy phase", async function () { + + it("returns 50 eth ( 0 from first, half of the second contribution )", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + new BN("50").mul( helpers.solidity.etherBN ).toString() + ); + }); + + }); + + + describe("- contract at 75% of the buy phase", async function () { + + before(async () => { + const ThreeFourthsTheWayThere = buyPhaseStartBlock + Math.floor(((buyPhaseEndBlock - buyPhaseStartBlock) / 4) * 3); + await ReversibleICOInstance.methods.jumpToBlockNumber(ThreeFourthsTheWayThere).send({ + from: deployerAddress, gas: 100000 + }); + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 100 eth ( 25 from first, 75 from second )", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + new BN("100").mul( helpers.solidity.etherBN ).toString() + ); + }); + + }); + + describe("- contract after end of rICO", async function () { + + before(async () => { + await ReversibleICOInstance.methods.jumpToBlockNumber(buyPhaseEndBlock).send({ + from: deployerAddress, gas: 100000 + }); + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 150 eth ( 50 from first, 100 from second )", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + new BN("150").mul( helpers.solidity.etherBN ).toString() + ); + }); + + }); + + }); + + describe("Scenario: One 100 ETH contribution at stage 0 (Participant1), project withdraw HALF available at middle, then new 100 ETH contribution (Participant2)", async function () { + + before(async () => { + + await revertToFreshDeployment(); + + currentBlock = await helpers.utils.jumpToContractStage (ReversibleICOInstance, deployerAddress, 0); + + // contribution 1 + await commitFundsFromAddress(participant_1, ContributionAmount); + await whitelist(participant_1); + + // jump to middle block + const middleBlock = buyPhaseStartBlock + Math.floor((buyPhaseEndBlock - buyPhaseStartBlock) / 2); + await ReversibleICOInstance.methods.jumpToBlockNumber(middleBlock).send({ + from: deployerAddress, gas: 100000 + }); + + // project withdraw + const AvailableForWithdraw = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + await ReversibleICOInstance.methods.projectWithdraw( + AvailableForWithdraw.div(new BN("2")).toString() + ).send({ + from: projectWalletAddress + }); + + // contribution 2 + await commitFundsFromAddress(participant_2, ContributionAmount); + await whitelist(participant_2); + + currentBlock = middleBlock; + helpers.utils.resetAccountNonceCache(helpers); + + }); + + + describe("- contract at 50% of the buy phase", async function () { + + it("returns 75 eth ( 25 from first, half of the second contribution )", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + new BN("75").mul( helpers.solidity.etherBN ).toString() + ); + }); + + }); + + + describe("- contract at 75% of the buy phase", async function () { + + before(async () => { + const ThreeFourthsTheWayThere = buyPhaseStartBlock + Math.floor(((buyPhaseEndBlock - buyPhaseStartBlock) / 4) * 3); + await ReversibleICOInstance.methods.jumpToBlockNumber(ThreeFourthsTheWayThere).send({ + from: deployerAddress, gas: 100000 + }); + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 125 eth ( 50 from first, 75 from second )", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + new BN("125").mul( helpers.solidity.etherBN ).toString() + ); + }); + + }); + + describe("- contract after end of rICO", async function () { + + before(async () => { + await ReversibleICOInstance.methods.jumpToBlockNumber(buyPhaseEndBlock).send({ + from: deployerAddress, gas: 100000 + }); + helpers.utils.resetAccountNonceCache(helpers); + }); + + it("returns 175 eth ( 75 from first, 100 from second )", async function () { + const ProjectAvailableEth = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); + expect( + ProjectAvailableEth.toString() + ).to.equal( + new BN("175").mul( helpers.solidity.etherBN ).toString() + ); + }); + + }); + + }); + + }); + + +}); + +async function displayTokensForParticipantAtStage(start, blocks, contract, deployerAddress, participant, stage, end = false, after = false) { + let currentBlock = await helpers.utils.jumpToContractStage ( contract, deployerAddress, stage, end, after ); + + let ParticipantsByAddress = await contract.methods.ParticipantsByAddress(participant).call(); + let totalTokens = ParticipantsByAddress.token_amount; + + let diffBlock = (currentBlock - start); + + let tx1 = await contract.methods.getLockedTokenAmount(participant).send({from: deployerAddress }); + let amount1 = await contract.methods.getLockedTokenAmount(participant).call(); + + console.log("stage ["+stage+"] ( "+ diffBlock + " )"); + + console.log("participant: ", participant); + console.log("gas V: ", tx1.gasUsed); + console.log("amount: ", helpers.utils.toFullToken(helpers, new BN(amount1) )); + console.log("tokensV3:", helpers.utils.toFullToken( + helpers, helpers.utils.calculateLockedTokensAtBlockForBoughtAmount(helpers, diffBlock, blocks, totalTokens) + ) + ); + + const ratioA = await contract.methods.getCurrentUnlockPercentage(20).call(); + const ratioC = helpers.utils.getCurrentUnlockPercentage(helpers, diffBlock, blocks, 20); + console.log("ratioA: ", helpers.utils.toFullToken(helpers, ratioA)); + console.log("ratioC: ", helpers.utils.toFullToken(helpers, ratioC)); +} + + +async function displayContractStats(contract, TokenContractInstance) { + + let maxEth = await contract.methods.availableEthAtStage().call(); + let totalReceivedETH = await contract.methods.totalReceivedETH().call(); + let returnedETH = await contract.methods.returnedETH().call(); + let committedETH = await contract.methods.committedETH().call(); + let contributorsETH = await contract.methods.contributorsETH().call(); + let projectETH = await contract.methods.projectETH().call(); + let projectWithdrawnETH = await contract.methods.projectWithdrawnETH().call(); + let ricoTokenBalance = await TokenContractInstance.methods.balanceOf(contract.receipt.contractAddress).call(); + + console.log("ricoTokenBalance: ", helpers.utils.toEth(helpers, ricoTokenBalance) + " tokens"); + console.log("maxEth: ", helpers.utils.toEth(helpers, maxEth) + " eth"); + console.log("totalReceivedETH: ", helpers.utils.toEth(helpers,totalReceivedETH) + " eth"); + console.log("returnedETH: ", helpers.utils.toEth(helpers,returnedETH) + " eth"); + console.log("committedETH: ", helpers.utils.toEth(helpers,committedETH) + " eth"); + console.log("contributorsETH: ", helpers.utils.toEth(helpers,contributorsETH) + " eth"); + console.log("projectETH: ", helpers.utils.toEth(helpers,projectETH) + " eth"); + console.log("projectWithdrawnETH:", helpers.utils.toEth(helpers,projectWithdrawnETH) + " eth"); + console.log("\n"); +} diff --git a/test/tests/1_ERC1820.js b/test/solc_tests/1_ERC1820.js similarity index 100% rename from test/tests/1_ERC1820.js rename to test/solc_tests/1_ERC1820.js diff --git a/test/tests/2_ERC777_Token.js b/test/solc_tests/2_ERC777_Token.js similarity index 92% rename from test/tests/2_ERC777_Token.js rename to test/solc_tests/2_ERC777_Token.js index 1299a47..665bdac 100644 --- a/test/tests/2_ERC777_Token.js +++ b/test/solc_tests/2_ERC777_Token.js @@ -50,7 +50,7 @@ describe("ERC777 - RICO Token", async function () { await this.RicoToken.methods .setup(_ricoAddress) - .send({ from: holder }); + .send({ from: holder, gas: 100000 }); console.log( " Gas used for deployment:", @@ -155,13 +155,13 @@ describe("ERC777 - RICO Token", async function () { await helpers.assertInvalidOpcode(async () => { await this.RicoToken.methods .changeManager(accounts[1]) - .send({ from: accounts[1] }); + .send({ from: accounts[1], gas: 100000 }); }, "onlyManager: Only manager can call this method"); }); it("Allows manager to transfer", async function () { await this.RicoToken.methods .changeManager(newManager) - .send({ from: holder }); + .send({ from: holder, gas: 100000 }); expect(await this.RicoToken.methods.manager().call()).to.be.equal( newManager ); @@ -198,7 +198,7 @@ describe("ERC777 - RICO Token", async function () { it("returns their locked balance when calling `getLockedBalance` ", async function () { await this.ReversibleICOMock777.methods .setLockedTokenAmount(holder, lockedAmount) - .send({ from: holder }); + .send({ from: holder, gas: 100000 }); expect( await this.RicoToken.methods.getLockedBalance(holder).call() ).to.be.equal(lockedAmount.toString()); @@ -206,7 +206,7 @@ describe("ERC777 - RICO Token", async function () { it("returns their unlocked balance when calling `getUnlockedBalance` ", async function () { await this.ReversibleICOMock777.methods .setLockedTokenAmount(holder, lockedAmount) - .send({ from: accounts[0] }); + .send({ from: accounts[0], gas: 100000 }); expect( await this.RicoToken.methods.getUnlockedBalance(holder).call() ).to.be.equal( @@ -221,7 +221,7 @@ describe("ERC777 - RICO Token", async function () { it("to true", async function () { await this.RicoToken.methods .setFrozen(true) - .send({ from: newManager }); + .send({ from: newManager, gas: 100000 }); expect(await this.RicoToken.methods.frozen().call()).to.be.equal( true ); @@ -230,7 +230,7 @@ describe("ERC777 - RICO Token", async function () { it("to false", async function () { await this.RicoToken.methods .setFrozen(false) - .send({ from: newManager }); + .send({ from: newManager, gas: 100000 }); expect(await this.RicoToken.methods.frozen().call()).to.be.equal( false ); @@ -240,7 +240,7 @@ describe("ERC777 - RICO Token", async function () { await helpers.assertInvalidOpcode(async () => { await this.RicoToken.methods .setFrozen(false) - .send({ from: accounts[3] }); + .send({ from: accounts[3], gas: 100000 }); }, "onlyManager: Only manager can call this method"); }); }); @@ -250,7 +250,7 @@ describe("ERC777 - RICO Token", async function () { it("Blocks transfers", async function () { await this.RicoToken.methods .setFrozen(true) - .send({ from: newManager }); + .send({ from: newManager, gas: 100000 }); await helpers.assertInvalidOpcode(async () => { await this.RicoToken.methods @@ -263,19 +263,19 @@ describe("ERC777 - RICO Token", async function () { it("Blocks burns", async function () { await this.RicoToken.methods .setFrozen(true) - .send({ from: newManager }); + .send({ from: newManager, gas: 100000 }); await helpers.assertInvalidOpcode(async () => { - await this.RicoToken.methods.burn("1", "0x").send({ from: holder }); + await this.RicoToken.methods.burn("1", "0x").send({ from: holder, gas: 100000 }); }, "revert"); }); it("Re-allows transfer when unfrozen", async function () { await this.RicoToken.methods .setFrozen(false) - .send({ from: newManager }); + .send({ from: newManager, gas: 100000 }); await this.RicoToken.methods .transfer(accounts[5], 10000) - .send({ from: holder }); + .send({ from: holder, gas: 100000}); const balance = await this.RicoToken.methods .balanceOf(accounts[5]) @@ -294,11 +294,11 @@ describe("ERC777 - RICO Token", async function () { it("should transfer if amount is unlocked", async function () { await this.ReversibleICOMock777.methods .setLockedTokenAmount(holder, lockedAmount) - .send({ from: accounts[0] }); + .send({ from: accounts[0], gas: 100000 }); await this.RicoToken.methods .transfer(accounts[1], 10000) - .send({ from: holder }); + .send({ from: holder, gas: 100000 }); const balance = await this.RicoToken.methods .balanceOf(accounts[1]) @@ -314,13 +314,13 @@ describe("ERC777 - RICO Token", async function () { await this.ReversibleICOMock777.methods .setLockedTokenAmount(holder, amt.toString()) - .send({ from: accounts[0] }); + .send({ from: accounts[0], gas: 100000 }); await helpers.assertInvalidOpcode(async () => { await this.RicoToken.methods .transfer(accounts[1], amt.toString()) - .send({ from: holder }); - }, "SafeMath: subtraction overflow"); + .send({ from: holder, gas: 100000 }); + }, "getUnlockedBalance: Insufficient funds"); }); it("should be able to transfer whole balance to RICO", async function () { @@ -328,7 +328,7 @@ describe("ERC777 - RICO Token", async function () { let locked = new BN("10000"); await this.RicoToken.methods .transfer(accounts[0], locked.toString()) - .send({ from: accounts[1] }); + .send({ from: accounts[1], gas: 100000 }); // lock half await this.ReversibleICOMock777.methods @@ -336,7 +336,7 @@ describe("ERC777 - RICO Token", async function () { accounts[0], locked.div(new BN("2")).toString() ) - .send({ from: accounts[0] }); + .send({ from: accounts[0], gas: 100000 }); let balance = new BN(await this.RicoToken.methods.balanceOf(accounts[0]).call()); @@ -345,7 +345,7 @@ describe("ERC777 - RICO Token", async function () { _ricoAddress, balance.toString() ) - .send({ from: accounts[0] }); + .send({ from: accounts[0], gas: 100000 }); balance = await this.RicoToken.methods .balanceOf(accounts[0]) @@ -440,11 +440,11 @@ describe("ERC777 - RICO Token", async function () { await this.RicoToken.methods .transfer(accounts[3], amount.toString()) - .send({ from: holder }); + .send({ from: holder, gas: 100000 }); await this.ReversibleICOMock777.methods .setLockedTokenAmount(accounts[3], locked.toString()) - .send({ from: holder }); + .send({ from: holder, gas: 100000 }); await this.RicoToken.methods .burn(1, ERC777data) @@ -478,7 +478,7 @@ describe("ERC777 - RICO Token", async function () { await testToken.methods .setFrozen(false) - .send({ from: holder }); + .send({ from: holder, gas: 100000 }); await helpers.assertInvalidOpcode(async () => { await testToken.methods @@ -492,7 +492,7 @@ describe("ERC777 - RICO Token", async function () { await helpers.assertInvalidOpcode(async () => { await this.RicoToken.methods .setup(_ricoAddress) - .send({ from: holder }); + .send({ from: holder, gas: 100000 }); }, "Contract is already initialized."); }); diff --git a/test/tests/3_ERC20Token.js b/test/solc_tests/3_ERC20Token.js similarity index 100% rename from test/tests/3_ERC20Token.js rename to test/solc_tests/3_ERC20Token.js diff --git a/test/tests/4_ReversibleICO.js b/test/solc_tests/4_ReversibleICO.js similarity index 90% rename from test/tests/4_ReversibleICO.js rename to test/solc_tests/4_ReversibleICO.js index f207293..984ed0d 100644 --- a/test/tests/4_ReversibleICO.js +++ b/test/solc_tests/4_ReversibleICO.js @@ -102,18 +102,10 @@ describe("ReversibleICO", function () { expect(await this.ReversibleICO.methods.initialized().call()).to.be.equal(false); }); - it("Property running should be false", async function () { - expect(await this.ReversibleICO.methods.started().call()).to.be.equal(false); - }); - it("Property frozen should be false", async function () { expect(await this.ReversibleICO.methods.frozen().call()).to.be.equal(false); }); - it("Property ended should be false", async function () { - expect(await this.ReversibleICO.methods.ended().call()).to.be.equal(false); - }); - it("Property TokenContractAddress should be address(0x0)", async function () { expect(await this.ReversibleICO.methods.tokenContractAddress().call()).to.be.equal("0x0000000000000000000000000000000000000000"); }); @@ -142,19 +134,18 @@ describe("ReversibleICO", function () { StageBlockCount = blocksPerDay * 30; StagePriceIncrease = helpers.solidity.ether * 0.0001; - commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount; + commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount - 1; // for validation - BuyPhaseEndBlock = commitPhaseEndBlock + ( (StageBlockCount + 1) * StageCount ); + BuyPhaseEndBlock = commitPhaseEndBlock + StageBlockCount * StageCount; - const StageStartBlock = commitPhaseEndBlock; - let lastStageBlockEnd = StageStartBlock; + let lastStageBlockEnd = commitPhaseEndBlock; for(let i = 0; i < StageCount; i++) { const start_block = lastStageBlockEnd + 1; - const end_block = lastStageBlockEnd + StageBlockCount + 1; - const token_price = commitPhasePrice + ( StagePriceIncrease * ( i + 1) ); + const end_block = lastStageBlockEnd + StageBlockCount; + const token_price = commitPhasePrice + ( StagePriceIncrease * ( i + 1) ); stageValidation.push( { start_block: start_block, @@ -162,7 +153,7 @@ describe("ReversibleICO", function () { token_price: token_price }); - lastStageBlockEnd = end_block; + lastStageBlockEnd = end_block; } await this.ReversibleICO.methods.init( @@ -188,18 +179,10 @@ describe("ReversibleICO", function () { expect(await this.ReversibleICO.methods.initialized().call()).to.be.equal(true); }); - it("Property running should be false", async function () { - expect(await this.ReversibleICO.methods.started().call()).to.be.equal(false); - }); - it("Property frozen should be false", async function () { expect(await this.ReversibleICO.methods.frozen().call()).to.be.equal(false); }); - it("Property ended should be false", async function () { - expect(await this.ReversibleICO.methods.ended().call()).to.be.equal(false); - }); - it("Property TokenContractAddress should be deployed ERC777 Token Contract address", async function () { expect(await this.ReversibleICO.methods.tokenContractAddress().call()).to.be.equal(TokenContractAddress); }); @@ -227,7 +210,7 @@ describe("ReversibleICO", function () { it("Stage Count is correct", async function () { // account for the commit stage and add 1 - const stages = (StageCount + 1); + const stages = StageCount; expect(await this.ReversibleICO.methods.stageCount().call()).to.be.equal(stages.toString()); }); @@ -236,7 +219,7 @@ describe("ReversibleICO", function () { }); it("Allocation duration is commitPhaseBlockCount", async function () { - const count = allocationStageData.endBlock - allocationStageData.startBlock; + const count = allocationStageData.endBlock - allocationStageData.startBlock + 1; expect(count.toString()).to.be.equal(commitPhaseBlockCount.toString()); }); @@ -379,14 +362,28 @@ describe("ReversibleICO", function () { expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); }); - it("Returns 255 after last stage end_block", async function () { + it("Revert before commit phase start_block", async function () { + const stageData = await this.ReversibleICO.methods.stages(0).call(); + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.jumpToBlockNumber( + stageData.startBlock - 1 + ).send({ + from: deployerAddress, gas: 100000 + }); + await this.ReversibleICO.methods.getCurrentStage().call(); + }, "Block outside of rICO period."); + }); + + it("Revert after last stage end_block", async function () { const stageData = await this.ReversibleICO.methods.stages(StageCount).call(); - await this.ReversibleICO.methods.jumpToBlockNumber( - stageData.endBlock + 1 - ).send({ - from: deployerAddress, gas: 100000 - }); - expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( "255" ); + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.jumpToBlockNumber( + stageData.endBlock + 1 + ).send({ + from: deployerAddress, gas: 100000 + }); + await this.ReversibleICO.methods.getCurrentStage().call(); + }, "Block outside of rICO period."); }); }); @@ -456,13 +453,14 @@ describe("ReversibleICO", function () { ).to.be.equal( stageId.toString() ); }); - it("Returns 255 if getStageAtBlock( last_stage.endBlock + 1 )", async function () { + it("Reverts if getStageAtBlock( last_stage.endBlock + 1 )", async function () { const stageId = StageCount; const stageData = await this.ReversibleICO.methods.stages(stageId).call(); - expect( - await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock + 1).call() - ).to.be.equal( "255" ); + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock + 1).call(); + }, "Block outside of rICO period."); }); + }); @@ -504,15 +502,16 @@ describe("ReversibleICO", function () { ); }); - it("Returns 0 after last stage ended", async function () { + it("Reverts after last stage end block", async function () { const stageData = await this.ReversibleICO.methods.stages(StageCount).call(); await this.ReversibleICO.methods.jumpToBlockNumber( stageData.endBlock + 1 ).send({ from: deployerAddress, gas: 100000 }); - - expect( await this.ReversibleICO.methods.getCurrentPrice().call() ).to.be.equal("0"); + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.getCurrentPrice().call(); + }, "Block outside of rICO period."); }); }); @@ -556,12 +555,12 @@ describe("ReversibleICO", function () { ); }); - it("Returns 0 after last stage ended", async function () { + it("Reverts after last stage end block", async function () { const stageId = StageCount; const stageData = await this.ReversibleICO.methods.stages(stageId).call(); - expect( - await this.ReversibleICO.methods.getPriceAtBlock(stageData.endBlock + 1).call() - ).to.be.equal( "0" ); + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.getPriceAtBlock(stageData.endBlock + 1).call(); + }, "Block outside of rICO period."); }); }); @@ -662,7 +661,7 @@ describe("ReversibleICO", function () { ).to.be.equal( true ); await this.ReversibleICO.methods.whitelist( - accounts[1], + [accounts[1]], true ).send({ from: TransactionSender @@ -697,7 +696,7 @@ describe("ReversibleICO", function () { expect( initialized ).to.be.equal( false ); await TestReversibleICO.methods.whitelist( - accounts[1], + [accounts[1]], true ).send({ from: whitelistControllerAddress @@ -714,7 +713,7 @@ describe("ReversibleICO", function () { it("transaction is accepted and participant address is whitelisted", async function () { await this.ReversibleICO.methods.whitelist( - accounts[3], + [accounts[3]], true ).send({ from: whitelistControllerAddress @@ -817,7 +816,7 @@ describe("ReversibleICO", function () { before(async function () { whitelistTx = await this.ReversibleICO.methods.whitelist( - TestAcceptParticipant, + [TestAcceptParticipant], true, ).send({ from: whitelistControllerAddress @@ -864,7 +863,7 @@ describe("ReversibleICO", function () { ); }); - describe("new contribution from the TestAcceptParticipant that is now whitelisted, is acceepted automatically.", async function () { + describe("new contribution from the TestAcceptParticipant that is now whitelisted, is accepted automatically.", async function () { let newContributionTx, initialContributionsCount, afterContributionsCount; @@ -899,22 +898,19 @@ describe("ReversibleICO", function () { let currentStage = await this.ReversibleICO.methods.getCurrentStage().call(); const StageDetails = await this.ReversibleICO.methods.getParticipantDetailsByStage( TestAcceptParticipant, - // indexed from 0, thus inital count will match last id + // indexed from 0, thus initial count will match last id currentStage ).call(); - const commited = (parseInt(StageDetails.stageCommittedETH, 10) ); + const total = (parseInt(StageDetails.stageTotalReceivedETH, 10) ); + const committed = (parseInt(StageDetails.stageCommittedETH, 10) ); const returned = (parseInt(StageDetails.stageReturnedETH, 10) ); - const accepted = (parseInt(StageDetails.stageAcceptedETH, 10) ); const withdrawn = (parseInt(StageDetails.stageWithdrawnETH, 10) ); - - const processedTotals = accepted + returned + withdrawn; - expect( processedTotals ).to.be.equal(commited); + const processedTotals = committed + returned + withdrawn; + expect( processedTotals ).to.be.equal(total); }); - }); - }); @@ -934,7 +930,7 @@ describe("ReversibleICO", function () { ).to.be.equal( false ); whitelistTx = await this.ReversibleICO.methods.whitelist( - TestRejectParticipant, + [TestRejectParticipant], false, ).send({ from: whitelistControllerAddress @@ -1007,16 +1003,16 @@ describe("ReversibleICO", function () { it("Participant Record has valid parameters", async function () { - let ParticipantByAddress = await this.ReversibleICO.methods.participantsByAddress(TestRejectParticipant).call(); + let ParticipantTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(TestRejectParticipant).call(); - const received = (parseInt(ParticipantByAddress.committedETH, 10) ); - const returned = (parseInt(ParticipantByAddress.returnedETH, 10) ); - const accepted = (parseInt(ParticipantByAddress.acceptedETH, 10) ); - const withdrawn = (parseInt(ParticipantByAddress.withdrawnETH, 10) ); + const received = (parseInt(ParticipantTotalStats.totalReceivedETH, 10) ); + const returned = (parseInt(ParticipantTotalStats.returnedETH, 10) ); + const accepted = (parseInt(ParticipantTotalStats.committedETH, 10) ); + const withdrawn = (parseInt(ParticipantTotalStats.withdrawnETH, 10) ); const processedTotals = accepted + returned + withdrawn; - expect( (parseInt(ParticipantByAddress.reservedTokens, 10) ) ).to.be.above(0); + expect( (parseInt(ParticipantTotalStats.reservedTokens, 10) ) ).to.be.above(0); expect( processedTotals ).to.be.below(received); }); @@ -1045,7 +1041,7 @@ describe("ReversibleICO", function () { BuyPhaseBlockCount = await this.ReversibleICO.methods.buyPhaseBlockCount().call(); }); - it("Returns 0 before stage 1 start_block + 1", async function () { + it("Returns 0 before stage 1 start_block", async function () { let stageId = 0; // jump to stage commit start block - 1 @@ -1058,7 +1054,9 @@ describe("ReversibleICO", function () { stageId = 1; // jump to stage start_block - 1 - currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + // currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, false, -1); + contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); calculatedRatio = helpers.utils.getCurrentUnlockPercentage(helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, precision); @@ -1068,34 +1066,50 @@ describe("ReversibleICO", function () { }); - it("Returns higher than 0 if at stage 1 start_block + 1", async function () { + it("Returns higher than 0 if at stage 1 start_block", async function () { const stageId = 1; // jump to stage 1 start_block exactly - const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, false, 1 ); + const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, false, 0 ); const contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); const calculatedRatio = helpers.utils.getCurrentUnlockPercentage(helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, precision); expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); expect( calculatedRatio.toNumber() ).to.be.above( 0 ); }); - it("Returns 0 at BuyPhaseEndBlock", async function () { + it("Returns lower than max at BuyPhaseEndBlock - 1", async function () { + const stageId = 12; + // jump to stage 1 start_block exactly + const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true, -1 ); + const contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); + const calculatedRatio = helpers.utils.getCurrentUnlockPercentage(helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, precision); + expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); + + const maxRatio = new helpers.BN("10").pow( new helpers.BN(precision)); + // ratio should be lower than 10 ** precision + expect( + calculatedRatio.lt(maxRatio) + ).to.be.equal( true ); + + }); + + it("Returns max at BuyPhaseEndBlock", async function () { const stageId = 12; // jump to stage 1 start_block exactly - const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true, 0 ); const contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); const calculatedRatio = helpers.utils.getCurrentUnlockPercentage(helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, precision); expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); - expect( calculatedRatio.toString() ).to.be.equal("0"); + expect( calculatedRatio.toString() ).to.be.equal( new helpers.BN("10").pow( new helpers.BN(precision) ).toString() ); }); - it("Returns 0 at BuyPhaseEndBlock + 1", async function () { + it("Returns max at BuyPhaseEndBlock + 1", async function () { const stageId = 12; // jump to stage 1 start_block exactly const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true, 1 ); const contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); const calculatedRatio = helpers.utils.getCurrentUnlockPercentage(helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, precision); expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); - expect( calculatedRatio.toString() ).to.be.equal("0"); + expect( calculatedRatio.toString() ).to.be.equal( new helpers.BN("10").pow( new helpers.BN(precision) ).toString() ); }); }); @@ -1120,7 +1134,7 @@ describe("ReversibleICO", function () { }); let whitelistTx = await this.ReversibleICO.methods.whitelist( - participant_1, + [participant_1], true, ).send({ from: whitelistControllerAddress @@ -1133,8 +1147,8 @@ describe("ReversibleICO", function () { // jump to stage commit start block - 1 const stageId = 0; let currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, false, -1); - const ParticipantsByAddress = await this.ReversibleICO.methods.participantsByAddress(participant_6).call(); - const ContractContributionTokens = ParticipantsByAddress.boughtTokens; + const ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_6).call(); + const ContractContributionTokens = ParticipantsTotalStats.boughtTokens; let getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_6).call(); // make sure we return full purchased amount. @@ -1168,8 +1182,8 @@ describe("ReversibleICO", function () { const stageId = 1; const currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, false, -1); - const ParticipantsByAddress = await this.ReversibleICO.methods.participantsByAddress(participant_1).call(); - const ContractContributionTokens = ParticipantsByAddress.boughtTokens; + const ParticipantTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + const ContractContributionTokens = ParticipantTotalStats.boughtTokens; const getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); expect(parseInt(ContractContributionTokens)).to.be.above(0); @@ -1190,8 +1204,8 @@ describe("ReversibleICO", function () { const stageId = 1; const currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId); - const ParticipantsByAddress = await this.ReversibleICO.methods.participantsByAddress(participant_1).call(); - const ContractContributionTokens = ParticipantsByAddress.boughtTokens; + const ParticipantTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + const ContractContributionTokens = ParticipantTotalStats.boughtTokens; expect(parseInt(ContractContributionTokens)).to.be.above(0); const getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); @@ -1207,8 +1221,8 @@ describe("ReversibleICO", function () { const stageId = 6; const currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true, 0); - const ParticipantsByAddress = await this.ReversibleICO.methods.participantsByAddress(participant_1).call(); - const ContractContributionTokens = ParticipantsByAddress.boughtTokens; + const ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + const ContractContributionTokens = ParticipantsTotalStats.boughtTokens; expect(parseInt(ContractContributionTokens)).to.be.above(0); const getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); @@ -1225,8 +1239,8 @@ describe("ReversibleICO", function () { const stageId = 12; const currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true, 0); - const ParticipantsByAddress = await this.ReversibleICO.methods.participantsByAddress(participant_1).call(); - const ContractContributionTokens = ParticipantsByAddress.boughtTokens; + const ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + const ContractContributionTokens = ParticipantsTotalStats.boughtTokens; expect(parseInt(ContractContributionTokens)).to.be.above(0); const getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); @@ -1243,8 +1257,8 @@ describe("ReversibleICO", function () { let stageId = 12; let currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true); - let ParticipantsByAddress = await this.ReversibleICO.methods.participantsByAddress(participant_1).call(); - let ContractContributionTokens = ParticipantsByAddress.boughtTokens; + let ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + let ContractContributionTokens = ParticipantsTotalStats.boughtTokens; expect(parseInt(ContractContributionTokens)).to.be.above(0); let getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); @@ -1262,8 +1276,8 @@ describe("ReversibleICO", function () { let stageId = 12; let currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true, 1); - let ParticipantsByAddress = await this.ReversibleICO.methods.participantsByAddress(participant_1).call(); - let ContractContributionTokens = ParticipantsByAddress.boughtTokens; + let ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + let ContractContributionTokens = ParticipantsTotalStats.boughtTokens; expect(parseInt(ContractContributionTokens)).to.be.above(0); let getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); @@ -1276,8 +1290,8 @@ describe("ReversibleICO", function () { currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true, 1000); - ParticipantsByAddress = await this.ReversibleICO.methods.participantsByAddress(participant_1).call(); - ContractContributionTokens = ParticipantsByAddress.boughtTokens; + ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + ContractContributionTokens = ParticipantsTotalStats.boughtTokens; expect(parseInt(ContractContributionTokens)).to.be.above(0); getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); diff --git a/test/tests/5_Cancel.js b/test/solc_tests/5_Cancel.js similarity index 66% rename from test/tests/5_Cancel.js rename to test/solc_tests/5_Cancel.js index e173ec3..362d612 100644 --- a/test/tests/5_Cancel.js +++ b/test/solc_tests/5_Cancel.js @@ -132,7 +132,7 @@ async function revertToFreshDeployment() { StageCount = 12; StageBlockCount = blocksPerDay * 30; StagePriceIncrease = helpers.solidity.ether * 0.0001; - commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount; + commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount - 1; BuyPhaseEndBlock = commitPhaseEndBlock + ( (StageBlockCount + 1) * StageCount ); @@ -271,7 +271,7 @@ describe("Testing canceling", function () { // whitelist and accept contribution let whitelistTx = await ReversibleICOInstance.methods.whitelist( - participant_1, + [participant_1], true ).send({ from: whitelistControllerAddress @@ -340,7 +340,7 @@ describe("Testing canceling", function () { // whitelist and accept contribution let whitelistTx = await ReversibleICOInstance.methods.whitelist( - participant_1, + [participant_1], true ).send({ from: whitelistControllerAddress @@ -449,7 +449,7 @@ describe("Testing canceling", function () { }); - it("value < rico.minContribution results in cancel(), account has 2 contributions", async function () { + it("value < rico.minContribution results in cancel(value), account has 2 contributions", async function () { const ParticipantAccountBalanceInitial = await helpers.utils.getBalance(helpers, participant_1); @@ -481,18 +481,19 @@ describe("Testing canceling", function () { // validate contributions - ParticipantByAddress = await ReversibleICOInstance.methods.participantsByAddress(participant_1).call(); + let ParticipantTotalStats = await ReversibleICOInstance.methods.participantAggregatedStats(participant_1).call(); let ContributionTotals = new helpers.BN("0"); for(let i = 0; i < StageCount; i++) { const ParticipantStageDetails = await ReversibleICOInstance.methods.getParticipantDetailsByStage(participant_1, i).call(); - ContributionTotals = ContributionTotals.add(new helpers.BN( - ParticipantStageDetails.stageCommittedETH - )); + ContributionTotals = ContributionTotals.add( + new helpers.BN(ParticipantStageDetails.stageTotalReceivedETH) + ); } + expect( - ParticipantByAddress.committedETH.toString() + ParticipantTotalStats.totalReceivedETH.toString() ).to.be.equal( ContributionTotals.toString(), ); @@ -599,10 +600,10 @@ describe("Testing canceling", function () { from: participant_1, // initial token supply holder gas: 1000000, gasPrice: helpers.networkConfig.gasPrice, - value: ContributionAmount.toString(), + value: ContributionAmount.toString(), // amount will be refunded }); - }, "Can not send value to non-payable contract method or constructor"); + }, "Contract must be initialized."); }); @@ -610,8 +611,239 @@ describe("Testing canceling", function () { }); + describe("Test whitelisting after cancelled contribution", async function () { + + before(async () => { + await revertToFreshDeployment(); + helpers.utils.resetAccountNonceCache(helpers); + // jump to contract start + currentBlock = await helpers.utils.jumpToContractStage(ReversibleICOInstance, deployerAddress, 0); + }); + + it("Participant buys 1 tokens in phase 0", async function () { + let ParticipantByAddress = await ReversibleICOInstance.methods.participantsByAddress(participant_1).call(); + + const ContributionAmount = 1 * commitPhasePrice; + await helpers.web3Instance.eth.sendTransaction({ + from: participant_1, + to: ReversibleICOInstance.receipt.contractAddress, + value: ContributionAmount, + gasPrice: helpers.networkConfig.gasPrice + }); + }); + it("Participant cancels", async function () { + await ReversibleICOInstance.methods.cancel() + .send({ from: participant_1, gas: 1000000 }); + }); + it("Whitelisting buyer should be successful", async function () { + let whitelistTx = await ReversibleICOInstance.methods.whitelist( + [participant_1], + true + ).send({ + from: whitelistControllerAddress + }); + }); + }); + + describe("Check aggregated state after cancelled contribution", async function () { + + before(async () => { + await revertToFreshDeployment(); + helpers.utils.resetAccountNonceCache(helpers); + // jump to contract start + currentBlock = await helpers.utils.jumpToContractStage(ReversibleICOInstance, deployerAddress, 0); + }); + + it("Participant buys 1 tokens in phase 0", async function () { + let ParticipantByAddress = await ReversibleICOInstance.methods.participantsByAddress(participant_1).call(); + + const ContributionAmount = 1 * commitPhasePrice; + await helpers.web3Instance.eth.sendTransaction({ + from: participant_1, + to: ReversibleICOInstance.receipt.contractAddress, + value: ContributionAmount, + gasPrice: helpers.networkConfig.gasPrice + }); + }); + + it("Participant cancels", async function () { + await ReversibleICOInstance.methods.cancel() + .send({ from: participant_1, gas: 1000000 }); + }); + + it("Participant aggregated state should match sum over all stages", async function () { + let participantCount = await ReversibleICOInstance.methods.participantCount().call(); + for (let p = 0; p < participantCount; p++) { + let participant = await ReversibleICOInstance.methods.participantsById(p).call(); + + let participantTotalReceivedETH = new helpers.BN("0"); + let participantReturnedETH = new helpers.BN("0"); + let participantCommittedETH = new helpers.BN("0"); + let participantWithdrawnETH = new helpers.BN("0"); + let participantAllocatedETH = new helpers.BN("0"); + let participantReservedTokens = new helpers.BN("0"); + let participantBoughtTokens = new helpers.BN("0"); + let participantReturnedTokens = new helpers.BN("0"); + + // Calculate sum over all stages for participant + for (let s = 0; s < StageCount; s++) { + const state = await ReversibleICOInstance.methods.getParticipantDetailsByStage(participant, s).call(); + + participantTotalReceivedETH = participantTotalReceivedETH.add(new helpers.BN(state.stageTotalReceivedETH)); + participantReturnedETH = participantReturnedETH.add(new helpers.BN(state.stageReturnedETH)); + participantCommittedETH = participantCommittedETH.add(new helpers.BN(state.stageCommittedETH)); + participantWithdrawnETH = participantWithdrawnETH.add(new helpers.BN(state.stageWithdrawnETH)); + participantAllocatedETH = participantAllocatedETH.add(new helpers.BN(state.stageAllocatedETH)); + participantReservedTokens = participantReservedTokens.add(new helpers.BN(state.stageReservedTokens)); + participantBoughtTokens = participantBoughtTokens.add(new helpers.BN(state.stageBoughtTokens)); + participantReturnedTokens = participantReturnedTokens.add(new helpers.BN(state.stageReturnedTokens)); + } + + // Compare calculated sums against participantAggregatedStats + let aggregated = await ReversibleICOInstance.methods.participantAggregatedStats(participant).call(); + expect(new helpers.BN(aggregated[0])) + .to.be.bignumber.equal(participantTotalReceivedETH, "aggregated.totalReceivedETH mismatch for participant " + p); + expect(new helpers.BN(aggregated[1])) + .to.be.bignumber.equal(participantReturnedETH, "aggregated.returnedETH mismatch for participant " + p); + expect(new helpers.BN(aggregated[2])) + .to.be.bignumber.equal(participantCommittedETH, "aggregated.committedETH mismatch for participant " + p); + expect(new helpers.BN(aggregated[3])) + .to.be.bignumber.equal(participantWithdrawnETH, "aggregated.withdrawnETH mismatch for participant " + p); + expect(new helpers.BN(aggregated[4])) + .to.be.bignumber.equal(participantAllocatedETH, "aggregated.allocatedETH mismatch for participant " + p); + expect(new helpers.BN(aggregated[5])) + .to.be.bignumber.equal(participantReservedTokens, "aggregated.reservedTokens mismatch for participant " + p); + expect(new helpers.BN(aggregated[6])) + .to.be.bignumber.equal(participantBoughtTokens, "aggregated.boughtTokens mismatch for participant " + p); + expect(new helpers.BN(aggregated[7])) + .to.be.bignumber.equal(participantReturnedTokens, "aggregated.returnedTokens mismatch for participant " + p); + } + }); + }); + + describe("Check global state after cancelled contribution", async function () { + + before(async () => { + await revertToFreshDeployment(); + helpers.utils.resetAccountNonceCache(helpers); + // jump to contract start + currentBlock = await helpers.utils.jumpToContractStage(ReversibleICOInstance, deployerAddress, 0); + }); + + it("Participant buys 1 tokens in phase 0", async function () { + let ParticipantByAddress = await ReversibleICOInstance.methods.participantsByAddress(participant_1).call(); + + const ContributionAmount = 1 * commitPhasePrice; + await helpers.web3Instance.eth.sendTransaction({ + from: participant_1, + to: ReversibleICOInstance.receipt.contractAddress, + value: ContributionAmount, + gasPrice: helpers.networkConfig.gasPrice + }); + }); + + it("Participant cancels", async function () { + await ReversibleICOInstance.methods.cancel() + .send({ from: participant_1, gas: 1000000 }); + }); + + it("Contract global state should match sum over all participants and stages", async function () { + let globalTotalReceivedETH = new helpers.BN("0"); + let globalReturnedETH = new helpers.BN("0"); + let globalCommittedETH = new helpers.BN("0"); + let globalWithdrawnETH = new helpers.BN("0"); + let globalAllocatedETH = new helpers.BN("0"); + + let participantCount = await ReversibleICOInstance.methods.participantCount().call(); + for (let p = 0; p < participantCount; p++) { + let participant = await ReversibleICOInstance.methods.participantsById(p).call(); + + for (let s = 0; s < StageCount; s++) { + const state = await ReversibleICOInstance.methods.getParticipantDetailsByStage(participant, s).call(); + + globalTotalReceivedETH = globalTotalReceivedETH.add(new helpers.BN(state.stageTotalReceivedETH)); + globalReturnedETH = globalReturnedETH.add(new helpers.BN(state.stageReturnedETH)); + globalCommittedETH = globalCommittedETH.add(new helpers.BN(state.stageCommittedETH)); + globalWithdrawnETH = globalWithdrawnETH.add(new helpers.BN(state.stageWithdrawnETH)); + globalAllocatedETH = globalAllocatedETH.add(new helpers.BN(state.stageAllocatedETH)); + } + } + + // Compare calculated sums against global contract values + expect(new helpers.BN(await ReversibleICOInstance.methods.totalReceivedETH().call())) + .to.be.bignumber.equal(globalTotalReceivedETH, "ReversibleICO.totalReceivedETH mismatch"); + expect(new helpers.BN(await ReversibleICOInstance.methods.returnedETH().call())) + .to.be.bignumber.equal(globalReturnedETH, "ReversibleICO.returnedETH mismatch"); + expect(new helpers.BN(await ReversibleICOInstance.methods.committedETH().call())) + .to.be.bignumber.equal(globalCommittedETH, "ReversibleICO.committedETH mismatch"); + expect(new helpers.BN(await ReversibleICOInstance.methods.withdrawnETH().call())) + .to.be.bignumber.equal(globalWithdrawnETH, "ReversibleICO.withdrawnETH mismatch"); + expect(new helpers.BN(await ReversibleICOInstance.methods.projectAllocatedETH().call())) + .to.be.bignumber.equal(globalAllocatedETH, "ReversibleICO.projectAllocatedETH mismatch"); + }); + }); + + describe("Cancelling before white-listing should not deliver too many tokens later", async function () { + + before(async () => { + await revertToFreshDeployment(); + helpers.utils.resetAccountNonceCache(helpers); + // jump to contract start + currentBlock = await helpers.utils.jumpToContractStage(ReversibleICOInstance, deployerAddress, 0); + }); + + it("Participant buys 900 tokens in phase 0", async function () { + // jump to phase 0 + currentBlock = await helpers.utils.jumpToContractStage(ReversibleICOInstance, deployerAddress, 0); + + let ParticipantByAddress = await ReversibleICOInstance.methods.participantsByAddress(participant_1).call(); + + const ContributionAmount = 900 * commitPhasePrice; + await helpers.web3Instance.eth.sendTransaction({ + from: participant_1, + to: ReversibleICOInstance.receipt.contractAddress, + value: ContributionAmount, + gasPrice: helpers.networkConfig.gasPrice + }); + + let balance = await TokenContractInstance.methods.balanceOf(participant_1).call(); + expect(balance).to.be.equal("0"); + }); + + it("Participant cancels", async function () { + await ReversibleICOInstance.methods.cancel() + .send({ from: participant_1, gas: 1000000 }); + }); + + it("Participant gets whitelisted", async function () { + let whitelistTx = await ReversibleICOInstance.methods.whitelist( + [participant_1], + true + ).send({ + from: whitelistControllerAddress + }); + }); + + it("Participant buying 1 token should not get cancelled tokens", async function () { + // jump to phase 0 + currentBlock = await helpers.utils.jumpToContractStage(ReversibleICOInstance, deployerAddress, 0); + + let ParticipantByAddress = await ReversibleICOInstance.methods.participantsByAddress(participant_1).call(); + + const ContributionAmount = commitPhasePrice; + await helpers.web3Instance.eth.sendTransaction({ + from: participant_1, + to: ReversibleICOInstance.receipt.contractAddress, + value: ContributionAmount, + gasPrice: helpers.networkConfig.gasPrice + }); + + let balance = await TokenContractInstance.methods.balanceOf(participant_1).call(); + expect(balance).to.be.equal("1000000000000000000"); + }); + }); }); diff --git a/test/tests/5_Contributions.js b/test/solc_tests/5_Contributions.js similarity index 99% rename from test/tests/5_Contributions.js rename to test/solc_tests/5_Contributions.js index d4efcf9..d2f682e 100644 --- a/test/tests/5_Contributions.js +++ b/test/solc_tests/5_Contributions.js @@ -129,7 +129,7 @@ async function revertToFreshDeployment() { StageCount = 12; StageBlockCount = blocksPerDay * 30; StagePriceIncrease = helpers.solidity.ether * 0.0001; - commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount; + commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount - 1; BuyPhaseEndBlock = commitPhaseEndBlock + ( (StageBlockCount + 1) * StageCount ); @@ -242,7 +242,7 @@ describe("Contribution Testing", function () { contributionCount++; let whitelistTx = await ReversibleICOInstance.methods.whitelist( - participant_1, + [participant_1], true ).send({ from: whitelistControllerAddress diff --git a/test/tests/5_Flows.js b/test/solc_tests/5_Flows.js similarity index 98% rename from test/tests/5_Flows.js rename to test/solc_tests/5_Flows.js index 01e832d..64f4a3c 100644 --- a/test/tests/5_Flows.js +++ b/test/solc_tests/5_Flows.js @@ -130,7 +130,7 @@ async function revertToFreshDeployment() { StageCount = 12; StageBlockCount = blocksPerDay * 30; StagePriceIncrease = helpers.solidity.ether * 0.0001; - commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount; + commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount - 1; BuyPhaseEndBlock = commitPhaseEndBlock + ( (StageBlockCount + 1) * StageCount ); @@ -334,7 +334,7 @@ describe("Flow Testing", function () { StageCount = 12; StageBlockCount = blocksPerDay * 30; StagePriceIncrease = helpers.solidity.ether * 0.0001; - commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount; + commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount - 1; // for validation BuyPhaseEndBlock = commitPhaseEndBlock + ( (StageBlockCount + 1) * StageCount ); @@ -657,7 +657,7 @@ describe("Flow Testing", function () { // whitelist and accept contribution let whitelistTx = await ReversibleICOInstance.methods.whitelist( - participant_1, + [participant_1], true, ).send({ from: whitelistControllerAddress @@ -815,7 +815,7 @@ describe("Flow Testing", function () { // whitelist and accept contribution let whitelistTx = await ReversibleICOInstance.methods.whitelist( - participant_1, + [participant_1], true, ).send({ from: whitelistControllerAddress @@ -972,7 +972,7 @@ describe("Flow Testing", function () { if( withdrawCalculatedBefore.eth.lt(ethAmount) ) { expect(withdrawCalculatedBefore.eth).to.be.bignumber.equal(ethAmount.sub( new helpers.BN("1") )); } else { - expect(withdrawCalculatedBefore.eth).to.be.bignumber.equal(ethAmount).or(ethAmount); + expect(withdrawCalculatedBefore.eth).to.be.bignumber.equal(ethAmount); // .or(ethAmount); } }); @@ -1022,6 +1022,13 @@ describe("Flow Testing", function () { helpers, ReversibleICOInstance, TestParticipantAddress, ReturnTokenAmount ); + // console.log("withdrawCalculatedBefore: ", withdrawCalculatedBefore); + // console.log("returnValues.eth: ", helpers.utils.toEth(helpers, withdrawCalculatedBefore.eth)); + // console.log("returnValues.project_allocated_eth: ", helpers.utils.toEth(helpers, withdrawCalculatedBefore.project_allocated_eth)); + // console.log("returnValues.withdrawn_tokens: ", helpers.utils.toEth(helpers, withdrawCalculatedBefore.withdrawn_tokens)); + // console.log("returnValues.returned_tokens: ", helpers.utils.toEth(helpers, withdrawCalculatedBefore.returned_tokens)); + // await helpers.utils.displayContributions(helpers, ReversibleICOInstance, TestParticipantAddress, 6 ); + // send full token balance back to rico let withdrawTx = await TokenContractInstance.methods.send( ReversibleICOInstance.receipt.contractAddress, @@ -1062,6 +1069,7 @@ describe("Flow Testing", function () { .sub(txGasCost) // add withdrawn eth amount .add(withdrawCalculatedBefore.eth); + expect( ParticipantBalanceAfter ).to.be.bignumber.equal( ParticipantBalanceAfterValidation ); // ETH: validate contract eth balances @@ -1356,7 +1364,7 @@ describe("Flow Testing", function () { // whitelist and accept contribution let whitelistTx = await ReversibleICOInstance.methods.whitelist( - participant_1, + [participant_1], true, ).send({ from: whitelistControllerAddress @@ -1391,7 +1399,7 @@ describe("Flow Testing", function () { expect(CancelStates[1]).to.be.equal(false); }); - it("sending unlocked tokens to Rico reverts \"Withdraw not possible. Participant has no locked tokens.\"", async function () { + it("sending unlocked tokens to Rico reverts \"Withdraw not possible. Buy phase ended.\"", async function () { const TestParticipantAddress = participant_1; const ReturnTokenAmount = new BN( @@ -1422,7 +1430,7 @@ describe("Flow Testing", function () { gas: 1000000, gasPrice: helpers.networkConfig.gasPrice }); - }, "Withdraw not possible. Participant has no locked tokens."); + }, "Withdraw not possible. Buy phase ended."); }); }); @@ -1463,9 +1471,9 @@ async function displayTokensForParticipantAtStage(start, blocks, contract, deplo async function displayContractStats(contract, TokenContractInstance) { let maxEth = await contract.methods.availableEthAtStage().call(); - let committedETH = await contract.methods.committedETH().call(); + let totalReceivedETH = await contract.methods.totalReceivedETH().call(); let returnedETH = await contract.methods.returnedETH().call(); - let acceptedETH = await contract.methods.acceptedETH().call(); + let committedETH = await contract.methods.committedETH().call(); let contributorsETH = await contract.methods.contributorsETH().call(); let projectETH = await contract.methods.projectETH().call(); let projectWithdrawnETH = await contract.methods.projectWithdrawnETH().call(); @@ -1473,9 +1481,9 @@ async function displayContractStats(contract, TokenContractInstance) { console.log("ricoTokenBalance: ", helpers.utils.toEth(helpers, ricoTokenBalance) + " tokens"); console.log("maxEth: ", helpers.utils.toEth(helpers, maxEth) + " eth"); - console.log("committedETH: ", helpers.utils.toEth(helpers,committedETH) + " eth"); + console.log("totalReceivedETH: ", helpers.utils.toEth(helpers,totalReceivedETH) + " eth"); console.log("returnedETH: ", helpers.utils.toEth(helpers,returnedETH) + " eth"); - console.log("acceptedETH: ", helpers.utils.toEth(helpers,acceptedETH) + " eth"); + console.log("committedETH: ", helpers.utils.toEth(helpers,committedETH) + " eth"); console.log("contributorsETH: ", helpers.utils.toEth(helpers,contributorsETH) + " eth"); console.log("projectETH: ", helpers.utils.toEth(helpers,projectETH) + " eth"); console.log("projectWithdrawnETH:", helpers.utils.toEth(helpers,projectWithdrawnETH) + " eth"); diff --git a/test/tests/5_ProjectWithdraw.js b/test/solc_tests/5_ProjectWithdraw.js similarity index 96% rename from test/tests/5_ProjectWithdraw.js rename to test/solc_tests/5_ProjectWithdraw.js index 997bd10..35df7ca 100644 --- a/test/tests/5_ProjectWithdraw.js +++ b/test/solc_tests/5_ProjectWithdraw.js @@ -128,7 +128,7 @@ async function revertToFreshDeployment() { StageCount = 12; StageBlockCount = blocksPerDay * 30; StagePriceIncrease = helpers.solidity.ether * 0.0001; - commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount; + commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount - 1; BuyPhaseEndBlock = commitPhaseEndBlock + ( (StageBlockCount + 1) * StageCount ); @@ -198,7 +198,7 @@ describe("ProjectWithdraw Testing", function () { describe("ProjectWithdraw()", function () { /* - describe("0 - contract not initialized with settings", async function () { + describe("0 - contract not initialized with settings", async function () { let TestReversibleICO; @@ -260,14 +260,14 @@ describe("ProjectWithdraw Testing", function () { describe("caller is projectWalletAddress", async function () { - it("reverts \"Requested amount to large, not enough unlocked ETH available.\"", async function () { + it("reverts \"Requested amount too big, not enough unlocked ETH available.\"", async function () { await helpers.assertInvalidOpcode( async function () { await ReversibleICOInstance.methods.projectWithdraw( 1 ).send({ from: projectWalletAddress, gas: 100000 }); - }, "Requested amount to large, not enough unlocked ETH available."); + }, "Requested amount too big, not enough unlocked ETH available."); }); }); @@ -305,14 +305,14 @@ describe("ProjectWithdraw Testing", function () { describe("caller is projectWalletAddress", async function () { - it("reverts \"Requested amount to large, not enough unlocked ETH available.\"", async function () { + it("reverts \"Requested amount too big, not enough unlocked ETH available.\"", async function () { await helpers.assertInvalidOpcode( async function () { await ReversibleICOInstance.methods.projectWithdraw( 1 ).send({ from: projectWalletAddress, gas: 100000 }); - }, "Requested amount to large, not enough unlocked ETH available."); + }, "Requested amount too big, not enough unlocked ETH available."); }); }); @@ -335,7 +335,7 @@ describe("ProjectWithdraw Testing", function () { // whitelist and accept contribution let whitelistTx = await ReversibleICOInstance.methods.whitelist( - participant_1, + [participant_1], true, ).send({ from: whitelistControllerAddress @@ -345,14 +345,14 @@ describe("ProjectWithdraw Testing", function () { describe("caller is projectWalletAddress", async function () { - it("reverts \"Requested amount to large, not enough unlocked ETH available.\"", async function () { + it("reverts \"Requested amount too big, not enough unlocked ETH available.\"", async function () { await helpers.assertInvalidOpcode( async function () { await ReversibleICOInstance.methods.projectWithdraw( 1 ).send({ from: projectWalletAddress, gas: 100000 }); - }, "Requested amount to large, not enough unlocked ETH available."); + }, "Requested amount too big, not enough unlocked ETH available."); }); }); @@ -362,13 +362,13 @@ describe("ProjectWithdraw Testing", function () { describe("2 - contract in buy phase ( stage 1 - last block )", async function () { - describe("One whitelisted contribution in contract", async function () { + describe("One whitelisted contribution in contract", async function () { const ContributionAmount = new helpers.BN("1000").mul( helpers.solidity.etherBN ); before(async () => { await revertToFreshDeployment(); currentBlock = await helpers.utils.jumpToContractStage (ReversibleICOInstance, deployerAddress, 0); - + let newContributionTx = await helpers.web3Instance.eth.sendTransaction({ from: participant_1, @@ -379,7 +379,7 @@ describe("ProjectWithdraw Testing", function () { // whitelist and accept contribution let whitelistTx = await ReversibleICOInstance.methods.whitelist( - participant_1, + [participant_1], true, ).send({ from: whitelistControllerAddress @@ -425,7 +425,7 @@ describe("ProjectWithdraw Testing", function () { describe("caller is projectWalletAddress", async function () { - it("reverts \"Requested amount to large, not enough unlocked ETH available.\"", async function () { + it("reverts \"Requested amount too big, not enough unlocked ETH available.\"", async function () { let Available = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); console.log("Available ETH: ", helpers.utils.toEth(helpers, Available.toString() ) +" eth" ); @@ -435,14 +435,14 @@ describe("ProjectWithdraw Testing", function () { let AvailableAfterWithdraw = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); - let AfterWithdrawacceptedETH = new BN( await ReversibleICOInstance.methods.acceptedETH().call() ); + let AfterWithdrawcommittedETH = new BN( await ReversibleICOInstance.methods.committedETH().call() ); let AfterWithdrawwithdrawnETH = new BN( await ReversibleICOInstance.methods.withdrawnETH().call() ); let AfterWithdrawAllocatedETH = new BN( await ReversibleICOInstance.methods.projectAllocatedETH().call() ); let AfterWithdrawProjectETHWithdrawn = new BN( await ReversibleICOInstance.methods.projectWithdrawnETH().call() ); console.log(""); console.log("Available ETH: ", helpers.utils.toEth(helpers, AvailableAfterWithdraw.toString() ) +" eth" ); - console.log("acceptedETH: ", helpers.utils.toEth(helpers, AfterWithdrawacceptedETH.toString() ) +" eth" ); + console.log("committedETH: ", helpers.utils.toEth(helpers, AfterWithdrawcommittedETH.toString() ) +" eth" ); console.log("withdrawnETH ETH: ", helpers.utils.toEth(helpers, AfterWithdrawwithdrawnETH.toString() ) +" eth" ); console.log("projectWithdrawnETH: ", helpers.utils.toEth(helpers, AfterWithdrawProjectETHWithdrawn.toString() ) +" eth" ); console.log("projectAllocatedETH: ", helpers.utils.toEth(helpers, AfterWithdrawAllocatedETH.toString() ) +" eth" ); @@ -452,7 +452,7 @@ describe("ProjectWithdraw Testing", function () { const ReturnTokenAmount = new BN( await TokenContractInstance.methods.balanceOf(participant_1).call() ); - + // projectWithdraw const projSum = AvailableAfterWithdraw.div( new BN(2) ).toString(); let projectWithdrawTx = await ReversibleICOInstance.methods.projectWithdraw( @@ -462,18 +462,18 @@ describe("ProjectWithdraw Testing", function () { ).send({ from: projectWalletAddress }); - + console.log("after projectWithdrawTx", helpers.utils.toEth(helpers, projSum) +" eth", "\n"); AvailableAfterWithdraw = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); - AfterWithdrawacceptedETH = new BN( await ReversibleICOInstance.methods.acceptedETH().call() ); + AfterWithdrawcommittedETH = new BN( await ReversibleICOInstance.methods.committedETH().call() ); AfterWithdrawwithdrawnETH = new BN( await ReversibleICOInstance.methods.withdrawnETH().call() ); AfterWithdrawProjectETHWithdrawn = new BN( await ReversibleICOInstance.methods.projectWithdrawnETH().call() ); AfterWithdrawETHWithdrawn = new BN( await ReversibleICOInstance.methods.returnedETH().call() ); AfterWithdrawAllocatedETH = new BN( await ReversibleICOInstance.methods.projectAllocatedETH().call() ); console.log("Available ETH: ", helpers.utils.toEth(helpers, AvailableAfterWithdraw.toString() ) +" eth" ); - console.log("acceptedETH: ", helpers.utils.toEth(helpers, AfterWithdrawacceptedETH.toString() ) +" eth" ); + console.log("committedETH: ", helpers.utils.toEth(helpers, AfterWithdrawcommittedETH.toString() ) +" eth" ); console.log("withdrawnETH ETH: ", helpers.utils.toEth(helpers, AfterWithdrawwithdrawnETH.toString() ) +" eth" ); console.log("projectWithdrawnETH: ", helpers.utils.toEth(helpers, AfterWithdrawProjectETHWithdrawn.toString() ) +" eth" ); console.log("returnedETH: ", helpers.utils.toEth(helpers, AfterWithdrawETHWithdrawn.toString() ) +" eth" ); @@ -483,7 +483,7 @@ describe("ProjectWithdraw Testing", function () { console.log("ContractBalance: ", helpers.utils.toEth(helpers, ContractBalance.toString() ) +" eth" ); console.log(""); - + // await helpers.utils.displayContributions(helpers, ReversibleICOInstance, participant_1, 4 ); @@ -499,11 +499,11 @@ describe("ProjectWithdraw Testing", function () { gasPrice: helpers.networkConfig.gasPrice }); console.log("after withdrawTx" ); - + // await helpers.utils.displayContributions(helpers, ReversibleICOInstance, participant_1, 4 ); - AfterWithdrawacceptedETH = new BN( await ReversibleICOInstance.methods.acceptedETH().call() ); - console.log("acceptedETH: ", helpers.utils.toEth(helpers, AfterWithdrawacceptedETH.toString() ) +" eth" ); + AfterWithdrawcommittedETH = new BN( await ReversibleICOInstance.methods.committedETH().call() ); + console.log("committedETH: ", helpers.utils.toEth(helpers, AfterWithdrawcommittedETH.toString() ) +" eth" ); AfterWithdrawwithdrawnETH = new BN( await ReversibleICOInstance.methods.withdrawnETH().call() ); console.log("withdrawnETH ETH: ", helpers.utils.toEth(helpers, AfterWithdrawwithdrawnETH.toString() ) +" eth" ); @@ -538,7 +538,7 @@ describe("ProjectWithdraw Testing", function () { console.log("whitelistTx:" ); whitelistTx = await ReversibleICOInstance.methods.whitelist( - participant_2, + [participant_2], true, ).send({ from: whitelistControllerAddress @@ -595,7 +595,7 @@ describe("ProjectWithdraw Testing", function () { }); console.log(""); - console.log("after withdrawTx" ); + console.log("after withdrawTx 2" ); ContractBalance = await helpers.utils.getBalance(helpers, ReversibleICOAddress); console.log("ContractBalance: ", helpers.utils.toEth(helpers, ContractBalance.toString() ) +" eth" ); @@ -608,13 +608,12 @@ describe("ProjectWithdraw Testing", function () { AvailableAfterWithdraw = new BN( await ReversibleICOInstance.methods.getProjectAvailableEth().call() ); console.log("Available ETH: ", helpers.utils.toEth(helpers, AvailableAfterWithdraw.toString() ) +" eth" ); - console.log(""); console.log("whitelistTx participant_3:" ); whitelistTx = await ReversibleICOInstance.methods.whitelist( - participant_3, + [participant_3], false, ).send({ from: whitelistControllerAddress @@ -634,9 +633,11 @@ describe("ProjectWithdraw Testing", function () { }); }); }); + + /* + describe("getProjectAvailableEth", async function () { - describe("getProjectAvailableEth", async function () { before(async () => { await revertToFreshDeployment(); @@ -653,7 +654,7 @@ describe("ProjectWithdraw Testing", function () { // whitelist and accept contribution let whitelistTx = await ReversibleICOInstance.methods.whitelist( - participant_1, + [participant_1], true, ).send({ from: whitelistControllerAddress @@ -682,13 +683,15 @@ describe("ProjectWithdraw Testing", function () { it("getProjectAvailableEth()", async function () { // getProjectAvailableEth - const CancelStates = await ReversibleICOInstance.methods.getCancelModes(participant_1).call(); - expect(CancelStates[0]).to.be.equal(false); - expect(CancelStates[1]).to.be.equal(true); + const getProjectAvailableEth = await ReversibleICOInstance.methods.getProjectAvailableEth().call(); + console.log(getProjectAvailableEth); + }); }); + */ + /* describe("participant is whitelisted and has 3 contributions ( 1 in stage 0 / 1 in stage 1 / 1 in stage 6 )", async function () { @@ -707,7 +710,7 @@ describe("ProjectWithdraw Testing", function () { // whitelist and accept contribution let whitelistTx = await ReversibleICOInstance.methods.whitelist( - participant_1, + [participant_1], true, ).send({ from: whitelistControllerAddress @@ -1244,7 +1247,7 @@ describe("ProjectWithdraw Testing", function () { // whitelist and accept contribution let whitelistTx = await ReversibleICOInstance.methods.whitelist( - participant_1, + [participant_1], true, ).send({ from: whitelistControllerAddress @@ -1324,8 +1327,8 @@ describe("ProjectWithdraw Testing", function () { async function displayTokensForParticipantAtStage(start, blocks, contract, deployerAddress, participant, stage, end = false, after = false) { let currentBlock = await helpers.utils.jumpToContractStage ( contract, deployerAddress, stage, end, after ); - let ParticipantsByAddress = await contract.methods.ParticipantsByAddress(participant).call(); - let totalTokens = ParticipantsByAddress.token_amount; + let ParticipantTotalStats = await contract.methods.participantAggregatedStats(participant).call(); + let totalTokens = ParticipantTotalStats.token_amount; let diffBlock = (currentBlock - start); @@ -1352,9 +1355,9 @@ async function displayTokensForParticipantAtStage(start, blocks, contract, deplo async function displayContractStats(contract, TokenContractInstance) { let maxEth = await contract.methods.availableEthAtStage().call(); - let committedETH = await contract.methods.committedETH().call(); + let totalReceivedETH = await contract.methods.totalReceivedETH().call(); let returnedETH = await contract.methods.returnedETH().call(); - let acceptedETH = await contract.methods.acceptedETH().call(); + let committedETH = await contract.methods.committedETH().call(); let contributorsETH = await contract.methods.contributorsETH().call(); let projectETH = await contract.methods.projectETH().call(); let projectWithdrawnETH = await contract.methods.projectWithdrawnETH().call(); @@ -1362,9 +1365,9 @@ async function displayContractStats(contract, TokenContractInstance) { console.log("ricoTokenBalance: ", helpers.utils.toEth(helpers, ricoTokenBalance) + " tokens"); console.log("maxEth: ", helpers.utils.toEth(helpers, maxEth) + " eth"); - console.log("committedETH: ", helpers.utils.toEth(helpers,committedETH) + " eth"); + console.log("totalReceivedETH: ", helpers.utils.toEth(helpers,totalReceivedETH) + " eth"); console.log("returnedETH: ", helpers.utils.toEth(helpers,returnedETH) + " eth"); - console.log("acceptedETH: ", helpers.utils.toEth(helpers,acceptedETH) + " eth"); + console.log("committedETH: ", helpers.utils.toEth(helpers,committedETH) + " eth"); console.log("contributorsETH: ", helpers.utils.toEth(helpers,contributorsETH) + " eth"); console.log("projectETH: ", helpers.utils.toEth(helpers,projectETH) + " eth"); console.log("projectWithdrawnETH:", helpers.utils.toEth(helpers,projectWithdrawnETH) + " eth"); diff --git a/test/solc_tests/5_Whitelist.js b/test/solc_tests/5_Whitelist.js new file mode 100644 index 0000000..5d34e73 --- /dev/null +++ b/test/solc_tests/5_Whitelist.js @@ -0,0 +1,479 @@ +const helpers = setup.helpers; +const BN = helpers.BN; +const MAX_UINT256 = helpers.MAX_UINT256; +const expect = helpers.expect + +const holder = accounts[10]; +const projectWalletAddress = holder; +const participant_1 = accounts[4]; +const participant_2 = accounts[5]; +const participant_3 = accounts[6]; +const participant_4 = accounts[7]; +const participant_5 = accounts[8]; +const participant_6 = accounts[9]; + +const RicoSaleSupply = setup.settings.token.sale.toString(); +const blocksPerDay = 1000; + +const ApplicationEventTypes = { + NOT_SET:0, // will match default value of a mapping result + CONTRIBUTION_NEW:1, + CONTRIBUTION_CANCEL:2, + PARTICIPANT_CANCEL:3, + COMMITMENT_ACCEPTED:4, + WHITELIST_APPROVE:5, + WHITELIST_REJECT:6, + PROJECT_WITHDRAW:7 +} + +const TransferTypes = { + NOT_SET:0, + AUTOMATIC_RETURN:1, + WHITELIST_REJECT:2, + PARTICIPANT_CANCEL:3, + PARTICIPANT_WITHDRAW:4, + PROJECT_WITHDRAW:5 +} + + +const ERC777data = web3.utils.sha3('777TestData'); +const defaultOperators = []; // accounts[0] maybe +const data = web3.utils.sha3('OZ777TestData'); +const operatorData = web3.utils.sha3('OZ777TestOperatorData'); +const anyone = '0x0000000000000000000000000000000000000001'; + +let errorMessage; + +let SnapShotKey = "ContributionsTestInit"; +let snapshotsEnabled = true; +let snapshots = []; + +const deployerAddress = accounts[0]; +const whitelistControllerAddress = accounts[1]; + +let TokenContractAddress, ReversibleICOAddress, stageValidation = [], currentBlock, + commitPhaseStartBlock, commitPhaseBlockCount, commitPhasePrice, commitPhaseEndBlock, StageCount, + StageBlockCount, StagePriceIncrease, BuyPhaseEndBlock, TokenContractInstance, + TokenContractReceipt, ReversibleICOInstance, ReversibleICOReceipt; + +async function revertToFreshDeployment() { + + // test requires ERC1820.instance + if (helpers.ERC1820.instance == false) { + console.log(" Error: ERC1820.instance not found, please make sure to run it first."); + process.exit(); + } + + if (typeof snapshots[SnapShotKey] !== "undefined" && snapshotsEnabled) { + // restore snapshot + await helpers.web3.evm.revert(snapshots[SnapShotKey]); + + // save again because whomever wrote test rpc had the impression no one would ever restore twice.. dafuq + snapshots[SnapShotKey] = await helpers.web3.evm.snapshot(); + + // reset account nonces. + helpers.utils.resetAccountNonceCache(helpers); + } else { + + /* + * Deploy Token Contract + */ + + TokenContractInstance = await helpers.utils.deployNewContractInstance( + helpers, "RicoToken", { + from: holder, + arguments: [ + setup.settings.token.supply.toString(), + defaultOperators + ], + gas: 6500000, + gasPrice: helpers.solidity.gwei * 10 + } + ); + TokenContractReceipt = TokenContractInstance.receipt; + TokenContractAddress = TokenContractInstance.receipt.contractAddress; + console.log(" TOKEN Gas used for deployment:", TokenContractInstance.receipt.gasUsed); + console.log(" Contract Address:", TokenContractAddress); + + /* + * Deploy RICO Contract + */ + ReversibleICOInstance = await helpers.utils.deployNewContractInstance(helpers, "ReversibleICOMock"); + ReversibleICOReceipt = ReversibleICOInstance.receipt; + ReversibleICOAddress = ReversibleICOInstance.receipt.contractAddress; + // helpers.addresses.Rico = ReversibleICOAddress; + + console.log(" RICO Gas used for deployment: ", ReversibleICOInstance.receipt.gasUsed); + console.log(" Contract Address:", ReversibleICOAddress); + console.log(""); + + await TokenContractInstance.methods.setup( + ReversibleICOAddress + ).send({ + from: holder, // initial token supply holder + }); + + /* + * Add RICO Settings + */ + currentBlock = await ReversibleICOInstance.methods.getCurrentBlockNumber().call(); + + // starts in one day + commitPhaseStartBlock = parseInt(currentBlock, 10) + blocksPerDay * 1; + + // 1 days allocation + commitPhaseBlockCount = blocksPerDay * 1; + commitPhasePrice = helpers.solidity.ether * 0.002; + + // 10 x 10 day periods for distribution + StageCount = 10; + StageBlockCount = blocksPerDay * 10; + StagePriceIncrease = commitPhasePrice; + commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount - 1; + + BuyPhaseEndBlock = commitPhaseEndBlock + ( (StageBlockCount + 1) * StageCount ); + + + await ReversibleICOInstance.methods.init( + TokenContractAddress, // address _tokenContractAddress + whitelistControllerAddress, // address _whitelistControllerAddress + projectWalletAddress, // address _projectWalletAddress + commitPhaseStartBlock, // uint256 _StartBlock + commitPhaseBlockCount, // uint256 _commitPhaseBlockCount, + commitPhasePrice, // uint256 _commitPhasePrice in wei + StageCount, // uint8 _stageCount + StageBlockCount, // uint256 _stageBlockCount + StagePriceIncrease // uint256 _stagePriceIncrease in wei + ).send({ + from: deployerAddress, // deployer + gas: 3000000 + }); + + // transfer tokens to rico + await TokenContractInstance.methods.send( + ReversibleICOInstance.receipt.contractAddress, + RicoSaleSupply, + ERC777data + ).send({ + from: holder, // initial token supply holder + gas: 100000 + }); + + expect( + await TokenContractInstance.methods.balanceOf(ReversibleICOAddress).call() + ).to.be.equal(RicoSaleSupply.toString()); + + + // create snapshot + if (snapshotsEnabled) { + snapshots[SnapShotKey] = await helpers.web3.evm.snapshot(); + } + } + + // reinitialize instances so revert works properly. + TokenContractInstance = await helpers.utils.getContractInstance(helpers, "RicoToken", TokenContractAddress); + TokenContractInstance.receipt = TokenContractReceipt; + ReversibleICOInstance = await helpers.utils.getContractInstance(helpers, "ReversibleICOMock", ReversibleICOAddress); + ReversibleICOInstance.receipt = ReversibleICOReceipt; + + // do some validation + expect( + await helpers.utils.getBalance(helpers, ReversibleICOAddress) + ).to.be.bignumber.equal( new helpers.BN(0) ); + + expect( + await TokenContractInstance.methods.balanceOf(ReversibleICOAddress).call() + ).to.be.equal(RicoSaleSupply.toString()); + + expect( + await ReversibleICOInstance.methods.tokenSupply().call() + ).to.be.equal( + await TokenContractInstance.methods.balanceOf(ReversibleICOAddress).call() + ); +}; + +describe("Whitelist Testing", function () { + + let tokenToEth = function(token, price) { + return new BN(token).mul(new BN(price)); + }; + + before(async function () { + await revertToFreshDeployment(); + }); + + describe("Blacklist participant after whitelisting and whitelist again", async function () { + + before(async () => { + await revertToFreshDeployment(); + helpers.utils.resetAccountNonceCache(helpers); + // jump to contract start + currentBlock = await helpers.utils.jumpToContractStage(ReversibleICOInstance, deployerAddress, 0); + }); + + it("Buy 1 token before whitelisting", async function () { + // jump to phase 0 + currentBlock = await helpers.utils.jumpToContractStage(ReversibleICOInstance, deployerAddress, 0); + + let ParticipantByAddress = await ReversibleICOInstance.methods.participantsByAddress(participant_1).call(); + + const ContributionAmount = 1 * commitPhasePrice; + await helpers.web3Instance.eth.sendTransaction({ + from: participant_1, + to: ReversibleICOInstance.receipt.contractAddress, + value: ContributionAmount, + gasPrice: helpers.networkConfig.gasPrice + }); + + let balance = await TokenContractInstance.methods.balanceOf(participant_1).call(); + expect(balance).to.be.equal("0"); + }); + + it("Participant cancels", async function () { + await ReversibleICOInstance.methods.cancel() + .send({ from: participant_1, gas: 1000000 }); + }); + + it("Buy 1 token before whitelisting", async function () { + // jump to phase 0 + currentBlock = await helpers.utils.jumpToContractStage(ReversibleICOInstance, deployerAddress, 0); + + let ParticipantByAddress = await ReversibleICOInstance.methods.participantsByAddress(participant_1).call(); + + const ContributionAmount = 1 * commitPhasePrice; + await helpers.web3Instance.eth.sendTransaction({ + from: participant_1, + to: ReversibleICOInstance.receipt.contractAddress, + value: ContributionAmount, + gasPrice: helpers.networkConfig.gasPrice + }); + + let balance = await TokenContractInstance.methods.balanceOf(participant_1).call(); + expect(balance).to.be.equal("0"); + }); + + it("Whitelist buyer", async function () { + let whitelistTx = await ReversibleICOInstance.methods.whitelist( + [participant_1], + true + ).send({ + from: whitelistControllerAddress + }); + }); + + it("Buy 1 token after getting whitelisted", async function () { + // jump to phase 0 + currentBlock = await helpers.utils.jumpToContractStage(ReversibleICOInstance, deployerAddress, 0); + + let ParticipantByAddress = await ReversibleICOInstance.methods.participantsByAddress(participant_1).call(); + + const ContributionAmount = 1 * commitPhasePrice; + await helpers.web3Instance.eth.sendTransaction({ + from: participant_1, + to: ReversibleICOInstance.receipt.contractAddress, + value: ContributionAmount, + gasPrice: helpers.networkConfig.gasPrice + }); + + let balance = await TokenContractInstance.methods.balanceOf(participant_1).call(); + expect(balance).to.be.equal("2000000000000000000"); + }); + + it("Withdraw 1 tokens", async function () { + await TokenContractInstance.methods.transfer(ReversibleICOInstance.receipt.contractAddress, "1000000000000000000") + .send({ from: participant_1, gas: 1000000 }); + + let balance = await TokenContractInstance.methods.balanceOf(participant_1).call(); + expect(balance).to.be.equal("1000000000000000000"); + }); + + it("Check aggregated state", async function () { + let aggregated = await ReversibleICOInstance.methods.participantAggregatedStats(participant_1).call(); + expect(new BN(aggregated["totalReceivedETH"])) + .to.be.bignumber.equal(tokenToEth(3, commitPhasePrice), "aggregated.totalReceivedETH mismatch"); + expect(new BN(aggregated["returnedETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.returnedETH mismatch"); + expect(new BN(aggregated["committedETH"])) + .to.be.bignumber.equal(tokenToEth(2, commitPhasePrice), "aggregated.committedETH mismatch"); + expect(new BN(aggregated["withdrawnETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.withdrawnETH mismatch"); + expect(new BN(aggregated["allocatedETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.allocatedETH mismatch"); + expect(new BN(aggregated["reservedTokens"])) + .to.be.bignumber.equal(new BN("0"), "aggregated.reservedTokens mismatch"); + expect(new BN(aggregated["boughtTokens"])) + .to.be.bignumber.equal(new BN("2000000000000000000"), "aggregated.boughtTokens mismatch"); + expect(new BN(aggregated["returnedTokens"])) + .to.be.bignumber.equal(new BN("1000000000000000000"), "aggregated.returnedTokens mismatch"); + }); + + it("Blacklist buyer", async function () { + let whitelistTx = await ReversibleICOInstance.methods.whitelist( + [participant_1], + false + ).send({ + from: whitelistControllerAddress + }); + }); + + it("Balance should still be 1 token", async function () { + let balance = await TokenContractInstance.methods.balanceOf(participant_1).call(); + expect(balance).to.be.equal("1000000000000000000"); + }); + + it("Check aggregated state (should not change)", async function () { + let aggregated = await ReversibleICOInstance.methods.participantAggregatedStats(participant_1).call(); + expect(new BN(aggregated["totalReceivedETH"])) + .to.be.bignumber.equal(tokenToEth(3, commitPhasePrice), "aggregated.totalReceivedETH mismatch"); + expect(new BN(aggregated["returnedETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.returnedETH mismatch"); + expect(new BN(aggregated["committedETH"])) + .to.be.bignumber.equal(tokenToEth(2, commitPhasePrice), "aggregated.committedETH mismatch"); + expect(new BN(aggregated["withdrawnETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.withdrawnETH mismatch"); + expect(new BN(aggregated["allocatedETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.allocatedETH mismatch"); + expect(new BN(aggregated["reservedTokens"])) + .to.be.bignumber.equal(new BN("0"), "aggregated.reservedTokens mismatch"); + expect(new BN(aggregated["boughtTokens"])) + .to.be.bignumber.equal(new BN("2000000000000000000"), "aggregated.boughtTokens mismatch"); + expect(new BN(aggregated["returnedTokens"])) + .to.be.bignumber.equal(new BN("1000000000000000000"), "aggregated.returnedTokens mismatch"); + }); + + it("Buy 1 token while being blacklisted", async function () { + // jump to phase 0 + currentBlock = await helpers.utils.jumpToContractStage(ReversibleICOInstance, deployerAddress, 0); + + let ParticipantByAddress = await ReversibleICOInstance.methods.participantsByAddress(participant_1).call(); + + const ContributionAmount = 1 * commitPhasePrice; + await helpers.web3Instance.eth.sendTransaction({ + from: participant_1, + to: ReversibleICOInstance.receipt.contractAddress, + value: ContributionAmount, + gasPrice: helpers.networkConfig.gasPrice + }); + + let balance = await TokenContractInstance.methods.balanceOf(participant_1).call(); + expect(balance).to.be.equal("1000000000000000000"); + }); + + it("Check aggregated state", async function () { + let aggregated = await ReversibleICOInstance.methods.participantAggregatedStats(participant_1).call(); + expect(new BN(aggregated["totalReceivedETH"])) + .to.be.bignumber.equal(tokenToEth(4, commitPhasePrice), "aggregated.totalReceivedETH mismatch"); + expect(new BN(aggregated["returnedETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.returnedETH mismatch"); + expect(new BN(aggregated["committedETH"])) + .to.be.bignumber.equal(tokenToEth(2, commitPhasePrice), "aggregated.committedETH mismatch"); + expect(new BN(aggregated["withdrawnETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.withdrawnETH mismatch"); + expect(new BN(aggregated["allocatedETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.allocatedETH mismatch"); + expect(new BN(aggregated["reservedTokens"])) + .to.be.bignumber.equal(new BN("1000000000000000000"), "aggregated.reservedTokens mismatch"); + expect(new BN(aggregated["boughtTokens"])) + .to.be.bignumber.equal(new BN("2000000000000000000"), "aggregated.boughtTokens mismatch"); + expect(new BN(aggregated["returnedTokens"])) + .to.be.bignumber.equal(new BN("1000000000000000000"), "aggregated.returnedTokens mismatch"); + }); + + it("Participant cancels", async function () { + await ReversibleICOInstance.methods.cancel() + .send({ from: participant_1, gas: 1000000 }); + }); + + it("Check aggregated state", async function () { + let aggregated = await ReversibleICOInstance.methods.participantAggregatedStats(participant_1).call(); + expect(new BN(aggregated["totalReceivedETH"])) + .to.be.bignumber.equal(tokenToEth(4, commitPhasePrice), "aggregated.totalReceivedETH mismatch"); + expect(new BN(aggregated["returnedETH"])) + .to.be.bignumber.equal(tokenToEth(2, commitPhasePrice), "aggregated.returnedETH mismatch"); + expect(new BN(aggregated["committedETH"])) + .to.be.bignumber.equal(tokenToEth(2, commitPhasePrice), "aggregated.committedETH mismatch"); + expect(new BN(aggregated["withdrawnETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.withdrawnETH mismatch"); + expect(new BN(aggregated["allocatedETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.allocatedETH mismatch"); + expect(new BN(aggregated["reservedTokens"])) + .to.be.bignumber.equal(new BN("0"), "aggregated.reservedTokens mismatch"); + expect(new BN(aggregated["boughtTokens"])) + .to.be.bignumber.equal(new BN("2000000000000000000"), "aggregated.boughtTokens mismatch"); + expect(new BN(aggregated["returnedTokens"])) + .to.be.bignumber.equal(new BN("1000000000000000000"), "aggregated.returnedTokens mismatch"); + }); + + it("Buy 1 token while being blacklisted", async function () { + // jump to phase 0 + currentBlock = await helpers.utils.jumpToContractStage(ReversibleICOInstance, deployerAddress, 0); + + let ParticipantByAddress = await ReversibleICOInstance.methods.participantsByAddress(participant_1).call(); + + const ContributionAmount = 1 * commitPhasePrice; + await helpers.web3Instance.eth.sendTransaction({ + from: participant_1, + to: ReversibleICOInstance.receipt.contractAddress, + value: ContributionAmount, + gasPrice: helpers.networkConfig.gasPrice + }); + + let balance = await TokenContractInstance.methods.balanceOf(participant_1).call(); + expect(balance).to.be.equal("1000000000000000000"); + }); + + it("Check aggregated state", async function () { + let aggregated = await ReversibleICOInstance.methods.participantAggregatedStats(participant_1).call(); + expect(new BN(aggregated["totalReceivedETH"])) + .to.be.bignumber.equal(tokenToEth(5, commitPhasePrice), "aggregated.totalReceivedETH mismatch"); + expect(new BN(aggregated["returnedETH"])) + .to.be.bignumber.equal(tokenToEth(2, commitPhasePrice), "aggregated.returnedETH mismatch"); + expect(new BN(aggregated["committedETH"])) + .to.be.bignumber.equal(tokenToEth(2, commitPhasePrice), "aggregated.committedETH mismatch"); + expect(new BN(aggregated["withdrawnETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.withdrawnETH mismatch"); + expect(new BN(aggregated["allocatedETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.allocatedETH mismatch"); + expect(new BN(aggregated["reservedTokens"])) + .to.be.bignumber.equal(new BN("1000000000000000000"), "aggregated.reservedTokens mismatch"); + expect(new BN(aggregated["boughtTokens"])) + .to.be.bignumber.equal(new BN("2000000000000000000"), "aggregated.boughtTokens mismatch"); + expect(new BN(aggregated["returnedTokens"])) + .to.be.bignumber.equal(new BN("1000000000000000000"), "aggregated.returnedTokens mismatch"); + }); + + it("Whitelist buyer (again)", async function () { + let whitelistTx = await ReversibleICOInstance.methods.whitelist( + [participant_1], + true + ).send({ + from: whitelistControllerAddress + }); + }); + + it("Balance should be 2 token", async function () { + let balance = await TokenContractInstance.methods.balanceOf(participant_1).call(); + expect(balance).to.be.equal("2000000000000000000"); + }); + + it("Check aggregated state", async function () { + let aggregated = await ReversibleICOInstance.methods.participantAggregatedStats(participant_1).call(); + expect(new BN(aggregated["totalReceivedETH"])) + .to.be.bignumber.equal(tokenToEth(5, commitPhasePrice), "aggregated.totalReceivedETH mismatch"); + expect(new BN(aggregated["returnedETH"])) + .to.be.bignumber.equal(tokenToEth(2, commitPhasePrice), "aggregated.returnedETH mismatch"); + expect(new BN(aggregated["committedETH"])) + .to.be.bignumber.equal(tokenToEth(3, commitPhasePrice), "aggregated.committedETH mismatch"); + expect(new BN(aggregated["withdrawnETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.withdrawnETH mismatch"); + expect(new BN(aggregated["allocatedETH"])) + .to.be.bignumber.equal(tokenToEth(1, commitPhasePrice), "aggregated.allocatedETH mismatch"); + expect(new BN(aggregated["reservedTokens"])) + .to.be.bignumber.equal(new BN("0"), "aggregated.reservedTokens mismatch"); + expect(new BN(aggregated["boughtTokens"])) + .to.be.bignumber.equal(new BN("3000000000000000000"), "aggregated.boughtTokens mismatch"); + expect(new BN(aggregated["returnedTokens"])) + .to.be.bignumber.equal(new BN("1000000000000000000"), "aggregated.returnedTokens mismatch"); + }); + }); +}); diff --git a/test/tests/6_Gnosis-Safe.js b/test/solc_tests/6_Gnosis-Safe.js similarity index 99% rename from test/tests/6_Gnosis-Safe.js rename to test/solc_tests/6_Gnosis-Safe.js index 867d80f..4cf01fd 100644 --- a/test/tests/6_Gnosis-Safe.js +++ b/test/solc_tests/6_Gnosis-Safe.js @@ -312,7 +312,7 @@ describe("Gnosis Safe Integration", function () { StageBlockCount = blocksPerDay * 30; StagePriceIncrease = helpers.solidity.ether * 0.0001; - commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount; + commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount - 1; // for validation BuyPhaseEndBlock = commitPhaseEndBlock + (StageBlockCount + 1) * StageCount; diff --git a/test/tests/7_Website.js b/test/solc_tests/7_Website.js similarity index 96% rename from test/tests/7_Website.js rename to test/solc_tests/7_Website.js index 52bd39f..7ee7f40 100644 --- a/test/tests/7_Website.js +++ b/test/solc_tests/7_Website.js @@ -121,7 +121,7 @@ async function doFreshDeployment(name) { StageCount = 12; StageBlockCount = blocksPerDay * 30; StagePriceIncrease = helpers.solidity.ether * 0.0001; - commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount; + commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount - 1; // for validation BuyPhaseEndBlock = commitPhaseEndBlock + ( (StageBlockCount + 1) * StageCount ); @@ -194,9 +194,9 @@ async function doFreshDeployment(name) { describe("Website States", function () { - describe("contract in stage 0 - 1 day before Allocation Start", async function () { + describe("1 day before Allocation Start", async function () { - const name = "stage_0_before_allocation"; + const name = "before_allocation"; let Instances; before(async () => { helpers.utils.resetAccountNonceCache(helpers); @@ -208,10 +208,9 @@ describe("Website States", function () { expect( await Instances.ReversibleICOInstance.methods.initialized().call() ).to.be.equal( true ); - expect( - await Instances.ReversibleICOInstance.methods.getCurrentStage().call() - ).to.be.equal( "0" ); - + await helpers.assertInvalidOpcode( async () => { + await Instances.ReversibleICOInstance.methods.getCurrentStage().call(); + }, "Block outside of rICO period."); }); }); @@ -267,7 +266,7 @@ describe("Website States", function () { await Instances.ReversibleICOInstance.methods.participantCount().call() ).to.be.equal( "1" ); - let participant_address = await Instances.ReversibleICOInstance.methods.participantsById(1).call(); + let participant_address = await Instances.ReversibleICOInstance.methods.participantsById(0).call(); let Participant = await Instances.ReversibleICOInstance.methods.participantsByAddress(participant_address).call(); expect( @@ -294,7 +293,7 @@ describe("Website States", function () { }); await Instances.ReversibleICOInstance.methods.whitelist( - participant_1, + [participant_1], true, ).send({ from: whitelistControllerAddress @@ -313,7 +312,7 @@ describe("Website States", function () { await Instances.ReversibleICOInstance.methods.participantCount().call() ).to.be.equal( "1" ); - let participant_address = await Instances.ReversibleICOInstance.methods.participantsById(1).call(); + let participant_address = await Instances.ReversibleICOInstance.methods.participantsById(0).call(); let Participant = await Instances.ReversibleICOInstance.methods.participantsByAddress(participant_address).call(); expect( diff --git a/test/solc_tests/9_Stages.js b/test/solc_tests/9_Stages.js new file mode 100644 index 0000000..8f42766 --- /dev/null +++ b/test/solc_tests/9_Stages.js @@ -0,0 +1,419 @@ +const helpers = setup.helpers; +const BN = helpers.BN; +const MAX_UINT256 = helpers.MAX_UINT256; +const expect = helpers.expect + +const holder = accounts[10]; +const projectWalletAddress = holder; +const participant_1 = accounts[4]; +const participant_2 = accounts[5]; +const participant_3 = accounts[6]; +const participant_4 = accounts[7]; +const participant_5 = accounts[8]; +const participant_6 = accounts[9]; + +const RicoSaleSupply = setup.settings.token.sale.toString(); +const blocksPerDay = 6450; + +const ApplicationEventTypes = { + NOT_SET:0, // will match default value of a mapping result + CONTRIBUTION_NEW:1, + CONTRIBUTION_CANCEL:2, + PARTICIPANT_CANCEL:3, + COMMITMENT_ACCEPTED:4, + WHITELIST_APPROVE:5, + WHITELIST_REJECT:6, + PROJECT_WITHDRAW:7 +} + +const TransferTypes = { + NOT_SET:0, + AUTOMATIC_REFUND:1, + WHITELIST_REJECT:2, + PARTICIPANT_CANCEL:3, + PARTICIPANT_WITHDRAW:4, + PROJECT_WITHDRAW:5 +} + + +let errorMessage; + +describe("ReversibleICO", function () { + + const deployerAddress = accounts[0]; + const whitelistControllerAddress = accounts[1]; + let TokenContractAddress, stageValidation = [], currentBlock, commitPhaseStartBlock, + commitPhaseBlockCount, commitPhasePrice, commitPhaseEndBlock, StageCount, + StageBlockCount, StagePriceIncrease, BuyPhaseEndBlock; + let TokenContractInstance; + + before(async function () { + // test requires ERC1820.instance + if (helpers.ERC1820.instance == false) { + console.log(" Error: ERC1820.instance not found, please make sure to run it first."); + process.exit(); + } + + // deploy mock contract so we can set block times. ( ReversibleICOMock ) + this.ReversibleICO = await helpers.utils.deployNewContractInstance(helpers, "ReversibleICOMock"); + + console.log(" Gas used for deployment:", this.ReversibleICO.receipt.gasUsed); + console.log(" Contract Address:", this.ReversibleICO.receipt.contractAddress); + console.log(""); + + helpers.addresses.Rico = this.ReversibleICO.receipt.contractAddress; + + TokenContractInstance = await helpers.utils.deployNewContractInstance( + helpers, + "RicoToken", + { + from: holder, + arguments: [setup.settings.token.supply.toString(), []], + gas: 6500000, + gasPrice: helpers.solidity.gwei * 10 + } + ); + + TokenContractAddress = TokenContractInstance.receipt.contractAddress; + + await TokenContractInstance.methods.setup( + helpers.addresses.Rico + ).send({ + from: holder, // initial token supply holder + }); + + }); + + describe("Stage 1 - Deployment", function () { + + before(async function () { + + }); + + it("Gas usage should be lower than network configuration gas.", function () { + expect(this.ReversibleICO.receipt.gasUsed).to.be.below(helpers.networkConfig.gas); + }); + + it("Property deployerAddress should be " + deployerAddress, async function () { + expect(await this.ReversibleICO.methods.deployerAddress().call()).to.be.equal(deployerAddress); + }); + + it("Property initialized should be false", async function () { + expect(await this.ReversibleICO.methods.initialized().call()).to.be.equal(false); + }); + + it("Property frozen should be false", async function () { + expect(await this.ReversibleICO.methods.frozen().call()).to.be.equal(false); + }); + + it("Property TokenContractAddress should be address(0x0)", async function () { + expect(await this.ReversibleICO.methods.tokenContractAddress().call()).to.be.equal("0x0000000000000000000000000000000000000000"); + }); + + it("Property whitelistControllerAddress should be address(0x0)", async function () { + expect(await this.ReversibleICO.methods.whitelistControllerAddress().call()).to.be.equal("0x0000000000000000000000000000000000000000"); + }); + + }); + + describe("Stage 2 - Initialisation - init()", function () { + + before(async function () { + + currentBlock = await this.ReversibleICO.methods.getCurrentBlockNumber().call(); + + // starts in one day + commitPhaseStartBlock = parseInt(currentBlock, 10) + blocksPerDay * 1; + + // 22 days commiting + commitPhaseBlockCount = blocksPerDay * 22; + commitPhasePrice = helpers.solidity.ether * 0.002; + + // 12 x 30 day periods for buying + StageCount = 12; + StageBlockCount = blocksPerDay * 30; + StagePriceIncrease = helpers.solidity.ether * 0.0001; + + commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount - 1; + + stageValidation.push( { + start_block: commitPhaseStartBlock, + end_block: commitPhaseEndBlock, + token_price: commitPhasePrice + }); + + let lastStageBlockEnd = commitPhaseEndBlock; + for (let i = 1; i <= StageCount; i++) { + + const startBlock = lastStageBlockEnd + 1; + const endBlock = startBlock + StageBlockCount - 1; + stageValidation.push( { + start_block: startBlock, + end_block: endBlock, + token_price: commitPhasePrice + (StagePriceIncrease * (i)) + }); + + lastStageBlockEnd = endBlock; + } + + // The buy phase starts on the subsequent block of the commitPhase's (stage0) endBlock + BuyPhaseStartBlock = commitPhaseEndBlock + 1; + BuyPhaseEndBlock = lastStageBlockEnd; + // The duration of buyPhase in blocks + BuyPhaseBlockCount = BuyPhaseEndBlock - BuyPhaseStartBlock; + + await this.ReversibleICO.methods.init( + TokenContractAddress, // address _tokenContractAddress + whitelistControllerAddress, // address _whitelistControllerAddress + projectWalletAddress, // address _projectWalletAddress + commitPhaseStartBlock, // uint256 _commitPhaseStartBlock + commitPhaseBlockCount, // uint256 _commitPhaseBlockCount, + commitPhasePrice, // uint256 _commitPhasePrice in wei + StageCount, // uint8 _stageCount + StageBlockCount, // uint256 _stageBlockCount + StagePriceIncrease // uint256 _stagePriceIncrease in wei + ).send({ + from: deployerAddress, // deployer + gas: 3000000 + }); + + }); + + describe("Contract settings", function () { + + it("Property initialized should be true", async function () { + expect(await this.ReversibleICO.methods.initialized().call()).to.be.equal(true); + }); + + it("Property frozen should be false", async function () { + expect(await this.ReversibleICO.methods.frozen().call()).to.be.equal(false); + }); + + it("Property TokenContractAddress should be deployed ERC777 Token Contract address", async function () { + expect(await this.ReversibleICO.methods.tokenContractAddress().call()).to.be.equal(TokenContractAddress); + }); + + it("Property whitelistControllerAddress should be " + whitelistControllerAddress, async function () { + expect(await this.ReversibleICO.methods.whitelistControllerAddress().call()).to.be.equal(whitelistControllerAddress); + }); + + it("Property projectWalletAddress should be " + projectWalletAddress, async function () { + expect(await this.ReversibleICO.methods.projectWalletAddress().call()).to.be.equal(projectWalletAddress); + }); + + it("BuyPhaseEndBlock matches settings", async function () { + expect(await this.ReversibleICO.methods.buyPhaseEndBlock().call()).to.be.equal(BuyPhaseEndBlock.toString()); + }); + + }); + + describe("Contract Stages", function () { + + let StageData; + before(async function () { + StageData = await this.ReversibleICO.methods.stages(0).call(); + }); + + it("Stage Count is correct", async function () { + expect(await this.ReversibleICO.methods.stageCount().call()).to.be.equal(StageCount.toString()); + }); + + it("Commit Phase StartBlock matches settings", async function () { + expect(StageData.startBlock.toString()).to.be.equal(commitPhaseStartBlock.toString()); + }); + + it("Commit Phase duration is PhaseBlockCount", async function () { + const count = StageData.endBlock - StageData.startBlock + 1; + expect(count.toString()).to.be.equal(commitPhaseBlockCount.toString()); + }); + + it("Commit Phase EndBlock matches settings", async function () { + expect(StageData.endBlock).to.be.equal(commitPhaseEndBlock.toString()); + }); + + it("Commit Phase Price matches settings", async function () { + expect(StageData.tokenPrice.toString()).to.be.equal(commitPhasePrice.toString()); + }); + + it("First Buy Stage settings are correct", async function () { + const stageId = 0; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + const stage_block_start = stageData.startBlock; + const stage_end_block = stageData.endBlock; + const stage_token_price = stageData.tokenPrice; + + expect(stage_block_start).to.be.equal(stageValidation[stageId].start_block.toString()); + expect(stage_end_block).to.be.equal(stageValidation[stageId].end_block.toString()); + expect(stage_token_price).to.be.equal(stageValidation[stageId].token_price.toString()); + }); + + it("Last Buy Stage settings are correct", async function () { + const stageId = StageCount; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + const stage_block_start = stageData.startBlock; + const stage_end_block = stageData.endBlock; + const stage_token_price = stageData.tokenPrice; + + expect(stage_block_start).to.be.equal(stageValidation[stageId].start_block.toString()); + expect(stage_end_block).to.be.equal(stageValidation[stageId].end_block.toString()); + expect(stage_token_price).to.be.equal(stageValidation[stageId].token_price.toString()); + }); + + it("Last Buy Stage end_block matches contract BuyPhaseEndBlock", async function () { + const stageId = StageCount; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + const stage_end_block = stageData.endBlock; + expect(stage_end_block).to.be.equal(BuyPhaseEndBlock.toString()); + }); + + }); + + }); + + + describe("Contract Methods", function () { + + describe("view getCurrentStage()", async function () { + + it("Returns stage 0 if at Commit Phase start_block", async function () { + const stageId = 0; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 0 if at Commit Phase end_block", async function () { + const stageId = 0; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 1 if at stage 1 start_block", async function () { + const stageId = 1; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 1 if at stage 1 end_block", async function () { + const stageId = 1; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 5 if at stage 5 start_block", async function () { + const stageId = 5; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 5 if at stage 5 end_block", async function () { + const stageId = 5; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns last stage if at last stage start_block", async function () { + const stageId = StageCount; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns last stage if at last stage end_block", async function () { + const stageId = StageCount; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + + it("after last stage end_block reverts with \"Block outside of rICO period.\"", async function () { + + const stageData = await this.ReversibleICO.methods.stages(StageCount).call(); + await this.ReversibleICO.methods.jumpToBlockNumber( + stageData.endBlock + 1 + ).send({ + from: deployerAddress, gas: 100000 + }); + + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.getCurrentStage().call() + }, "Block outside of rICO period."); + }); + + }); + + describe("view getStageAtBlock(uint256)", async function () { + + it("Returns stage 0 if getStageAtBlock( Commit Phase startBlock )", async function () { + const stageId = 0; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.startBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 0 if getStageAtBlock( Commit Phase endBlock )", async function () { + const stageId = 0; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 1 if getStageAtBlock( stage_1.startBlock )", async function () { + const stageId = 1; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.startBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 1 if getStageAtBlock( stage_1.endBlock )", async function () { + const stageId = 1; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 5 if getStageAtBlock( stage_5.startBlock )", async function () { + const stageId = 5; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.startBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 5 if getStageAtBlock( stage_5.endBlock )", async function () { + const stageId = 5; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage last stage if getStageAtBlock( last_stage.startBlock )", async function () { + const stageId = StageCount; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.startBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage last stage if getStageAtBlock( last_stage.endBlock )", async function () { + const stageId = StageCount; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("after last stage end_block reverts with \"Block outside of rICO period.\"", async function () { + const stageData = await this.ReversibleICO.methods.stages(StageCount).call(); + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock + 1).call() + }, "Block outside of rICO period."); + }); + + }); + + }); +}); diff --git a/test/tests/external/ERC777.behavior.js b/test/solc_tests/external/ERC777.behavior.js similarity index 100% rename from test/tests/external/ERC777.behavior.js rename to test/solc_tests/external/ERC777.behavior.js diff --git a/test/tests/external/ERC777.test.js b/test/solc_tests/external/ERC777.test.js similarity index 100% rename from test/tests/external/ERC777.test.js rename to test/solc_tests/external/ERC777.test.js diff --git a/test/tests/external/SafeMath.js b/test/solc_tests/external/SafeMath.js similarity index 100% rename from test/tests/external/SafeMath.js rename to test/solc_tests/external/SafeMath.js diff --git a/test/helpers/ExecutionTarget.sol b/test/solc_tests/helpers/ExecutionTarget.sol similarity index 100% rename from test/helpers/ExecutionTarget.sol rename to test/solc_tests/helpers/ExecutionTarget.sol diff --git a/test/helpers/SolidityAccountUtils.sol b/test/solc_tests/helpers/SolidityAccountUtils.sol similarity index 100% rename from test/helpers/SolidityAccountUtils.sol rename to test/solc_tests/helpers/SolidityAccountUtils.sol diff --git a/test/helpers/assertThrow.js b/test/solc_tests/helpers/assertThrow.js similarity index 100% rename from test/helpers/assertThrow.js rename to test/solc_tests/helpers/assertThrow.js diff --git a/test/helpers/evmScript.js b/test/solc_tests/helpers/evmScript.js similarity index 100% rename from test/helpers/evmScript.js rename to test/solc_tests/helpers/evmScript.js diff --git a/test/helpers/safeUtils.js b/test/solc_tests/helpers/safeUtils.js similarity index 100% rename from test/helpers/safeUtils.js rename to test/solc_tests/helpers/safeUtils.js diff --git a/test/helpers/timer.js b/test/solc_tests/helpers/timer.js similarity index 100% rename from test/helpers/timer.js rename to test/solc_tests/helpers/timer.js diff --git a/test/helpers/utils.js b/test/solc_tests/helpers/utils.js similarity index 70% rename from test/helpers/utils.js rename to test/solc_tests/helpers/utils.js index 5aee29c..a5d7666 100644 --- a/test/helpers/utils.js +++ b/test/solc_tests/helpers/utils.js @@ -70,7 +70,7 @@ module.exports = { This is useless for testing.. time is going to really depend on testrpc internal time, and we can't do anything about going back to test multiple things. - instead we mock time in both ApplicationEntity and Assets + instead we mock block number in our Contract */ /* async timeTravelTo(helpers, time) { @@ -130,11 +130,11 @@ module.exports = { return web3.eth.getAccounts(); }, async getAbi(name) { - const data = await require("../../build/contracts/"+name+".json"); + const data = await require("../../../build/contracts/"+name+".json"); return data.abi; }, async getAbiFile(name) { - return require("../../build/contracts/"+name+".json"); + return require("../../../build/contracts/"+name+".json"); }, async getContractInstance(helpers, name, address) { return new helpers.web3.eth.Contract( @@ -277,51 +277,53 @@ module.exports = { currentBlock = new helpers.BN(currentBlock); BuyPhaseStartBlock = new helpers.BN(BuyPhaseStartBlock); BuyPhaseEndBlock = new helpers.BN(BuyPhaseEndBlock); + BuyPhaseBlockCount = BuyPhaseEndBlock.sub(BuyPhaseStartBlock).add(new helpers.BN(1)); + precision = new helpers.BN(precision); - if( - currentBlock.toNumber() > BuyPhaseStartBlock.toNumber() - && currentBlock.toNumber() < BuyPhaseEndBlock.toNumber()) - { - const passedBlocks = currentBlock.sub(BuyPhaseStartBlock); - const BuyPhaseBlockCount = new helpers.BN(BuyPhaseEndBlock).sub(BuyPhaseStartBlock); + if(currentBlock.gte(BuyPhaseStartBlock) && currentBlock.lte(BuyPhaseEndBlock)) { + + // get the number of blocks that have "elapsed" since the buyPhase start + const passedBlocks = currentBlock.sub(BuyPhaseStartBlock).add(new helpers.BN(1)); // + 1 since we count current as well. + const BuyPhaseBlockCount = new helpers.BN(BuyPhaseEndBlock).sub(BuyPhaseStartBlock).add(new helpers.BN("1")); return passedBlocks.mul( new helpers.BN("10").pow( new helpers.BN(precision) ) - ).div(new helpers.BN(BuyPhaseBlockCount)); - } else if (currentBlock.toNumber() >= BuyPhaseEndBlock.toNumber()) { - return 0; + ).div(BuyPhaseBlockCount); + + } else if (currentBlock.gt(BuyPhaseEndBlock)) { + return new helpers.BN(1).mul(new helpers.BN("10").pow( new helpers.BN(precision))); } else { - return 0; + return new helpers.BN(0); } }, calculateLockedTokensAtBlockForBoughtAmount(helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, tokenAmount) { tokenAmount = new helpers.BN(tokenAmount); - if(currentBlock < BuyPhaseStartBlock) { - // commit phase - return tokenAmount; - } else if(currentBlock < BuyPhaseEndBlock) { - // buy phase - const precision = 20; - const unlocked = tokenAmount.mul( - new helpers.BN( + if (tokenAmount.gt( new helpers.BN("0") ) ) { + if(currentBlock < BuyPhaseStartBlock) { + // commit phase + return tokenAmount; + } else if(currentBlock < BuyPhaseEndBlock) { + // buy phase + const precision = new helpers.BN(20); + const unlocked = tokenAmount.mul( helpers.utils.getCurrentUnlockPercentage( helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, - new helpers.BN(precision) + precision ) - ) - ).div( - new helpers.BN("10").pow( new helpers.BN(precision) ) - ); - return tokenAmount.sub(unlocked); - } else { - // after contract end + ).div( + new helpers.BN("10").pow( precision ) + ); + return tokenAmount.sub(unlocked); + } + // after buyPhase's end return new helpers.BN("0"); } + return new helpers.BN("0"); }, async getTokenAmountForEthAtStage(helpers, contract, ethValue, stageId) { const stageData = await contract.methods.stages(stageId).call(); @@ -331,6 +333,13 @@ module.exports = { new helpers.BN(stageData.tokenPrice) ); }, + getTokenAmountForEthAtValue(helpers, ethValue, tokenPrice) { + return new helpers.BN(ethValue.toString()).mul( + new helpers.BN("10").pow( new helpers.BN("18") ) + ).div( + new helpers.BN(tokenPrice) + ); + }, async jumpToContractStage ( contract, deployerAddress, stageId, end = false, addToBlockNumber = false ) { const stageData = await contract.methods.stages(stageId).call(); let block = stageData.startBlock; @@ -352,40 +361,42 @@ module.exports = { }, async displayContributions(helpers, contract, participant_address, max = null) { - let committedETH = await contract.methods.committedETH().call(); + + let totalReceivedETH = await contract.methods.totalReceivedETH().call(); let returnedETH = await contract.methods.returnedETH().call(); - let acceptedETH = await contract.methods.acceptedETH().call(); + let committedETH = await contract.methods.committedETH().call(); let withdrawnETH = await contract.methods.withdrawnETH().call(); let allocatedETH = await contract.methods.projectAllocatedETH().call(); - let ProjectETHWithdrawn = await contract.methods.ProjectETHWithdrawn().call(); + let projectWithdrawnETH = await contract.methods.projectWithdrawnETH().call(); let ContractBalance = await helpers.utils.getBalance(helpers, contract.receipt.contractAddress); let ParticipantByAddress = await contract.methods.participantsByAddress(participant_address).call(); + let ParticipantTotalStats = await contract.methods.participantAggregatedStats(participant_address).call(); let StageCount = await contract.methods.stageCount().call(); const contributionsCount = ParticipantByAddress.contributionsCount; - const LockedBalance = await contract.methods.getLockedTokenAmount(participant_address).call(); - + const LockedBalance = await contract.methods.getLockedTokenAmount(participant_address, false).call(); + console.log(); console.log("Globals"); console.log("Real Balance: ", helpers.utils.toEth(helpers, ContractBalance.toString()) +" eth" ); - console.log("Total amount Received: ", helpers.utils.toEth(helpers, committedETH.toString()) +" eth" ); + console.log("Total amount Received: ", helpers.utils.toEth(helpers, totalReceivedETH.toString()) +" eth" ); console.log("Total amount Returned: ", helpers.utils.toEth(helpers, returnedETH.toString()) +" eth" ); - console.log("Total amount Accepted: ", helpers.utils.toEth(helpers, acceptedETH.toString()) +" eth" ); + console.log("Total amount Committed: ", helpers.utils.toEth(helpers, committedETH.toString()) +" eth" ); console.log("Total amount Withdrawn: ", helpers.utils.toEth(helpers, withdrawnETH.toString()) +" eth" ); console.log("Total amount Allocated: ", helpers.utils.toEth(helpers, allocatedETH.toString()) +" eth" ); - console.log("Project ETH Withdrawn: ", helpers.utils.toEth(helpers, ProjectETHWithdrawn.toString()) +" eth" ); + console.log("Project ETH Withdrawn: ", helpers.utils.toEth(helpers, projectWithdrawnETH.toString()) +" eth" ); console.log("Contributions for address:", participant_address); console.log("Count: ", contributionsCount.toString()); - console.log("Total committedETH: ", helpers.utils.toEth(helpers, ParticipantByAddress.committedETH.toString()) +" eth" ); - console.log("Total returnedETH: ", helpers.utils.toEth(helpers, ParticipantByAddress.returnedETH.toString()) +" eth" ); - console.log("Total acceptedETH: ", helpers.utils.toEth(helpers, ParticipantByAddress.acceptedETH.toString()) +" eth" ); - console.log("Total withdrawnETH: ", helpers.utils.toEth(helpers, ParticipantByAddress.withdrawnETH.toString()) +" eth" ); - console.log("Total allocatedETH: ", helpers.utils.toEth(helpers, ParticipantByAddress.allocatedETH.toString()) +" eth" ); - console.log("Total reservedTokens: ", helpers.utils.toEth(helpers, ParticipantByAddress.reservedTokens.toString()) +" tokens" ); - console.log("Total boughtTokens: ", helpers.utils.toEth(helpers, ParticipantByAddress.boughtTokens.toString()) +" tokens" ); - console.log("Total returnedTokens: ", helpers.utils.toEth(helpers, ParticipantByAddress.returnedTokens.toString()) +" tokens" ); + console.log("Total totalReceivedETH: ", helpers.utils.toEth(helpers, ParticipantTotalStats.totalReceivedETH.toString()) +" eth" ); + console.log("Total returnedETH: ", helpers.utils.toEth(helpers, ParticipantTotalStats.returnedETH.toString()) +" eth" ); + console.log("Total committedETH: ", helpers.utils.toEth(helpers, ParticipantTotalStats.committedETH.toString()) +" eth" ); + console.log("Total withdrawnETH: ", helpers.utils.toEth(helpers, ParticipantTotalStats.withdrawnETH.toString()) +" eth" ); + console.log("Total allocatedETH: ", helpers.utils.toEth(helpers, ParticipantTotalStats.allocatedETH.toString()) +" eth" ); + console.log("Total reservedTokens: ", helpers.utils.toEth(helpers, ParticipantTotalStats.reservedTokens.toString()) +" tokens" ); + console.log("Total boughtTokens: ", helpers.utils.toEth(helpers, ParticipantTotalStats.boughtTokens.toString()) +" tokens" ); + console.log("Total returnedTokens: ", helpers.utils.toEth(helpers, ParticipantTotalStats.returnedTokens.toString()) +" tokens" ); console.log("Locked Token Balance: ", helpers.utils.toEth(helpers, LockedBalance.toString()) +" tokens" ); if(max > 0) { @@ -395,10 +406,10 @@ module.exports = { for(let i = 0; i < StageCount; i++) { const ParticipantStageDetails = await contract.methods.getParticipantDetailsByStage(participant_address, i).call(); console.log("-------------------------------------------"); - console.log("stageId: ", i); - console.log("committedETH: ", helpers.utils.toEth(helpers,ParticipantStageDetails.stageCommittedETH.toString() ) +" eth" ); + console.log("stageId: ", i); + console.log("totalReceivedETH: ", helpers.utils.toEth(helpers,ParticipantStageDetails.stageTotalReceivedETH.toString() ) +" eth" ); console.log("returnedETH: ", helpers.utils.toEth(helpers,ParticipantStageDetails.stageReturnedETH.toString() ) +" eth" ); - console.log("acceptedETH: ", helpers.utils.toEth(helpers,ParticipantStageDetails.stageAcceptedETH.toString() ) +" eth" ); + console.log("committedETH: ", helpers.utils.toEth(helpers,ParticipantStageDetails.stageCommittedETH.toString() ) +" eth" ); console.log("withdrawnETH: ", helpers.utils.toEth(helpers,ParticipantStageDetails.stageWithdrawnETH.toString() ) +" eth" ); console.log("allocatedETH: ", helpers.utils.toEth(helpers,ParticipantStageDetails.stageAllocatedETH.toString() ) +" eth" ); console.log("reservedTokens: ", helpers.utils.toEth(helpers,ParticipantStageDetails.stageReservedTokens.toString() ) +" tokens" ); @@ -421,71 +432,106 @@ module.exports = { }, async getAvailableEthAndTokensForWithdraw(helpers, contract, _from, _returned_token_amount) { - let InitialTokens = new helpers.BN(_returned_token_amount); + let _returnedTokenAmount = new helpers.BN(_returned_token_amount); let returnValues = { eth: new helpers.BN("0"), - initial_tokens: InitialTokens, + project_allocated_eth: new helpers.BN("0"), + initial_tokens: _returnedTokenAmount, returned_tokens: new helpers.BN("0"), withdrawn_tokens: new helpers.BN("0"), }; - const currentBlockNumber = parseInt(await contract.methods.getCurrentBlockNumber().call()); const BuyPhaseEndBlock = parseInt(await contract.methods.buyPhaseEndBlock().call()); const BuyPhaseStartBlock = parseInt(await contract.methods.buyPhaseStartBlock().call()); - const maxLocked = new helpers.BN( await contract.methods.getLockedTokenAmount(_from).call() ); + const maxLocked = new helpers.BN( await contract.methods.getLockedTokenAmount(_from, false).call() ); const ParticipantRecord = await contract.methods.participantsByAddress(_from).call(); - if(ParticipantRecord.whitelisted == true) { + if(maxLocked > 0) { - let RemainingTokenAmount = InitialTokens; + const currentBlockNumber = parseInt(await contract.methods.getCurrentBlockNumber().call()); + + // Contributors can send more tokens than they have locked, + // thus make sure we only try to return for said amount + let RemainingTokenAmount = _returnedTokenAmount; let ReturnTokenAmount = new helpers.BN("0"); + let allocatedEthAmount = new helpers.BN("0"); + // if returned amount is greater than the locked amount... + // set it equal to locked, keep track of the overflow tokens (remainingTokenAmount) if(RemainingTokenAmount.gt(maxLocked)) { ReturnTokenAmount = RemainingTokenAmount.sub(maxLocked); RemainingTokenAmount = maxLocked; } + // decrease the total allocated ETH by the equivalent participant's allocated amount + // projectAllocatedETH = projectAllocatedETH.sub(ParticipantRecord.allocatedETH); + if(RemainingTokenAmount.gt( new helpers.BN("0") )) { + // go through stages starting with current stage + // take stage token amount and remove from "amount participant wants to return" + // get ETH amount in said stage for that token amount + // set stage tokens to 0 + // if stage tokens < remaining tokens to process, just subtract remaining from stage + // this way we can receive tokens in current stage / later stages and process them again. + let ReturnETHAmount = new helpers.BN("0"); const currentStageNumber = parseInt( await contract.methods.getCurrentStage().call()); + for( let i = currentStageNumber; i >= 0; i-- ) { let stage_id = i; - let ParticipantRecordbyStage = await contract.methods.getParticipantDetailsByStage(_from, stage_id).call(); + const ParticipantRecordByStage = await contract.methods.getParticipantDetailsByStage(_from, stage_id).call(); + const StageReservedTokens = new helpers.BN(ParticipantRecordByStage.stageReservedTokens); + const StageBoughtTokens = new helpers.BN(ParticipantRecordByStage.stageBoughtTokens); + const StageReturnedTokens = new helpers.BN(ParticipantRecordByStage.stageReturnedTokens); + // total participant tokens at the current stage i.e. bought - returned + const totalInStage = StageBoughtTokens.sub(StageReturnedTokens); - let tokenAmount = new helpers.BN(ParticipantRecordbyStage.reservedTokens) - .add( - new helpers.BN(ParticipantRecordbyStage.stageBoughtTokens) - ) + // calculate how many tokens are actually locked at this stage... + // ...(at the current block number) and use only those for returning. + // reserved + bought - returned (at currentStage & currentBlock) - let tokens_in_stage = helpers.utils.calculateLockedTokensAtBlockForBoughtAmount( - helpers, currentBlockNumber, BuyPhaseStartBlock, BuyPhaseEndBlock, tokenAmount - ).sub( - new helpers.BN(ParticipantRecordbyStage.stageReturnedTokens.toString()) - ); + let tokensInStage = helpers.utils.calculateLockedTokensAtBlockForBoughtAmount( + helpers, currentBlockNumber, BuyPhaseStartBlock, BuyPhaseEndBlock, + StageBoughtTokens + ).sub(StageReturnedTokens); // only try to process stages that actually have tokens in them. - if(tokens_in_stage.gt( new helpers.BN("0") )) { + if(tokensInStage.gt( new helpers.BN("0") )) { - if (RemainingTokenAmount.lt(tokens_in_stage)) { - tokens_in_stage = RemainingTokenAmount; + if (RemainingTokenAmount.lt(tokensInStage)) { + tokensInStage = RemainingTokenAmount; } let CurrentETHAmount = await helpers.utils.getEthAmountForTokensAtStage( - helpers, contract, tokens_in_stage, stage_id + helpers, contract, tokensInStage, stage_id ); - // get eth for tokens in current stage + // increase the corresponding ETH counters ReturnETHAmount = ReturnETHAmount.add( CurrentETHAmount ); + // allocated to project + const unlockedETHAmount = await helpers.utils.getEthAmountForTokensAtStage( + helpers, + contract, + RemainingTokenAmount.sub(tokensInStage), // unlocked token amount + stage_id + ); + // console.log("["+i+"]CurrentETHAmount: ", CurrentETHAmount.toString()); + // console.log("["+i+"]ReturnETHAmount: ", ReturnETHAmount.toString()); + // console.log("["+i+"]unlockedETHAmount: ", unlockedETHAmount.toString()); + + allocatedEthAmount = allocatedEthAmount.add(unlockedETHAmount); + // participantRecord.byStage[stageId].allocatedETH = unlockedETHAmount; + // remove processed token amount from requested amount - RemainingTokenAmount = RemainingTokenAmount.sub(tokens_in_stage); + RemainingTokenAmount = RemainingTokenAmount.sub(tokensInStage); // break loop if remaining amount = 0 if(RemainingTokenAmount.eq( new helpers.BN("0"))) { @@ -495,7 +541,8 @@ module.exports = { } returnValues.eth = ReturnETHAmount; - returnValues.withdrawn_tokens = InitialTokens.sub(ReturnTokenAmount); + returnValues.project_allocated_eth = allocatedEthAmount; + returnValues.withdrawn_tokens = _returnedTokenAmount.sub(ReturnTokenAmount); returnValues.returned_tokens = ReturnTokenAmount; return returnValues; diff --git a/test/helpers/web3.js b/test/solc_tests/helpers/web3.js similarity index 100% rename from test/helpers/web3.js rename to test/solc_tests/helpers/web3.js diff --git a/test/solc_tests/rework/4_ReversibleICO.js b/test/solc_tests/rework/4_ReversibleICO.js new file mode 100644 index 0000000..ee98e00 --- /dev/null +++ b/test/solc_tests/rework/4_ReversibleICO.js @@ -0,0 +1,1273 @@ +const { + validatorHelper +} = require('./includes/setup'); + +const { + requiresERC1820Instance, + doFreshDeployment +} = require('./includes/deployment'); + +global.snapshots = []; +global.testKey = "ReversibleICOTests"; + +describe("ReversibleICO", function () { + + const deployerAddress = accounts[0]; + const whitelistControllerAddress = accounts[1]; + let TokenContractAddress, stageValidation = [], currentBlock, commitPhaseStartBlock, + commitPhaseBlockCount, commitPhasePrice, commitPhaseEndBlock, StageCount, + StageBlockCount, StagePriceIncrease, BuyPhaseEndBlock; + let TokenContractInstance; + + before(async function () { + requiresERC1820Instance(); + + const contracts = await doFreshDeployment(0); + this.ReversibleICO = contracts.ReversibleICOInstance; + TokenContractInstance = contracts.TokenContractInstance; + TokenContractAddress = TokenContractInstance.receipt.contractAddress; + }); + + + describe("Stage 1 - Deployment", function () { + + before(async function () { + + }); + + it("Gas usage should be lower than network configuration gas.", function () { + expect(this.ReversibleICO.receipt.gasUsed).to.be.below(helpers.networkConfig.gas); + }); + + it("Property deployerAddress should be " + deployerAddress, async function () { + expect(await this.ReversibleICO.methods.deployerAddress().call()).to.be.equal(deployerAddress); + }); + + it("Property initialized should be false", async function () { + expect(await this.ReversibleICO.methods.initialized().call()).to.be.equal(false); + }); + + it("Property frozen should be false", async function () { + expect(await this.ReversibleICO.methods.frozen().call()).to.be.equal(false); + }); + + it("Property TokenContractAddress should be address(0x0)", async function () { + expect(await this.ReversibleICO.methods.tokenContractAddress().call()).to.be.equal("0x0000000000000000000000000000000000000000"); + }); + + it("Property whitelistControllerAddress should be address(0x0)", async function () { + expect(await this.ReversibleICO.methods.whitelistControllerAddress().call()).to.be.equal("0x0000000000000000000000000000000000000000"); + }); + + }); + + describe("Stage 2 - Initialisation - init()", function () { + + before(async function () { + + currentBlock = await this.ReversibleICO.methods.getCurrentBlockNumber().call(); + + // starts in one day + commitPhaseStartBlock = parseInt(currentBlock, 10) + blocksPerDay * 1; + + // 22 days allocation + commitPhaseBlockCount = blocksPerDay * 22; + commitPhasePrice = helpers.solidity.ether * 0.002; + + // 12 x 30 day periods for distribution + StageCount = 12; + StageBlockCount = blocksPerDay * 30; + StagePriceIncrease = helpers.solidity.ether * 0.0001; + + commitPhaseEndBlock = commitPhaseStartBlock + commitPhaseBlockCount - 1; + + // for validation + BuyPhaseEndBlock = commitPhaseEndBlock + StageBlockCount * StageCount; + + let lastStageBlockEnd = commitPhaseEndBlock; + + for(let i = 0; i < StageCount; i++) { + + const start_block = lastStageBlockEnd + 1; + const end_block = lastStageBlockEnd + StageBlockCount; + const token_price = commitPhasePrice + ( StagePriceIncrease * ( i + 1) ); + + stageValidation.push( { + start_block: start_block, + end_block: end_block, + token_price: token_price + }); + + lastStageBlockEnd = end_block; + } + + await this.ReversibleICO.methods.init( + TokenContractAddress, // address _tokenContractAddress + whitelistControllerAddress, // address _whitelistControllerAddress + projectWalletAddress, // address _projectWalletAddress + commitPhaseStartBlock, // uint256 _commitPhaseStartBlock + commitPhaseBlockCount, // uint256 _commitPhaseBlockCount, + commitPhasePrice, // uint256 _commitPhasePrice in wei + StageCount, // uint8 _stageCount + StageBlockCount, // uint256 _stageBlockCount + StagePriceIncrease // uint256 _stagePriceIncrease in wei + ).send({ + from: deployerAddress, // deployer + gas: 3000000 + }); + + }); + + describe("Contract settings", function () { + + it("Property initialized should be true", async function () { + expect(await this.ReversibleICO.methods.initialized().call()).to.be.equal(true); + }); + + it("Property frozen should be false", async function () { + expect(await this.ReversibleICO.methods.frozen().call()).to.be.equal(false); + }); + + it("Property TokenContractAddress should be deployed ERC777 Token Contract address", async function () { + expect(await this.ReversibleICO.methods.tokenContractAddress().call()).to.be.equal(TokenContractAddress); + }); + + it("Property whitelistControllerAddress should be " + whitelistControllerAddress, async function () { + expect(await this.ReversibleICO.methods.whitelistControllerAddress().call()).to.be.equal(whitelistControllerAddress); + }); + + it("Property projectWalletAddress should be " + projectWalletAddress, async function () { + expect(await this.ReversibleICO.methods.projectWalletAddress().call()).to.be.equal(projectWalletAddress); + }); + + it("BuyPhaseEndBlock matches settings", async function () { + expect(await this.ReversibleICO.methods.buyPhaseEndBlock().call()).to.be.equal(BuyPhaseEndBlock.toString()); + }); + + }); + + describe("Contract Stages", function () { + + let allocationStageData; + before(async function () { + allocationStageData = await this.ReversibleICO.methods.stages(0).call(); + }); + + it("Stage Count is correct", async function () { + // account for the commit stage and add 1 + const stages = StageCount; + expect(await this.ReversibleICO.methods.stageCount().call()).to.be.equal(stages.toString()); + }); + + it("Allocation commitPhaseStartBlock matches settings", async function () { + expect(allocationStageData.startBlock.toString()).to.be.equal(commitPhaseStartBlock.toString()); + }); + + it("Allocation duration is commitPhaseBlockCount", async function () { + const count = allocationStageData.endBlock - allocationStageData.startBlock + 1; + expect(count.toString()).to.be.equal(commitPhaseBlockCount.toString()); + }); + + it("Allocation BuyPhaseEndBlock matches settings", async function () { + expect(allocationStageData.endBlock).to.be.equal(commitPhaseEndBlock.toString()); + }); + + it("commitPhasePrice matches settings", async function () { + expect(allocationStageData.tokenPrice.toString()).to.be.equal(commitPhasePrice.toString()); + }); + + it("First Distribution Stage settings are correct", async function () { + const stageRefId = 0; + const stageData = await this.ReversibleICO.methods.stages((stageRefId + 1)).call(); + const stage_block_start = stageData.startBlock; + const stage_end_block = stageData.endBlock; + const stage_token_price = stageData.tokenPrice; + + expect(stage_block_start).to.be.equal(stageValidation[stageRefId].start_block.toString()); + expect(stage_end_block).to.be.equal(stageValidation[stageRefId].end_block.toString()); + expect(stage_token_price).to.be.equal(stageValidation[stageRefId].token_price.toString()); + }); + + it("Last Distribution Stage settings are correct", async function () { + const stageRefId = StageCount - 1; + const stageData = await this.ReversibleICO.methods.stages((stageRefId + 1)).call(); + const stage_block_start = stageData.startBlock; + const stage_end_block = stageData.endBlock; + const stage_token_price = stageData.tokenPrice; + + expect(stage_block_start).to.be.equal(stageValidation[stageRefId].start_block.toString()); + expect(stage_end_block).to.be.equal(stageValidation[stageRefId].end_block.toString()); + expect(stage_token_price).to.be.equal(stageValidation[stageRefId].token_price.toString()); + }); + + it("Last Distribution Stage end_block matches contract BuyPhaseEndBlock", async function () { + const stageRefId = StageCount; + const stageData = await this.ReversibleICO.methods.stages(stageRefId).call(); + const stage_end_block = stageData.endBlock; + expect(stage_end_block).to.be.equal(BuyPhaseEndBlock.toString()); + }); + + }); + + }); + + describe("Stage 3 - Transfer tokens to RICO contract address", function () { + + const ERC777data = web3.utils.sha3('777TestData'); + + before(async function () { + TokenContractInstance = await helpers.utils.getContractInstance(helpers, "RicoToken", TokenContractAddress); + await TokenContractInstance.methods.send( + helpers.addresses.Rico, + RicoSaleSupply, + ERC777data + ).send({ + from: holder, // initial token supply holder + gas: 100000 + }); + }); + + describe("Contract Assets", function () { + + before(async function () { + }); + + it("RICO Contract should have 0 eth", async function () { + const ContractBalance = await helpers.utils.getBalance(helpers, helpers.addresses.Rico); + expect( ContractBalance ).to.be.bignumber.equal( new helpers.BN(0) ); + }); + + it("RICO Contract should have the correct token balance ("+RicoSaleSupply+")", async function () { + expect( + await TokenContractInstance.methods.balanceOf(helpers.addresses.Rico).call() + ).to.be.equal(RicoSaleSupply.toString()); + }); + + it("TokenSupply property should match Contract token balance ("+RicoSaleSupply+")", async function () { + expect( + await this.ReversibleICO.methods.tokenSupply().call() + ).to.be.equal( + await TokenContractInstance.methods.balanceOf(helpers.addresses.Rico).call() + ); + }); + + }); + + }); + + describe("Contract Methods", function () { + + describe("view getCurrentStage()", async function () { + + it("Returns stage 0 if at Allocation start_block", async function () { + const stageId = 0; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 0 if at Allocation end_block", async function () { + const stageId = 0; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 1 if at stage 1 start_block", async function () { + const stageId = 1; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 1 if at stage 1 end_block", async function () { + const stageId = 1; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 5 if at stage 5 start_block", async function () { + const stageId = 5; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 5 if at stage 5 end_block", async function () { + const stageId = 5; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns last stage if at last stage start_block", async function () { + const stageId = StageCount; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Returns last stage if at last stage end_block", async function () { + const stageId = StageCount; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + expect( await this.ReversibleICO.methods.getCurrentStage().call() ).to.be.equal( stageId.toString() ); + }); + + it("Revert before commit phase start_block", async function () { + const stageData = await this.ReversibleICO.methods.stages(0).call(); + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.jumpToBlockNumber( + stageData.startBlock - 1 + ).send({ + from: deployerAddress, gas: 100000 + }); + await this.ReversibleICO.methods.getCurrentStage().call(); + }, "Block outside of rICO period."); + }); + + it("Revert after last stage end_block", async function () { + const stageData = await this.ReversibleICO.methods.stages(StageCount).call(); + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.jumpToBlockNumber( + stageData.endBlock + 1 + ).send({ + from: deployerAddress, gas: 100000 + }); + await this.ReversibleICO.methods.getCurrentStage().call(); + }, "Block outside of rICO period."); + }); + }); + + describe("view getStageAtBlock(uint256)", async function () { + + it("Returns stage 0 if getStageAtBlock( Allocation.startBlock )", async function () { + const stageId = 0; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.startBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 0 if getStageAtBlock( Allocation.endBlock )", async function () { + const stageId = 0; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 1 if getStageAtBlock( stage_1.startBlock )", async function () { + const stageId = 1; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.startBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 1 if getStageAtBlock( stage_1.endBlock )", async function () { + const stageId = 1; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 5 if getStageAtBlock( stage_5.startBlock )", async function () { + const stageId = 5; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.startBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage 5 if getStageAtBlock( stage_5.endBlock )", async function () { + const stageId = 5; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage last stage if getStageAtBlock( last_stage.startBlock )", async function () { + const stageId = StageCount; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.startBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Returns stage last stage if getStageAtBlock( last_stage.endBlock )", async function () { + const stageId = StageCount; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock).call() + ).to.be.equal( stageId.toString() ); + }); + + it("Reverts if getStageAtBlock( last_stage.endBlock + 1 )", async function () { + const stageId = StageCount; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock + 1).call(); + }, "Block outside of rICO period."); + }); + + }); + + + describe("view getCurrentPrice()", async function () { + + it("Returns correct value for commit phase", async function () { + const stageId = 0; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + expect( await this.ReversibleICO.methods.getCurrentPrice().call() ).to.be.equal( commitPhasePrice.toString() ); + }); + + it("Returns correct value for stage 1", async function () { + const stageId = 1; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + expect( + await this.ReversibleICO.methods.getCurrentPrice().call() + ).to.be.equal( + stageValidation[stageId - 1].token_price.toString() + ); + }); + + it("Returns correct value for stage 5", async function () { + const stageId = 5; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + expect( + await this.ReversibleICO.methods.getCurrentPrice().call() + ).to.be.equal( + stageValidation[stageId - 1].token_price.toString() + ); + }); + + it("Returns correct value for last stage", async function () { + const stageId = StageCount; + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + expect( + await this.ReversibleICO.methods.getCurrentPrice().call() + ).to.be.equal( + stageValidation[stageId - 1].token_price.toString() + ); + }); + + it("Reverts after last stage end block", async function () { + const stageData = await this.ReversibleICO.methods.stages(StageCount).call(); + await this.ReversibleICO.methods.jumpToBlockNumber( + stageData.endBlock + 1 + ).send({ + from: deployerAddress, gas: 100000 + }); + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.getCurrentPrice().call(); + }, "Block outside of rICO period."); + }); + }); + + describe("view getPriceAtBlock(uint256)", async function () { + + it("Returns correct value for commit phase", async function () { + const stageId = 0; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getPriceAtBlock(stageData.startBlock).call() + ).to.be.equal( commitPhasePrice.toString() ); + }); + + it("Returns correct value for stage 1", async function () { + const stageId = 1; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getPriceAtBlock(stageData.startBlock).call() + ).to.be.equal( + stageValidation[stageId - 1].token_price.toString() + ); + }); + + it("Returns correct value for stage 5", async function () { + const stageId = 5; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getPriceAtBlock(stageData.startBlock).call() + ).to.be.equal( + stageValidation[stageId - 1].token_price.toString() + ); + }); + + it("Returns correct value for last stage", async function () { + const stageId = StageCount; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + expect( + await this.ReversibleICO.methods.getPriceAtBlock(stageData.startBlock).call() + ).to.be.equal( + stageValidation[stageId - 1].token_price.toString() + ); + }); + + it("Reverts after last stage end block", async function () { + const stageId = StageCount; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.getPriceAtBlock(stageData.endBlock + 1).call(); + }, "Block outside of rICO period."); + }); + }); + + + describe("view getTokenAmountForEthAtStage(uint256, uint8)", async function () { + + it("Returns correct value for 1 eth & Allocation stage", async function () { + const ethValue = helpers.solidity.ether * 1; + const stageId = 0; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + + const calculatedTokenAmount = new helpers.BN(ethValue.toString()).mul( + new helpers.BN("10").pow( new BN("18") ) + ).div( + new helpers.BN(stageData.tokenPrice) + ); + const tokenAmount = await this.ReversibleICO.methods.getTokenAmountForEthAtStage( ethValue.toString() , stageId).call(); + expect( tokenAmount.toString() ).to.be.equal( calculatedTokenAmount.toString() ); + }); + + + it("Returns correct value for 1 eth & stage 1", async function () { + const ethValue = helpers.solidity.ether * 1; + const stageId = 1; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + + const calculatedTokenAmount = new helpers.BN(ethValue.toString()).mul( + new helpers.BN("10").pow( new BN("18") ) + ).div( + new helpers.BN(stageData.tokenPrice) + ); + + const tokenAmount = await this.ReversibleICO.methods.getTokenAmountForEthAtStage( ethValue.toString() , stageId).call(); + expect( tokenAmount.toString() ).to.be.equal( calculatedTokenAmount.toString() ); + }); + + it("Returns correct value for 0.002 eth & Allocation stage ( results in 1 full token )", async function () { + const ethValue = helpers.solidity.ether * 0.002; + const stageId = 0; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + + const calculatedTokenAmount = new helpers.BN(ethValue.toString()).mul( + new helpers.BN("10").pow( new BN("18") ) + ).div( + new helpers.BN(stageData.tokenPrice) + ); + + const tokenAmount = await this.ReversibleICO.methods.getTokenAmountForEthAtStage( ethValue.toString() , stageId).call(); + expect( tokenAmount.toString() ).to.be.equal( calculatedTokenAmount.toString() ); + expect( helpers.utils.toFullToken(helpers, tokenAmount) ).to.be.equal("1"); + // console.log("tokenAmount", helpers.utils.toFullToken(helpers, tokenAmount) ); + + }); + + it("Returns correct value for 1 wei & Allocation stage ( results in 500 token grains )", async function () { + const ethValue = 1; + const stageId = 0; + const stageData = await this.ReversibleICO.methods.stages(stageId).call(); + + const calculatedTokenAmount = new helpers.BN(ethValue.toString()).mul( + new helpers.BN("10").pow( new BN("18") ) + ).div( + new helpers.BN(stageData.tokenPrice) + ); + + const tokenAmount = await this.ReversibleICO.methods.getTokenAmountForEthAtStage( ethValue.toString() , stageId).call(); + expect( tokenAmount.toString() ).to.be.equal( calculatedTokenAmount.toString() ); + expect( tokenAmount.toString() ).to.be.equal("500"); + // console.log("tokenAmount", helpers.utils.toFullToken(helpers, tokenAmount) ); + }); + }); + + + describe("transaction whitelist(address,approve)", async function () { + + before(async function () { + // jump to commit start + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, 0 ); + helpers.utils.resetAccountNonceCache(helpers); + }); + + describe("if msg.sender is not whitelistControllerAddress", async function () { + + it("transaction reverts \"Only the whitelist controller can call this method.\"", async function () { + + await helpers.assertInvalidOpcode( async () => { + + const TransactionSender = accounts[0]; + + expect( + TransactionSender + ).to.not.be.equal( + await this.ReversibleICO.methods.whitelistControllerAddress.call() + ); + + expect( + await this.ReversibleICO.methods.initialized().call() + ).to.be.equal( true ); + + await this.ReversibleICO.methods.whitelist( + [accounts[1]], + true + ).send({ + from: TransactionSender + }); + }, "Only the whitelist controller can call this method."); + }); + + }); + + describe("msg.sender is whitelistControllerAddress", async function () { + + describe("contract in stage 1 or 2 ( not initialized with settings )", async function () { + + let TestReversibleICO; + + before(async function () { + helpers.utils.resetAccountNonceCache(helpers); + + // deploy mock contract so we can set block times. ( ReversibleICOMock ) + TestReversibleICO = await helpers.utils.deployNewContractInstance(helpers, "ReversibleICOMock"); + }); + + it("initialized is false", async function () { + const test = await TestReversibleICO.methods.initialized().call(); + expect( test ).to.be.equal( false ); + }); + + it("transaction reverts with \"Contract must be initialized.\"", async function () { + await helpers.assertInvalidOpcode( async () => { + + const initialized = await TestReversibleICO.methods.initialized().call(); + expect( initialized ).to.be.equal( false ); + + await TestReversibleICO.methods.whitelist( + [accounts[1]], + true + ).send({ + from: whitelistControllerAddress + }); + }, "Contract must be initialized."); + }); + }); + + + describe("contract in stage 4 - Ready for contributions", async function () { + + describe("supplied address has no contributions", async function () { + + it("transaction is accepted and participant address is whitelisted", async function () { + + await this.ReversibleICO.methods.whitelist( + [accounts[3]], + true + ).send({ + from: whitelistControllerAddress + }); + + let Participant = await this.ReversibleICO.methods.participantsByAddress(accounts[3]).call(); + expect( + Participant.whitelisted + ).to.be.equal( true ); + + }); + + + }); + + describe("supplied address has 15 contributions", async function () { + + const TestAcceptParticipant = participant_1; + const TestRejectParticipant = participant_2; + + const AcceptContributionAmount = new helpers.BN("1").mul( helpers.solidity.etherBN ); + const RejectContributionAmount = new helpers.BN("1").mul( helpers.solidity.etherBN ); + let TotalAcceptContributionsAmount = new helpers.BN(); + let TotalRejectContributionsAmount = new helpers.BN(); + let TotalAcceptGasCostAmount = new helpers.BN(); + let TotalRejectGasCostAmount = new helpers.BN(); + + before(async function () { + + // save contract and sender balances so we can check later + const InitialAcceptParticipantBalance = await helpers.utils.getBalance(helpers, TestAcceptParticipant); + const InitialRejectParticipantBalance = await helpers.utils.getBalance(helpers, TestRejectParticipant); + + const InitialContractBalance = await helpers.utils.getBalance(helpers, helpers.addresses.Rico); + + // Send 15 x 1 eth contributions from the same account. + for(i = 0; i < 15; i++) { + + // send a 1 eth contribution from TestAcceptParticipant + fundingTx = await helpers.web3Instance.eth.sendTransaction({ + from: TestAcceptParticipant, + to: helpers.addresses.Rico, + value: AcceptContributionAmount.toString(), + gasPrice: helpers.networkConfig.gasPrice + }); + + TotalAcceptContributionsAmount = TotalAcceptContributionsAmount.add( AcceptContributionAmount ); + TotalAcceptGasCostAmount = TotalAcceptGasCostAmount.add( + new helpers.BN(fundingTx.gasUsed).mul( + new helpers.BN( helpers.networkConfig.gasPrice.toString() ) + ) + ); + + // send a 1 eth contribution from TestRejectParticipant + fundingTx = await helpers.web3Instance.eth.sendTransaction({ + from: TestRejectParticipant, + to: helpers.addresses.Rico, + value: RejectContributionAmount.toString(), + gasPrice: helpers.networkConfig.gasPrice + }); + + TotalRejectContributionsAmount = TotalRejectContributionsAmount.add( RejectContributionAmount ); + TotalRejectGasCostAmount = TotalRejectGasCostAmount.add( + new helpers.BN(fundingTx.gasUsed).mul( + new helpers.BN( helpers.networkConfig.gasPrice.toString() ) + ) + ); + } + + // make sure our ending participant's balance is correct + const AcceptParticipantBalanceAfter = await helpers.utils.getBalance(helpers, TestAcceptParticipant); + const RejectParticipantBalanceAfter = await helpers.utils.getBalance(helpers, TestRejectParticipant); + + const newAcceptParticipantCalculatedBalance = InitialAcceptParticipantBalance + .sub(TotalAcceptContributionsAmount) + .sub(TotalAcceptGasCostAmount); + + const newRejectParticipantCalculatedBalance = InitialRejectParticipantBalance + .sub(TotalRejectContributionsAmount) + .sub(TotalRejectGasCostAmount); + + expect( AcceptParticipantBalanceAfter ).to.be.bignumber.equal( newAcceptParticipantCalculatedBalance ); + + expect( RejectParticipantBalanceAfter ).to.be.bignumber.equal( newRejectParticipantCalculatedBalance ); + + // make sure our ending contract balance is correct + const ContractBalanceAfter = await helpers.utils.getBalance(helpers, helpers.addresses.Rico); + const newCalculatedBalance = InitialContractBalance + .add(TotalAcceptContributionsAmount) + .add(TotalRejectContributionsAmount); + + expect( ContractBalanceAfter ).to.be.bignumber.equal( newCalculatedBalance ); + + }); + + describe("supplied mode TRUE", async function () { + + const ContributionCountToProcess = 15; + let whitelistTx; + + before(async function () { + whitelistTx = await this.ReversibleICO.methods.whitelist( + [TestAcceptParticipant], + true, + ).send({ + from: whitelistControllerAddress + }); + }); + + it("transaction is accepted", async function () { + expect( whitelistTx.status ).to.be.equal( true ); + }); + + it("ApplicationEvent emitted", async function () { + expect( + whitelistTx.events.hasOwnProperty('ApplicationEvent') + ).to.be.equal( + true + ); + }); + + it("Participant Contribution count is correct", async function () { + const ParticipantByAddress = await this.ReversibleICO.methods.participantsByAddress(TestAcceptParticipant).call(); + expect( + ParticipantByAddress.contributionsCount.toString() + ).to.be.equal( + ContributionCountToProcess.toString() + ); + }); + + it("Participant Token Balance is correct", async function () { + const ParticipantTokenBalance = await TokenContractInstance.methods.balanceOf(TestAcceptParticipant).call(); + + let TokenAmount = new helpers.BN(); + + for(let i = 0; i < StageCount; i++) { + const ParticipantStageDetails = await this.ReversibleICO.methods.getParticipantDetailsByStage(TestAcceptParticipant, i).call(); + TokenAmount = TokenAmount.add(new helpers.BN( + ParticipantStageDetails.stageBoughtTokens + )); + } + + expect( + ParticipantTokenBalance.toString() + ).to.be.equal( + TokenAmount.toString() + ); + }); + + describe("new contribution from the TestAcceptParticipant that is now whitelisted, is acceepted automatically.", async function () { + + let newContributionTx, initialContributionsCount, afterContributionsCount; + + before(async function () { + let ParticipantByAddress = await this.ReversibleICO.methods.participantsByAddress(TestAcceptParticipant).call(); + initialContributionsCount = ParticipantByAddress.contributionsCount; + + newContributionTx = await helpers.web3Instance.eth.sendTransaction({ + from: TestAcceptParticipant, + to: helpers.addresses.Rico, + value: AcceptContributionAmount.toString(), + gasPrice: helpers.networkConfig.gasPrice + }); + }); + + it("transaction is accepted", async function () { + expect( newContributionTx.status ).to.be.equal( true ); + }); + + it("Participant Contribution Count increases by 1", async function () { + let ParticipantByAddress = await this.ReversibleICO.methods.participantsByAddress(TestAcceptParticipant).call(); + afterContributionsCount = ParticipantByAddress.contributionsCount; + expect( + afterContributionsCount + ).to.be.equal( + ( ( parseInt(initialContributionsCount, 10) + 1 ) ).toString() + ); + }); + + it("Last Contribution is processed and has valid parameters", async function () { + + let currentStage = await this.ReversibleICO.methods.getCurrentStage().call(); + const StageDetails = await this.ReversibleICO.methods.getParticipantDetailsByStage( + TestAcceptParticipant, + // indexed from 0, thus inital count will match last id + currentStage + ).call(); + + const totalReceived = new BN(StageDetails.stageTotalReceivedETH); + const returned = new BN(StageDetails.stageReturnedETH); + const commited = new BN(StageDetails.stageCommittedETH); + const withdrawn = new BN(StageDetails.stageWithdrawnETH); + const allocated = new BN(StageDetails.stageAllocatedETH); + + const processedTotals = returned.add(commited).add(withdrawn).add(allocated); + expect( + processedTotals.toString() + ).to.be.equal( + totalReceived.toString() + ); + + }); + + }); + + }); + + + describe("supplied mode is FALSE", async function () { + + const ContributionCountToProcess = 15; + let whitelistTx; + let initialParticipantTokenBalance; + + before(async function () { + + initialParticipantTokenBalance = await TokenContractInstance.methods.balanceOf(TestRejectParticipant).call(); + + let Participant = await this.ReversibleICO.methods.participantsByAddress(TestRejectParticipant).call(); + expect( + Participant.whitelisted + ).to.be.equal( false ); + + whitelistTx = await this.ReversibleICO.methods.whitelist( + [TestRejectParticipant], + false, + ).send({ + from: whitelistControllerAddress + }); + + }); + + it("transaction is accepted", async function () { + expect( whitelistTx.status ).to.be.equal( true ); + }); + + it("ContributionEvent emitted event count matches", async function () { + expect( + whitelistTx.events.hasOwnProperty('ApplicationEvent') + ).to.be.equal( + true + ); + }); + + it("Participant Contribution count is correct", async function () { + const ParticipantByAddress = await this.ReversibleICO.methods.participantsByAddress(TestRejectParticipant).call(); + expect( + ParticipantByAddress.contributionsCount.toString() + ).to.be.equal( + ContributionCountToProcess.toString() + ); + }); + + it("Participant Token Balance is the same as initial", async function () { + + // since we're rejecting their contribution.. new balance should be the same as initial. + const ParticipantTokenBalance = await TokenContractInstance.methods.balanceOf(TestRejectParticipant).call(); + expect( + ParticipantTokenBalance.toString() + ).to.be.equal( + initialParticipantTokenBalance.toString() + ); + + }); + + describe("new contribution from the RejectParticipant is now waiting processing.", async function () { + + let newContributionTx, initialContributionsCount, afterContributionsCount; + + before(async function () { + let ParticipantByAddress = await this.ReversibleICO.methods.participantsByAddress(TestRejectParticipant).call(); + initialContributionsCount = ParticipantByAddress.contributionsCount; + + newContributionTx = await helpers.web3Instance.eth.sendTransaction({ + from: TestRejectParticipant, + to: helpers.addresses.Rico, + value: RejectContributionAmount.toString(), + gasPrice: helpers.networkConfig.gasPrice + }); + }); + + it("transaction is accepted", async function () { + expect( newContributionTx.status ).to.be.equal( true ); + }); + + it("Participant Contribution Count increases by 1", async function () { + let ParticipantByAddress = await this.ReversibleICO.methods.participantsByAddress(TestRejectParticipant).call(); + afterContributionsCount = ParticipantByAddress.contributionsCount; + expect( + afterContributionsCount + ).to.be.equal( + ( ( parseInt(initialContributionsCount, 10) + 1 ) ).toString() + ); + }); + + it("Participant Record has valid parameters", async function () { + + let ParticipantTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(TestRejectParticipant).call(); + + const received = (parseInt(ParticipantTotalStats.totalReceivedETH, 10) ); + const returned = (parseInt(ParticipantTotalStats.returnedETH, 10) ); + const accepted = (parseInt(ParticipantTotalStats.committedETH, 10) ); + const withdrawn = (parseInt(ParticipantTotalStats.withdrawnETH, 10) ); + + const processedTotals = accepted + returned + withdrawn; + + expect( (parseInt(ParticipantTotalStats.reservedTokens, 10) ) ).to.be.above(0); + expect( processedTotals ).to.be.below(received); + + }); + + }); + + + }); + + + }); + + }); + + }); + + }); + + describe("view getCurrentUnlockPercentage()", async function () { + + const precision = 20; + let BuyPhaseStartBlock, BuyPhaseBlockCount; + + before(async function () { + BuyPhaseStartBlock = await this.ReversibleICO.methods.buyPhaseStartBlock().call(); + BuyPhaseBlockCount = await this.ReversibleICO.methods.buyPhaseBlockCount().call(); + }); + + it("Returns 0 before stage 1 start_block", async function () { + + let stageId = 0; + // jump to stage commit start block - 1 + let currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId); + let contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); + let calculatedRatio = helpers.utils.getCurrentUnlockPercentage(helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, precision); + + expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); + expect( contractRatio.toString() ).to.be.equal( "0" ); + + stageId = 1; + // jump to stage start_block - 1 + // currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, false, -1); + + contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); + calculatedRatio = helpers.utils.getCurrentUnlockPercentage(helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, precision); + + expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); + expect( contractRatio.toString() ).to.be.equal( "0" ); + + }); + + + it("Returns higher than 0 if at stage 1 start_block", async function () { + const stageId = 1; + // jump to stage 1 start_block exactly + const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, false, 0 ); + const contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); + const calculatedRatio = helpers.utils.getCurrentUnlockPercentage(helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, precision); + expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); + expect( calculatedRatio.toNumber() ).to.be.above( 0 ); + }); + + it("Returns lower than max at BuyPhaseEndBlock - 1", async function () { + const stageId = 12; + // jump to stage 1 start_block exactly + const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true, -1 ); + const contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); + const calculatedRatio = helpers.utils.getCurrentUnlockPercentage(helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, precision); + expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); + + const maxRatio = new helpers.BN("10").pow( new helpers.BN(precision)); + // ratio should be lower than 10 ** precision + expect( + calculatedRatio.lt(maxRatio) + ).to.be.equal( true ); + + }); + + it("Returns max at BuyPhaseEndBlock", async function () { + const stageId = 12; + // jump to stage 1 start_block exactly + const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true, 0 ); + const contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); + const calculatedRatio = helpers.utils.getCurrentUnlockPercentage(helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, precision); + expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); + expect( calculatedRatio.toString() ).to.be.equal( new helpers.BN("10").pow( new helpers.BN(precision) ).toString() ); + }); + + it("Returns max at BuyPhaseEndBlock + 1", async function () { + const stageId = 12; + // jump to stage 1 start_block exactly + const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true, 1 ); + const contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); + const calculatedRatio = helpers.utils.getCurrentUnlockPercentage(helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, precision); + expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); + expect( calculatedRatio.toString() ).to.be.equal( new helpers.BN("10").pow( new helpers.BN(precision) ).toString() ); + }); + }); + + describe("view getLockedTokenAmount(address)", async function () { + + const ContributionAmount = new helpers.BN("1").mul( helpers.solidity.etherBN ); + let BuyPhaseStartBlock, BuyPhaseBlockCount; + + before(async function () { + BuyPhaseStartBlock = await this.ReversibleICO.methods.buyPhaseStartBlock().call(); + BuyPhaseBlockCount = await this.ReversibleICO.methods.buyPhaseBlockCount().call(); + + // move to start of the commit phase + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, 0 ); + + // send 1 eth contribution + newContributionTx = await helpers.web3Instance.eth.sendTransaction({ + from: participant_1, + to: helpers.addresses.Rico, + value: ContributionAmount.toString(), + gasPrice: helpers.networkConfig.gasPrice + }); + + let whitelistTx = await this.ReversibleICO.methods.whitelist( + [participant_1], + true, + ).send({ + from: whitelistControllerAddress + }); + + }); + + it("Returns 0 at any stage if participant has no contributions", async function () { + + // jump to stage commit start block - 1 + const stageId = 0; + let currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, false, -1); + const ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_6).call(); + const ContractContributionTokens = ParticipantsTotalStats.boughtTokens; + + let getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_6).call(); + // make sure we return full purchased amount. + expect(getLockedTokenAmount).to.be.equal(ContractContributionTokens); + + // now let's validate the js calculations + let calculatedTokenAmount = helpers.utils.calculateLockedTokensAtBlockForBoughtAmount( + helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, ContractContributionTokens + ); + + expect(getLockedTokenAmount).to.be.equal(calculatedTokenAmount.toString()); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + + + currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, 1); + getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_6).call(); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + + currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, 12); + getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_6).call(); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + + currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, 12, false, 1); + getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_6).call(); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + }); + + it("Returns participant's purchased token amount before stage 1 start_block", async function () { + + // jump to stage commit start block - 1 + const stageId = 1; + const currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, false, -1); + + const ParticipantTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + const ContractContributionTokens = ParticipantTotalStats.boughtTokens; + + const getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + expect(getLockedTokenAmount).to.be.equal(ContractContributionTokens); + + let calculatedTokenAmount = helpers.utils.calculateLockedTokensAtBlockForBoughtAmount( + helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, ContractContributionTokens + ); + + expect(getLockedTokenAmount).to.be.equal(calculatedTokenAmount.toString()); + }); + + + it("Returns proper amount at stage 1 start_block", async function () { + + // jump to stage commit start block + const stageId = 1; + const currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId); + + const ParticipantTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + const ContractContributionTokens = ParticipantTotalStats.boughtTokens; + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + const getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); + const calculatedTokenAmount = helpers.utils.calculateLockedTokensAtBlockForBoughtAmount( + helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, ContractContributionTokens + ); + expect(getLockedTokenAmount).to.be.equal(calculatedTokenAmount.toString()); + }); + + it("Returns proper amount at stage 6 end_block - 1", async function () { + + // jump to stage commit start block + const stageId = 6; + const currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true, 0); + + const ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + const ContractContributionTokens = ParticipantsTotalStats.boughtTokens; + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + const getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); + const calculatedTokenAmount = helpers.utils.calculateLockedTokensAtBlockForBoughtAmount( + helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, ContractContributionTokens + ); + + expect(getLockedTokenAmount).to.be.equal(calculatedTokenAmount.toString()); + }); + + it("Returns proper amount at stage 12 end_block - 1", async function () { + + // jump to stage commit start block + const stageId = 12; + const currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true, 0); + + const ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + const ContractContributionTokens = ParticipantsTotalStats.boughtTokens; + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + const getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); + const calculatedTokenAmount = helpers.utils.calculateLockedTokensAtBlockForBoughtAmount( + helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, ContractContributionTokens + ); + + expect(getLockedTokenAmount).to.be.equal(calculatedTokenAmount.toString()); + }); + + it("Returns 0 locked tokens at stage 12 end_block ( also known as BuyPhaseEndBlock )", async function () { + + // jump to stage commit start block + let stageId = 12; + let currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true); + + let ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + let ContractContributionTokens = ParticipantsTotalStats.boughtTokens; + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + let getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); + let calculatedTokenAmount = helpers.utils.calculateLockedTokensAtBlockForBoughtAmount( + helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, ContractContributionTokens + ); + + expect(getLockedTokenAmount).to.be.equal(calculatedTokenAmount.toString()); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + }); + + it("Returns 0 locked tokens after BuyPhaseEndBlock", async function () { + + // jump to stage commit start block + let stageId = 12; + let currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true, 1); + + let ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + let ContractContributionTokens = ParticipantsTotalStats.boughtTokens; + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + let getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); + let calculatedTokenAmount = helpers.utils.calculateLockedTokensAtBlockForBoughtAmount( + helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, ContractContributionTokens + ); + + expect(getLockedTokenAmount).to.be.equal(calculatedTokenAmount.toString()); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + + currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true, 1000); + + ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participant_1).call(); + ContractContributionTokens = ParticipantsTotalStats.boughtTokens; + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participant_1).call(); + calculatedTokenAmount = helpers.utils.calculateLockedTokensAtBlockForBoughtAmount( + helpers, currentBlock, BuyPhaseStartBlock, BuyPhaseEndBlock, ContractContributionTokens + ); + + expect(getLockedTokenAmount).to.be.equal(calculatedTokenAmount.toString()); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + }); + + }); + + }); + + describe("Stage 4 - Funding Start", function () { + + /* + before(async function () { + // jump to commit start + // await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, 0 ); + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, 1 ); + }); + */ + }); +}); diff --git a/test/solc_tests/rework/includes/deployment.js b/test/solc_tests/rework/includes/deployment.js new file mode 100644 index 0000000..41bd649 --- /dev/null +++ b/test/solc_tests/rework/includes/deployment.js @@ -0,0 +1,186 @@ + +function requiresERC1820Instance() { + // test requires ERC1820.instance + if (helpers.ERC1820.instance == false) { + console.log(helpers.utils.colors.red, " Error: ERC1820.instance not found, please make sure to run it first.", helpers.utils.colors.none); + process.exit(); + } +} + +async function deployContract(name, args = {}) { + + const contractInstance = await helpers.utils.deployNewContractInstance( + helpers, name, args + ); + + console.log(" Contract deployed: ", name); + console.log(" Gas used: ", contractInstance.receipt.gasUsed); + console.log(" Contract Address: ", contractInstance.receipt.contractAddress); + + return { + instance: contractInstance, + receipt: contractInstance.receipt, + address: contractInstance.receipt.contractAddress + } +} + +async function deployTokenContract() { + return await deployContract( + "RicoToken", + { + from: holder, + arguments: [ + setup.settings.token.supply.toString(), + defaultOperators = [], // accounts[0] maybe + ], + gas: 6500000, + gasPrice: helpers.solidity.gwei * 10 + } + ); +} + +async function deployRICOContract() { + return await deployContract("ReversibleICOMock"); +} + +async function doFreshDeployment(snapshots, testKey, phase = 0, settings = null ) { + + requiresERC1820Instance(); + const snapShotKey = testKey+"_Phase_"+phase; + + // TestRPC EVM Snapshots allow us to save and restore snapshots at any block + // we use them to speed up the test runner. + + if (typeof snapshots[snapShotKey] !== "undefined" && snapshotsEnabled) { + + console.log(helpers.utils.colors.light_cyan, " * EVM snapshot["+snapShotKey+"] restore", helpers.utils.colors.none); + + // restore snapshot + await helpers.web3.evm.revert(snapshots[snapShotKey]); + + // save again because whomever wrote test rpc had the impression no one would ever restore twice.. dafuq + snapshots[snapShotKey+"_"+phase] = await helpers.web3.evm.snapshot(); + + // reset account nonces.. + helpers.utils.resetAccountNonceCache(helpers); + + } else { + + if (snapshotsEnabled) { + console.log(helpers.utils.colors.light_blue, " * EVM snapshot["+snapShotKey+"] start", helpers.utils.colors.none); + } + + const TokenContract = await deployTokenContract(); + TokenContractInstance = TokenContract.instance; + TokenContractAddress = TokenContract.address; + TokenContractReceipt = TokenContract.receipt; + + const RICOContract = await deployRICOContract(); + ReversibleICOInstance = RICOContract.instance; + ReversibleICOAddress = RICOContract.address; + ReversibleICOReceipt = RICOContract.receipt; + + // Setup token contract by adding RICO address + await TokenContractInstance.methods.setup( + ReversibleICOAddress + ).send({ + from: holder, // initial token supply holder + }); + + // phase = 1 -> init RICO with Settings + if(phase >= 1 ) { + + if(settings == null) { + throw "Settings cannot be null"; + } + + /* + * Add RICO Settings + */ + currentBlock = await ReversibleICOInstance.methods.getCurrentBlockNumber().call(); + + commitPhaseStartBlock = parseInt(currentBlock, 10) + settings.rico.startBlockDelay; + + // 22 days allocation + commitPhaseBlockCount = settings.rico.blocksPerDay * settings.rico.commitPhaseDays; + commitPhasePrice = settings.rico.commitPhasePrice; + + // 12 x 30 day periods for distribution + stageCount = settings.rico.stageCount; + stageBlockCount = settings.rico.blocksPerDay * settings.rico.stageDays; + stagePriceIncrease = settings.rico.stagePriceIncrease; + + await ReversibleICOInstance.methods.init( + TokenContractAddress, // address _TokenContractAddress + whitelistControllerAddress, // address _whitelistControllerAddress + projectWalletAddress, // address _projectWalletAddress + commitPhaseStartBlock, // uint256 _commitPhaseStartBlock + commitPhaseBlockCount, // uint256 _commitPhaseBlockCount, + commitPhasePrice, // uint256 _commitPhasePrice in wei + stageCount, // uint8 _StageCount + stageBlockCount, // uint256 _StageBlockCount + stagePriceIncrease // uint256 _StagePriceIncrease in wei + ).send({ + from: deployerAddress, // deployer + gas: 3000000 + }); + } + + // phase = 2 -> transfer tokens to rico + if(phase >= 2 ) { + + // transfer tokens to rico + await TokenContractInstance.methods.send( + ReversibleICOInstance.receipt.contractAddress, + setup.settings.token.sale.toString(), + web3.utils.sha3('777TestData') + ).send({ + from: holder, // initial token supply holder + gas: 100000 + }); + + expect( + await TokenContractInstance.methods.balanceOf(ReversibleICOAddress).call() + ).to.be.equal(setup.settings.token.sale.toString()); + } + + // create snapshot + if (snapshotsEnabled) { + snapshots[snapShotKey] = await helpers.web3.evm.snapshot(); + console.log(helpers.utils.colors.light_blue, " * EVM snapshot["+snapShotKey+"] end", helpers.utils.colors.none); + } + } + + // reinitialize instances so revert works properly. + TokenContractInstance = await helpers.utils.getContractInstance(helpers, "RicoToken", TokenContractAddress); + TokenContractInstance.receipt = TokenContractReceipt; + ReversibleICOInstance = await helpers.utils.getContractInstance(helpers, "ReversibleICOMock", ReversibleICOAddress); + ReversibleICOInstance.receipt = ReversibleICOReceipt; + + // do some validation + expect( + await helpers.utils.getBalance(helpers, ReversibleICOAddress) + ).to.be.bignumber.equal( new BN(0) ); + + let expectedTokenSupply = "0"; + if(phase >= 2 ) { + expectedTokenSupply = setup.settings.token.sale.toString(); + } + expect(await TokenContractInstance.methods.balanceOf(ReversibleICOAddress).call()).to.be.equal(expectedTokenSupply); + + expect( + await ReversibleICOInstance.methods.tokenSupply().call() + ).to.be.equal( + await TokenContractInstance.methods.balanceOf(ReversibleICOAddress).call() + ); + + return { + TokenContractInstance: TokenContractInstance, + ReversibleICOInstance: ReversibleICOInstance, + } +}; + +module.exports = { + requiresERC1820Instance, + doFreshDeployment +} \ No newline at end of file diff --git a/test/solc_tests/rework/includes/setup.js b/test/solc_tests/rework/includes/setup.js new file mode 100644 index 0000000..9be41f6 --- /dev/null +++ b/test/solc_tests/rework/includes/setup.js @@ -0,0 +1,46 @@ +global.helpers = setup.helpers; +global.BN = helpers.BN; +global.MAX_UINT256 = helpers.MAX_UINT256; +global.expect = helpers.expect + +global.deployerAddress = accounts[0]; +global.whitelistControllerAddress = accounts[1]; + +global.holder = accounts[10]; +global.projectWalletAddress = holder; + +global.participant_1 = accounts[4]; +global.participant_2 = accounts[5]; +global.participant_3 = accounts[6]; +global.participant_4 = accounts[7]; +global.participant_5 = accounts[8]; +global.participant_6 = accounts[9]; + + +global.ApplicationEventTypes = { + NOT_SET:0, // will match default value of a mapping result + CONTRIBUTION_NEW:1, + CONTRIBUTION_CANCEL:2, + PARTICIPANT_CANCEL:3, + COMMITMENT_ACCEPTED:4, + WHITELIST_APPROVE:5, + WHITELIST_REJECT:6, + PROJECT_WITHDRAW:7 +} + +global.TransferTypes = { + NOT_SET:0, + AUTOMATIC_REFUND:1, + WHITELIST_REJECT:2, + PARTICIPANT_CANCEL:3, + PARTICIPANT_WITHDRAW:4, + PROJECT_WITHDRAW:5 +} + +global.snapshotsEnabled = true; + +const validatorHelper = require("../../../js_validator_tests/assets/ricoContract.js"); + +module.exports = { + validatorHelper +}; diff --git a/test/solc_tests/rework/methods/stages.js b/test/solc_tests/rework/methods/stages.js new file mode 100644 index 0000000..caf5514 --- /dev/null +++ b/test/solc_tests/rework/methods/stages.js @@ -0,0 +1,458 @@ +const { + validatorHelper +} = require('../includes/setup'); + +const { + requiresERC1820Instance, + doFreshDeployment +} = require('../includes/deployment'); + +const snapshots = []; +const testKey = "StageTests"; + +describe("ReversibleICO - Methods - Stages", function () { + + const deployerAddress = accounts[0]; + const whitelistControllerAddress = accounts[1]; + let TokenContractAddress, RICOContractAddress, currentBlock; + let TokenContractInstance; + + before(async function () { + requiresERC1820Instance(); + + const contracts = await doFreshDeployment(snapshots, testKey, 2, setup.settings); + this.ReversibleICO = contracts.ReversibleICOInstance; + TokenContractInstance = contracts.TokenContractInstance; + TokenContractAddress = TokenContractInstance.receipt.contractAddress; + RICOContractAddress = this.ReversibleICO.receipt.contractAddress; + + currentBlock = parseInt( await this.ReversibleICO.methods.getCurrentBlockNumber().call(), 10); + this.jsValidator = new validatorHelper(setup.settings, currentBlock); + }); + + describe("Contract Methods", async function () { + + describe("view getCurrentStage()", async function () { + + it("Returns stage 0 if at commitPhase start_block", async function () { + const stageId = 0; + currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + this.jsValidator.setBlockNumber(currentBlock); + const result = await this.ReversibleICO.methods.getCurrentStage().call(); + expect( result ).to.be.equal( stageId.toString() ); + expect( result ).to.be.equal( this.jsValidator.getCurrentStage().toString() ); + }); + + it("Returns stage 0 if at commitPhase end_block", async function () { + const stageId = 0; + currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + this.jsValidator.setBlockNumber(currentBlock); + const result = await this.ReversibleICO.methods.getCurrentStage().call(); + expect( result ).to.be.equal( stageId.toString() ); + expect( result ).to.be.equal( this.jsValidator.getCurrentStage().toString() ); + }); + + it("Returns stage 1 if at stage 1 start_block", async function () { + const stageId = 1; + currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + this.jsValidator.setBlockNumber(currentBlock); + const result = await this.ReversibleICO.methods.getCurrentStage().call(); + expect( result ).to.be.equal( stageId.toString() ); + expect( result ).to.be.equal( this.jsValidator.getCurrentStage().toString() ); + }); + + it("Returns stage 1 if at stage 1 end_block", async function () { + const stageId = 1; + currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + this.jsValidator.setBlockNumber(currentBlock); + const result = await this.ReversibleICO.methods.getCurrentStage().call(); + expect( result ).to.be.equal( stageId.toString() ); + expect( result ).to.be.equal( this.jsValidator.getCurrentStage().toString() ); + }); + + it("Returns stage 5 if at stage 5 start_block", async function () { + const stageId = 5; + currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + this.jsValidator.setBlockNumber(currentBlock); + const result = await this.ReversibleICO.methods.getCurrentStage().call(); + expect( result ).to.be.equal( stageId.toString() ); + expect( result ).to.be.equal( this.jsValidator.getCurrentStage().toString() ); + }); + + it("Returns stage 5 if at stage 5 end_block", async function () { + const stageId = 5; + currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + this.jsValidator.setBlockNumber(currentBlock); + const result = await this.ReversibleICO.methods.getCurrentStage().call(); + expect( result ).to.be.equal( stageId.toString() ); + expect( result ).to.be.equal( this.jsValidator.getCurrentStage().toString() ); + }); + + it("Returns last stage if at last stage start_block", async function () { + const stageId = this.jsValidator.stageCount; + currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + this.jsValidator.setBlockNumber(currentBlock); + const result = await this.ReversibleICO.methods.getCurrentStage().call(); + expect( result ).to.be.equal( stageId.toString() ); + expect( result ).to.be.equal( this.jsValidator.getCurrentStage().toString() ); + }); + + it("Returns last stage if at last stage end_block", async function () { + const stageId = this.jsValidator.stageCount; + currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + this.jsValidator.setBlockNumber(currentBlock); + const result = await this.ReversibleICO.methods.getCurrentStage().call(); + expect( result ).to.be.equal( stageId.toString() ); + expect( result ).to.be.equal( this.jsValidator.getCurrentStage().toString() ); + }); + + it("Revert before commit phase start_block", async function () { + const stageData = this.jsValidator.stages[0]; + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.jumpToBlockNumber( + stageData.startBlock - 1 + ).send({ + from: deployerAddress, gas: 100000 + }); + await this.ReversibleICO.methods.getCurrentStage().call(); + }, "Block outside of rICO period."); + }); + + it("Revert after last stage end_block", async function () { + const stageData = this.jsValidator.stages[this.jsValidator.stageCount]; + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.jumpToBlockNumber( + stageData.endBlock + 1 + ).send({ + from: deployerAddress, gas: 100000 + }); + await this.ReversibleICO.methods.getCurrentStage().call(); + }, "Block outside of rICO period."); + }); + }); + + describe("view getStageAtBlock(uint256)", async function () { + + it("Returns stage 0 if getStageAtBlock( commitPhase.startBlock )", async function () { + const stageId = 0; + const stageData = this.jsValidator.stages[stageId]; + const result = await this.ReversibleICO.methods.getStageAtBlock(stageData.startBlock).call() + expect(result).to.be.equal( stageId.toString() ); + expect(result).to.be.equal( this.jsValidator.getStageAtBlock(stageData.startBlock).toString()); + }); + + it("Returns stage 0 if getStageAtBlock( commitPhase.endBlock )", async function () { + const stageId = 0; + const stageData = this.jsValidator.stages[stageId]; + const result = await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock).call() + expect(result).to.be.equal( stageId.toString() ); + expect(result).to.be.equal( this.jsValidator.getStageAtBlock(stageData.endBlock).toString()); + }); + + it("Returns stage 1 if getStageAtBlock( stage_1.startBlock )", async function () { + const stageId = 1; + const stageData = this.jsValidator.stages[stageId]; + const result = await this.ReversibleICO.methods.getStageAtBlock(stageData.startBlock).call() + expect(result).to.be.equal( stageId.toString() ); + expect(result).to.be.equal( this.jsValidator.getStageAtBlock(stageData.startBlock).toString()); + }); + + it("Returns stage 1 if getStageAtBlock( stage_1.endBlock )", async function () { + const stageId = 1; + const stageData = this.jsValidator.stages[stageId]; + const result = await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock).call() + expect(result).to.be.equal( stageId.toString() ); + expect(result).to.be.equal( this.jsValidator.getStageAtBlock(stageData.endBlock).toString()); + }); + + it("Returns stage 5 if getStageAtBlock( stage_5.startBlock )", async function () { + const stageId = 5; + const stageData = this.jsValidator.stages[stageId]; + const result = await this.ReversibleICO.methods.getStageAtBlock(stageData.startBlock).call() + expect(result).to.be.equal( stageId.toString() ); + expect(result).to.be.equal( this.jsValidator.getStageAtBlock(stageData.startBlock).toString()); + }); + + it("Returns stage 5 if getStageAtBlock( stage_5.endBlock )", async function () { + const stageId = 5; + const stageData = this.jsValidator.stages[stageId]; + const result = await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock).call() + expect(result).to.be.equal( stageId.toString() ); + expect(result).to.be.equal( this.jsValidator.getStageAtBlock(stageData.endBlock).toString()); + }); + + it("Returns stage last stage if getStageAtBlock( last_stage.startBlock )", async function () { + const stageId = this.jsValidator.stageCount; + const stageData = this.jsValidator.stages[stageId]; + const result = await this.ReversibleICO.methods.getStageAtBlock(stageData.startBlock).call() + expect(result).to.be.equal( stageId.toString() ); + expect(result).to.be.equal( this.jsValidator.getStageAtBlock(stageData.startBlock).toString()); + }); + + it("Returns stage last stage if getStageAtBlock( last_stage.endBlock )", async function () { + const stageId = this.jsValidator.stageCount; + const stageData = this.jsValidator.stages[stageId]; + const result = await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock).call() + expect(result).to.be.equal( stageId.toString() ); + expect(result).to.be.equal( this.jsValidator.getStageAtBlock(stageData.endBlock).toString()); + }); + + it("Reverts if getStageAtBlock( last_stage.endBlock + 1 )", async function () { + const stageId = this.jsValidator.stageCount; + const stageData = this.jsValidator.stages[stageId]; + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.getStageAtBlock(stageData.endBlock + 1).call(); + }, "Block outside of rICO period."); + }); + + }); + + + describe("view getCurrentPrice()", async function () { + + it("Returns correct value for commit phase", async function () { + const stageId = 0; + currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId ); + this.jsValidator.setBlockNumber(currentBlock); + const result = await this.ReversibleICO.methods.getCurrentPrice().call(); + expect(result).to.be.equal( commitPhasePrice.toString() ); + expect(result).to.be.equal( this.jsValidator.getCurrentPrice().toString()); + }); + + it("Returns correct value for stage 1", async function () { + const stageId = 1; + currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + this.jsValidator.setBlockNumber(currentBlock); + const result = await this.ReversibleICO.methods.getCurrentPrice().call(); + expect(result).to.be.equal( this.jsValidator.stages[stageId].tokenPrice.toString()); + expect(result).to.be.equal( this.jsValidator.getCurrentPrice().toString()); + }); + + it("Returns correct value for stage 5", async function () { + const stageId = 5; + currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + this.jsValidator.setBlockNumber(currentBlock); + const result = await this.ReversibleICO.methods.getCurrentPrice().call(); + expect(result).to.be.equal( this.jsValidator.stages[stageId].tokenPrice.toString()); + expect(result).to.be.equal( this.jsValidator.getCurrentPrice().toString()); + }); + + it("Returns correct value for last stage", async function () { + const stageId = this.jsValidator.stageCount; + currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true ); + this.jsValidator.setBlockNumber(currentBlock); + const result = await this.ReversibleICO.methods.getCurrentPrice().call(); + expect(result).to.be.equal( this.jsValidator.stages[stageId].tokenPrice.toString()); + expect(result).to.be.equal( this.jsValidator.getCurrentPrice().toString()); + }); + + it("Reverts after last stage end block", async function () { + const stageData = this.jsValidator.stages[this.jsValidator.stageCount]; + await this.ReversibleICO.methods.jumpToBlockNumber( + stageData.endBlock + 1 + ).send({ + from: deployerAddress, gas: 100000 + }); + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.getCurrentPrice().call(); + }, "Block outside of rICO period."); + }); + }); + + describe("view getPriceAtBlock(uint256)", async function () { + + it("Returns correct value for commit phase", async function () { + const stageId = 0; + const stageData = this.jsValidator.stages[stageId]; + const result = await this.ReversibleICO.methods.getPriceAtBlock(stageData.startBlock).call(); + expect(result).to.be.equal( commitPhasePrice.toString()); + expect(result).to.be.equal( this.jsValidator.getPriceAtBlock(stageData.startBlock).toString()); + }); + + it("Returns correct value for stage 1", async function () { + const stageId = 1; + const stageData = this.jsValidator.stages[stageId]; + const result = await this.ReversibleICO.methods.getPriceAtBlock(stageData.startBlock).call(); + expect(result).to.be.equal( this.jsValidator.stages[stageId].tokenPrice.toString()); + expect(result).to.be.equal( this.jsValidator.getPriceAtBlock(stageData.startBlock).toString()); + }); + + it("Returns correct value for stage 5", async function () { + const stageId = 5; + const stageData = this.jsValidator.stages[stageId]; + const result = await this.ReversibleICO.methods.getPriceAtBlock(stageData.startBlock).call(); + expect(result).to.be.equal( this.jsValidator.stages[stageId].tokenPrice.toString()); + expect(result).to.be.equal( this.jsValidator.getPriceAtBlock(stageData.startBlock).toString()); + }); + + it("Returns correct value for last stage", async function () { + const stageId = this.jsValidator.stageCount; + const stageData = this.jsValidator.stages[stageId]; + const result = await this.ReversibleICO.methods.getPriceAtBlock(stageData.startBlock).call(); + expect(result).to.be.equal( this.jsValidator.stages[stageId].tokenPrice.toString()); + expect(result).to.be.equal( this.jsValidator.getPriceAtBlock(stageData.startBlock).toString()); + + }); + + it("Reverts after last stage end block", async function () { + const stageId = this.jsValidator.stageCount; + const stageData = this.jsValidator.stages[stageId]; + await helpers.assertInvalidOpcode( async () => { + await this.ReversibleICO.methods.getPriceAtBlock(stageData.endBlock + 1).call(); + }, "Block outside of rICO period."); + }); + }); + + + describe("view getTokenAmountForEthAtStage(uint256, uint8)", async function () { + + it("Returns correct value for 1 eth & commitPhase stage", async function () { + const ethValue = helpers.solidity.ether * 1; + const stageId = 0; + const stageData = this.jsValidator.stages[stageId]; + + const calculatedTokenAmount = new helpers.BN(ethValue.toString()).mul( + new helpers.BN("10").pow( new BN("18") ) + ).div( + new helpers.BN(stageData.tokenPrice) + ); + const tokenAmount = await this.ReversibleICO.methods.getTokenAmountForEthAtStage( ethValue.toString() , stageId).call(); + expect( tokenAmount.toString() ).to.be.equal( calculatedTokenAmount.toString() ); + + const jsTokenAmount = this.jsValidator.getTokenAmountForEthAtStage(ethValue.toString() , stageId); + expect( tokenAmount.toString() ).to.be.equal( jsTokenAmount.toString() ); + }); + + + it("Returns correct value for 1 eth & stage 1", async function () { + const ethValue = helpers.solidity.ether * 1; + const stageId = 1; + const stageData = this.jsValidator.stages[stageId]; + + const calculatedTokenAmount = new helpers.BN(ethValue.toString()).mul( + new helpers.BN("10").pow( new BN("18") ) + ).div( + new helpers.BN(stageData.tokenPrice) + ); + + const tokenAmount = await this.ReversibleICO.methods.getTokenAmountForEthAtStage( ethValue.toString() , stageId).call(); + expect( tokenAmount.toString() ).to.be.equal( calculatedTokenAmount.toString() ); + + const jsTokenAmount = this.jsValidator.getTokenAmountForEthAtStage(ethValue.toString() , stageId); + expect( tokenAmount.toString() ).to.be.equal( jsTokenAmount.toString() ); + }); + + it("Returns correct value for 0.002 eth & commitPhase stage ( results in 1 full token )", async function () { + const ethValue = helpers.solidity.ether * 0.002; + const stageId = 0; + const stageData = this.jsValidator.stages[stageId]; + + const calculatedTokenAmount = new helpers.BN(ethValue.toString()).mul( + new helpers.BN("10").pow( new BN("18") ) + ).div( + new helpers.BN(stageData.tokenPrice) + ); + + const tokenAmount = await this.ReversibleICO.methods.getTokenAmountForEthAtStage( ethValue.toString() , stageId).call(); + expect( tokenAmount.toString() ).to.be.equal( calculatedTokenAmount.toString() ); + expect( helpers.utils.toFullToken(helpers, tokenAmount) ).to.be.equal("1"); + + const jsTokenAmount = this.jsValidator.getTokenAmountForEthAtStage(ethValue.toString() , stageId); + expect( tokenAmount.toString() ).to.be.equal( jsTokenAmount.toString() ); + }); + + it("Returns correct value for 1 wei & commitPhase stage ( results in 500 token grains )", async function () { + const ethValue = 1; + const stageId = 0; + const stageData = this.jsValidator.stages[stageId]; + + const calculatedTokenAmount = new helpers.BN(ethValue.toString()).mul( + new helpers.BN("10").pow( new BN("18") ) + ).div( + new helpers.BN(stageData.tokenPrice) + ); + + const tokenAmount = await this.ReversibleICO.methods.getTokenAmountForEthAtStage( ethValue.toString() , stageId).call(); + expect( tokenAmount.toString() ).to.be.equal( calculatedTokenAmount.toString() ); + expect( tokenAmount.toString() ).to.be.equal("500"); + + const jsTokenAmount = this.jsValidator.getTokenAmountForEthAtStage(ethValue.toString() , stageId); + expect( tokenAmount.toString() ).to.be.equal( jsTokenAmount.toString() ); + }); + }); + + describe("view getCurrentUnlockPercentage()", async function () { + + const precision = 20; + + it("Returns 0 before stage 1 start_block", async function () { + + let stageId = 0; + // jump to stage commit start block - 1 + let currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId); + let contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); + + this.jsValidator.setBlockNumber(currentBlock); + let calculatedRatio = this.jsValidator.getCurrentUnlockPercentage(); + + expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); + expect( contractRatio.toString() ).to.be.equal( "0" ); + + stageId = 1; + currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, false, -1); + contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); + + this.jsValidator.setBlockNumber(currentBlock); + calculatedRatio = this.jsValidator.getCurrentUnlockPercentage(); + + expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); + expect( contractRatio.toString() ).to.be.equal( "0" ); + + }); + + it("Returns higher than 0 if at stage 1 start_block + 1", async function () { + const stageId = 1; + // jump to stage 1 start_block exactly + const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, false, 1 ); + const contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); + this.jsValidator.setBlockNumber(currentBlock); + const calculatedRatio = this.jsValidator.getCurrentUnlockPercentage(); + + expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); + expect( calculatedRatio.toNumber() ).to.be.above( 0 ); + }); + + it("Returns lower than max (99%) at BuyPhaseEndBlock - 1", async function () { + const stageId = 12; + // jump to stage 1 start_block exactly + const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true, - 1 ); + const contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); + + this.jsValidator.setBlockNumber(currentBlock); + const calculatedRatio = this.jsValidator.getCurrentUnlockPercentage(); + expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); + + const maxRatio = new helpers.BN("10").pow( new helpers.BN(precision)); + // ratio should be lower than 10 ** precision + expect( + calculatedRatio.lt(maxRatio) + ).to.be.equal( true ); + + }); + + it("Returns max ( 10 ** precision ) at BuyPhaseEndBlock", async function () { + const stageId = 12; + // jump to stage 1 start_block exactly + const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, stageId, true, 1 ); + const contractRatio = await this.ReversibleICO.methods.getCurrentUnlockPercentage().call(); + this.jsValidator.setBlockNumber(currentBlock); + const calculatedRatio = this.jsValidator.getCurrentUnlockPercentage(); + expect( contractRatio.toString() ).to.be.equal( calculatedRatio.toString() ); + expect( calculatedRatio.toString() ).to.be.equal( new helpers.BN("10").pow( new helpers.BN(precision) ).toString() ); + }); + + }); + + }); + +}); \ No newline at end of file diff --git a/test/solc_tests/rework/methods/tokens.js b/test/solc_tests/rework/methods/tokens.js new file mode 100644 index 0000000..f30c780 --- /dev/null +++ b/test/solc_tests/rework/methods/tokens.js @@ -0,0 +1,271 @@ +const { + validatorHelper +} = require('../includes/setup'); + +const { + requiresERC1820Instance, + doFreshDeployment +} = require('../includes/deployment'); + +const snapshots = []; +const testKey = "TokensTests"; + +describe("ReversibleICO - Methods - Tokens", function () { + + const deployerAddress = accounts[0]; + const whitelistControllerAddress = accounts[1]; + let TokenContractAddress, RICOContractAddress; + let TokenContractInstance; + + before(async function () { + requiresERC1820Instance(); + + const contracts = await doFreshDeployment(snapshots, testKey, 2, setup.settings); + this.ReversibleICO = contracts.ReversibleICOInstance; + TokenContractInstance = contracts.TokenContractInstance; + TokenContractAddress = TokenContractInstance.receipt.contractAddress; + RICOContractAddress = this.ReversibleICO.receipt.contractAddress; + + this.jsValidator = new validatorHelper(setup.settings, + parseInt( await this.ReversibleICO.methods.getCurrentBlockNumber().call(), 10) + ); + }); + + describe("Contract Methods", async function () { + + describe("view getLockedTokenAmount(address)", async function () { + + const ContributionAmount = new helpers.BN("1").mul( helpers.solidity.etherBN ); + let BuyPhaseStartBlock, BuyPhaseBlockCount, BuyPhaseEndBlock; + + before(async function () { + + BuyPhaseStartBlock = await this.ReversibleICO.methods.buyPhaseStartBlock().call(); + BuyPhaseBlockCount = await this.ReversibleICO.methods.buyPhaseBlockCount().call(); + BuyPhaseEndBlock = await this.ReversibleICO.methods.buyPhaseEndBlock().call(); + + // move to start of the commit phase + const currentBlock = await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, 0 ); + + // send 1 eth contribution + newContributionTx = await helpers.web3Instance.eth.sendTransaction({ + from: participant_1, + to: RICOContractAddress, + value: ContributionAmount.toString(), + gasPrice: helpers.networkConfig.gasPrice + }); + + let whitelistTx = await this.ReversibleICO.methods.whitelist( + [participant_1], + true, + ).send({ + from: whitelistControllerAddress + }); + + /* + * Validator + */ + + this.jsValidator.setBlockNumber(currentBlock); + // set participant initial balance to 100 ETH + this.jsValidator.BalanceContractInstance.set( + participant_1, this.jsValidator.getOneEtherBn().mul(new BN("100")) + ); + // commit ContributionAmount + this.jsValidator.commit(participant_1, ContributionAmount); + + }); + + describe("participant has no contributions", async function () { + + it("Returns 0 at any stage", async function () { + const participantAddress = participant_6; + // jump to stage commit start block - 1 + const stageId = 0; + let currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, false, -1); + const ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participantAddress).call(); + const ContractContributionTokens = ParticipantsTotalStats.boughtTokens; + + this.jsValidator.setBlockNumber(currentBlock); + let validatorTokenAmount = this.jsValidator.getLockedTokenAmount(participantAddress); + + let getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participantAddress, false).call(); + expect(getLockedTokenAmount).to.be.equal(ContractContributionTokens); + expect(getLockedTokenAmount.toString()).to.be.equal(validatorTokenAmount.toString()); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + + // jump to stage 12 end block - 1 + currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, 1); + this.jsValidator.setBlockNumber(currentBlock); + + validatorTokenAmount = this.jsValidator.getLockedTokenAmount(participantAddress); + getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participantAddress, false).call(); + expect(getLockedTokenAmount.toString()).to.be.equal(validatorTokenAmount.toString()); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + + // jump to stage 12 start block + currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, 12); + this.jsValidator.setBlockNumber(currentBlock); + + validatorTokenAmount = this.jsValidator.getLockedTokenAmount(participantAddress); + getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participantAddress, false).call(); + expect(getLockedTokenAmount.toString()).to.be.equal(validatorTokenAmount.toString()); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + + // jump to stage 12 end block + 1 + currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, 12, false, 1); + this.jsValidator.setBlockNumber(currentBlock); + + validatorTokenAmount = this.jsValidator.getLockedTokenAmount(participantAddress); + getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participantAddress, false).call(); + expect(getLockedTokenAmount.toString()).to.be.equal(validatorTokenAmount.toString()); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + }); + + }); + + describe("participant has made a contribution", async function () { + + const participantAddress = participant_1; + + it("Returns participant's purchased token amount before stage 1 start_block", async function () { + + // jump to stage commit start block - 1 + const stageId = 1; + const currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, false, -1); + this.jsValidator.setBlockNumber(currentBlock); + + const ParticipantTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participantAddress).call(); + const ContractContributionTokens = ParticipantTotalStats.boughtTokens; + + const getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participantAddress, false).call(); + expect(parseInt(ContractContributionTokens)).to.be.above(0); + expect(getLockedTokenAmount).to.be.equal(ContractContributionTokens); + + let validatorTokenAmount = this.jsValidator.getLockedTokenAmount(participantAddress); + expect(getLockedTokenAmount.toString()).to.be.equal(validatorTokenAmount.toString()); + }); + + + it("Returns proper amount at stage 1 start_block", async function () { + + // jump to stage commit start block + const stageId = 1; + const currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId); + this.jsValidator.setBlockNumber(currentBlock); + + const ParticipantTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participantAddress).call(); + const ContractContributionTokens = ParticipantTotalStats.boughtTokens; + + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + const getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participantAddress, false).call(); + const validatorTokenAmount = this.jsValidator.getLockedTokenAmount(participantAddress); + + expect(getLockedTokenAmount.toString()).to.be.equal(validatorTokenAmount.toString()); + }); + + it("Returns proper amount at stage 1 start_block + 1", async function () { + + // jump to stage commit start block + const stageId = 1; + const currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, false, 1); + this.jsValidator.setBlockNumber(currentBlock); + + const ParticipantTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participantAddress).call(); + const ContractContributionTokens = ParticipantTotalStats.boughtTokens; + + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + const getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participantAddress, false).call(); + const validatorTokenAmount = this.jsValidator.getLockedTokenAmount(participantAddress); + expect(getLockedTokenAmount.toString()).to.be.equal(validatorTokenAmount.toString()); + }); + + it("Returns proper amount at stage 6 end_block - 1", async function () { + + // jump to stage commit start block + const stageId = 6; + const currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true, 0); + this.jsValidator.setBlockNumber(currentBlock); + + const ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participantAddress).call(); + const ContractContributionTokens = ParticipantsTotalStats.boughtTokens; + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + const getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participantAddress, false).call(); + let validatorTokenAmount = this.jsValidator.getLockedTokenAmount(participantAddress); + expect(getLockedTokenAmount.toString()).to.be.equal(validatorTokenAmount.toString()); + + }); + + it("Returns proper amount at stage 12 end_block - 1", async function () { + + // jump to stage commit start block + const stageId = 12; + const currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true, 0); + this.jsValidator.setBlockNumber(currentBlock); + + const ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participantAddress).call(); + const ContractContributionTokens = ParticipantsTotalStats.boughtTokens; + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + const getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participantAddress, false).call(); + let validatorTokenAmount = this.jsValidator.getLockedTokenAmount(participantAddress); + expect(getLockedTokenAmount.toString()).to.be.equal(validatorTokenAmount.toString()); + + }); + + it("Returns 0 locked tokens at stage 12 end_block ( also known as BuyPhaseEndBlock )", async function () { + + // jump to stage commit start block + let stageId = 12; + let currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true); + this.jsValidator.setBlockNumber(currentBlock); + + let ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participantAddress).call(); + let ContractContributionTokens = ParticipantsTotalStats.boughtTokens; + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + let getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participantAddress, false).call(); + let validatorTokenAmount = this.jsValidator.getLockedTokenAmount(participantAddress); + expect(getLockedTokenAmount.toString()).to.be.equal(validatorTokenAmount.toString()); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + }); + + it("Returns 0 locked tokens after BuyPhaseEndBlock", async function () { + + // jump to stage commit start block + let stageId = 12; + let currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true, 1); + this.jsValidator.setBlockNumber(currentBlock); + + let ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participantAddress).call(); + let ContractContributionTokens = ParticipantsTotalStats.boughtTokens; + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + let getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participantAddress, false).call(); + let validatorTokenAmount = this.jsValidator.getLockedTokenAmount(participantAddress); + expect(getLockedTokenAmount.toString()).to.be.equal(validatorTokenAmount.toString()); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + + currentBlock = await helpers.utils.jumpToContractStage (this.ReversibleICO, deployerAddress, stageId, true, 1000); + this.jsValidator.setBlockNumber(currentBlock); + + ParticipantsTotalStats = await this.ReversibleICO.methods.participantAggregatedStats(participantAddress).call(); + ContractContributionTokens = ParticipantsTotalStats.boughtTokens; + expect(parseInt(ContractContributionTokens)).to.be.above(0); + + getLockedTokenAmount = await this.ReversibleICO.methods.getLockedTokenAmount(participantAddress, false).call(); + validatorTokenAmount = this.jsValidator.getLockedTokenAmount(participantAddress); + expect(getLockedTokenAmount.toString()).to.be.equal(validatorTokenAmount.toString()); + expect(getLockedTokenAmount.toString()).to.be.equal("0"); + }); + + }); + + }); + + }); + +}); \ No newline at end of file diff --git a/test/solc_tests/rework/phases.js b/test/solc_tests/rework/phases.js new file mode 100644 index 0000000..e18cc66 --- /dev/null +++ b/test/solc_tests/rework/phases.js @@ -0,0 +1,243 @@ +const { + validatorHelper +} = require('./includes/setup'); + +const { + requiresERC1820Instance, + doFreshDeployment +} = require('./includes/deployment'); + +const snapshots = []; +const testKey = "PhaseTests"; + +describe("ReversibleICO - Phases", function () { + + const deployerAddress = accounts[0]; + const whitelistControllerAddress = accounts[1]; + let TokenContractAddress, RICOContractAddress, currentBlock; + let TokenContractInstance; + + before(async function () { + requiresERC1820Instance(); + }); + + describe("Phase 1 - Deployment", async function () { + + before(async function () { + const contracts = await doFreshDeployment(snapshots, testKey, 0); + this.ReversibleICO = contracts.ReversibleICOInstance; + TokenContractInstance = contracts.TokenContractInstance; + TokenContractAddress = TokenContractInstance.receipt.contractAddress; + RICOContractAddress = this.ReversibleICO.receipt.contractAddress; + }); + + it("Gas usage should be lower than network configuration gas.", async function () { + expect(this.ReversibleICO.receipt.gasUsed).to.be.below(helpers.networkConfig.gas); + }); + + it("Property deployerAddress should be " + deployerAddress, async function () { + expect(await this.ReversibleICO.methods.deployerAddress().call()).to.be.equal(deployerAddress); + }); + + it("Property initialized should be false", async function () { + expect(await this.ReversibleICO.methods.initialized().call()).to.be.equal(false); + }); + + it("Property frozen should be false", async function () { + expect(await this.ReversibleICO.methods.frozen().call()).to.be.equal(false); + }); + + it("Property TokenContractAddress should be address(0x0)", async function () { + expect(await this.ReversibleICO.methods.tokenContractAddress().call()).to.be.equal("0x0000000000000000000000000000000000000000"); + }); + + it("Property whitelistControllerAddress should be address(0x0)", async function () { + expect(await this.ReversibleICO.methods.whitelistControllerAddress().call()).to.be.equal("0x0000000000000000000000000000000000000000"); + }); + + }); + + + describe("Phase 2 - Initialisation - init()", function () { + + before(async function () { + const contracts = await doFreshDeployment(snapshots, testKey, 1, setup.settings); + this.ReversibleICO = contracts.ReversibleICOInstance; + TokenContractInstance = contracts.TokenContractInstance; + TokenContractAddress = TokenContractInstance.receipt.contractAddress; + RICOContractAddress = this.ReversibleICO.receipt.contractAddress; + + currentBlock = parseInt( await this.ReversibleICO.methods.getCurrentBlockNumber().call(), 10); + this.jsValidator = new validatorHelper(setup.settings, currentBlock); + }); + + describe("Contract settings", function () { + + it("Property initialized should be true", async function () { + expect(await this.ReversibleICO.methods.initialized().call()).to.be.equal(true); + }); + + it("Property frozen should be false", async function () { + expect(await this.ReversibleICO.methods.frozen().call()).to.be.equal(false); + }); + + it("Property TokenContractAddress should be deployed ERC777 Token Contract address", async function () { + expect(await this.ReversibleICO.methods.tokenContractAddress().call()).to.be.equal(TokenContractAddress); + }); + + it("Property whitelistControllerAddress should be " + whitelistControllerAddress, async function () { + expect(await this.ReversibleICO.methods.whitelistControllerAddress().call()).to.be.equal(whitelistControllerAddress); + }); + + it("Property projectWalletAddress should be " + projectWalletAddress, async function () { + expect(await this.ReversibleICO.methods.projectWalletAddress().call()).to.be.equal(projectWalletAddress); + }); + + it("Property commitPhaseStartBlock matches settings", async function () { + expect(await this.ReversibleICO.methods.commitPhaseStartBlock().call()).to.be.equal(this.jsValidator.commitPhaseStartBlock.toString()); + }); + + it("Property commitPhaseEndBlock matches settings", async function () { + expect(await this.ReversibleICO.methods.commitPhaseEndBlock().call()).to.be.equal(this.jsValidator.commitPhaseEndBlock.toString()); + }); + + it("Property buyPhaseStartBlock matches settings", async function () { + expect(await this.ReversibleICO.methods.buyPhaseStartBlock().call()).to.be.equal(this.jsValidator.buyPhaseStartBlock.toString()); + }); + + it("Property buyPhaseEndBlock matches settings", async function () { + expect(await this.ReversibleICO.methods.buyPhaseEndBlock().call()).to.be.equal(this.jsValidator.buyPhaseEndBlock.toString()); + }); + + }); + + describe("Contract Stages", function () { + + let allocationStageData; + let validatorAllocationStageData; + + before(async function () { + allocationStageData = await this.ReversibleICO.methods.stages(0).call(); + validatorAllocationStageData = this.jsValidator.stages[0]; + }); + + it("Stage Count is correct", async function () { + const stages = this.jsValidator.stageCount; + expect(stages).to.be.equal(this.jsValidator.stages.length - 1); + expect(await this.ReversibleICO.methods.stageCount().call()).to.be.equal(stages.toString()); + }); + + it("Stage[0].startBlock is commitPhaseStartBlock and matches settings", async function () { + expect(allocationStageData.startBlock.toString()).to.be.equal(this.jsValidator.commitPhaseStartBlock.toString()); + }); + + it("Stage[0] duration is commitPhaseBlockCount", async function () { + const count = allocationStageData.endBlock - allocationStageData.startBlock + 1; + expect(count.toString()).to.be.equal(this.jsValidator.commitPhaseBlockCount.toString()); + }); + + it("Stage[0].endBlock is commitPhaseEndBlock and matches settings", async function () { + expect(allocationStageData.endBlock).to.be.equal(this.jsValidator.commitPhaseEndBlock.toString()); + }); + + it("Stage[0].tokenPrice is commitPhasePrice and matches settings", async function () { + expect(allocationStageData.tokenPrice.toString()).to.be.equal(this.jsValidator.commitPhasePrice.toString()); + }); + + it("First Distribution Stage settings are correct", async function () { + const stageRefId = 1; + const stageData = await this.ReversibleICO.methods.stages((stageRefId)).call(); + const validatorStageData = this.jsValidator.stages[stageRefId]; + + expect(stageData.startBlock.toString()).to.be.equal(validatorStageData.startBlock.toString()); + expect(stageData.endBlock.toString()).to.be.equal(validatorStageData.endBlock.toString()); + expect(stageData.tokenPrice.toString()).to.be.equal(validatorStageData.tokenPrice.toString()); + }); + + it("Last Distribution Stage settings are correct", async function () { + const stageRefId = this.jsValidator.stageCount; + const stageData = await this.ReversibleICO.methods.stages((stageRefId)).call(); + const validatorStageData = this.jsValidator.stages[stageRefId]; + + expect(stageData.startBlock.toString()).to.be.equal(validatorStageData.startBlock.toString()); + expect(stageData.endBlock.toString()).to.be.equal(validatorStageData.endBlock.toString()); + expect(stageData.tokenPrice.toString()).to.be.equal(validatorStageData.tokenPrice.toString()); + }); + + it("Last Distribution Stage end_block matches contract BuyPhaseEndBlock", async function () { + const stageRefId = this.jsValidator.stageCount; + const stageData = await this.ReversibleICO.methods.stages(stageRefId).call(); + const validatorStageData = this.jsValidator.stages[stageRefId]; + + expect(stageData.endBlock.toString()).to.be.equal(validatorStageData.endBlock.toString()); + expect(stageData.endBlock.toString()).to.be.equal(this.jsValidator.buyPhaseEndBlock.toString()); + }); + + }); + + }); + + + describe("Phase 3 - Transfer tokens to RICO contract address", function () { + + const ERC777data = web3.utils.sha3('777TestData'); + const RicoSaleSupply = setup.settings.token.sale.toString(); + + before(async function () { + const contracts = await doFreshDeployment(snapshots, testKey, 1, setup.settings); + this.ReversibleICO = contracts.ReversibleICOInstance; + TokenContractInstance = contracts.TokenContractInstance; + TokenContractAddress = TokenContractInstance.receipt.contractAddress; + RICOContractAddress = this.ReversibleICO.receipt.contractAddress; + + TokenContractInstance = await helpers.utils.getContractInstance(helpers, "RicoToken", TokenContractAddress); + await TokenContractInstance.methods.send( + RICOContractAddress, + RicoSaleSupply, + ERC777data + ).send({ + from: holder, // initial token supply holder + gas: 100000 + }); + }); + + describe("Contract Assets", function () { + + before(async function () { + }); + + it("RICO Contract should have 0 eth", async function () { + const ContractBalance = await helpers.utils.getBalance(helpers, RICOContractAddress); + expect( ContractBalance ).to.be.bignumber.equal( new helpers.BN(0) ); + }); + + it("RICO Contract should have the correct token balance ("+RicoSaleSupply+")", async function () { + expect( + await TokenContractInstance.methods.balanceOf(RICOContractAddress).call() + ).to.be.equal(RicoSaleSupply.toString()); + }); + + it("TokenSupply property should match Contract token balance ("+RicoSaleSupply+")", async function () { + expect( + await this.ReversibleICO.methods.tokenSupply().call() + ).to.be.equal( + await TokenContractInstance.methods.balanceOf(RICOContractAddress).call() + ); + }); + + }); + + }); + + + describe("Phase 4 - Funding Start", function () { + /* + before(async function () { + // jump to commit start + // await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, 0 ); + await helpers.utils.jumpToContractStage ( this.ReversibleICO, deployerAddress, 1 ); + }); + */ + }); + +}); \ No newline at end of file