From 5f80bad413e19a5ba76ac2faa52ca9fe993a1757 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Thu, 18 Oct 2018 19:57:23 -0300 Subject: [PATCH 001/139] CLI transfer manager for GTM --- CLI/commands/transfer_manager.js | 330 ++++++++++++++++++++++++------- CLI/package.json | 1 + CLI/yarn.lock | 21 ++ 3 files changed, 276 insertions(+), 76 deletions(-) diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index df06c68f4..6a03ec1dd 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -1,17 +1,27 @@ -var readlineSync = require('readline-sync'); -var chalk = require('chalk'); -var moment = require('moment'); -var common = require('./common/common_functions'); -var global = require('./common/global'); -var contracts = require('./helpers/contract_addresses'); -var abis = require('./helpers/contract_abis'); +const readlineSync = require('readline-sync'); +const chalk = require('chalk'); +const ethers = require('ethers'); +const common = require('./common/common_functions'); +const global = require('./common/global'); +const contracts = require('./helpers/contract_addresses'); +const abis = require('./helpers/contract_abis'); + +const MODULES_TYPES = { + PERMISSION: 1, + TRANSFER: 2, + STO: 3, + DIVIDEND: 4, + BURN: 5 +} // App flow let tokenSymbol; let securityToken; let securityTokenRegistry; +let network; async function executeApp(remoteNetwork) { + network = remoteNetwork; await global.initialize(remoteNetwork); common.logAsciiBull(); @@ -55,87 +65,255 @@ async function start_explorer() { } else { let securityTokenABI = abis.securityToken(); securityToken = new web3.eth.Contract(securityTokenABI,result); + + let tmModules = securityToken.methods.getModulesByType(MODULES_TYPES.TRANSFER).call(); + let options = []; let forcedTransferDisabled = await securityToken.methods.controllerDisabled().call(); - if (!forcedTransferDisabled) { - let options = ['Disable controller', 'Set controller']; - let controller = await securityToken.methods.controller().call(); - if (controller == Issuer.address) { - options.push('Force Transfer') - } - let index = readlineSync.keyInSelect(options, 'What do you want to do?'); - let optionSelected = options[index]; - console.log('Selected:', index != -1 ? optionSelected : 'Cancel', '\n'); - switch (optionSelected) { - case 'Disable controller': - if (readlineSync.keyInYNStrict()) { - let disableControllerAction = securityToken.methods.disableController(); - await common.sendTransaction(Issuer, disableControllerAction, defaultGasPrice); - console.log(chalk.green(`Forced transfers have been disabled permanently`)); - } + options.push('Forced Transfers'); + } + + options.push('GeneralTransferManager', 'ManualApprovalTransferManager', 'PercentageTransferManager', 'CountTransferManager', + 'SingleTradeVolumeRestrictionTM', 'LookupVolumeRestrictionTM'); + + let index = readlineSync.keyInSelect(options, 'Choose one:'); + let optionSelected = options[index]; + console.log('Selected:', index != -1 ? optionSelected : 'Cancel', '\n'); + switch (optionSelected) { + case 'Forced Transfers': + await forcedTransfers(); + break; + case 'GeneralTransferManager': + await generalTransferManager(); break; - case 'Set controller': - let controllerAddress = readlineSync.question(`Enter the address for the controller (${Issuer.address}): `, { - limit: function(input) { - return web3.utils.isAddress(input); - }, - limitMessage: "Must be a valid address", - defaultInput: Issuer.address - }); - let setControllerAction = securityToken.methods.setController(controllerAddress); - let setControllerReceipt = await common.sendTransaction(Issuer, setControllerAction, defaultGasPrice); - let setControllerEvent = common.getEventFromLogs(securityToken._jsonInterface, setControllerReceipt.logs, 'SetController'); - console.log(chalk.green(`New controller is ${setControllerEvent._newController}`)); + case 'ManualApprovalTransferManager': + await manualApprovalTransferManager(); break; - case 'Force Transfer': - let from = readlineSync.question('Enter the address from which to take tokens: ', { - limit: function(input) { - return web3.utils.isAddress(input); - }, - limitMessage: "Must be a valid address", - }); - let fromBalance = web3.utils.fromWei(await securityToken.methods.balanceOf(from).call()); - console.log(chalk.yellow(`Balance of ${from}: ${fromBalance} ${tokenSymbol}`)); - let to = readlineSync.question('Enter address where to send tokens: ', { - limit: function(input) { - return web3.utils.isAddress(input); - }, - limitMessage: "Must be a valid address", - }); - let toBalance = web3.utils.fromWei(await securityToken.methods.balanceOf(to).call()); - console.log(chalk.yellow(`Balance of ${to}: ${toBalance} ${tokenSymbol}`)); - let amount = readlineSync.question('Enter amount of tokens to transfer: ', { - limit: function(input) { - return parseInt(input) <= parseInt(fromBalance); - }, - limitMessage: `Amount must be less or equal than ${fromBalance} ${tokenSymbol}`, - }); - let data = readlineSync.question('Enter the data to indicate validation: '); - let log = readlineSync.question('Enter the data attached to the transfer by controller to emit in event: '); - let forceTransferAction = securityToken.methods.forceTransfer(from, to, web3.utils.toWei(amount), web3.utils.asciiToHex(data), web3.utils.asciiToHex(log)); - let forceTransferReceipt = await common.sendTransaction(Issuer, forceTransferAction, defaultGasPrice, 0, 1.5); - let forceTransferEvent = common.getEventFromLogs(securityToken._jsonInterface, forceTransferReceipt.logs, 'ForceTransfer'); - console.log(chalk.green(` ${forceTransferEvent._controller} has successfully forced a transfer of ${web3.utils.fromWei(forceTransferEvent._value)} ${tokenSymbol} + case 'PercentageTransferManager': + await percentageTransferManager(); + break; + case 'CountTransferManager': + await countTransferManager(); + break; + case 'SingleTradeVolumeRestrictionTM': + await singleTradeVolumeRestrictionTM(); + break; + case 'LookupVolumeRestrictionTM': + await lookupVolumeRestrictionTM(); + break; + } + } + + //Restart + await start_explorer(); +} + +async function forcedTransfers() { + let options = ['Disable controller', 'Set controller']; + let controller = await securityToken.methods.controller().call(); + if (controller == Issuer.address) { + options.push('Force Transfer'); + } + let index = readlineSync.keyInSelect(options, 'What do you want to do?'); + let optionSelected = options[index]; + console.log('Selected:', index != -1 ? optionSelected : 'Cancel', '\n'); + switch (optionSelected) { + case 'Disable controller': + if (readlineSync.keyInYNStrict()) { + let disableControllerAction = securityToken.methods.disableController(); + await common.sendTransaction(Issuer, disableControllerAction, defaultGasPrice); + console.log(chalk.green(`Forced transfers have been disabled permanently`)); + } + break; + case 'Set controller': + let controllerAddress = readlineSync.question(`Enter the address for the controller (${Issuer.address}): `, { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address", + defaultInput: Issuer.address + }); + let setControllerAction = securityToken.methods.setController(controllerAddress); + let setControllerReceipt = await common.sendTransaction(Issuer, setControllerAction, defaultGasPrice); + let setControllerEvent = common.getEventFromLogs(securityToken._jsonInterface, setControllerReceipt.logs, 'SetController'); + console.log(chalk.green(`New controller is ${setControllerEvent._newController}`)); + break; + case 'Force Transfer': + let from = readlineSync.question('Enter the address from which to take tokens: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address", + }); + let fromBalance = web3.utils.fromWei(await securityToken.methods.balanceOf(from).call()); + console.log(chalk.yellow(`Balance of ${from}: ${fromBalance} ${tokenSymbol}`)); + let to = readlineSync.question('Enter address where to send tokens: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address", + }); + let toBalance = web3.utils.fromWei(await securityToken.methods.balanceOf(to).call()); + console.log(chalk.yellow(`Balance of ${to}: ${toBalance} ${tokenSymbol}`)); + let amount = readlineSync.question('Enter amount of tokens to transfer: ', { + limit: function (input) { + return parseInt(input) <= parseInt(fromBalance); + }, + limitMessage: `Amount must be less or equal than ${fromBalance} ${tokenSymbol}`, + }); + let data = readlineSync.question('Enter the data to indicate validation: '); + let log = readlineSync.question('Enter the data attached to the transfer by controller to emit in event: '); + let forceTransferAction = securityToken.methods.forceTransfer(from, to, web3.utils.toWei(amount), web3.utils.asciiToHex(data), web3.utils.asciiToHex(log)); + let forceTransferReceipt = await common.sendTransaction(Issuer, forceTransferAction, defaultGasPrice, 0, 1.5); + let forceTransferEvent = common.getEventFromLogs(securityToken._jsonInterface, forceTransferReceipt.logs, 'ForceTransfer'); + console.log(chalk.green(` ${forceTransferEvent._controller} has successfully forced a transfer of ${web3.utils.fromWei(forceTransferEvent._value)} ${tokenSymbol} from ${forceTransferEvent._from} to ${forceTransferEvent._to} Verified transfer: ${forceTransferEvent._verifyTransfer} Data: ${web3.utils.hexToAscii(forceTransferEvent._data)} - `)); - console.log(`Balance of ${from} after transfer: ${web3.utils.fromWei(await securityToken.methods.balanceOf(from).call())} ${tokenSymbol}`); - console.log(`Balance of ${to} after transfer: ${web3.utils.fromWei(await securityToken.methods.balanceOf(to).call())} ${tokenSymbol}`); - break; - default: - process.exit(0); + `)); + console.log(`Balance of ${from} after transfer: ${web3.utils.fromWei(await securityToken.methods.balanceOf(from).call())} ${tokenSymbol}`); + console.log(`Balance of ${to} after transfer: ${web3.utils.fromWei(await securityToken.methods.balanceOf(to).call())} ${tokenSymbol}`); + break; + } +} + +async function generalTransferManager() { + let options = ['Change Issuance Address', 'Change Signing Address', 'Change Allow All Transfers', 'Change Allow All Whitelist Transfers', + 'Change Allow All Whitelist Issuances', 'Change Allow All Burn Transfers', 'Modify Whitelist', 'Modify Whitelist from CSV', + 'Modify Whitelist Signed']; + let index = readlineSync.keyInSelect(options, 'What do you want to do?'); + let optionSelected = options[index]; + console.log('Selected:', index != -1 ? optionSelected : 'Cancel', '\n'); + switch (optionSelected) { + case 'Change Issuance Address': + let issuanceAddress = readlineSync.question('Enter the new issuance address: ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let changeIssuanceAddressAction = currentTransferManager.methods.changeIssuanceAddress(issuanceAddress); + let changeIssuanceAddressReceipt = await common.sendTransaction(Issuer.address, changeIssuanceAddressAction, defaultGasPrice); + let changeIssuanceAddressEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeIssuanceAddressReceipt.logs, 'ChangeIssuanceAddress'); + console.log(chalk.green(`${changeIssuanceAddressEvent._issuanceAddress} is the new address for the issuance!`)); + break; + case 'Change Signing Address': + let signingAddress = readlineSync.question('Enter the new signing address: ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let changeSigningAddressAction = currentTransferManager.methods.changeSigningAddress(signingAddress); + let changeSigningAddressReceipt = await common.sendTransaction(Issuer.address, changeSigningAddressAction, defaultGasPrice); + let changeSigningAddressEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeSigningAddressReceipt.logs, 'ChangeSigningAddress'); + console.log(chalk.green(`${changeSigningAddressEvent._signingAddress} is the new address for the signing!`)); + break; + case 'Change Allow All Transfers': + let allowAllTransfers = readlineSync.keyInYNStrict('Do you want to remove all restrictions for any addresses?'); + let changeAllowAllTransfersAction = currentTransferManager.methods.changeAllowAllTransfers(allowAllTransfers); + let changeAllowAllTransfersReceipt = await common.sendTransaction(Issuer.address, changeAllowAllTransfersAction, defaultGasPrice); + let changeAllowAllTransfersEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeAllowAllTransfersReceipt.logs, 'AllowAllTransfers'); + if (changeAllowAllTransfersEvent._allowAllTransfers) { + console.log(chalk.green(`All transfers are allowed!`)); + } else { + console.log(chalk.green(`Transfers are restricted!`)); } - } else { - console.log(chalk.red(`Controller featueres are permanently disabled for this token.`)) - tokenSymbol = undefined; - } + break; + case 'Change Allow All Whitelist Transfers': + let allowAllWhitelistTransfers = readlineSync.keyInYNStrict('Do you want to ignore time locks from whitelist (address must still be whitelisted)?'); + let changeAllowAllWhitelistTransfersAction = currentTransferManager.methods.changeAllowAllWhitelistTransfers(allowAllWhitelistTransfers); + let changeAllowAllWhitelistTransfersReceipt = await common.sendTransaction(Issuer.address, changeAllowAllWhitelistTransfersAction, defaultGasPrice); + let changeAllowAllWhitelistTransfersEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeAllowAllWhitelistTransfersReceipt.logs, 'AllowAllWhitelistTransfers'); + if (changeAllowAllWhitelistTransfersEvent._allowAllWhitelistTransfers) { + console.log(chalk.green(`Time locks from whitelist are ignored for transfers!`)); + } else { + console.log(chalk.green(`Transfers are restricted by time locks from whitelist!`)); + } + break; + case 'Change Allow All Whitelist Issuances': + let allowAllWhitelistIssuances = readlineSync.keyInYNStrict('Do you want to ignore time locks from whitelist (address must still be whitelisted)?'); + let changeAllowAllWhitelistIssuancesAction = currentTransferManager.methods.changeAllowAllIssuancesTransfers(allowAllWhitelistIssuances); + let changeAllowAllWhitelistIssuancesReceipt = await common.sendTransaction(Issuer.address, changeAllowAllWhitelistIssuancesAction, defaultGasPrice); + let changeAllowAllWhitelistIssuancesEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeAllowAllWhitelistIssuancesReceipt.logs, 'AllowAllWhitelistIssuances'); + if (changeAllowAllWhitelistIssuancesEvent._allowAllWhitelistIssuances) { + console.log(chalk.green(`Time locks from whitelist are ignored for issuances!`)); + } else { + console.log(chalk.green(`Issuances are restricted by time locks from whitelist!`)); + } + break; + case 'Change Allow All Burn Transfers': + let allowAllBurnTransfers = readlineSync.keyInYNStrict('Do you want to ignore time locks from whitelist (address must still be whitelisted)?'); + let changeAllowAllBurnTransfersAction = currentTransferManager.methods.allowAllBurnTransfers(allowAllBurnTransfers); + let changeAllowAllBurnTransfersReceipt = await common.sendTransaction(Issuer.address, changeAllowAllBurnTransfersAction, defaultGasPrice); + let changeAllowAllBurnTransfersEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeAllowAllBurnTransfersReceipt.logs, 'AllowAllBurnTransfers'); + if (changeAllowAllBurnTransfersEvent._allowAllWhitelistTransfers) { + console.log(chalk.green(`To burn tokens is allowed!`)); + } else { + console.log(chalk.green(`The burning mechanism is deactivated!`)); + } + break; + case 'Modify Whitelist': + let investor = readlineSync.question('Enter the address to whitelist: ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let fromTime = readlineSync.questionInt('Enter the time (Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens: '); + let toTime = readlineSync.questionInt('Enter the time (Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others: '); + let expiryTime = readlineSync.questionInt('Enter the time till investors KYC will be validated (after that investor need to do re-KYC): '); + let canBuyFromSTO = readlineSync.keyInYNStrict('Is the investor a restricted investor?'); + let modifyWhitelistAction = currentTransferManager.methods.modifyWhitelist(investor, fromTime, toTime, expiryTime, canBuyFromSTO); + let modifyWhitelistReceipt = await common.sendTransaction(Issuer.address, modifyWhitelistAction, defaultGasPrice); + let modifyWhitelistEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, modifyWhitelistReceipt.logs, 'ModifyWhitelist'); + console.log(chalk.green(`${modifyWhitelistEvent._investor} has been whitelisted sucessfully!`)); + case 'Modify Whitelist from CSV': + console.log(chalk.yellow(`Data is going to be read from 'data/whitelist_data.csv'. Be sure this file is updated!`)); + if (readlineSync.keyInYNStrict(`Do you want to continue?`)) { + shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${network}`); + } + break; + /* + case 'Modify Whitelist Signed': + let investorSigned = readlineSync.question('Enter the address to whitelist: ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let fromTimeSigned = readlineSync.questionInt('Enter the time (Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens: '); + let toTimeSigned = readlineSync.questionInt('Enter the time (Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others: '); + let expiryTimeSigned = readlineSync.questionInt('Enter the time till investors KYC will be validated (after that investor need to do re-KYC): '); + let vSigned = readlineSync.questionInt('Enter v: '); + let rSigned = readlineSync.question('Enter r: '); + let sSigned = readlineSync.question('Enter s: '); + let canBuyFromSTOSigned = readlineSync.keyInYNStrict('Is the investor a restricted investor?'); + let modifyWhitelistSignedAction = currentTransferManager.methods.modifyWhitelistSigned(investorSigned, fromTimeSigned, toTimeSigned, expiryTimeSigned, canBuyFromSTOSigned); + let modifyWhitelistSignedReceipt = await common.sendTransaction(Issuer.address, modifyWhitelistSignedAction, defaultGasPrice); + let modifyWhitelistSignedEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, modifyWhitelistSignedReceipt.logs, 'ModifyWhitelist'); + console.log(chalk.green(`${modifyWhitelistSignedEvent._investor} has been whitelisted sucessfully!`)); + break; + */ } +} - //Restart - await start_explorer(); +/* +// Copied from tests +function signData(tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, pk) { + let packedData = ethers.utils + .solidityKeccak256( + ["address", "address", "uint256", "uint256", "uint256", "bool", "uint256", "uint256"], + [tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo] + ) + .slice(2); + packedData = new Buffer(packedData, "hex"); + packedData = Buffer.concat([new Buffer(`\x19Ethereum Signed Message:\n${packedData.length.toString()}`), packedData]); + packedData = web3.sha3(`0x${packedData.toString("hex")}`, { encoding: "hex" }); + return ethUtil.ecsign(new Buffer(packedData.slice(2), "hex"), new Buffer(pk, "hex")); } +*/ module.exports = { executeApp: async function(type, remoteNetwork) { diff --git a/CLI/package.json b/CLI/package.json index 92430ac59..d035e7cca 100644 --- a/CLI/package.json +++ b/CLI/package.json @@ -11,6 +11,7 @@ "dependencies": { "chalk": "^2.4.1", "commander": "^2.16.0", + "ethers": "^4.0.7", "moment": "^2.22.2", "readline-sync": "^1.4.9", "request": "^2.88.0", diff --git a/CLI/yarn.lock b/CLI/yarn.lock index 4a06bda2e..0fd77a236 100644 --- a/CLI/yarn.lock +++ b/CLI/yarn.lock @@ -674,6 +674,22 @@ ethers@4.0.0-beta.1: uuid "2.0.1" xmlhttprequest "1.8.0" +ethers@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.7.tgz#8c653618077a1fc60c5c1b2575da03561f0039f4" + integrity sha512-HGR2FcyeiRjg6qZUjtK5gkTp7puB+KPhBDa0s2zG4IMVcfU33rkhl9yBIqZBzpD5J0fE33gQ57+epZh90nBaeA== + dependencies: + "@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" + ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" @@ -1658,6 +1674,11 @@ scrypt-js@2.0.3: resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.3.tgz#bb0040be03043da9a012a2cea9fc9f852cfc87d4" integrity sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q= +scrypt-js@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16" + integrity sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw== + scrypt.js@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/scrypt.js/-/scrypt.js-0.2.0.tgz#af8d1465b71e9990110bedfc593b9479e03a8ada" From 44c83b4e7fff51ee78e112aafdafdc64bc6b213f Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Sat, 20 Oct 2018 01:26:39 -0300 Subject: [PATCH 002/139] CLI transfer manager for STVR TM --- CLI/commands/transfer_manager.js | 163 +++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 6a03ec1dd..9d4917117 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -299,6 +299,169 @@ async function generalTransferManager() { } } +async function singleTradeVolumeRestrictionTM() { + let primaryIssuanceAllowed = await currentTransferManager.methods.allowPrimaryIssuance().call(); + let allowPrimeryIssuanceOption = primaryIssuanceAllowed ? 'Allow Primary Issuance' : 'Disallow Primary Issuance'; + + let options = [allowPrimeryIssuanceOption, 'Add exempted wallet', 'Remove exempted wallet']; + + let isTransferLimitInPercentage = await currentTransferManager.methods.isTransferLimitInPercentage().call(); + if (isTransferLimitInPercentage) { + options.push('Change transfer limit to tokens', 'Change default percentage limit', + 'Set percentage transfer limit per account', 'Remove percentage transfer limit per account'); + } else { + options.push('Change transfer limit to percentage', 'Change default tokens limit', + 'Set tokens transfer limit per account', 'Remove tokens transfer limit per account'); + } + + let index = readlineSync.keyInSelect(options, 'What do you want to do?'); + let optionSelected = options[index]; + console.log('Selected:', index != -1 ? optionSelected : 'Cancel', '\n'); + switch (optionSelected) { + case 'Allow Primary Issuance': + let allowPrimaryIssuanceAction = currentTransferManager.methods.setAllowPrimaryIssuance(true); + await common.sendTransaction(Issuer.address, allowPrimaryIssuanceAction, defaultGasPrice); + break; + case 'Disallow Primary Issuance': + let disallowPrimaryIssuanceAction = currentTransferManager.methods.setAllowPrimaryIssuance(false); + await common.sendTransaction(Issuer.address, disallowPrimaryIssuanceAction, defaultGasPrice); + break; + case 'Add exempted wallet': + let walletToExempt = readlineSync.question('Enter the wallet to exempt', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let addExemptWalletAction = currentTransferManager.methods.addExemptWallet(walletToExempt); + let addExemptWalletReceipt = await common.sendTransaction(Issuer.address, addExemptWalletAction, defaultGasPrice); + let addExemptWalletEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, addExemptWalletReceipt.logs, 'ExemptWalletAdded'); + console.log(chalk.green(`${addExemptWalletEvent._wallet} has been exempted sucessfully!`)); + break; + case 'Remove exempted wallet': + let exemptedWallet = readlineSync.question('Enter the wallet to remove from exempt', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let removeExemptWalletAction = currentTransferManager.methods.removeExemptWallet(exemptedWallet); + let removeExemptWalletReceipt = await common.sendTransaction(Issuer.address, removeExemptWalletAction, defaultGasPrice); + let removeExemptWalletEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, removeExemptWalletReceipt.logs, 'ExemptWalletRemoved'); + console.log(chalk.green(`${removeExemptWalletEvent._wallet} has been removed from exempt wallets sucessfully!`)); + break; + case 'Change transfer limit to tokens': + let newDefaultLimitInTokens = readlineSync.questionInt('Enter the amount of tokens for default limit: ', { + limit: function(input) { + return input > 0; + }, + limitMessage: "Must be greater than zero" + }); + let changeTransferLimitToTokensAction = currentTransferManager.methods.changeTransferLimitToTokens(web3.utils.toWei(newDefaultLimitInTokens)); + let changeTransferLimitToTokensReceipt = await common.sendTransaction(Issuer.address, changeTransferLimitToTokensAction, defaultGasPrice); + let changeTransferLimitToTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeTransferLimitToTokensReceipt.logs, 'GlobalTransferLimitInTokensSet'); + console.log(chalk.green(`Transfer limit has been set to tokens sucessfully!`)); + console.log(chalk.green(`The default transfer limit is ${changeTransferLimitToTokensEvent._amount} ${tokenSymbol}`)); + break; + case 'Change transfer limit to percentage': + let newDefaultLimitInPercentage = readlineSync.questionInt('Enter the percentage for default limit: ', { + limit: function(input) { + return 0 < input <= 100; + }, + limitMessage: "Must be greater than 0 and less than 100" + }); + let changeTransferLimitToPercentageAction = currentTransferManager.methods.changeTransferLimitToPercentage(newDefaultLimitInPercentage); + let changeTransferLimitToPercentageReceipt = await common.sendTransaction(Issuer.address, changeTransferLimitToPercentageAction, defaultGasPrice); + let changeTransferLimitToPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeTransferLimitToPercentageReceipt.logs, 'GlobalTransferLimitInPercentageSet'); + console.log(chalk.green(`Transfer limit has been set to tokens sucessfully!`)); + console.log(chalk.green(`The default transfer limit is ${changeTransferLimitToPercentageEvent._percentage}%`)); + break; + case 'Change default percentage limit': + let defaultLimitInPercentage = readlineSync.questionInt('Enter the percentage for default limit: ', { + limit: function(input) { + return 0 < input <= 100; + }, + limitMessage: "Must be greater than 0 and less than 100" + }); + let changeGlobalLimitInPercentageAction = currentTransferManager.methods.changeGlobalLimitInPercentage(defaultLimitInPercentage); + let changeGlobalLimitInPercentageReceipt = await common.sendTransaction(Issuer.address, changeGlobalLimitInPercentageAction, defaultGasPrice); + let changeGlobalLimitInPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeGlobalLimitInPercentageReceipt.logs, 'GlobalTransferLimitInPercentageSet'); + console.log(chalk.green(`The default transfer limit is ${changeGlobalLimitInPercentageEvent._percentage}%`)); + break; + case 'Change default tokens limit': + let defaultLimitInTokens = readlineSync.questionInt('Enter the amount of tokens for default limit: ', { + limit: function(input) { + return input > 0; + }, + limitMessage: "Must be greater than zero" + }); + let changeGlobalLimitInTokensAction = currentTransferManager.methods.changeGlobalLimitInTokens(web3.utils.toWei(defaultLimitInTokens)); + let changeGlobalLimitInTokensReceipt = await common.sendTransaction(Issuer.address, changeGlobalLimitInTokensAction, defaultGasPrice); + let changeGlobalLimitInTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeGlobalLimitInTokensReceipt.logs, 'GlobalTransferLimitInTokensSet'); + console.log(chalk.green(`The default transfer limit is ${changeGlobalLimitInTokensEvent._amount} ${tokenSymbol}`)); + break; + case 'Set percentage transfer limit per account': + let percentageAccount = readlineSync.question('Enter the wallet: ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let accountLimitInPercentage = readlineSync.questionInt(`Enter the transfer limit for ${percentageAccount} in percentage: `, { + limit: function(input) { + return 0 < input <= 100; + }, + limitMessage: "Must be greater than 0 and less than 100" + }); + let setTransferLimitInPercentageAction = currentTransferManager.methods.setTransferLimitInPercentage(percentageAccount, web3.utils.toWei(accountLimitInPercentage)); + let setTransferLimitInPercentageReceipt = await common.sendTransaction(Issuer.address, setTransferLimitInPercentageAction, defaultGasPrice); + let setTransferLimitInPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, setTransferLimitInPercentageReceipt.logs, 'TransferLimitInPercentageSet'); + console.log(chalk.green(`The transfer limit for ${setTransferLimitInPercentageEvent._wallet} is ${setTransferLimitInPercentageEvent._percentage}%`)); + break; + case 'Set tokens transfer limit per account': + let tokensAccount = readlineSync.question('Enter the wallet: ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let accountLimitInTokens = readlineSync.questionInt(`Enter the transfer limit for ${tokensAccount} in amount of tokens: `, { + limit: function(input) { + return input > 0; + }, + limitMessage: "Must be greater than zero" + }); + let setTransferLimitInTokensAction = currentTransferManager.methods.setTransferLimitInTokens(tokensAccount, web3.utils.toWei(accountLimitInTokens)); + let setTransferLimitInTokensReceipt = await common.sendTransaction(Issuer.address, setTransferLimitInTokensAction, defaultGasPrice); + let setTransferLimitInTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, setTransferLimitInTokensReceipt.logs, 'TransferLimitInTokensSet'); + console.log(chalk.green(`The transfer limit for ${setTransferLimitInTokensEvent._wallet} is ${setTransferLimitInTokensEvent._percentage} ${tokenSymbol}`)); + break; + case 'Remove percentage transfer limit per account': + let percentageAccountToRemove = readlineSync.question('Enter the wallet to remove: ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let removeTransferLimitInPercentageAction = currentTransferManager.methods.removeTransferLimitInPercentage(percentageAccountToRemove); + let removeTransferLimitInPercentageReceipt = await common.sendTransaction(Issuer.address, removeTransferLimitInPercentageAction, defaultGasPrice); + let removeTransferLimitInPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, removeTransferLimitInPercentageReceipt.logs, 'TransferLimitInPercentageRemoved'); + console.log(chalk.green(`The transfer limit for ${removeTransferLimitInPercentageEvent._wallet} is the default limit`)); + break; + case 'Remove tokens transfer limit per account': + let tokensAccountToRemove = readlineSync.question('Enter the wallet to remove: ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let removeTransferLimitInTokensAction = currentTransferManager.methods.removeTransferLimitInTokens(tokensAccountToRemove); + let removeTransferLimitInTokensReceipt = await common.sendTransaction(Issuer.address, removeTransferLimitInTokensAction, defaultGasPrice); + let removeTransferLimitInTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, removeTransferLimitInTokensReceipt.logs, 'TransferLimitInTokensRemoved'); + console.log(chalk.green(`The transfer limit for ${removeTransferLimitInTokensEvent._wallet} is the default limit`)); + break; + } +} /* // Copied from tests function signData(tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, pk) { From f8d73b92569b780d6f83d3260e05ad2e92dbd1fa Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Tue, 23 Oct 2018 11:37:47 -0300 Subject: [PATCH 003/139] Minor changes --- CLI/commands/common/common_functions.js | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/CLI/commands/common/common_functions.js b/CLI/commands/common/common_functions.js index dbf3aa8dd..aa553b18e 100644 --- a/CLI/commands/common/common_functions.js +++ b/CLI/commands/common/common_functions.js @@ -1,5 +1,30 @@ const chalk = require('chalk'); const Tx = require('ethereumjs-tx'); +const permissionsList = require('./permissions_list'); +const abis = require('../helpers/contract_abis'); + +async function connect(abi, address) { + contractRegistry = new web3.eth.Contract(abi, address); + contractRegistry.setProvider(web3.currentProvider); + return contractRegistry +}; + +async function checkPermission(contractName, functionName, contractRegistry) { + let permission = permissionsList.verifyPermission(contractName, functionName); + if (permission === undefined) { + return true + } else { + let stAddress = await contractRegistry.methods.securityToken().call(); + let securityToken = await connect(abis.securityToken(), stAddress); + let stOwner = await securityToken.methods.owner().call(); + if (stOwner == Issuer.address) { + return true + } else { + let result = await securityToken.methods.checkPermission(Issuer.address, contractRegistry.options.address, web3.utils.asciiToHex(permission)).call(); + return result + } + } +}; module.exports = { convertToDaysRemaining: function (timeRemaining) { @@ -48,6 +73,20 @@ module.exports = { `); }, sendTransaction: async function (from, action, gasPrice, value, factor) { + let contractRegistry = await connect(action._parent.options.jsonInterface, action._parent._address); + + //NOTE this is a condition to verify if the transaction comes from a module or not. + if (contractRegistry.methods.hasOwnProperty('factory')) { + let moduleAddress = await contractRegistry.methods.factory().call(); + let moduleRegistry = await connect(abis.moduleFactory(), moduleAddress) + let parentModule = await moduleRegistry.methods.getName().call(); + let result = await checkPermission(web3.utils.hexToUtf8(parentModule), action._method.name, contractRegistry); + if (!result) { + console.log(chalk.red(`\nYou have not the right permissions to execute this method on this module!\n`)); + process.exit(0); + } + } + if (typeof factor === 'undefined') factor = 1.2; let block = await web3.eth.getBlock("latest"); From 40d49a18c8769908cf8ce6c1be86fc35a35673ab Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Tue, 23 Oct 2018 11:53:57 -0300 Subject: [PATCH 004/139] Dependencies fix for CLI --- CLI/package.json | 2 +- CLI/yarn.lock | 394 ++++++++++++++++++++--------------------------- 2 files changed, 167 insertions(+), 229 deletions(-) diff --git a/CLI/package.json b/CLI/package.json index d035e7cca..95a391b45 100644 --- a/CLI/package.json +++ b/CLI/package.json @@ -16,6 +16,6 @@ "readline-sync": "^1.4.9", "request": "^2.88.0", "request-promise": "^4.2.2", - "web3": "^1.0.0-beta.35" + "web3": "1.0.0-beta.35" } } diff --git a/CLI/yarn.lock b/CLI/yarn.lock index 0fd77a236..4d20bee11 100644 --- a/CLI/yarn.lock +++ b/CLI/yarn.lock @@ -3,9 +3,9 @@ "@types/node@^10.3.2": - version "10.11.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.11.7.tgz#0e75ca9357d646ca754016ca1d68a127ad7e7300" - integrity sha512-yOxFfkN9xUFLyvWaeYj90mlqTJ41CsQzWKS3gXdOMOyPVacUsymejKxJ4/pMW7exouubuEeZLJawGgcNGYlTeg== + version "10.12.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.0.tgz#ea6dcbddbc5b584c83f06c60e82736d8fbb0c235" + integrity sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ== accepts@~1.3.5: version "1.3.5" @@ -327,14 +327,7 @@ color-name@1.1.3: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= -combined-stream@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" - integrity sha1-cj599ugBrFYTETp+RFqbactjKBg= - dependencies: - delayed-stream "~1.0.0" - -combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== @@ -628,14 +621,6 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= -eth-ens-namehash@2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf" - integrity sha1-IprEbsqG1S4MmR58sq74P/D2i88= - dependencies: - idna-uts46-hx "^2.3.1" - js-sha3 "^0.5.7" - eth-lib@0.1.27, eth-lib@^0.1.26: version "0.1.27" resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.1.27.tgz#f0b0fd144f865d2d6bf8257a40004f2e75ca1dd6" @@ -658,22 +643,6 @@ eth-lib@0.2.7: elliptic "^6.4.0" xhr-request-promise "^0.1.2" -ethers@4.0.0-beta.1: - version "4.0.0-beta.1" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.0-beta.1.tgz#0648268b83e0e91a961b1af971c662cdf8cbab6d" - integrity sha512-SoYhktEbLxf+fiux5SfCEwdzWENMvgIbMZD90I62s4GZD9nEjgEWy8ZboI3hck193Vs0bDoTohDISx84f2H2tw== - dependencies: - "@types/node" "^10.3.2" - aes-js "3.0.0" - bn.js "^4.4.0" - elliptic "6.3.3" - hash.js "1.1.3" - js-sha3 "0.5.7" - scrypt-js "2.0.3" - setimmediate "1.0.4" - uuid "2.0.1" - xmlhttprequest "1.8.0" - ethers@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.7.tgz#8c653618077a1fc60c5c1b2575da03561f0039f4" @@ -820,12 +789,12 @@ forever-agent@~0.6.1: integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= form-data@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" - integrity sha1-SXBJi+YEwgwAXU9cI67NIda0kJk= + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== dependencies: asynckit "^0.4.0" - combined-stream "1.0.6" + combined-stream "^1.0.6" mime-types "^2.1.12" forwarded@~0.1.2: @@ -1040,13 +1009,6 @@ iconv-lite@0.4.23: dependencies: safer-buffer ">= 2.1.2 < 3" -idna-uts46-hx@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz#a1dc5c4df37eee522bf66d969cc980e00e8711f9" - integrity sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA== - dependencies: - punycode "2.1.0" - ieee754@^1.1.4: version "1.1.12" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b" @@ -1133,7 +1095,7 @@ isurl@^1.0.0-alpha5: has-to-string-tag-x "^1.2.0" is-object "^1.0.1" -js-sha3@0.5.7, js-sha3@^0.5.7: +js-sha3@0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" integrity sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc= @@ -1237,17 +1199,17 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@~1.36.0: - version "1.36.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" - integrity sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw== +mime-db@~1.37.0: + version "1.37.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" + integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.18, mime-types@~2.1.19: - version "2.1.20" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" - integrity sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A== + version "2.1.21" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" + integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== dependencies: - mime-db "~1.36.0" + mime-db "~1.37.0" mime@1.4.1: version "1.4.1" @@ -1524,11 +1486,6 @@ public-encrypt@^4.0.0: randombytes "^2.0.1" safe-buffer "^5.1.2" -punycode@2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" - integrity sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0= - punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -1669,11 +1626,6 @@ safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, s resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -scrypt-js@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.3.tgz#bb0040be03043da9a012a2cea9fc9f852cfc87d4" - integrity sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q= - scrypt-js@2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16" @@ -2055,86 +2007,87 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -web3-bzz@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.0.0-beta.36.tgz#adb3fe7a70053eb7843e32b106792b01b482ef41" - integrity sha512-clDRS/ziboJ5ytnrfxq80YSu9HQsT0vggnT3BkoXadrauyEE/9JNLxRu016jjUxqdkfdv4MgIPDdOS3Bv2ghiw== +web3-bzz@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.0.0-beta.35.tgz#9d5e1362b3db2afd77d65619b7cd46dd5845c192" + integrity sha512-BhAU0qhlr8zltm4gs/+P1gki2VkxHJaM2Rrh4DGesDW0lzwufRoNvWFlwx1bKHoFPWNbSmm9PRkHOYOINL/Tgw== dependencies: got "7.1.0" swarm-js "0.1.37" underscore "1.8.3" -web3-core-helpers@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.36.tgz#6f618e80f1a6588d846efbfdc28f92ae0477f8d2" - integrity sha512-gu74l0htiGWuxLQuMnZqKToFvkSM+UFPE7qUuy1ZosH/h2Jd+VBWg6k4CyNYVYfP0hL5x3CN8SBmB+HMowo55A== +web3-core-helpers@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.35.tgz#d681d218a0c6e3283ee1f99a078ab9d3eef037f1" + integrity sha512-APOu3sEsamyqWt//8o4yq9KF25/uqGm+pQShson/sC4gKzmfJB07fLo2ond0X30E8fIqAPeVCotPXQxGciGUmA== dependencies: underscore "1.8.3" - web3-eth-iban "1.0.0-beta.36" - web3-utils "1.0.0-beta.36" + web3-eth-iban "1.0.0-beta.35" + web3-utils "1.0.0-beta.35" -web3-core-method@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.0.0-beta.36.tgz#855c0365ae7d0ead394d973ea9e28828602900e0" - integrity sha512-dJsP3KkGaqBBSdxfzvLsYPOmVaSs1lR/3oKob/gtUYG7UyTnwquwliAc7OXj+gqRA2E/FHZcM83cWdl31ltdSA== +web3-core-method@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.0.0-beta.35.tgz#fc10e2d546cf4886038e6130bd5726b0952a4e5f" + integrity sha512-jidImCide8q0GpfsO4L73qoHrbkeWgwU3uOH5DKtJtv0ccmG086knNMRgryb/o9ZgetDWLmDEsJnHjBSoIwcbA== dependencies: underscore "1.8.3" - web3-core-helpers "1.0.0-beta.36" - web3-core-promievent "1.0.0-beta.36" - web3-core-subscriptions "1.0.0-beta.36" - web3-utils "1.0.0-beta.36" + web3-core-helpers "1.0.0-beta.35" + web3-core-promievent "1.0.0-beta.35" + web3-core-subscriptions "1.0.0-beta.35" + web3-utils "1.0.0-beta.35" -web3-core-promievent@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.36.tgz#3a5127787fff751be6de272722cbc77dc9523fd5" - integrity sha512-RGIL6TjcOeJTullFLMurChPTsg94cPF6LI763y/sPYtXTDol1vVa+J5aGLp/4WW8v+s+1bSQO6zYq2ZtkbmtEQ== +web3-core-promievent@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.35.tgz#4f1b24737520fa423fee3afee110fbe82bcb8691" + integrity sha512-GvqXqKq07OmHuVi5uNRg6k79a1/CI0ViCC+EtNv4CORHtDRmYEt5Bvdv6z6FJEiaaQkD0lKbFwNhLxutx7HItw== dependencies: any-promise "1.3.0" eventemitter3 "1.1.1" -web3-core-requestmanager@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.36.tgz#70c8eead84da9ed1cf258e6dde3f137116d0691b" - integrity sha512-/CHuaMbiMDu1v8ANGYI7yFCnh1GaCWx5pKnUPJf+QTk2xAAw+Bvd97yZJIWPOK5AOPUIzxgwx9Ob/5ln6mTmYA== +web3-core-requestmanager@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.35.tgz#2b77cbf6303720ad68899b39fa7f584dc03dbc8f" + integrity sha512-S+zW2h17ZZQU9oe3yaCJE0E7aJS4C3Kf4kGPDv+nXjW0gKhQQhgVhw1Doq/aYQGqNSWJp7f1VHkz5gQWwg6RRg== dependencies: underscore "1.8.3" - web3-core-helpers "1.0.0-beta.36" - web3-providers-http "1.0.0-beta.36" - web3-providers-ipc "1.0.0-beta.36" - web3-providers-ws "1.0.0-beta.36" + web3-core-helpers "1.0.0-beta.35" + web3-providers-http "1.0.0-beta.35" + web3-providers-ipc "1.0.0-beta.35" + web3-providers-ws "1.0.0-beta.35" -web3-core-subscriptions@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.36.tgz#20f1f20c85d5b40f1e5a49b070ba977a142621f3" - integrity sha512-/evyLQ8CMEYXC5aUCodDpmEnmGVYQxaIjiEIfA/85f9ifHkfzP1aOwCAjcsLsJWnwrWDagxSpjCYrDtnNabdEw== +web3-core-subscriptions@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.35.tgz#c1b76a2ad3c6e80f5d40b8ba560f01e0f4628758" + integrity sha512-gXzLrWvcGkGiWq1y33Z4Y80XI8XMrwowiQJkrPSjQ81K5PBKquOGwcMffLaKcwdmEy/NpsOXDeFo3eLE1Ghvvw== dependencies: eventemitter3 "1.1.1" underscore "1.8.3" - web3-core-helpers "1.0.0-beta.36" + web3-core-helpers "1.0.0-beta.35" -web3-core@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.0.0-beta.36.tgz#86182f2456c2cf1cd6e7654d314e195eac211917" - integrity sha512-C2QW9CMMRZdYAiKiLkMrKRSp+gekSqTDgZTNvlxAdN1hXn4d9UmcmWSJXOmIHqr5N2ISbRod+bW+qChODxVE3Q== +web3-core@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.0.0-beta.35.tgz#0c44d3c50d23219b0b1531d145607a9bc7cd4b4f" + integrity sha512-ayGavbgVk4KL9Y88Uv411fBJ0SVgVfKhKEBweKYzmP0zOqneMzWt6YsyD1n6kRvjAbqA0AfUPEOKyMNjcx2tjw== dependencies: - web3-core-helpers "1.0.0-beta.36" - web3-core-method "1.0.0-beta.36" - web3-core-requestmanager "1.0.0-beta.36" - web3-utils "1.0.0-beta.36" + web3-core-helpers "1.0.0-beta.35" + web3-core-method "1.0.0-beta.35" + web3-core-requestmanager "1.0.0-beta.35" + web3-utils "1.0.0-beta.35" -web3-eth-abi@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.36.tgz#21c0f222701db827a8a269accb9cd18bbd8f70f9" - integrity sha512-fBfW+7hvA0rxEMV45fO7JU+0R32ayT7aRwG9Cl6NW2/QvhFeME2qVbMIWw0q5MryPZGIN8A6366hKNuWvVidDg== +web3-eth-abi@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.35.tgz#2eb9c1c7c7233db04010defcb192293e0db250e6" + integrity sha512-KUDC+EtFFYG8z01ZleKrASdjj327/rtWHzEt6RWsEj7bBa0bGp9nEh+nqdZx/Sdgz1O8tnfFzJlrRcXpfr1vGg== dependencies: - ethers "4.0.0-beta.1" + bn.js "4.11.6" underscore "1.8.3" - web3-utils "1.0.0-beta.36" + web3-core-helpers "1.0.0-beta.35" + web3-utils "1.0.0-beta.35" -web3-eth-accounts@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.36.tgz#8aea37df9b038ef2c6cda608856ffd861b39eeef" - integrity sha512-MmgIlBEZ0ILLWV4+wfMrbeVVMU/VmQnCpgSDcw7wHKOKu47bKncJ6rVqVsUbC6d9F613Rios+Yj2Ua6SCHtmrg== +web3-eth-accounts@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.35.tgz#7d0e5a69f510dc93874471599eb7abfa9ddf3e63" + integrity sha512-duIgRsfht/0kAW/eQ0X9lKtVIykbETrnM2H7EnvplCzPHtQLodpib4o9JXfh9n6ZDgdDC7cuJoiVB9QJg089ew== dependencies: any-promise "1.3.0" crypto-browserify "3.12.0" @@ -2142,126 +2095,111 @@ web3-eth-accounts@1.0.0-beta.36: scrypt.js "0.2.0" underscore "1.8.3" uuid "2.0.1" - web3-core "1.0.0-beta.36" - web3-core-helpers "1.0.0-beta.36" - web3-core-method "1.0.0-beta.36" - web3-utils "1.0.0-beta.36" + web3-core "1.0.0-beta.35" + web3-core-helpers "1.0.0-beta.35" + web3-core-method "1.0.0-beta.35" + web3-utils "1.0.0-beta.35" -web3-eth-contract@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.36.tgz#c0c366c4e4016896142208cee758a2ff2a31be2a" - integrity sha512-cywqcIrUsCW4fyqsHdOb24OCC8AnBol8kNiptI+IHRylyCjTNgr53bUbjrXWjmEnear90rO0QhAVjLB1a4iEbQ== +web3-eth-contract@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.35.tgz#5276242d8a3358d9f1ce92b71575c74f9015935c" + integrity sha512-foPohOg5O1UCGKGZOIs+kQK5IZdV2QQ7pAWwNxH8WHplUA+fre1MurXNpoxknUmH6mYplFhXjqgYq2MsrBpHrA== dependencies: underscore "1.8.3" - web3-core "1.0.0-beta.36" - web3-core-helpers "1.0.0-beta.36" - web3-core-method "1.0.0-beta.36" - web3-core-promievent "1.0.0-beta.36" - web3-core-subscriptions "1.0.0-beta.36" - web3-eth-abi "1.0.0-beta.36" - web3-utils "1.0.0-beta.36" - -web3-eth-ens@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.0.0-beta.36.tgz#c7440b42b597fd74f64bc402f03ad2e832f423d8" - integrity sha512-8ZdD7XoJfSX3jNlZHSLe4G837xQ0v5a8cHCcDcd1IoqoY855X9SrIQ0Xdqia9p4mR1YcH1vgmkXY9/3hsvxS7g== - dependencies: - eth-ens-namehash "2.0.8" - underscore "1.8.3" - web3-core "1.0.0-beta.36" - web3-core-helpers "1.0.0-beta.36" - web3-core-promievent "1.0.0-beta.36" - web3-eth-abi "1.0.0-beta.36" - web3-eth-contract "1.0.0-beta.36" - web3-utils "1.0.0-beta.36" - -web3-eth-iban@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.36.tgz#00cb3aba7a5aeb15d02b07421042e263d7b2e01b" - integrity sha512-b5AEDjjhOLR4q47Hbzf65zYE+7U7JgCgrUb13RU4HMIGoMb1q4DXaJw1UH8VVHCZulevl2QBjpCyrntecMqqCQ== + web3-core "1.0.0-beta.35" + web3-core-helpers "1.0.0-beta.35" + web3-core-method "1.0.0-beta.35" + web3-core-promievent "1.0.0-beta.35" + web3-core-subscriptions "1.0.0-beta.35" + web3-eth-abi "1.0.0-beta.35" + web3-utils "1.0.0-beta.35" + +web3-eth-iban@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.35.tgz#5aa10327a9abb26bcfc4ba79d7bad18a002b332c" + integrity sha512-H5wkcNcAIc+h/WoDIKv7ZYmrM2Xqu3O7jBQl1IWo73EDVQji+AoB2i3J8tuwI1yZRInRwrfpI3Zuwuf54hXHmQ== dependencies: bn.js "4.11.6" - web3-utils "1.0.0-beta.36" + web3-utils "1.0.0-beta.35" -web3-eth-personal@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.36.tgz#95545998a8ee377e3bb71e27c8d1a5dc1d7d5a21" - integrity sha512-+oxvhojeWh4C/XtnlYURWRR3F5Cg7bQQNjtN1ZGnouKAZyBLoYDVVJ6OaPiveNtfC9RKnzLikn9/Uqc0xz410A== +web3-eth-personal@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.35.tgz#ecac95b7a53d04a567447062d5cae5f49879e89f" + integrity sha512-AcM9nnlxu7ZRRxPvkrFB9eLxMM4A2cPfj2aCg21Wb2EpMnhR+b/O1cT33k7ApRowoMpM+T9M8vx2oPNwXfaCOQ== dependencies: - web3-core "1.0.0-beta.36" - web3-core-helpers "1.0.0-beta.36" - web3-core-method "1.0.0-beta.36" - web3-net "1.0.0-beta.36" - web3-utils "1.0.0-beta.36" + web3-core "1.0.0-beta.35" + web3-core-helpers "1.0.0-beta.35" + web3-core-method "1.0.0-beta.35" + web3-net "1.0.0-beta.35" + web3-utils "1.0.0-beta.35" -web3-eth@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.0.0-beta.36.tgz#04a8c748d344c1accaa26d7d5d0eac0da7127f14" - integrity sha512-uEa0UnbnNHUB4N2O1U+LsvxzSPJ/w3azy5115IseaUdDaiz6IFFgFfFP3ssauayQNCf7v2F44GXLfPhrNeb/Sw== +web3-eth@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.0.0-beta.35.tgz#c52c804afb95e6624b6f5e72a9af90fbf5005b68" + integrity sha512-04mcb2nGPXThawuuYICPOxv0xOHofvQKsjZeIq+89nyOC8DQMGTAErDkGyMHQYtjpth5XDhic0wuEsA80AmFZA== dependencies: underscore "1.8.3" - web3-core "1.0.0-beta.36" - web3-core-helpers "1.0.0-beta.36" - web3-core-method "1.0.0-beta.36" - web3-core-subscriptions "1.0.0-beta.36" - web3-eth-abi "1.0.0-beta.36" - web3-eth-accounts "1.0.0-beta.36" - web3-eth-contract "1.0.0-beta.36" - web3-eth-ens "1.0.0-beta.36" - web3-eth-iban "1.0.0-beta.36" - web3-eth-personal "1.0.0-beta.36" - web3-net "1.0.0-beta.36" - web3-utils "1.0.0-beta.36" - -web3-net@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.0.0-beta.36.tgz#396cd35cb40934ed022a1f44a8a642d3908c41eb" - integrity sha512-BriXK0Pjr6Hc/VDq1Vn8vyOum4JB//wpCjgeGziFD6jC7Of8YaWC7AJYXje89OckzfcqX1aJyJlBwDpasNkAzQ== - dependencies: - web3-core "1.0.0-beta.36" - web3-core-method "1.0.0-beta.36" - web3-utils "1.0.0-beta.36" - -web3-providers-http@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.0.0-beta.36.tgz#c1937a2e64f8db7cd30f166794e37cf0fcca1131" - integrity sha512-KLSqMS59nRdpet9B0B64MKgtM3n9wAHTcAHJ03hv79avQNTjHxtjZm0ttcjcFUPpWDgTCtcYCa7tqaYo9Pbeog== - dependencies: - web3-core-helpers "1.0.0-beta.36" + web3-core "1.0.0-beta.35" + web3-core-helpers "1.0.0-beta.35" + web3-core-method "1.0.0-beta.35" + web3-core-subscriptions "1.0.0-beta.35" + web3-eth-abi "1.0.0-beta.35" + web3-eth-accounts "1.0.0-beta.35" + web3-eth-contract "1.0.0-beta.35" + web3-eth-iban "1.0.0-beta.35" + web3-eth-personal "1.0.0-beta.35" + web3-net "1.0.0-beta.35" + web3-utils "1.0.0-beta.35" + +web3-net@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.0.0-beta.35.tgz#5c6688e0dea71fcd910ee9dc5437b94b7f6b3354" + integrity sha512-bbwaQ/KohGjIJ6HAKbZ6KrklCAaG6/B7hIbAbVLSFLxF+Yz9lmAgQYaDInpidpC/NLb3WOmcbRF+P77J4qMVIA== + dependencies: + web3-core "1.0.0-beta.35" + web3-core-method "1.0.0-beta.35" + web3-utils "1.0.0-beta.35" + +web3-providers-http@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.0.0-beta.35.tgz#92059d9d6de6e9f82f4fae30b743efd841afc1e1" + integrity sha512-DcIMFq52Fb08UpWyZ3ZlES6NsNqJnco4hBS/Ej6eOcASfuUayPI+GLkYVZsnF3cBYqlH+DOKuArcKSuIxK7jIA== + dependencies: + web3-core-helpers "1.0.0-beta.35" xhr2-cookies "1.1.0" -web3-providers-ipc@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.36.tgz#0c78efb4ed6b0305ec830e1e0b785e61217ee605" - integrity sha512-iEUrmdd2CzoWgp+75/ydom/1IaoLw95qkAzsgwjjZp1waDncHP/cvVGX74+fbUx4hRaPdchyzxCQfNpgLDmNjQ== +web3-providers-ipc@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.35.tgz#031afeb10fade2ebb0ef2fb82f5e58c04be842d9" + integrity sha512-iB0FG0HcpUnayfa8pn4guqEQ4Y1nrroi/jffdtQgFkrNt0sD3fMSwwC0AbmECqj3tDLl0e1slBR0RENll+ZF0g== dependencies: oboe "2.1.3" underscore "1.8.3" - web3-core-helpers "1.0.0-beta.36" + web3-core-helpers "1.0.0-beta.35" -web3-providers-ws@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.36.tgz#27b74082c7adfa0cb5a65535eb312e49008c97c3" - integrity sha512-wAnENuZx75T5ZSrT2De2LOaUuPf2yRjq1VfcbD7+Zd79F3DZZLBJcPyCNVQ1U0fAXt0wfgCKl7sVw5pffqR9Bw== +web3-providers-ws@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.35.tgz#5d38603fd450243a26aae0ff7f680644e77fa240" + integrity sha512-Cx64NgDStynKaUGDIIOfaCd0fZusL8h5avKTkdTjUu2aHhFJhZoVBGVLhoDtUaqZGWIZGcBJOoVf2JkGUOjDRQ== dependencies: underscore "1.8.3" - web3-core-helpers "1.0.0-beta.36" + web3-core-helpers "1.0.0-beta.35" websocket "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible" -web3-shh@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.0.0-beta.36.tgz#6ff297594480edefc710d9d287765a0c4a5d5af1" - integrity sha512-bREGHS/WprYFSvGUhyIk8RSpT2Z5SvJOKGBrsUW2nDIMWO6z0Op8E7fzC6GXY2HZfZliAqq6LirbXLgcLRWuPw== +web3-shh@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.0.0-beta.35.tgz#7e4a585f8beee0c1927390937c6537748a5d1a58" + integrity sha512-8qSonk/x0xabERS9Sr6AIADN/Ty+5KwARkkGIfSYHKqFpdMDz+76F7cUCxtoCZoS8K04xgZlDKYe0TJXLYA0Fw== dependencies: - web3-core "1.0.0-beta.36" - web3-core-method "1.0.0-beta.36" - web3-core-subscriptions "1.0.0-beta.36" - web3-net "1.0.0-beta.36" + web3-core "1.0.0-beta.35" + web3-core-method "1.0.0-beta.35" + web3-core-subscriptions "1.0.0-beta.35" + web3-net "1.0.0-beta.35" -web3-utils@1.0.0-beta.36: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.0.0-beta.36.tgz#dc19c9aeec009b1816cc91ef64d7fe9f8ee344c9" - integrity sha512-7ri74lG5fS2Th0fhYvTtiEHMB1Pmf2p7dQx1COQ3OHNI/CHNEMjzoNMEbBU6FAENrywfoFur40K4m0AOmEUq5A== +web3-utils@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.0.0-beta.35.tgz#ced9e1df47c65581c441c5f2af76b05a37a273d7" + integrity sha512-Dq6f0SOKj3BDFRgOPnE6ALbzBDCKVIW8mKWVf7tGVhTDHf+wQaWwQSC3aArFSqdExB75BPBPyDpuMTNszhljpA== dependencies: bn.js "4.11.6" eth-lib "0.1.27" @@ -2271,18 +2209,18 @@ web3-utils@1.0.0-beta.36: underscore "1.8.3" utf8 "2.1.1" -web3@^1.0.0-beta.35: - version "1.0.0-beta.36" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.0.0-beta.36.tgz#2954da9e431124c88396025510d840ba731c8373" - integrity sha512-fZDunw1V0AQS27r5pUN3eOVP7u8YAvyo6vOapdgVRolAu5LgaweP7jncYyLINqIX9ZgWdS5A090bt+ymgaYHsw== - dependencies: - web3-bzz "1.0.0-beta.36" - web3-core "1.0.0-beta.36" - web3-eth "1.0.0-beta.36" - web3-eth-personal "1.0.0-beta.36" - web3-net "1.0.0-beta.36" - web3-shh "1.0.0-beta.36" - web3-utils "1.0.0-beta.36" +web3@1.0.0-beta.35: + version "1.0.0-beta.35" + resolved "https://registry.yarnpkg.com/web3/-/web3-1.0.0-beta.35.tgz#6475095bd451a96e50a32b997ddee82279292f11" + integrity sha512-xwDmUhvTcHQvvNnOPcPZZgCxKUsI2e+GbHy7JkTK3/Rmnutazy8x7fsAXT9myw7V1qpi3GgLoZ3fkglSUbg1Mg== + dependencies: + web3-bzz "1.0.0-beta.35" + web3-core "1.0.0-beta.35" + web3-eth "1.0.0-beta.35" + web3-eth-personal "1.0.0-beta.35" + web3-net "1.0.0-beta.35" + web3-shh "1.0.0-beta.35" + web3-utils "1.0.0-beta.35" "websocket@git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible": version "1.0.26" From d7e97bbaec22a7af6f99f5dbe6449d28fd742917 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Tue, 23 Oct 2018 16:30:50 -0300 Subject: [PATCH 005/139] STRV TM added to migration script --- migrations/2_deploy_contracts.js | 51 +++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index 0994e249e..70ba2e8fe 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -2,6 +2,7 @@ const PolymathRegistry = artifacts.require('./PolymathRegistry.sol') const GeneralTransferManagerFactory = artifacts.require('./GeneralTransferManagerFactory.sol') const GeneralPermissionManagerFactory = artifacts.require('./GeneralPermissionManagerFactory.sol') const PercentageTransferManagerFactory = artifacts.require('./PercentageTransferManagerFactory.sol') +const SingleTradeVolumeRestrictionTMFactory = artifacts.require('./SingleTradeVolumeRestrictionTMFactory.sol') const USDTieredSTOProxyFactory = artifacts.require('./USDTieredSTOProxyFactory.sol'); const CountTransferManagerFactory = artifacts.require('./CountTransferManagerFactory.sol') const EtherDividendCheckpointFactory = artifacts.require('./EtherDividendCheckpointFactory.sol') @@ -157,6 +158,10 @@ module.exports = function (deployer, network, accounts) { // D) Deploy the CountTransferManagerFactory Contract (Factory used to generate the CountTransferManager contract use // to track the counts of the investors of the security token) return deployer.deploy(CountTransferManagerFactory, PolyToken, 0, 0, 0, {from: PolymathAccount}); + }).then(() => { + // D) Deploy the SingleTradeVolumeRestrictionTMFactory Contract (Factory used to generate the SingleTradeVolumeRestrictionTM contract use + // to impose volume restriction on a single trade that the investors could do for a particular security token) + return deployer.deploy(SingleTradeVolumeRestrictionTMFactory, PolyToken, 0, 0, 0, {from: PolymathAccount}); }).then(() => { // D) Deploy the PercentageTransferManagerFactory Contract (Factory used to generate the PercentageTransferManager contract use // to track the percentage of investment the investors could do for a particular security token) @@ -196,6 +201,10 @@ module.exports = function (deployer, network, accounts) { }).then(() => { // Update all addresses into the registry contract by calling the function updateFromregistry return moduleRegistry.updateFromRegistry({from: PolymathAccount}); + }).then(() => { + // D) Register the SingleTradeVolumeRestrictionTMFactory in the ModuleRegistry to make the factory available at the protocol level. + // So any securityToken can use that factory to generate the SingleTradeVolumeRestrictionTM contract. + return moduleRegistry.registerModule(SingleTradeVolumeRestrictionTMFactory.address, {from: PolymathAccount}); }).then(() => { // D) Register the PercentageTransferManagerFactory in the ModuleRegistry to make the factory available at the protocol level. // So any securityToken can use that factory to generate the PercentageTransferManager contract. @@ -239,6 +248,11 @@ module.exports = function (deployer, network, accounts) { // contract, Factory should comes under the verified list of factories or those factories deployed by the securityToken issuers only. // Here it gets verified because it is deployed by the third party account (Polymath Account) not with the issuer accounts. return moduleRegistry.verifyModule(PercentageTransferManagerFactory.address, true, {from: PolymathAccount}); + }).then(() => { + // G) Once the SingleTradeVolumeRestrictionTMFactory registered with the ModuleRegistry contract then for making them accessble to the securityToken + // contract, Factory should comes under the verified list of factories or those factories deployed by the securityToken issuers only. + // Here it gets verified because it is deployed by the third party account (Polymath Account) not with the issuer accounts. + return moduleRegistry.verifyModule(SingleTradeVolumeRestrictionTMFactory.address, true, {from: PolymathAccount}); }).then(() => { // G) Once the GeneralPermissionManagerFactory registered with the ModuleRegistry contract then for making them accessble to the securityToken // contract, Factory should comes under the verified list of factories or those factories deployed by the securityToken issuers only. @@ -294,27 +308,28 @@ module.exports = function (deployer, network, accounts) { console.log('\n'); console.log(` ----------------------- Polymath Network Smart Contracts: ----------------------- - PolymathRegistry: ${PolymathRegistry.address} - SecurityTokenRegistry (Proxy): ${SecurityTokenRegistryProxy.address} - ModuleRegistry (Proxy): ${ModuleRegistryProxy.address} - FeatureRegistry: ${FeatureRegistry.address} - - ETHOracle: ${ETHOracle} - POLYOracle: ${POLYOracle} + PolymathRegistry: ${PolymathRegistry.address} + SecurityTokenRegistry (Proxy): ${SecurityTokenRegistryProxy.address} + ModuleRegistry (Proxy): ${ModuleRegistryProxy.address} + FeatureRegistry: ${FeatureRegistry.address} - STFactory: ${STFactory.address} - GeneralTransferManagerFactory: ${GeneralTransferManagerFactory.address} - GeneralPermissionManagerFactory: ${GeneralPermissionManagerFactory.address} + ETHOracle: ${ETHOracle} + POLYOracle: ${POLYOracle} - CappedSTOFactory: ${CappedSTOFactory.address} - USDTieredSTOFactory: ${USDTieredSTOFactory.address} - USDTieredSTOProxyFactory: ${USDTieredSTOProxyFactory.address} + STFactory: ${STFactory.address} + GeneralTransferManagerFactory: ${GeneralTransferManagerFactory.address} + GeneralPermissionManagerFactory: ${GeneralPermissionManagerFactory.address} + + CappedSTOFactory: ${CappedSTOFactory.address} + USDTieredSTOFactory: ${USDTieredSTOFactory.address} + USDTieredSTOProxyFactory: ${USDTieredSTOProxyFactory.address} - CountTransferManagerFactory: ${CountTransferManagerFactory.address} - PercentageTransferManagerFactory: ${PercentageTransferManagerFactory.address} - ManualApprovalTransferManagerFactory: ${ManualApprovalTransferManagerFactory.address} - EtherDividendCheckpointFactory: ${EtherDividendCheckpointFactory.address} - ERC20DividendCheckpointFactory: ${ERC20DividendCheckpointFactory.address} + CountTransferManagerFactory: ${CountTransferManagerFactory.address} + PercentageTransferManagerFactory: ${PercentageTransferManagerFactory.address} + ManualApprovalTransferManagerFactory: ${ManualApprovalTransferManagerFactory.address} + SingleTradeVolumeRestrictionTMFactory: ${SingleTradeVolumeRestrictionTMFactory.address} + EtherDividendCheckpointFactory: ${EtherDividendCheckpointFactory.address} + ERC20DividendCheckpointFactory: ${ERC20DividendCheckpointFactory.address} --------------------------------------------------------------------------------- `); console.log('\n'); From 0ecec66d2b1f215f3553ef748aa549deaa3253e6 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Wed, 24 Oct 2018 08:28:49 -0300 Subject: [PATCH 006/139] STVR TM support --- CLI/commands/helpers/contract_abis.js | 5 + CLI/commands/transfer_manager.js | 534 +++++++++++++++++++------- 2 files changed, 397 insertions(+), 142 deletions(-) diff --git a/CLI/commands/helpers/contract_abis.js b/CLI/commands/helpers/contract_abis.js index b6c58cc38..38f063aec 100644 --- a/CLI/commands/helpers/contract_abis.js +++ b/CLI/commands/helpers/contract_abis.js @@ -7,6 +7,7 @@ let stoInterfaceABI; let cappedSTOABI; let usdTieredSTOABI; let generalTransferManagerABI; +let stvrTransferManagerABI; let generalPermissionManagerABI; let polyTokenABI; let cappedSTOFactoryABI; @@ -27,6 +28,7 @@ try { cappedSTOABI = JSON.parse(require('fs').readFileSync('./build/contracts/CappedSTO.json').toString()).abi; usdTieredSTOABI = JSON.parse(require('fs').readFileSync('./build/contracts/USDTieredSTO.json').toString()).abi; generalTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/GeneralTransferManager.json').toString()).abi; + stvrTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/SingleTradeVolumeRestrictionTM.json').toString()).abi; generalPermissionManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/GeneralPermissionManager.json').toString()).abi; polyTokenABI = JSON.parse(require('fs').readFileSync('./build/contracts/PolyTokenFaucet.json').toString()).abi; cappedSTOFactoryABI = JSON.parse(require('fs').readFileSync('./build/contracts/CappedSTOFactory.json').toString()).abi; @@ -69,6 +71,9 @@ module.exports = { generalTransferManager: function () { return generalTransferManagerABI; }, + singleTradeVolumeRestrictionTM: function() { + return stvrTransferManagerABI; + }, generalPermissionManager: function () { return generalPermissionManagerABI; }, diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 9d4917117..c17ba918c 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -1,6 +1,7 @@ const readlineSync = require('readline-sync'); const chalk = require('chalk'); const ethers = require('ethers'); +const shell = require('shelljs'); const common = require('./common/common_functions'); const global = require('./common/global'); const contracts = require('./helpers/contract_addresses'); @@ -19,6 +20,7 @@ let tokenSymbol; let securityToken; let securityTokenRegistry; let network; +let currentTransferManager; async function executeApp(remoteNetwork) { network = remoteNetwork; @@ -66,42 +68,89 @@ async function start_explorer() { let securityTokenABI = abis.securityToken(); securityToken = new web3.eth.Contract(securityTokenABI,result); - let tmModules = securityToken.methods.getModulesByType(MODULES_TYPES.TRANSFER).call(); + let tmModules = []; + let tmModuleAddresses = await securityToken.methods.getModulesByType(MODULES_TYPES.TRANSFER).call(); + for (const address of tmModuleAddresses) { + tmModules.push(await securityToken.methods.getModule(address).call()); + } + + // Show non-archived attached TM modules + console.log(); + console.log(`Transfer Manager modules attached:`); + tmModules.filter(m => m[3] == false).map(m => console.log(` - ${web3.utils.hexToAscii(m[0])} at ${m[1]}`)) - let options = []; + let options = ['Verify transfer', 'Transfer']; let forcedTransferDisabled = await securityToken.methods.controllerDisabled().call(); if (!forcedTransferDisabled) { - options.push('Forced Transfers'); + options.push('Forced transfers'); } - - options.push('GeneralTransferManager', 'ManualApprovalTransferManager', 'PercentageTransferManager', 'CountTransferManager', - 'SingleTradeVolumeRestrictionTM', 'LookupVolumeRestrictionTM'); + options.push('Config existing modules', 'Add new Transfer Manager module'); let index = readlineSync.keyInSelect(options, 'Choose one:'); - let optionSelected = options[index]; - console.log('Selected:', index != -1 ? optionSelected : 'Cancel', '\n'); + let optionSelected = index != -1 ? options[index] : 'Cancel'; + console.log('Selected:', optionSelected, '\n'); switch (optionSelected) { - case 'Forced Transfers': - await forcedTransfers(); + case 'Verify transfer': + let verifyTransferFrom = readlineSync.question(`Enter the sender account (${Issuer.address}): `, { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address", + defaultInput: Issuer.address + }); + let verifyFromBalance = web3.utils.fromWei(await securityToken.methods.balanceOf(verifyTransferFrom).call()); + console.log(chalk.yellow(`Balance of ${verifyTransferFrom}: ${verifyFromBalance} ${tokenSymbol}`)); + let verifyTransferTo = readlineSync.question('Enter the receiver account: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address", + }); + let verifyToBalance = web3.utils.fromWei(await securityToken.methods.balanceOf(verifyTransferTo).call()); + console.log(chalk.yellow(`Balance of ${verifyTransferTo}: ${verifyToBalance} ${tokenSymbol}`)); + let verifyTransferAmount = readlineSync.question('Enter amount of tokens to verify: '); + let isVerified = await securityToken.methods.verifyTransfer(verifyTransferFrom, verifyTransferTo, web3.utils.toWei(verifyTransferAmount), web3.utils.fromAscii("")).call(); + if (isVerified) { + console.log(chalk.green(`\n${verifyTransferAmount} ${tokenSymbol} can be transferred from ${verifyTransferFrom} to ${verifyTransferTo}!`)); + } else { + console.log(chalk.red(`\n${verifyTransferAmount} ${tokenSymbol} can't be transferred from ${verifyTransferFrom} to ${verifyTransferTo}!`)); + } break; - case 'GeneralTransferManager': - await generalTransferManager(); + case 'Transfer': + let fromBalance = web3.utils.fromWei(await securityToken.methods.balanceOf(Issuer.address).call()); + console.log(chalk.yellow(`Balance of ${Issuer.address}: ${fromBalance} ${tokenSymbol}`)); + let transferTo = readlineSync.question('Enter beneficiary of tranfer: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let toBalance = web3.utils.fromWei(await securityToken.methods.balanceOf(transferTo).call()); + console.log(chalk.yellow(`Balance of ${transferTo}: ${toBalance} ${tokenSymbol}`)); + let transferAmount = readlineSync.question('Enter amount of tokens to transfer: '); + let isTranferVerified = await securityToken.methods.verifyTransfer(Issuer.address, transferTo, web3.utils.toWei(transferAmount), web3.utils.fromAscii("")).call(); + if (isTranferVerified) { + let transferAction = securityToken.methods.transfer(transferTo, web3.utils.toWei(transferAmount)); + let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice); + let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'Transfer'); + console.log(chalk.green(`${event.from} transferred ${web3.utils.fromWei(event.value)} ${tokenSymbol} to ${event.to} successfully!`)); + console.log(`Balance of ${Issuer.address} after transfer: ${web3.utils.fromWei(await securityToken.methods.balanceOf(Issuer.address).call())} ${tokenSymbol}`); + console.log(`Balance of ${transferTo} after transfer: ${web3.utils.fromWei(await securityToken.methods.balanceOf(transferTo).call())} ${tokenSymbol}`); + } else { + console.log(chalk.red(`Transfer failed at verification. Please review the transfer restrictions.`)); + } break; - case 'ManualApprovalTransferManager': - await manualApprovalTransferManager(); - break; - case 'PercentageTransferManager': - await percentageTransferManager(); - break; - case 'CountTransferManager': - await countTransferManager(); + case 'Forced transfers': + await forcedTransfers(); break; - case 'SingleTradeVolumeRestrictionTM': - await singleTradeVolumeRestrictionTM(); + case 'Config existing modules': + await configExistingModules(tmModules); break; - case 'LookupVolumeRestrictionTM': - await lookupVolumeRestrictionTM(); + case 'Add new Transfer Manager module': + await addTransferManagerModule(); break; + case 'Cancel': + process.exit(0); } } @@ -178,15 +227,234 @@ async function forcedTransfers() { } } +async function configExistingModules(tmModules) { + let nonArchivedModules = tmModules.filter(m => m[3] == false); + + let options = nonArchivedModules.map(m => `${web3.utils.hexToAscii(m[0])} at ${m[1]}`); + let index = readlineSync.keyInSelect(options, 'Which module do you want to config? '); + console.log('Selected:', index != -1 ? options[index] : 'Cancel', '\n'); + let moduleNameSelected = web3.utils.hexToUtf8(nonArchivedModules[index][0]); + + switch (moduleNameSelected) { + case 'GeneralTransferManager': + currentTransferManager = new web3.eth.Contract(abis.generalTransferManager(), nonArchivedModules[index][1]); + currentTransferManager.setProvider(web3.currentProvider); + await generalTransferManager(); + break; + case 'ManualApprovalTransferManager': + //await manualApprovalTransferManager(); + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************` + )); + break; + case 'PercentageTransferManager': + //await percentageTransferManager(); + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************` + )); + break; + case 'CountTransferManager': + //await countTransferManager(); + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************` + )); + break; + case 'SingleTradeVolumeRestrictionTM': + currentTransferManager = new web3.eth.Contract(abis.singleTradeVolumeRestrictionTM(), nonArchivedModules[index][1]); + currentTransferManager.setProvider(web3.currentProvider); + await singleTradeVolumeRestrictionTM(); + break; + case 'LookupVolumeRestrictionTM': + //await lookupVolumeRestrictionTM(); + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************` + )); + break; + } +} + +async function addTransferManagerModule() { + let options = ['GeneralTransferManager', 'ManualApprovalTransferManager', 'PercentageTransferManager', + 'CountTransferManager', 'SingleTradeVolumeRestrictionTM', 'LookupVolumeRestrictionTM']; + + let index = readlineSync.keyInSelect(options, 'Which Transfer Manager module do you want to add? '); + if (index != -1 && readlineSync.keyInYNStrict(`Are you sure you want to add ${options[index]} module?`)) { + let bytes; + switch (options[index]) { + case 'ManualApprovalTransferManager': + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************` + )); + break; + case 'PercentageTransferManager': + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************` + )); + break; + case 'CountTransferManager': + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************` + )); + break; + case 'SingleTradeVolumeRestrictionTM': + let isTransferLimitInPercentage = !!readlineSync.keyInSelect(['In tokens', 'In percentage'], 'How do you want to set the transfer limit? ', {cancel: false}); + let globalTransferLimitInPercentageOrToken; + if (isTransferLimitInPercentage) { + globalTransferLimitInPercentageOrToken = toWeiPercentage(readlineSync.question('Enter the percentage for default limit: ', { + limit: function(input) { + return (parseInt(input) > 0 && parseInt(input) <= 100); + }, + limitMessage: "Must be greater than 0 and less than 100" + })); + } else { + globalTransferLimitInPercentageOrToken = web3.utils.toWei(readlineSync.question('Enter the amount of tokens for default limit: ', { + limit: function(input) { + return parseInt(input) > 0; + }, + limitMessage: "Must be greater than zero" + })); + } + let allowPrimaryIssuance = readlineSync.keyInYNStrict(`Do you want to allow all primary issuance transfers? `); + bytes = web3.eth.abi.encodeFunctionCall( { + name: 'configure', + type: 'function', + inputs: [ + { + type: 'bool', + name: '_isTransferLimitInPercentage' + },{ + type: 'uint256', + name: '_globalTransferLimitInPercentageOrToken' + },{ + type: 'bool', + name: '_isTransferLimitInPercentage' + } + ] + }, [isTransferLimitInPercentage, globalTransferLimitInPercentageOrToken, allowPrimaryIssuance]); + break; + case 'LookupVolumeRestrictionTM': + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************` + )); + break; + default: + bytes = web3.utils.fromAscii('', 16); + } + let selectedTMFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.TRANSFER, options[index]); + let addModuleAction = securityToken.methods.addModule(selectedTMFactoryAddress, bytes, 0, 0); + let receipt = await common.sendTransaction(Issuer, addModuleAction, defaultGasPrice); + let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); + console.log(`Module deployed at address: ${event._module}`); + } +} + async function generalTransferManager() { - let options = ['Change Issuance Address', 'Change Signing Address', 'Change Allow All Transfers', 'Change Allow All Whitelist Transfers', - 'Change Allow All Whitelist Issuances', 'Change Allow All Burn Transfers', 'Modify Whitelist', 'Modify Whitelist from CSV', - 'Modify Whitelist Signed']; + console.log(chalk.blue(`General Transfer Manager at ${currentTransferManager.options.address}`)); + console.log(); + + // Show current data + let displayIssuanceAddress = await currentTransferManager.methods.issuanceAddress().call(); + let displaySigningAddress = await currentTransferManager.methods.signingAddress().call(); + let displayAllowAllTransfers = await currentTransferManager.methods.allowAllTransfers().call(); + let displayAllowAllWhitelistTransfers = await currentTransferManager.methods.allowAllWhitelistTransfers().call(); + let displayAllowAllWhitelistIssuances = await currentTransferManager.methods.allowAllWhitelistIssuances().call(); + let displayAllowAllBurnTransfers = await currentTransferManager.methods.allowAllBurnTransfers().call(); + + console.log(`- Issuance address: ${displayIssuanceAddress}`); + console.log(`- Signing address: ${displaySigningAddress}`); + console.log(`- Allow all transfers: ${displayAllowAllTransfers ? `YES` : `NO`}`); + console.log(`- Allow all whitelist transfers: ${displayAllowAllWhitelistTransfers ? `YES` : `NO`}`); + console.log(`- Allow all whitelist issuances: ${displayAllowAllWhitelistIssuances ? `YES` : `NO`}`); + console.log(`- Allow all burn transfers: ${displayAllowAllBurnTransfers ? `YES` : `NO`}`); + // ------------------ + + let options = ['Modify whitelist', 'Modify whitelist from CSV', /*'Modify Whitelist Signed',*/ + `Change issuance address`, 'Change signing address']; + if (displayAllowAllTransfers) { + options.push('Disallow all transfers'); + } else { + options.push('Allow all transfers'); + } + if (displayAllowAllWhitelistTransfers) { + options.push('Disallow all whitelist transfers'); + } else { + options.push('Allow all whitelist transfers'); + } + if (displayAllowAllWhitelistIssuances) { + options.push('Disallow all whitelist issuances'); + } else { + options.push('Allow all whitelist issuances'); + } + if (displayAllowAllBurnTransfers) { + options.push('Disallow all burn transfers'); + } else { + options.push('Allow all burn transfers'); + } + let index = readlineSync.keyInSelect(options, 'What do you want to do?'); let optionSelected = options[index]; console.log('Selected:', index != -1 ? optionSelected : 'Cancel', '\n'); switch (optionSelected) { - case 'Change Issuance Address': + case 'Modify whitelist': + let investor = readlineSync.question('Enter the address to whitelist: ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let fromTime = readlineSync.questionInt('Enter the time (Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens: '); + let toTime = readlineSync.questionInt('Enter the time (Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others: '); + let expiryTime = readlineSync.questionInt('Enter the time till investors KYC will be validated (after that investor need to do re-KYC): '); + let canBuyFromSTO = readlineSync.keyInYNStrict('Is the investor a restricted investor?'); + let modifyWhitelistAction = currentTransferManager.methods.modifyWhitelist(investor, fromTime, toTime, expiryTime, canBuyFromSTO); + let modifyWhitelistReceipt = await common.sendTransaction(Issuer, modifyWhitelistAction, defaultGasPrice); + let modifyWhitelistEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, modifyWhitelistReceipt.logs, 'ModifyWhitelist'); + console.log(chalk.green(`${modifyWhitelistEvent._investor} has been whitelisted sucessfully!`)); + break; + case 'Modify whitelist from CSV': + console.log(chalk.yellow(`Data is going to be read from 'data/whitelist_data.csv'. Be sure this file is updated!`)); + if (readlineSync.keyInYNStrict(`Do you want to continue?`)) { + shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${network}`); + } + break; + /* + case 'Modify Whitelist Signed': + let investorSigned = readlineSync.question('Enter the address to whitelist: ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let fromTimeSigned = readlineSync.questionInt('Enter the time (Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens: '); + let toTimeSigned = readlineSync.questionInt('Enter the time (Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others: '); + let expiryTimeSigned = readlineSync.questionInt('Enter the time till investors KYC will be validated (after that investor need to do re-KYC): '); + let vSigned = readlineSync.questionInt('Enter v: '); + let rSigned = readlineSync.question('Enter r: '); + let sSigned = readlineSync.question('Enter s: '); + let canBuyFromSTOSigned = readlineSync.keyInYNStrict('Is the investor a restricted investor?'); + let modifyWhitelistSignedAction = currentTransferManager.methods.modifyWhitelistSigned(investorSigned, fromTimeSigned, toTimeSigned, expiryTimeSigned, canBuyFromSTOSigned); + let modifyWhitelistSignedReceipt = await common.sendTransaction(Issuer, modifyWhitelistSignedAction, defaultGasPrice); + let modifyWhitelistSignedEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, modifyWhitelistSignedReceipt.logs, 'ModifyWhitelist'); + console.log(chalk.green(`${modifyWhitelistSignedEvent._investor} has been whitelisted sucessfully!`)); + break; + */ + case 'Change issuance address': let issuanceAddress = readlineSync.question('Enter the new issuance address: ', { limit: function(input) { return web3.utils.isAddress(input); @@ -194,11 +462,11 @@ async function generalTransferManager() { limitMessage: "Must be a valid address" }); let changeIssuanceAddressAction = currentTransferManager.methods.changeIssuanceAddress(issuanceAddress); - let changeIssuanceAddressReceipt = await common.sendTransaction(Issuer.address, changeIssuanceAddressAction, defaultGasPrice); + let changeIssuanceAddressReceipt = await common.sendTransaction(Issuer, changeIssuanceAddressAction, defaultGasPrice); let changeIssuanceAddressEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeIssuanceAddressReceipt.logs, 'ChangeIssuanceAddress'); console.log(chalk.green(`${changeIssuanceAddressEvent._issuanceAddress} is the new address for the issuance!`)); break; - case 'Change Signing Address': + case 'Change signing address': let signingAddress = readlineSync.question('Enter the new signing address: ', { limit: function(input) { return web3.utils.isAddress(input); @@ -206,14 +474,14 @@ async function generalTransferManager() { limitMessage: "Must be a valid address" }); let changeSigningAddressAction = currentTransferManager.methods.changeSigningAddress(signingAddress); - let changeSigningAddressReceipt = await common.sendTransaction(Issuer.address, changeSigningAddressAction, defaultGasPrice); + let changeSigningAddressReceipt = await common.sendTransaction(Issuer, changeSigningAddressAction, defaultGasPrice); let changeSigningAddressEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeSigningAddressReceipt.logs, 'ChangeSigningAddress'); console.log(chalk.green(`${changeSigningAddressEvent._signingAddress} is the new address for the signing!`)); break; - case 'Change Allow All Transfers': - let allowAllTransfers = readlineSync.keyInYNStrict('Do you want to remove all restrictions for any addresses?'); - let changeAllowAllTransfersAction = currentTransferManager.methods.changeAllowAllTransfers(allowAllTransfers); - let changeAllowAllTransfersReceipt = await common.sendTransaction(Issuer.address, changeAllowAllTransfersAction, defaultGasPrice); + case 'Allow all transfers': + case 'Disallow all transfers': + let changeAllowAllTransfersAction = currentTransferManager.methods.changeAllowAllTransfers(!displayAllowAllTransfers); + let changeAllowAllTransfersReceipt = await common.sendTransaction(Issuer, changeAllowAllTransfersAction, defaultGasPrice); let changeAllowAllTransfersEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeAllowAllTransfersReceipt.logs, 'AllowAllTransfers'); if (changeAllowAllTransfersEvent._allowAllTransfers) { console.log(chalk.green(`All transfers are allowed!`)); @@ -221,10 +489,10 @@ async function generalTransferManager() { console.log(chalk.green(`Transfers are restricted!`)); } break; - case 'Change Allow All Whitelist Transfers': - let allowAllWhitelistTransfers = readlineSync.keyInYNStrict('Do you want to ignore time locks from whitelist (address must still be whitelisted)?'); - let changeAllowAllWhitelistTransfersAction = currentTransferManager.methods.changeAllowAllWhitelistTransfers(allowAllWhitelistTransfers); - let changeAllowAllWhitelistTransfersReceipt = await common.sendTransaction(Issuer.address, changeAllowAllWhitelistTransfersAction, defaultGasPrice); + case 'Allow all whitelist transfers': + case 'Disallow all whitelist transfers': + let changeAllowAllWhitelistTransfersAction = currentTransferManager.methods.changeAllowAllWhitelistTransfers(!displayAllowAllWhitelistTransfers); + let changeAllowAllWhitelistTransfersReceipt = await common.sendTransaction(Issuer, changeAllowAllWhitelistTransfersAction, defaultGasPrice); let changeAllowAllWhitelistTransfersEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeAllowAllWhitelistTransfersReceipt.logs, 'AllowAllWhitelistTransfers'); if (changeAllowAllWhitelistTransfersEvent._allowAllWhitelistTransfers) { console.log(chalk.green(`Time locks from whitelist are ignored for transfers!`)); @@ -232,10 +500,10 @@ async function generalTransferManager() { console.log(chalk.green(`Transfers are restricted by time locks from whitelist!`)); } break; - case 'Change Allow All Whitelist Issuances': - let allowAllWhitelistIssuances = readlineSync.keyInYNStrict('Do you want to ignore time locks from whitelist (address must still be whitelisted)?'); - let changeAllowAllWhitelistIssuancesAction = currentTransferManager.methods.changeAllowAllIssuancesTransfers(allowAllWhitelistIssuances); - let changeAllowAllWhitelistIssuancesReceipt = await common.sendTransaction(Issuer.address, changeAllowAllWhitelistIssuancesAction, defaultGasPrice); + case 'Allow all whitelist issuances': + case 'Disallow all whitelist issuances': + let changeAllowAllWhitelistIssuancesAction = currentTransferManager.methods.changeAllowAllWhitelistIssuances(!displayAllowAllWhitelistIssuances); + let changeAllowAllWhitelistIssuancesReceipt = await common.sendTransaction(Issuer, changeAllowAllWhitelistIssuancesAction, defaultGasPrice); let changeAllowAllWhitelistIssuancesEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeAllowAllWhitelistIssuancesReceipt.logs, 'AllowAllWhitelistIssuances'); if (changeAllowAllWhitelistIssuancesEvent._allowAllWhitelistIssuances) { console.log(chalk.green(`Time locks from whitelist are ignored for issuances!`)); @@ -243,10 +511,10 @@ async function generalTransferManager() { console.log(chalk.green(`Issuances are restricted by time locks from whitelist!`)); } break; - case 'Change Allow All Burn Transfers': - let allowAllBurnTransfers = readlineSync.keyInYNStrict('Do you want to ignore time locks from whitelist (address must still be whitelisted)?'); - let changeAllowAllBurnTransfersAction = currentTransferManager.methods.allowAllBurnTransfers(allowAllBurnTransfers); - let changeAllowAllBurnTransfersReceipt = await common.sendTransaction(Issuer.address, changeAllowAllBurnTransfersAction, defaultGasPrice); + case 'Allow all burn transfers': + case 'Disallow all burn transfers': + let changeAllowAllBurnTransfersAction = currentTransferManager.methods.changeAllowAllBurnTransfers(!displayAllowAllBurnTransfers); + let changeAllowAllBurnTransfersReceipt = await common.sendTransaction(Issuer, changeAllowAllBurnTransfersAction, defaultGasPrice); let changeAllowAllBurnTransfersEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeAllowAllBurnTransfersReceipt.logs, 'AllowAllBurnTransfers'); if (changeAllowAllBurnTransfersEvent._allowAllWhitelistTransfers) { console.log(chalk.green(`To burn tokens is allowed!`)); @@ -254,59 +522,36 @@ async function generalTransferManager() { console.log(chalk.green(`The burning mechanism is deactivated!`)); } break; - case 'Modify Whitelist': - let investor = readlineSync.question('Enter the address to whitelist: ', { - limit: function(input) { - return web3.utils.isAddress(input); - }, - limitMessage: "Must be a valid address" - }); - let fromTime = readlineSync.questionInt('Enter the time (Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens: '); - let toTime = readlineSync.questionInt('Enter the time (Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others: '); - let expiryTime = readlineSync.questionInt('Enter the time till investors KYC will be validated (after that investor need to do re-KYC): '); - let canBuyFromSTO = readlineSync.keyInYNStrict('Is the investor a restricted investor?'); - let modifyWhitelistAction = currentTransferManager.methods.modifyWhitelist(investor, fromTime, toTime, expiryTime, canBuyFromSTO); - let modifyWhitelistReceipt = await common.sendTransaction(Issuer.address, modifyWhitelistAction, defaultGasPrice); - let modifyWhitelistEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, modifyWhitelistReceipt.logs, 'ModifyWhitelist'); - console.log(chalk.green(`${modifyWhitelistEvent._investor} has been whitelisted sucessfully!`)); - case 'Modify Whitelist from CSV': - console.log(chalk.yellow(`Data is going to be read from 'data/whitelist_data.csv'. Be sure this file is updated!`)); - if (readlineSync.keyInYNStrict(`Do you want to continue?`)) { - shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${network}`); - } - break; - /* - case 'Modify Whitelist Signed': - let investorSigned = readlineSync.question('Enter the address to whitelist: ', { - limit: function(input) { - return web3.utils.isAddress(input); - }, - limitMessage: "Must be a valid address" - }); - let fromTimeSigned = readlineSync.questionInt('Enter the time (Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens: '); - let toTimeSigned = readlineSync.questionInt('Enter the time (Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others: '); - let expiryTimeSigned = readlineSync.questionInt('Enter the time till investors KYC will be validated (after that investor need to do re-KYC): '); - let vSigned = readlineSync.questionInt('Enter v: '); - let rSigned = readlineSync.question('Enter r: '); - let sSigned = readlineSync.question('Enter s: '); - let canBuyFromSTOSigned = readlineSync.keyInYNStrict('Is the investor a restricted investor?'); - let modifyWhitelistSignedAction = currentTransferManager.methods.modifyWhitelistSigned(investorSigned, fromTimeSigned, toTimeSigned, expiryTimeSigned, canBuyFromSTOSigned); - let modifyWhitelistSignedReceipt = await common.sendTransaction(Issuer.address, modifyWhitelistSignedAction, defaultGasPrice); - let modifyWhitelistSignedEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, modifyWhitelistSignedReceipt.logs, 'ModifyWhitelist'); - console.log(chalk.green(`${modifyWhitelistSignedEvent._investor} has been whitelisted sucessfully!`)); - break; - */ } } async function singleTradeVolumeRestrictionTM() { - let primaryIssuanceAllowed = await currentTransferManager.methods.allowPrimaryIssuance().call(); - let allowPrimeryIssuanceOption = primaryIssuanceAllowed ? 'Allow Primary Issuance' : 'Disallow Primary Issuance'; - - let options = [allowPrimeryIssuanceOption, 'Add exempted wallet', 'Remove exempted wallet']; + console.log(chalk.blue(`Single Trade Volume Restriction Transfer Manager at ${currentTransferManager.options.address}`)); + console.log(); - let isTransferLimitInPercentage = await currentTransferManager.methods.isTransferLimitInPercentage().call(); - if (isTransferLimitInPercentage) { + // Show current data + let displayIsInPercentage = await currentTransferManager.methods.isTransferLimitInPercentage().call(); + let displayGlobalTransferLimit; + if (displayIsInPercentage) { + displayGlobalTransferLimit = fromWeiPercentage(await currentTransferManager.methods.globalTransferLimitInPercentage().call()); + } else { + displayGlobalTransferLimit = web3.utils.fromWei(await currentTransferManager.methods.globalTransferLimitInTokens().call()); + } + let displayAllowPrimaryIssuance = await currentTransferManager.methods.allowPrimaryIssuance().call(); + + console.log(`- Limit type: ${displayIsInPercentage ? `Percentage` : `Tokens`}`); + console.log(`- Default transfer limit: ${displayGlobalTransferLimit} ${displayIsInPercentage ? `%` : `${tokenSymbol}`}`); + console.log(`- Allow primary issuance: ${displayAllowPrimaryIssuance ? `YES` : `NO`}`); + // ------------------ + + let options = []; + if (displayAllowPrimaryIssuance) { + options.push('Disallow primary issuance'); + } else { + options.push('Allow primary issuance'); + } + options.push('Add exempted wallet', 'Remove exempted wallet'); + if (displayIsInPercentage) { options.push('Change transfer limit to tokens', 'Change default percentage limit', 'Set percentage transfer limit per account', 'Remove percentage transfer limit per account'); } else { @@ -318,87 +563,84 @@ async function singleTradeVolumeRestrictionTM() { let optionSelected = options[index]; console.log('Selected:', index != -1 ? optionSelected : 'Cancel', '\n'); switch (optionSelected) { - case 'Allow Primary Issuance': - let allowPrimaryIssuanceAction = currentTransferManager.methods.setAllowPrimaryIssuance(true); - await common.sendTransaction(Issuer.address, allowPrimaryIssuanceAction, defaultGasPrice); - break; - case 'Disallow Primary Issuance': - let disallowPrimaryIssuanceAction = currentTransferManager.methods.setAllowPrimaryIssuance(false); - await common.sendTransaction(Issuer.address, disallowPrimaryIssuanceAction, defaultGasPrice); + case 'Allow primary issuance': + case 'Disallow primary issuance': + let disallowPrimaryIssuanceAction = currentTransferManager.methods.setAllowPrimaryIssuance(!displayAllowPrimaryIssuance); + await common.sendTransaction(Issuer, disallowPrimaryIssuanceAction, defaultGasPrice); break; case 'Add exempted wallet': - let walletToExempt = readlineSync.question('Enter the wallet to exempt', { + let walletToExempt = readlineSync.question('Enter the wallet to exempt: ', { limit: function(input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address" }); let addExemptWalletAction = currentTransferManager.methods.addExemptWallet(walletToExempt); - let addExemptWalletReceipt = await common.sendTransaction(Issuer.address, addExemptWalletAction, defaultGasPrice); + let addExemptWalletReceipt = await common.sendTransaction(Issuer, addExemptWalletAction, defaultGasPrice); let addExemptWalletEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, addExemptWalletReceipt.logs, 'ExemptWalletAdded'); console.log(chalk.green(`${addExemptWalletEvent._wallet} has been exempted sucessfully!`)); break; case 'Remove exempted wallet': - let exemptedWallet = readlineSync.question('Enter the wallet to remove from exempt', { + let exemptedWallet = readlineSync.question('Enter the wallet to remove from exempt: ', { limit: function(input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address" }); let removeExemptWalletAction = currentTransferManager.methods.removeExemptWallet(exemptedWallet); - let removeExemptWalletReceipt = await common.sendTransaction(Issuer.address, removeExemptWalletAction, defaultGasPrice); + let removeExemptWalletReceipt = await common.sendTransaction(Issuer, removeExemptWalletAction, defaultGasPrice); let removeExemptWalletEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, removeExemptWalletReceipt.logs, 'ExemptWalletRemoved'); console.log(chalk.green(`${removeExemptWalletEvent._wallet} has been removed from exempt wallets sucessfully!`)); break; case 'Change transfer limit to tokens': - let newDefaultLimitInTokens = readlineSync.questionInt('Enter the amount of tokens for default limit: ', { + let newDefaultLimitInTokens = web3.utils.toWei(readlineSync.question('Enter the amount of tokens for default limit: ', { limit: function(input) { - return input > 0; + return parseInt(input) > 0; }, limitMessage: "Must be greater than zero" - }); - let changeTransferLimitToTokensAction = currentTransferManager.methods.changeTransferLimitToTokens(web3.utils.toWei(newDefaultLimitInTokens)); - let changeTransferLimitToTokensReceipt = await common.sendTransaction(Issuer.address, changeTransferLimitToTokensAction, defaultGasPrice); + })); + let changeTransferLimitToTokensAction = currentTransferManager.methods.changeTransferLimitToTokens(newDefaultLimitInTokens); + let changeTransferLimitToTokensReceipt = await common.sendTransaction(Issuer, changeTransferLimitToTokensAction, defaultGasPrice); let changeTransferLimitToTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeTransferLimitToTokensReceipt.logs, 'GlobalTransferLimitInTokensSet'); console.log(chalk.green(`Transfer limit has been set to tokens sucessfully!`)); - console.log(chalk.green(`The default transfer limit is ${changeTransferLimitToTokensEvent._amount} ${tokenSymbol}`)); + console.log(chalk.green(`The default transfer limit is ${web3.utils.fromWei(changeTransferLimitToTokensEvent._amount)} ${tokenSymbol}`)); break; case 'Change transfer limit to percentage': - let newDefaultLimitInPercentage = readlineSync.questionInt('Enter the percentage for default limit: ', { + let newDefaultLimitInPercentage = toWeiPercentage(readlineSync.question('Enter the percentage for default limit: ', { limit: function(input) { - return 0 < input <= 100; + return (parseInt(input) > 0 && parseInt(input) <= 100); }, limitMessage: "Must be greater than 0 and less than 100" - }); + })); let changeTransferLimitToPercentageAction = currentTransferManager.methods.changeTransferLimitToPercentage(newDefaultLimitInPercentage); - let changeTransferLimitToPercentageReceipt = await common.sendTransaction(Issuer.address, changeTransferLimitToPercentageAction, defaultGasPrice); + let changeTransferLimitToPercentageReceipt = await common.sendTransaction(Issuer, changeTransferLimitToPercentageAction, defaultGasPrice); let changeTransferLimitToPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeTransferLimitToPercentageReceipt.logs, 'GlobalTransferLimitInPercentageSet'); console.log(chalk.green(`Transfer limit has been set to tokens sucessfully!`)); - console.log(chalk.green(`The default transfer limit is ${changeTransferLimitToPercentageEvent._percentage}%`)); + console.log(chalk.green(`The default transfer limit is ${fromWeiPercentage(changeTransferLimitToPercentageEvent._percentage)} %`)); break; case 'Change default percentage limit': - let defaultLimitInPercentage = readlineSync.questionInt('Enter the percentage for default limit: ', { + let defaultLimitInPercentage = toWeiPercentage(readlineSync.question('Enter the percentage for default limit: ', { limit: function(input) { - return 0 < input <= 100; + return (parseInt(input) > 0 && parseInt(input) <= 100); }, limitMessage: "Must be greater than 0 and less than 100" - }); + })); let changeGlobalLimitInPercentageAction = currentTransferManager.methods.changeGlobalLimitInPercentage(defaultLimitInPercentage); - let changeGlobalLimitInPercentageReceipt = await common.sendTransaction(Issuer.address, changeGlobalLimitInPercentageAction, defaultGasPrice); + let changeGlobalLimitInPercentageReceipt = await common.sendTransaction(Issuer, changeGlobalLimitInPercentageAction, defaultGasPrice); let changeGlobalLimitInPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeGlobalLimitInPercentageReceipt.logs, 'GlobalTransferLimitInPercentageSet'); - console.log(chalk.green(`The default transfer limit is ${changeGlobalLimitInPercentageEvent._percentage}%`)); + console.log(chalk.green(`The default transfer limit is ${fromWeiPercentage(changeGlobalLimitInPercentageEvent._percentage)} %`)); break; case 'Change default tokens limit': - let defaultLimitInTokens = readlineSync.questionInt('Enter the amount of tokens for default limit: ', { + let defaultLimitInTokens = web3.utils.toWei(readlineSync.question('Enter the amount of tokens for default limit: ', { limit: function(input) { - return input > 0; + return parseInt(input) > 0; }, limitMessage: "Must be greater than zero" - }); - let changeGlobalLimitInTokensAction = currentTransferManager.methods.changeGlobalLimitInTokens(web3.utils.toWei(defaultLimitInTokens)); - let changeGlobalLimitInTokensReceipt = await common.sendTransaction(Issuer.address, changeGlobalLimitInTokensAction, defaultGasPrice); + })); + let changeGlobalLimitInTokensAction = currentTransferManager.methods.changeGlobalLimitInTokens(defaultLimitInTokens); + let changeGlobalLimitInTokensReceipt = await common.sendTransaction(Issuer, changeGlobalLimitInTokensAction, defaultGasPrice); let changeGlobalLimitInTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeGlobalLimitInTokensReceipt.logs, 'GlobalTransferLimitInTokensSet'); - console.log(chalk.green(`The default transfer limit is ${changeGlobalLimitInTokensEvent._amount} ${tokenSymbol}`)); + console.log(chalk.green(`The default transfer limit is ${web3.utils.fromWei(changeGlobalLimitInTokensEvent._amount)} ${tokenSymbol}`)); break; case 'Set percentage transfer limit per account': let percentageAccount = readlineSync.question('Enter the wallet: ', { @@ -407,16 +649,16 @@ async function singleTradeVolumeRestrictionTM() { }, limitMessage: "Must be a valid address" }); - let accountLimitInPercentage = readlineSync.questionInt(`Enter the transfer limit for ${percentageAccount} in percentage: `, { + let accountLimitInPercentage = toWeiPercentage(readlineSync.question(`Enter the transfer limit for ${percentageAccount} in percentage: `, { limit: function(input) { - return 0 < input <= 100; + return (parseInt(input) > 0 && parseInt(input) <= 100); }, limitMessage: "Must be greater than 0 and less than 100" - }); - let setTransferLimitInPercentageAction = currentTransferManager.methods.setTransferLimitInPercentage(percentageAccount, web3.utils.toWei(accountLimitInPercentage)); - let setTransferLimitInPercentageReceipt = await common.sendTransaction(Issuer.address, setTransferLimitInPercentageAction, defaultGasPrice); + })); + let setTransferLimitInPercentageAction = currentTransferManager.methods.setTransferLimitInPercentage(percentageAccount, accountLimitInPercentage); + let setTransferLimitInPercentageReceipt = await common.sendTransaction(Issuer, setTransferLimitInPercentageAction, defaultGasPrice); let setTransferLimitInPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, setTransferLimitInPercentageReceipt.logs, 'TransferLimitInPercentageSet'); - console.log(chalk.green(`The transfer limit for ${setTransferLimitInPercentageEvent._wallet} is ${setTransferLimitInPercentageEvent._percentage}%`)); + console.log(chalk.green(`The transfer limit for ${setTransferLimitInPercentageEvent._wallet} is ${fromWeiPercentage(setTransferLimitInPercentageEvent._percentage)} %`)); break; case 'Set tokens transfer limit per account': let tokensAccount = readlineSync.question('Enter the wallet: ', { @@ -425,16 +667,16 @@ async function singleTradeVolumeRestrictionTM() { }, limitMessage: "Must be a valid address" }); - let accountLimitInTokens = readlineSync.questionInt(`Enter the transfer limit for ${tokensAccount} in amount of tokens: `, { + let accountLimitInTokens = web3.utils.toWei(readlineSync.question(`Enter the transfer limit for ${tokensAccount} in amount of tokens: `, { limit: function(input) { - return input > 0; + return parseInt(input) > 0; }, limitMessage: "Must be greater than zero" - }); - let setTransferLimitInTokensAction = currentTransferManager.methods.setTransferLimitInTokens(tokensAccount, web3.utils.toWei(accountLimitInTokens)); - let setTransferLimitInTokensReceipt = await common.sendTransaction(Issuer.address, setTransferLimitInTokensAction, defaultGasPrice); + })); + let setTransferLimitInTokensAction = currentTransferManager.methods.setTransferLimitInTokens(tokensAccount, accountLimitInTokens); + let setTransferLimitInTokensReceipt = await common.sendTransaction(Issuer, setTransferLimitInTokensAction, defaultGasPrice); let setTransferLimitInTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, setTransferLimitInTokensReceipt.logs, 'TransferLimitInTokensSet'); - console.log(chalk.green(`The transfer limit for ${setTransferLimitInTokensEvent._wallet} is ${setTransferLimitInTokensEvent._percentage} ${tokenSymbol}`)); + console.log(chalk.green(`The transfer limit for ${setTransferLimitInTokensEvent._wallet} is ${web3.utils.fromWei(setTransferLimitInTokensEvent._amount)} ${tokenSymbol}`)); break; case 'Remove percentage transfer limit per account': let percentageAccountToRemove = readlineSync.question('Enter the wallet to remove: ', { @@ -444,7 +686,7 @@ async function singleTradeVolumeRestrictionTM() { limitMessage: "Must be a valid address" }); let removeTransferLimitInPercentageAction = currentTransferManager.methods.removeTransferLimitInPercentage(percentageAccountToRemove); - let removeTransferLimitInPercentageReceipt = await common.sendTransaction(Issuer.address, removeTransferLimitInPercentageAction, defaultGasPrice); + let removeTransferLimitInPercentageReceipt = await common.sendTransaction(Issuer, removeTransferLimitInPercentageAction, defaultGasPrice); let removeTransferLimitInPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, removeTransferLimitInPercentageReceipt.logs, 'TransferLimitInPercentageRemoved'); console.log(chalk.green(`The transfer limit for ${removeTransferLimitInPercentageEvent._wallet} is the default limit`)); break; @@ -456,7 +698,7 @@ async function singleTradeVolumeRestrictionTM() { limitMessage: "Must be a valid address" }); let removeTransferLimitInTokensAction = currentTransferManager.methods.removeTransferLimitInTokens(tokensAccountToRemove); - let removeTransferLimitInTokensReceipt = await common.sendTransaction(Issuer.address, removeTransferLimitInTokensAction, defaultGasPrice); + let removeTransferLimitInTokensReceipt = await common.sendTransaction(Issuer, removeTransferLimitInTokensAction, defaultGasPrice); let removeTransferLimitInTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, removeTransferLimitInTokensReceipt.logs, 'TransferLimitInTokensRemoved'); console.log(chalk.green(`The transfer limit for ${removeTransferLimitInTokensEvent._wallet} is the default limit`)); break; @@ -478,6 +720,14 @@ function signData(tmAddress, investorAddress, fromTime, toTime, expiryTime, rest } */ +function toWeiPercentage(number) { + return new web3.utils.BN(web3.utils.toWei(number)).divn(100); +} + +function fromWeiPercentage(number) { + return web3.utils.fromWei(new web3.utils.BN(number).muln(100)); +} + module.exports = { executeApp: async function(type, remoteNetwork) { return executeApp(type, remoteNetwork); From aec6ec948d43fc4fd3a4fd6b53228512f97114c7 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Wed, 24 Oct 2018 15:34:43 -0300 Subject: [PATCH 007/139] Transfer is verified through ST function --- CLI/commands/ST20Generator.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index 630d2e1fc..a52499b2f 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -38,7 +38,6 @@ let securityTokenRegistry; let polyToken; let usdToken; let securityToken; -let generalTransferManager; let currentSTO; // App flow @@ -218,11 +217,6 @@ async function step_Wallet_Issuance(){ multimint = (isAffiliate == "Y" || isAffiliate == "y"); } - // Add address to whitelist - let generalTransferManagerAddress = (await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call())[0]; - let generalTransferManagerABI = abis.generalTransferManager(); - generalTransferManager = new web3.eth.Contract(generalTransferManagerABI,generalTransferManagerAddress); - if (multimint) await multi_mint_tokens(); else { @@ -241,7 +235,11 @@ async function step_Wallet_Issuance(){ canBuyFromSTO = readlineSync.keyInYNStrict(`Is address '(${mintWallet})' allowed to buy tokens from the STO? `); } - let modifyWhitelistAction = generalTransferManager.methods.modifyWhitelist(mintWallet,Math.floor(Date.now()/1000),Math.floor(Date.now()/1000),Math.floor(Date.now()/1000 + 31536000), canBuyFromSTO); + // Add address to whitelist + let generalTransferManagerAddress = (await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call())[0]; + let generalTransferManagerABI = abis.generalTransferManager(); + let generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, generalTransferManagerAddress); + let modifyWhitelistAction = generalTransferManager.methods.modifyWhitelist(mintWallet,Math.floor(Date.now()/1000),Math.floor(Date.now()/1000),Math.floor(Date.now()/1000 + 31536000), canBuyFromSTO); await common.sendTransaction(Issuer, modifyWhitelistAction, defaultGasPrice); // Mint tokens @@ -1002,7 +1000,7 @@ async function usdTieredSTO_configure() { switch (index) { case 0: let reserveWallet = await currentSTO.methods.reserveWallet().call(); - let isVerified = await generalTransferManager.methods.verifyTransfer(STO_Address, reserveWallet, 0, web3.utils.fromAscii("")).call(); + let isVerified = await securityToken.methods.verifyTransfer(STO_Address, reserveWallet, 0, web3.utils.fromAscii("")).call(); if (isVerified == "2") { if (readlineSync.keyInYNStrict()) { let finalizeAction = currentSTO.methods.finalize(); From 4f8899e47c9b50e1f0db06726c060659aa2e24b5 Mon Sep 17 00:00:00 2001 From: Federico Elgarte Date: Thu, 25 Oct 2018 11:21:18 -0300 Subject: [PATCH 008/139] Add support for createCheckpoint() from dividends modules --- CLI/commands/dividends_manager.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CLI/commands/dividends_manager.js b/CLI/commands/dividends_manager.js index bde3aa900..0efb86758 100644 --- a/CLI/commands/dividends_manager.js +++ b/CLI/commands/dividends_manager.js @@ -128,8 +128,13 @@ async function start_explorer(){ await transferTokens(_to2,_amount2); break; case 'Create checkpoint': - let createCheckpointAction = securityToken.methods.createCheckpoint(); - await common.sendTransaction(Issuer, createCheckpointAction, defaultGasPrice); + if (await isDividendsModuleAttached()) { + let createCheckpointAction = currentDividendsModule.methods.createCheckpoint(); + await common.sendTransaction(Issuer, createCheckpointAction, defaultGasPrice); + } else { + console.log("You must to attach Dividends module to perform this action."); + process.exit(1); + } break; case 'Set default exclusions for dividends': await setDefaultExclusions(); From 1f3b0f1ec95332d1d6ddd1b3b08675b7766e616b Mon Sep 17 00:00:00 2001 From: Federico Elgarte Date: Thu, 25 Oct 2018 11:37:32 -0300 Subject: [PATCH 009/139] advices from Victor --- CLI/commands/dividends_manager.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/CLI/commands/dividends_manager.js b/CLI/commands/dividends_manager.js index 0efb86758..19280f981 100644 --- a/CLI/commands/dividends_manager.js +++ b/CLI/commands/dividends_manager.js @@ -128,13 +128,9 @@ async function start_explorer(){ await transferTokens(_to2,_amount2); break; case 'Create checkpoint': - if (await isDividendsModuleAttached()) { - let createCheckpointAction = currentDividendsModule.methods.createCheckpoint(); - await common.sendTransaction(Issuer, createCheckpointAction, defaultGasPrice); - } else { - console.log("You must to attach Dividends module to perform this action."); - process.exit(1); - } + await addDividendsModule(); + let createCheckpointAction = currentDividendsModule.methods.createCheckpoint(); + await common.sendTransaction(Issuer, createCheckpointAction, defaultGasPrice); break; case 'Set default exclusions for dividends': await setDefaultExclusions(); From 54775debbf80cf48c2d594343cc71675390da98f Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Thu, 25 Oct 2018 13:25:14 -0300 Subject: [PATCH 010/139] ST20Generator refactoring and clean up. --- CLI/commands/ST20Generator.js | 1121 +++------------------------------ CLI/polymath-cli.js | 21 +- 2 files changed, 91 insertions(+), 1051 deletions(-) diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index a52499b2f..ab230af89 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -1,59 +1,23 @@ -var readlineSync = require('readline-sync'); -var BigNumber = require('bignumber.js'); -var moment = require('moment'); -var chalk = require('chalk'); -const shell = require('shelljs'); -var contracts = require('./helpers/contract_addresses'); -var abis = require('./helpers/contract_abis'); -var common = require('./common/common_functions'); -var global = require('./common/global'); +const readlineSync = require('readline-sync'); +const moment = require('moment'); +const chalk = require('chalk'); +const contracts = require('./helpers/contract_addresses'); +const abis = require('./helpers/contract_abis'); +const common = require('./common/common_functions'); +const global = require('./common/global'); +const BigNumber = require('bignumber.js'); +//////////////////////// let securityTokenRegistryAddress; - -/////////////////// -// Crowdsale params -let tokenName; let tokenSymbol; -let selectedSTO; - -const MODULES_TYPES = { - PERMISSION: 1, - TRANSFER: 2, - STO: 3, - DIVIDENDS: 4, - BURN: 5 -} +let tokenLaunched; -const cappedSTOFee = 20000; -const usdTieredSTOFee = 100000; -const tokenDetails = ""; -const FUND_RAISE_TYPES = { - ETH: 0, - POLY: 1, - DAI: 2 -} -//////////////////////// // Artifacts let securityTokenRegistry; let polyToken; -let usdToken; -let securityToken; -let currentSTO; - -// App flow -let _tokenConfig; -let _mintingConfig; -let _stoConfig; -let network; - -async function executeApp(tokenConfig, mintingConfig, stoConfig, remoteNetwork) { - _tokenConfig = tokenConfig; - _mintingConfig = mintingConfig; - _stoConfig = stoConfig; - - network = remoteNetwork; - await global.initialize(remoteNetwork); +async function executeApp(_ticker, _transferOwnership, _name, _details, _divisible, _remoteNetwork) { + await global.initialize(_remoteNetwork); common.logAsciiBull(); console.log("********************************************"); @@ -65,12 +29,11 @@ async function executeApp(tokenConfig, mintingConfig, stoConfig, remoteNetwork) await setup(); try { - await step_ticker_reg(); - await step_token_deploy(); - await step_Wallet_Issuance(); - await step_STO_launch(); - await step_STO_Status(); - await step_STO_configure(); + await step_ticker_registration(_ticker); + if (!tokenLaunched) { + await step_transfer_ticker_ownership(_transferOwnership); + await step_token_deploy(_name, _details, _divisible); + } } catch (err) { console.log(err); return; @@ -88,1049 +51,131 @@ async function setup(){ let polytokenABI = abis.polyToken(); polyToken = new web3.eth.Contract(polytokenABI, polytokenAddress); polyToken.setProvider(web3.currentProvider); - - //TODO: Use proper DAI token here - let usdTokenAddress = await contracts.usdToken(); - usdToken = new web3.eth.Contract(polytokenABI, usdTokenAddress); - usdToken.setProvider(web3.currentProvider); } catch (err) { console.log(err) - console.log('\x1b[31m%s\x1b[0m',"There was a problem getting the contracts. Make sure they are deployed to the selected network."); + console.log(chalk.red('\nThere was a problem getting the contracts. Make sure they are deployed to the selected network.')); process.exit(0); } } -async function step_ticker_reg(){ - console.log('\n\x1b[34m%s\x1b[0m',"Token Symbol Registration"); +async function step_ticker_registration(_ticker) { + console.log(chalk.blue('\nToken Symbol Registration')); - let available = false; let regFee = web3.utils.fromWei(await securityTokenRegistry.methods.getTickerRegistrationFee().call()); - let isDeployed; + let available = false; while (!available) { - console.log(chalk.green(`\nRegistering the new token symbol requires ${regFee} POLY & deducted from '${Issuer.address}', Current balance is ${(await currentBalance(Issuer.address))} POLY\n`)); + console.log(chalk.yellow(`\nRegistering the new token symbol requires ${regFee} POLY & deducted from '${Issuer.address}', Current balance is ${(web3.utils.fromWei(await polyToken.methods.balanceOf(Issuer.address).call()))} POLY\n`)); - if (typeof _tokenConfig !== 'undefined' && _tokenConfig.hasOwnProperty('symbol')) { - tokenSymbol = _tokenConfig.symbol; + if (typeof _ticker !== 'undefined') { + tokenSymbol = _ticker; + console.log(`Token Symbol: ${tokenSymbol}`); } else { - tokenSymbol = await selectTicker(true); + tokenSymbol = await selectTicker(); } let details = await securityTokenRegistry.methods.getTickerDetails(tokenSymbol).call(); - isDeployed = details[4]; if (new BigNumber(details[1]).toNumber() == 0) { + // If it has no registration date, it is available available = true; await approvePoly(securityTokenRegistryAddress, regFee); let registerTickerAction = securityTokenRegistry.methods.registerTicker(Issuer.address, tokenSymbol, ""); await common.sendTransaction(Issuer, registerTickerAction, defaultGasPrice, 0, 1.5); } else if (details[0] == Issuer.address) { + // If it has registration date and its owner is Issuer available = true; + tokenLaunched = details[4]; } else { - console.log('\n\x1b[31m%s\x1b[0m',"Token Symbol has already been registered, please choose another symbol"); - } - } - - if (!isDeployed) { - if (typeof _tokenConfig === 'undefined' && readlineSync.keyInYNStrict(`Do you want to transfer the ownership of ${tokenSymbol} ticker?`)) { - let newOwner = readlineSync.question('Enter the address that will be the new owner: ', { - limit: function(input) { - return web3.utils.isAddress(input); - }, - limitMessage: "Must be a valid address" - }); - let transferTickerOwnershipAction = securityTokenRegistry.methods.transferTickerOwnership(newOwner, tokenSymbol); - let receipt = await common.sendTransaction(Issuer, transferTickerOwnershipAction, defaultGasPrice, 0, 1.5); - let event = common.getEventFromLogs(securityTokenRegistry._jsonInterface, receipt.logs, 'ChangeTickerOwnership'); - console.log(chalk.green(`Ownership trasferred successfully. The new owner is ${event._newOwner}`)); - process.exit(0); - } - } -} - -async function step_token_deploy(){ - // Let's check if token has already been deployed, if it has, skip to STO - let tokenAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call(); - if (tokenAddress != "0x0000000000000000000000000000000000000000") { - console.log('\n\x1b[32m%s\x1b[0m',"Token has already been deployed at address " + tokenAddress + ". Skipping deployment."); - let securityTokenABI = abis.securityToken(); - securityToken = new web3.eth.Contract(securityTokenABI, tokenAddress); - } else { - console.log('\n\x1b[34m%s\x1b[0m',"Token Creation - Token Deployment"); - - let launchFee = web3.utils.fromWei(await securityTokenRegistry.methods.getSecurityTokenLaunchFee().call()); - console.log(chalk.green(`\nToken deployment requires ${launchFee} POLY & deducted from '${Issuer.address}', Current balance is ${(await currentBalance(Issuer.address))} POLY\n`)); - - if (typeof _tokenConfig !== 'undefined' && _tokenConfig.hasOwnProperty('name')) { - tokenName = _tokenConfig.name; - } else { - tokenName = readlineSync.question('Enter the name for your new token: '); - } - if (tokenName == "") tokenName = 'default'; - - console.log("\n"); - console.log('\x1b[34m%s\x1b[0m',"Select the Token divisibility type"); - - let divisibility; - if (typeof _tokenConfig !== 'undefined' && _tokenConfig.hasOwnProperty('divisible')) { - divisibility = _tokenConfig.divisible; - } else { - let divisible = readlineSync.question('Press "N" for Non-divisible type token or hit Enter for divisible type token (Default):'); - if (divisible == 'N' || divisible == 'n') - divisibility = false; - else - divisibility = true; - } - - await approvePoly(securityTokenRegistryAddress, launchFee); - let generateSecurityTokenAction = securityTokenRegistry.methods.generateSecurityToken(tokenName, tokenSymbol, tokenDetails, divisibility); - let receipt = await common.sendTransaction(Issuer, generateSecurityTokenAction, defaultGasPrice); - let event = common.getEventFromLogs(securityTokenRegistry._jsonInterface, receipt.logs, 'NewSecurityToken'); - console.log(`Deployed Token at address: ${event._securityTokenAddress}`); - let securityTokenABI = abis.securityToken(); - securityToken = new web3.eth.Contract(securityTokenABI, event._securityTokenAddress); - } -} - -async function step_Wallet_Issuance(){ - let result = await securityToken.methods.getModulesByType(MODULES_TYPES.STO).call(); - if (result.length > 0) { - console.log('\x1b[32m%s\x1b[0m',"STO has already been created at address " + result[0] + ". Skipping initial minting"); - } else { - let initialMint = await securityToken.getPastEvents('Transfer', { - filter: {from: "0x0000000000000000000000000000000000000000"}, // Using an array means OR: e.g. 20 or 23 - fromBlock: 0, - toBlock: 'latest' - }); - if (initialMint.length > 0) { - console.log('\x1b[32m%s\x1b[0m',web3.utils.fromWei(initialMint[0].returnValues.value) +" Tokens have already been minted for " + initialMint[0].returnValues.to + ". Skipping initial minting"); - } else { - console.log("\n"); - console.log('\x1b[34m%s\x1b[0m',"Token Creation - Token Minting for Issuer"); - - console.log("Before setting up the STO, you can mint any amount of tokens that will remain under your control or you can transfer to affiliates"); - - let multimint; - if (typeof _mintingConfig !== 'undefined' && _mintingConfig.hasOwnProperty('multimint')) { - multimint = _mintingConfig.multimint; - } else { - let isAffiliate = readlineSync.question('Press'+ chalk.green(` "Y" `) + 'if you have list of affiliates addresses with you otherwise hit' + chalk.green(' Enter ') + 'and get the minted tokens to a particular address: '); - multimint = (isAffiliate == "Y" || isAffiliate == "y"); - } - - if (multimint) - await multi_mint_tokens(); - else { - let mintWallet; - if (typeof _mintingConfig !== 'undefined' && _mintingConfig.hasOwnProperty('singleMint') && _mintingConfig.singleMint.hasOwnProperty('wallet')) { - mintWallet = _mintingConfig.singleMint.wallet; - } else { - mintWallet = readlineSync.question('Add the address that will hold the issued tokens to the whitelist (' + Issuer.address + '): '); - } - if (mintWallet == "") mintWallet = Issuer.address; - - let canBuyFromSTO; - if (typeof _mintingConfig !== 'undefined' && _mintingConfig.hasOwnProperty('singleMint') && _mintingConfig.singleMint.hasOwnProperty('allowedToBuy')) { - canBuyFromSTO = _mintingConfig.singleMint.allowedToBuy; - } else { - canBuyFromSTO = readlineSync.keyInYNStrict(`Is address '(${mintWallet})' allowed to buy tokens from the STO? `); - } - - // Add address to whitelist - let generalTransferManagerAddress = (await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call())[0]; - let generalTransferManagerABI = abis.generalTransferManager(); - let generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, generalTransferManagerAddress); - let modifyWhitelistAction = generalTransferManager.methods.modifyWhitelist(mintWallet,Math.floor(Date.now()/1000),Math.floor(Date.now()/1000),Math.floor(Date.now()/1000 + 31536000), canBuyFromSTO); - await common.sendTransaction(Issuer, modifyWhitelistAction, defaultGasPrice); - - // Mint tokens - if (typeof _mintingConfig !== 'undefined' && _mintingConfig.hasOwnProperty('singleMint') && _mintingConfig.singleMint.hasOwnProperty('tokenAmount')) { - issuerTokens = _mintingConfig.singleMint.tokenAmount; - } else { - issuerTokens = readlineSync.question('How many tokens do you plan to mint for the wallet you entered? (500.000): '); - } - if (issuerTokens == "") issuerTokens = '500000'; - - let mintAction = securityToken.methods.mint(mintWallet, web3.utils.toWei(issuerTokens)); - await common.sendTransaction(Issuer, mintAction, defaultGasPrice); - } - } - } -} - -async function multi_mint_tokens() { - //await whitelist.startWhitelisting(tokenSymbol); - shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${network}`); - console.log(chalk.green(`\nCongrats! All the affiliates get succssfully whitelisted, Now its time to Mint the tokens\n`)); - console.log(chalk.red(`WARNING: `) + `Please make sure all the addresses that get whitelisted are only eligible to hold or get Security token\n`); - - shell.exec(`${__dirname}/scripts//script.sh Multimint ${tokenSymbol} 75 ${network}`); - console.log(chalk.green(`\nHurray!! Tokens get successfully Minted and transferred to token holders`)); -} - -async function step_STO_launch() { - console.log("\n"); - console.log('\x1b[34m%s\x1b[0m',"Token Creation - STO Configuration"); - - let result = await securityToken.methods.getModulesByType(MODULES_TYPES.STO).call(); - if (result.length > 0) { - STO_Address = result[0]; - let stoModuleData = await securityToken.methods.getModule(STO_Address).call(); - selectedSTO = web3.utils.toAscii(stoModuleData[0]).replace(/\u0000/g, ''); - console.log('\x1b[32m%s\x1b[0m',selectedSTO + " has already been created at address " + STO_Address + ". Skipping STO creation"); - switch (selectedSTO) { - case 'CappedSTO': - let cappedSTOABI = abis.cappedSTO(); - currentSTO = new web3.eth.Contract(cappedSTOABI,STO_Address); - break; - case 'USDTieredSTO': - let usdTieredSTOABI = abis.usdTieredSTO(); - currentSTO = new web3.eth.Contract(usdTieredSTOABI,STO_Address); - break; - } - } else { - let index; - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('type')) { - index = _stoConfig.type; - } else { - let options = ['Capped STO', 'USD Tiered STO', 'Select STO later']; - index = readlineSync.keyInSelect(options, 'What type of STO do you want?', { cancel: false }); - } - switch (index) { - case 0: - selectedSTO = 'CappedSTO'; - await cappedSTO_launch(); - break; - case 1: - selectedSTO = 'USDTieredSTO'; - await usdTieredSTO_launch(); - break; - case 2: - process.exit(0); - break; + // If it has registration date and its owner is not Issuer + console.log(chalk.yellow('\nToken Symbol has already been registered, please choose another symbol')); } } } -async function step_STO_Status() { - switch (selectedSTO) { - case 'CappedSTO': - await cappedSTO_status(); - break; - case 'USDTieredSTO': - await usdTieredSTO_status(); - break; - } -} - -async function step_STO_configure() { - switch (selectedSTO) { - case 'CappedSTO': - break; - case 'USDTieredSTO': - await usdTieredSTO_configure(); - break; - } -} - -//////////////// -// Capped STO // -//////////////// -async function cappedSTO_launch() { - console.log("\n"); - console.log('\x1b[34m%s\x1b[0m',"Token Creation - Capped STO in No. of Tokens"); - - let stoFee = cappedSTOFee; - let contractBalance = await polyToken.methods.balanceOf(securityToken._address).call(); - let requiredAmount = web3.utils.toWei(stoFee.toString()); - if (parseInt(contractBalance) < parseInt(requiredAmount)) { - let transferAmount = parseInt(requiredAmount) - parseInt(contractBalance); - let ownerBalance = await polyToken.methods.balanceOf(Issuer.address).call(); - if(parseInt(ownerBalance) < transferAmount) { - console.log(chalk.red(`\n**************************************************************************************************************************************************`)); - console.log(chalk.red(`Not enough balance to pay the CappedSTO fee, Requires ${(new BigNumber(transferAmount).dividedBy(new BigNumber(10).pow(18))).toNumber()} POLY but have ${(new BigNumber(ownerBalance).dividedBy(new BigNumber(10).pow(18))).toNumber()} POLY. Access POLY faucet to get the POLY to complete this txn`)); - console.log(chalk.red(`**************************************************************************************************************************************************\n`)); - process.exit(0); - } else { - let transferAction = polyToken.methods.transfer(securityToken._address, new BigNumber(transferAmount)); - let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice, 0, 2); - let event = common.getEventFromLogs(polyToken._jsonInterface, receipt.logs, 'Transfer'); - console.log(`Number of POLY sent: ${web3.utils.fromWei(new web3.utils.BN(event._value))}`) - } - } - - let cap; - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('cap')) { - cap = _stoConfig.cap.toString(); - } else { - cap = readlineSync.question('How many tokens do you plan to sell on the STO? (500.000): '); - } - if (cap == "") cap = '500000'; - - let oneMinuteFromNow = BigNumber((Math.floor(Date.now() / 1000) + 60)); - let startTime; - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('startTime')) { - startTime = _stoConfig.startTime; - } else { - startTime = readlineSync.question('Enter the start time for the STO (Unix Epoch time)\n(1 minutes from now = ' + oneMinuteFromNow + ' ): '); - } - if (startTime == "") startTime = oneMinuteFromNow; - - let oneMonthFromNow = BigNumber((Math.floor(Date.now()/1000)+ (30 * 24 * 60 * 60))); - let endTime; - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('endTime')) { - endTime = _stoConfig.endTime; - } else { - endTime = readlineSync.question('Enter the end time for the STO (Unix Epoch time)\n(1 month from now = ' + oneMonthFromNow + ' ): '); - } - if (endTime == "") endTime = oneMonthFromNow; - - let wallet; - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('wallet')) { - wallet = _stoConfig.wallet; - } else { - wallet = readlineSync.question('Enter the address that will receive the funds from the STO (' + Issuer.address + '): '); - } - if (wallet == "") wallet = Issuer.address; - - let raiseType; - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('raiseType')) { - raiseType = [_stoConfig.raiseType]; - } else { - raiseType = readlineSync.question('Enter' + chalk.green(` P `) + 'for POLY raise or leave empty for Ether raise (E):'); - if (raiseType.toUpperCase() == 'P' ) { - raiseType = [1]; - } else { - raiseType = [0]; - } - } - - let rate; - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('rate')) { - rate = _stoConfig.rate; - } else { - rate = readlineSync.question(`Enter the rate (1 ${(raiseType == 1 ? 'POLY' : 'ETH')} = X ST) for the STO (1000): `); - } - if (rate == "") rate = 1000; - - let bytesSTO = web3.eth.abi.encodeFunctionCall( { - name: 'configure', - type: 'function', - inputs: [ - { - type: 'uint256', - name: '_startTime' - },{ - type: 'uint256', - name: '_endTime' - },{ - type: 'uint256', - name: '_cap' - },{ - type: 'uint256', - name: '_rate' - },{ - type: 'uint8[]', - name: '_fundRaiseTypes' - },{ - type: 'address', - name: '_fundsReceiver' - } - ] - }, [startTime, endTime, web3.utils.toWei(cap), rate, raiseType, wallet]); - - let cappedSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.STO, "CappedSTO"); - let addModuleAction = securityToken.methods.addModule(cappedSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); - let receipt = await common.sendTransaction(Issuer, addModuleAction, defaultGasPrice); - let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); - console.log(`STO deployed at address: ${event._module}`); - - STO_Address = event._module; - let cappedSTOABI = abis.cappedSTO(); - currentSTO = new web3.eth.Contract(cappedSTOABI, STO_Address); -} - -async function cappedSTO_status() { - let displayStartTime = await currentSTO.methods.startTime().call(); - let displayEndTime = await currentSTO.methods.endTime().call(); - let displayRate = await currentSTO.methods.rate().call(); - let displayCap = await currentSTO.methods.cap().call(); - let displayWallet = await currentSTO.methods.wallet().call(); - let displayRaiseType; - let displayFundsRaised; - let displayWalletBalance; - let raiseType = await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES.ETH).call(); - if (raiseType) { - displayRaiseType = 'ETH'; - displayFundsRaised = await currentSTO.methods.fundsRaised(FUND_RAISE_TYPES.ETH).call(); - displayWalletBalance = web3.utils.fromWei(await web3.eth.getBalance(displayWallet)); - } else { - displayRaiseType = 'POLY'; - displayFundsRaised = await currentSTO.methods.fundsRaised(FUND_RAISE_TYPES.POLY).call(); - displayWalletBalance = await currentBalance(displayWallet); - } - let displayTokensSold = await currentSTO.methods.totalTokensSold().call(); - let displayInvestorCount = await currentSTO.methods.investorCount().call(); - let displayTokenSymbol = await securityToken.methods.symbol().call(); - - let formattedCap = BigNumber(web3.utils.fromWei(displayCap)); - let formattedSold = BigNumber(web3.utils.fromWei(displayTokensSold)); - - let now = Math.floor(Date.now()/1000); - let timeTitle; - let timeRemaining; - - if (now < displayStartTime) { - timeTitle = "STO starts in: "; - timeRemaining = displayStartTime - now; - } else { - timeTitle = "Time remaining:"; - timeRemaining = displayEndTime - now; - } - - timeRemaining = common.convertToDaysRemaining(timeRemaining); - - console.log(` - ***** STO Information ***** - - Address: ${STO_Address} - - Raise Cap: ${web3.utils.fromWei(displayCap)} ${displayTokenSymbol.toUpperCase()} - - Start Time: ${new Date(displayStartTime * 1000)} - - End Time: ${new Date(displayEndTime * 1000)} - - Raise Type: ${displayRaiseType} - - Rate: 1 ${displayRaiseType} = ${displayRate} ${displayTokenSymbol.toUpperCase()} - - Wallet: ${displayWallet} - - Wallet Balance: ${displayWalletBalance} ${displayRaiseType} - -------------------------------------- - - ${timeTitle} ${timeRemaining} - - Funds raised: ${web3.utils.fromWei(displayFundsRaised)} ${displayRaiseType} - - Tokens sold: ${web3.utils.fromWei(displayTokensSold)} ${displayTokenSymbol.toUpperCase()} - - Tokens remaining: ${formattedCap.minus(formattedSold).toNumber()} ${displayTokenSymbol.toUpperCase()} - - Investor count: ${displayInvestorCount} - `); - - console.log(chalk.green(`\n${(await currentBalance(Issuer.address))} POLY balance remaining at issuer address ${Issuer.address}`)); -} - -//////////////////// -// USD Tiered STO // -//////////////////// -function fundingConfigUSDTieredSTO() { - let funding = {}; - - let selectedFunding; - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('fundingType')) { - selectedFunding = _stoConfig.fundingType; - } else { - selectedFunding = readlineSync.question('Enter' + chalk.green(` P `) + 'for POLY raise,' + chalk.green(` D `) + 'for DAI raise,' + chalk.green(` E `) + 'for Ether raise or any combination of them (i.e.'+ chalk.green(` PED `) + 'for all): ').toUpperCase(); - } - - funding.raiseType = []; - if (selectedFunding.includes('E')) { - funding.raiseType.push(FUND_RAISE_TYPES.ETH); - } - if (selectedFunding.includes('P')) { - funding.raiseType.push(FUND_RAISE_TYPES.POLY); - } - if (selectedFunding.includes('D')) { - funding.raiseType.push(FUND_RAISE_TYPES.DAI); - } - if (funding.raiseType.length == 0) { - funding.raiseType = [FUND_RAISE_TYPES.ETH, FUND_RAISE_TYPES.POLY, FUND_RAISE_TYPES.DAI]; - } - - return funding; -} - -function addressesConfigUSDTieredSTO(usdTokenRaise) { - let addresses = {}; - - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('wallet')) { - addresses.wallet = _stoConfig.wallet; - } else { - addresses.wallet = readlineSync.question('Enter the address that will receive the funds from the STO (' + Issuer.address + '): ', { - limit: function(input) { - return web3.utils.isAddress(input); - }, - limitMessage: "Must be a valid address", - defaultInput: Issuer.address - }); - } - if (addresses.wallet == "") addresses.wallet = Issuer.address; - - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('reserveWallet')) { - addresses.reserveWallet = _stoConfig.reserveWallet; - } else { - addresses.reserveWallet = readlineSync.question('Enter the address that will receive remaining tokens in the case the cap is not met (' + Issuer.address + '): ', { - limit: function(input) { +async function step_transfer_ticker_ownership(_transferOwnership) { + let newOwner = null; + if (typeof _transferOwnership !== 'undefined' && _transferOwnership != 'false') { + newOwner = _transferOwnership; + console.log(`Transfer ownership to: ${newOwner}`); + } else if (_transferOwnership != 'false' && readlineSync.keyInYNStrict(`Do you want to transfer the ownership of ${tokenSymbol} ticker?`)) { + newOwner = readlineSync.question('Enter the address that will be the new owner: ', { + limit: function (input) { return web3.utils.isAddress(input); }, - limitMessage: "Must be a valid address", - defaultInput: Issuer.address - }); - } - if (addresses.reserveWallet == "") addresses.reserveWallet = Issuer.address; - - if (usdTokenRaise) { - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('usdToken')) { - addresses.usdToken = _stoConfig.usdToken; - } else { - addresses.usdToken = readlineSync.question('Enter the address of the USD Token or stable coin (' + usdToken.options.address + '): ', { - limit: function(input) { - return web3.utils.isAddress(input); - }, - limitMessage: "Must be a valid address", - defaultInput: usdToken.options.address - }); - } - if (addresses.usdToken == "") addresses.usdToken = usdToken.options.address; - } else { - addresses.usdToken = '0x0000000000000000000000000000000000000000'; - } - - return addresses; -} - -function tiersConfigUSDTieredSTO(polyRaise) { - let tiers = {}; - - let defaultTiers = 3; - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('numberOfTiers')) { - tiers.tiers = _stoConfig.numberOfTiers; - } else { - tiers.tiers = readlineSync.questionInt(`Enter the number of tiers for the STO? (${defaultTiers}): `, { - limit: function(input) { - return input > 0; - }, - limitMessage: 'Must be greater than zero', - defaultInput: defaultTiers + limitMessage: "Must be a valid address" }); } - let defaultTokensPerTier = [190000000, 100000000, 200000000]; - let defaultRatePerTier = ['0.05', '0.10', '0.15']; - let defaultTokensPerTierDiscountPoly = [90000000, 50000000, 100000000]; - let defaultRatePerTierDiscountPoly = ['0.025', '0.05', '0.075']; - tiers.tokensPerTier = []; - tiers.ratePerTier = []; - tiers.tokensPerTierDiscountPoly = []; - tiers.ratePerTierDiscountPoly = []; - for (let i = 0; i < tiers.tiers; i++) { - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('tokensPerTiers') && i < _stoConfig.tokensPerTiers.length) { - tiers.tokensPerTier[i] = web3.utils.toWei(_stoConfig.tokensPerTiers[i].toString()); - } else { - tiers.tokensPerTier[i] = web3.utils.toWei(readlineSync.question(`How many tokens do you plan to sell on tier No. ${i+1}? (${defaultTokensPerTier[i]}): `, { - limit: function(input) { - return parseFloat(input) > 0; - }, - limitMessage: 'Must be greater than zero', - defaultInput: defaultTokensPerTier[i] - })); - } - - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('ratePerTiers') && i < _stoConfig.ratePerTiers.length) { - tiers.ratePerTier[i] = web3.utils.toWei(_stoConfig.ratePerTiers[i].toString()); - } else { - tiers.ratePerTier[i] = web3.utils.toWei(readlineSync.question(`What is the USD per token rate for tier No. ${i+1}? (${defaultRatePerTier[i]}): `, { - limit: function(input) { - return parseFloat(input) > 0; - }, - limitMessage: 'Must be greater than zero', - defaultInput: defaultRatePerTier[i] - })); - } - - let isTPTDPDefined = (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('discountedTokensPerTiers') && i < _stoConfig.discountedTokensPerTiers.length); //If it's defined by config file - let isRPTDPDefined = (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('discountedRatePerTiers') && i < _stoConfig.discountedRatePerTiers.length); //If it's defined by config file - //If funds can be raised in POLY and discounts are defined in config file or are choosen by user - if (polyRaise && ((isTPTDPDefined && isRPTDPDefined) || readlineSync.keyInYNStrict(`Do you plan to have a discounted rate for POLY investments for tier No. ${i+1}? `))) { - if (isTPTDPDefined) { - tiers.tokensPerTierDiscountPoly[i] = web3.utils.toWei(_stoConfig.discountedTokensPerTiers[i].toString()); - } else { - tiers.tokensPerTierDiscountPoly[i] = web3.utils.toWei(readlineSync.question(`How many of those tokens do you plan to sell at discounted rate on tier No. ${i+1}? (${defaultTokensPerTierDiscountPoly[i]}): `, { - limit: function(input) { - return new BigNumber(web3.utils.toWei(input)).lte(tiers.tokensPerTier[i]) - }, - limitMessage: 'Must be less than the No. of tokens of the tier', - defaultInput: defaultTokensPerTierDiscountPoly[i] - })); - } - - if (isRPTDPDefined) { - tiers.ratePerTierDiscountPoly[i] = web3.utils.toWei(_stoConfig.discountedRatePerTiers[i].toString()); - } else { - tiers.ratePerTierDiscountPoly[i] = web3.utils.toWei(readlineSync.question(`What is the discounted rate for tier No. ${i+1}? (${defaultRatePerTierDiscountPoly[i]}): `, { - limit: function(input) { - return new BigNumber(web3.utils.toWei(input)).lte(tiers.ratePerTier[i]) - }, - limitMessage: 'Must be less than the rate of the tier', - defaultInput: defaultRatePerTierDiscountPoly[i] - })); - } - } else { - tiers.tokensPerTierDiscountPoly[i] = 0; - tiers.ratePerTierDiscountPoly[i] = 0; - } - } - - return tiers; -} - -function timesConfigUSDTieredSTO() { - let times = {}; - - let oneMinuteFromNow = Math.floor(Date.now() / 1000) + 60; - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('startTime')) { - times.startTime = _stoConfig.startTime; - } else { - times.startTime = readlineSync.questionInt('Enter the start time for the STO (Unix Epoch time)\n(1 minutes from now = ' + oneMinuteFromNow + ' ): ', { - limit: function(input) { - return input > Math.floor(Date.now() / 1000); - }, - limitMessage: "Must be a future time", - defaultInput: oneMinuteFromNow - }); - } - if (times.startTime == "") times.startTime = oneMinuteFromNow; - - let oneMonthFromNow = Math.floor(Date.now() / 1000) + (30 * 24 * 60 * 60); - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('endTime')) { - times.endTime = _stoConfig.endTime; - } else { - times.endTime = readlineSync.questionInt('Enter the end time for the STO (Unix Epoch time)\n(1 month from now = ' + oneMonthFromNow + ' ): ', { - limit: function(input) { - return input > times.startTime; - }, - limitMessage: "Must be greater than Start Time", - defaultInput: oneMonthFromNow - }); + if (newOwner) { + let transferTickerOwnershipAction = securityTokenRegistry.methods.transferTickerOwnership(newOwner, tokenSymbol); + let receipt = await common.sendTransaction(Issuer, transferTickerOwnershipAction, defaultGasPrice, 0, 1.5); + let event = common.getEventFromLogs(securityTokenRegistry._jsonInterface, receipt.logs, 'ChangeTickerOwnership'); + console.log(chalk.green(`Ownership trasferred successfully. The new owner is ${event._newOwner}`)); + process.exit(0); } - if (times.endTime == "") times.endTime = oneMonthFromNow; - - return times; } -function limitsConfigUSDTieredSTO() { - let limits = {}; +async function step_token_deploy(_name, _details, _divisible) { + console.log(chalk.blue('\nToken Creation - Token Deployment')); - let defaultMinimumInvestment = 5; - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('minimumInvestmentUSD')) { - limits.minimumInvestmentUSD = web3.utils.toWei(_stoConfig.minimumInvestmentUSD.toString()); - } else { - limits.minimumInvestmentUSD = web3.utils.toWei(readlineSync.question(`What is the minimum investment in USD? (${defaultMinimumInvestment}): `, { - limit: function(input) { - return parseInt(input) > 0; - }, - limitMessage: "Must be greater than zero", - defaultInput: defaultMinimumInvestment - })); - } + let launchFee = web3.utils.fromWei(await securityTokenRegistry.methods.getSecurityTokenLaunchFee().call()); + console.log(chalk.green(`\nToken deployment requires ${launchFee} POLY & deducted from '${Issuer.address}', Current balance is ${(web3.utils.fromWei(await polyToken.methods.balanceOf(Issuer.address).call()))} POLY\n`)); - let nonAccreditedLimit = 2500; - if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('nonAccreditedLimitUSD')) { - limits.nonAccreditedLimitUSD = web3.utils.toWei(_stoConfig.nonAccreditedLimitUSD.toString()); + let tokenName; + if (typeof _name !== 'undefined') { + tokenName = _name; + console.log(`Token Name: ${tokenName}`); } else { - limits.nonAccreditedLimitUSD = web3.utils.toWei(readlineSync.question(`What is the default limit for non accredited investors in USD? (${nonAccreditedLimit}): `, { - limit: function(input) { - return new BigNumber(web3.utils.toWei(input)).gte(limits.minimumInvestmentUSD); - }, - limitMessage: "Must be greater than minimum investment", - defaultInput: nonAccreditedLimit - })); - } - - return limits; -} - -async function usdTieredSTO_launch() { - console.log("\n"); - console.log('\x1b[34m%s\x1b[0m',"Token Creation - USD Tiered STO"); - - let stoFee = usdTieredSTOFee; - let contractBalance = await polyToken.methods.balanceOf(securityToken._address).call(); - let requiredAmount = web3.utils.toWei(stoFee.toString(), "ether"); - if (new web3.utils.BN(contractBalance).lt(new web3.utils.BN(requiredAmount))) { - let transferAmount = (new web3.utils.BN(requiredAmount)).sub(new web3.utils.BN(contractBalance)); - let ownerBalance = new web3.utils.BN(await polyToken.methods.balanceOf(Issuer.address).call()); - if (ownerBalance.lt(transferAmount)) { - console.log(chalk.red(`\n**************************************************************************************************************************************************`)); - console.log(chalk.red(`Not enough balance to pay the ${selectedSTO} fee, Requires ${web3.utils.fromWei(transferAmount)} POLY but have ${web3.utils.fromWei(ownerBalance)} POLY. Access POLY faucet to get the POLY to complete this txn`)); - console.log(chalk.red(`**************************************************************************************************************************************************\n`)); - process.exit(0); - } else { - let transferAction = polyToken.methods.transfer(securityToken._address, transferAmount); - let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice, 0, 2); - let event = common.getEventFromLogs(polyToken._jsonInterface, receipt.logs, 'Transfer'); - console.log(`Number of POLY sent: ${web3.utils.fromWei(new web3.utils.BN(event._value))}`) - } - } - - let funding = fundingConfigUSDTieredSTO(); - let addresses = addressesConfigUSDTieredSTO(funding.raiseType.includes(FUND_RAISE_TYPES.DAI)); - let tiers = tiersConfigUSDTieredSTO(funding.raiseType.includes(FUND_RAISE_TYPES.POLY)); - let limits = limitsConfigUSDTieredSTO(); - let times = timesConfigUSDTieredSTO(); - let bytesSTO = web3.eth.abi.encodeFunctionCall( { - name: 'configure', - type: 'function', - inputs: [ - { - type: 'uint256', - name: '_startTime' - },{ - type: 'uint256', - name: '_endTime' - },{ - type: 'uint256[]', - name: '_ratePerTier' - },{ - type: 'uint256[]', - name: '_ratePerTierDiscountPoly' - },{ - type: 'uint256[]', - name: '_tokensPerTier' - },{ - type: 'uint256[]', - name: '_tokensPerTierDiscountPoly' - },{ - type: 'uint256', - name: '_nonAccreditedLimitUSD' - },{ - type: 'uint256', - name: '_minimumInvestmentUSD' - },{ - type: 'uint8[]', - name: '_fundRaiseTypes' - },{ - type: 'address', - name: '_wallet' - },{ - type: 'address', - name: '_reserveWallet' - },{ - type: 'address', - name: '_usdToken' - } - ] - }, [times.startTime, - times.endTime, - tiers.ratePerTier, - tiers.ratePerTierDiscountPoly, - tiers.tokensPerTier, - tiers.tokensPerTierDiscountPoly, - limits.nonAccreditedLimitUSD, - limits.minimumInvestmentUSD, - funding.raiseType, - addresses.wallet, - addresses.reserveWallet, - addresses.usdToken - ]); - - let usdTieredSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.STO, 'USDTieredSTO'); - let addModuleAction = securityToken.methods.addModule(usdTieredSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); - let receipt = await common.sendTransaction(Issuer, addModuleAction, defaultGasPrice); - let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); - console.log(`STO deployed at address: ${event._module}`); - - STO_Address = event._module; - let usdTieredSTOABI = abis.usdTieredSTO(); - currentSTO = new web3.eth.Contract(usdTieredSTOABI,STO_Address); -} - -async function usdTieredSTO_status() { - let displayStartTime = await currentSTO.methods.startTime().call(); - let displayEndTime = await currentSTO.methods.endTime().call(); - let displayCurrentTier = parseInt(await currentSTO.methods.currentTier().call()) + 1; - let displayNonAccreditedLimitUSD = web3.utils.fromWei(await currentSTO.methods.nonAccreditedLimitUSD().call()); - let displayMinimumInvestmentUSD = web3.utils.fromWei(await currentSTO.methods.minimumInvestmentUSD().call()); - let displayWallet = await currentSTO.methods.wallet().call(); - let displayReserveWallet = await currentSTO.methods.reserveWallet().call(); - let displayTokensSold = web3.utils.fromWei(await currentSTO.methods.getTokensSold().call()); - let displayInvestorCount = await currentSTO.methods.investorCount().call(); - let displayIsFinalized = await currentSTO.methods.isFinalized().call() ? "YES" : "NO"; - let displayTokenSymbol = await securityToken.methods.symbol().call(); - - let tiersLength = await currentSTO.methods.getNumberOfTiers().call();; - - let raiseTypes = []; - for (const fundType in FUND_RAISE_TYPES) { - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES[fundType]).call()) { - raiseTypes.push(fundType); - } + tokenName = readlineSync.question('Enter the name for your new token: ', {defaultInput: 'default'}); } - let displayTiers = ""; - let displayMintedPerTier = ""; - for (let t = 0; t < tiersLength; t++) { - let ratePerTier = await currentSTO.methods.ratePerTier(t).call(); - let tokensPerTierTotal = await currentSTO.methods.tokensPerTierTotal(t).call(); - let mintedPerTierTotal = await currentSTO.methods.mintedPerTierTotal(t).call(); - - let displayMintedPerTierPerType = ""; - let displayDiscountTokens = ""; - for (const type of raiseTypes) { - let displayDiscountMinted = ""; - if (type == 'POLY') { - let tokensPerTierDiscountPoly = await currentSTO.methods.tokensPerTierDiscountPoly(t).call(); - if (tokensPerTierDiscountPoly > 0) { - let ratePerTierDiscountPoly = await currentSTO.methods.ratePerTierDiscountPoly(t).call(); - let mintedPerTierDiscountPoly = await currentSTO.methods.mintedPerTierDiscountPoly(t).call(); - displayDiscountTokens = ` - Tokens at discounted rate: ${web3.utils.fromWei(tokensPerTierDiscountPoly)} ${displayTokenSymbol} - Discounted rate: ${web3.utils.fromWei(ratePerTierDiscountPoly, 'ether')} USD per Token`; - - displayDiscountMinted = `(${web3.utils.fromWei(mintedPerTierDiscountPoly)} ${displayTokenSymbol} at discounted rate)`; - } - } - - let mintedPerTier = await currentSTO.methods.mintedPerTier(FUND_RAISE_TYPES[type], t).call(); - displayMintedPerTierPerType += ` - Sold for ${type}:\t\t ${web3.utils.fromWei(mintedPerTier)} ${displayTokenSymbol} ${displayDiscountMinted}`; - } - - displayTiers += ` - - Tier ${t+1}: - Tokens: ${web3.utils.fromWei(tokensPerTierTotal)} ${displayTokenSymbol} - Rate: ${web3.utils.fromWei(ratePerTier)} USD per Token` - + displayDiscountTokens; - - displayMintedPerTier += ` - - Tokens minted in Tier ${t+1}: ${web3.utils.fromWei(mintedPerTierTotal)} ${displayTokenSymbol}` - + displayMintedPerTierPerType; - } - - let displayFundsRaisedUSD = web3.utils.fromWei(await currentSTO.methods.fundsRaisedUSD().call()); - - let displayWalletBalancePerType = ''; - let displayReserveWalletBalancePerType = ''; - let displayFundsRaisedPerType = ''; - let displayTokensSoldPerType = ''; - for (const type of raiseTypes) { - let balance = await getBalance(displayWallet, type); - let walletBalance = web3.utils.fromWei(balance); - let walletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(FUND_RAISE_TYPES[type], balance).call()); - displayWalletBalancePerType += ` - Balance ${type}:\t\t ${walletBalance} ${type} (${walletBalanceUSD} USD)`; - - balance = await getBalance(displayReserveWallet, type); - let reserveWalletBalance = web3.utils.fromWei(balance); - let reserveWalletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(FUND_RAISE_TYPES[type], balance).call()); - displayReserveWalletBalancePerType += ` - Balance ${type}:\t\t ${reserveWalletBalance} ${type} (${reserveWalletBalanceUSD} USD)`; - - let fundsRaised = web3.utils.fromWei(await currentSTO.methods.fundsRaised(FUND_RAISE_TYPES[type]).call()); - displayFundsRaisedPerType += ` - ${type}:\t\t\t ${fundsRaised} ${type}`; - - //Only show sold for if more than one raise type are allowed - if (raiseTypes.length > 1) { - let tokensSoldPerType = web3.utils.fromWei(await currentSTO.methods.getTokensSoldFor(FUND_RAISE_TYPES[type]).call()); - displayTokensSoldPerType += ` - Sold for ${type}:\t\t ${tokensSoldPerType} ${displayTokenSymbol}`; - } - } - - let displayRaiseType = raiseTypes.join(' - '); - - let now = Math.floor(Date.now()/1000); - let timeTitle; - let timeRemaining; - if (now < displayStartTime) { - timeTitle = "STO starts in: "; - timeRemaining = displayStartTime - now; + let tokenDetails; + if (typeof _details !== 'undefined') { + tokenDetails = _details; + console.log(`Token details: ${tokenDetails.toString()}`) } else { - timeTitle = "Time remaining:"; - timeRemaining = displayEndTime - now; + tokenDetails = readlineSync.question('Enter off-chain details of the token (i.e. Dropbox folder url): '); } - timeRemaining = common.convertToDaysRemaining(timeRemaining); - - console.log(` - ****************** STO Information ****************** - - Address: ${STO_Address} - - Start Time: ${new Date(displayStartTime * 1000)} - - End Time: ${new Date(displayEndTime * 1000)} - - Raise Type: ${displayRaiseType} - - Tiers: ${tiersLength}` - + displayTiers + ` - - Minimum Investment: ${displayMinimumInvestmentUSD} USD - - Non Accredited Limit: ${displayNonAccreditedLimitUSD} USD - - Wallet: ${displayWallet}` - + displayWalletBalancePerType + ` - - Reserve Wallet: ${displayReserveWallet}` - + displayReserveWalletBalancePerType + ` - - -------------------------------------- - - ${timeTitle} ${timeRemaining} - - Is Finalized: ${displayIsFinalized} - - Tokens Sold: ${displayTokensSold} ${displayTokenSymbol}` - + displayTokensSoldPerType + ` - - Current Tier: ${displayCurrentTier}` - + displayMintedPerTier + ` - - Investor count: ${displayInvestorCount} - - Funds Raised` - + displayFundsRaisedPerType + ` - USD: ${displayFundsRaisedUSD} USD - `); - - console.log(chalk.green(`\n${(await currentBalance(Issuer.address))} POLY balance remaining at issuer address ${Issuer.address}`)); -} - -async function usdTieredSTO_configure() { - console.log("\n"); - console.log('\x1b[34m%s\x1b[0m',"STO Configuration - USD Tiered STO"); - - let isFinalized = await currentSTO.methods.isFinalized().call(); - if (isFinalized) { - console.log(chalk.red(`STO is finalized`)); + let divisibility; + if (typeof _divisible !== 'undefined') { + divisibility = _divisible == 'true'; + console.log(`Divisible: ${divisibility.toString()}`) } else { - let options = []; - options.push('Finalize STO', - 'Change accredited account', 'Change accredited in batch', - 'Change non accredited limit for an account', 'Change non accredited limits in batch'); - - // If STO is not started, you can modify configuration - let now = Math.floor(Date.now() / 1000); - let startTime = await currentSTO.methods.startTime().call.call(); - if (now < startTime) { - options.push('Modify times configuration', 'Modify tiers configuration', 'Modify addresses configuration', - 'Modify limits configuration', 'Modify funding configuration'); - } - - if (typeof _stoConfig === 'undefined') { - let index = readlineSync.keyInSelect(options, 'What do you want to do?'); - switch (index) { - case 0: - let reserveWallet = await currentSTO.methods.reserveWallet().call(); - let isVerified = await securityToken.methods.verifyTransfer(STO_Address, reserveWallet, 0, web3.utils.fromAscii("")).call(); - if (isVerified == "2") { - if (readlineSync.keyInYNStrict()) { - let finalizeAction = currentSTO.methods.finalize(); - await common.sendTransaction(Issuer, finalizeAction, defaultGasPrice); - } - } else { - console.log(chalk.red(`Reserve wallet (${reserveWallet}) is not able to receive remaining tokens. Check if this address is whitelisted.`)); - } - break; - case 1: - let investor = readlineSync.question('Enter the address to change accreditation: '); - let isAccredited = readlineSync.keyInYNStrict(`Is ${investor} accredited?`); - let investors = [investor]; - let accredited = [isAccredited]; - let changeAccreditedAction = currentSTO.methods.changeAccredited(investors, accredited); - // 2 GAS? - await common.sendTransaction(Issuer, changeAccreditedAction, defaultGasPrice); - break; - case 2: - shell.exec(`${__dirname}/scripts/script.sh Accredit ${tokenSymbol} 75 ${network}`); - break; - case 3: - let account = readlineSync.question('Enter the address to change non accredited limit: '); - let limit = readlineSync.question(`Enter the limit in USD: `); - let accounts = [account]; - let limits = [web3.utils.toWei(limit)]; - let changeNonAccreditedLimitAction = currentSTO.methods.changeNonAccreditedLimit(accounts, limits); - // 2 GAS? - await common.sendTransaction(Issuer, changeNonAccreditedLimitAction, defaultGasPrice); - break; - case 4: - shell.exec(`${__dirname}/scripts/script.sh NonAccreditedLimit ${tokenSymbol} 75 ${network}`); - break; - case 5: - await modfifyTimes(); - await usdTieredSTO_status(); - break; - case 6: - await modfifyTiers(); - await usdTieredSTO_status(); - break; - case 7: - await modfifyAddresses(); - await usdTieredSTO_status(); - break; - case 8: - await modfifyLimits(); - await usdTieredSTO_status(); - break; - case 9: - await modfifyFunding(); - await usdTieredSTO_status(); - break; - } - } + let divisible = readlineSync.question('Press "N" for Non-divisible type token or hit Enter for divisible type token (Default): '); + divisibility = (divisible != 'N' && divisible != 'n'); } -} -async function modfifyTimes() { - let times = timesConfigUSDTieredSTO(); - let modifyTimesAction = currentSTO.methods.modifyTimes(times.startTime, times.endTime); - await common.sendTransaction(Issuer, modifyTimesAction, defaultGasPrice); -} - -async function modfifyLimits() { - let limits = limitsConfigUSDTieredSTO(); - let modifyLimitsAction = currentSTO.methods.modifyLimits(limits.nonAccreditedLimitUSD, limits.minimumInvestmentUSD); - await common.sendTransaction(Issuer, modifyLimitsAction, defaultGasPrice); -} - -async function modfifyFunding() { - let funding = fundingConfigUSDTieredSTO(); - let modifyFundingAction = currentSTO.methods.modifyFunding(funding.raiseType); - await common.sendTransaction(Issuer, modifyFundingAction, defaultGasPrice); -} - -async function modfifyAddresses() { - let addresses = addressesConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES.DAI).call()); - let modifyAddressesAction = currentSTO.methods.modifyAddresses(addresses.wallet, addresses.reserveWallet, addresses.usdToken); - await common.sendTransaction(Issuer, modifyAddressesAction, defaultGasPrice); -} - -async function modfifyTiers() { - let tiers = tiersConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES.POLY).call()); - let modifyTiersAction = currentSTO.methods.modifyTiers( - tiers.ratePerTier, - tiers.ratePerTierDiscountPoly, - tiers.tokensPerTier, - tiers.tokensPerTierDiscountPoly, - ); - await common.sendTransaction(Issuer, modifyTiersAction, defaultGasPrice); + await approvePoly(securityTokenRegistryAddress, launchFee); + let generateSecurityTokenAction = securityTokenRegistry.methods.generateSecurityToken(tokenName, tokenSymbol, tokenDetails, divisibility); + let receipt = await common.sendTransaction(Issuer, generateSecurityTokenAction, defaultGasPrice); + let event = common.getEventFromLogs(securityTokenRegistry._jsonInterface, receipt.logs, 'NewSecurityToken'); + console.log(chalk.green(`Security Token has been successfully deployed at address ${event._securityTokenAddress}`)); } ////////////////////// // HELPER FUNCTIONS // ////////////////////// -async function getBalance(from, type) { - switch (type) { - case 'ETH': - return await web3.eth.getBalance(from); - case 'POLY': - return await polyToken.methods.balanceOf(from).call(); - case 'DAI': - return await usdToken.methods.balanceOf(from).call(); - } -} - -async function currentBalance(from) { - let balance = await polyToken.methods.balanceOf(from).call(); - let balanceInPoly = new BigNumber(balance).dividedBy(new BigNumber(10).pow(18)); - return balanceInPoly; -} - -async function selectTicker(includeCreate) { +async function selectTicker() { let result; - let userTickers = (await securityTokenRegistry.methods.getTickersByOwner(Issuer.address).call()).map(function (t) {return web3.utils.hexToAscii(t)}); + let userTickers = (await securityTokenRegistry.methods.getTickersByOwner(Issuer.address).call()).map(t => web3.utils.hexToAscii(t)); let options = await Promise.all(userTickers.map(async function (t) { let tickerDetails = await securityTokenRegistry.methods.getTickerDetails(t).call(); - let tickerInfo = tickerDetails[4] ? 'Token launched' : `Expires at: ${moment.unix(tickerDetails[2]).format('MMMM Do YYYY, HH:mm:ss')}`; + let tickerInfo; + if (tickerDetails[4]) { + tickerInfo = `Token launched at ${(await securityTokenRegistry.methods.getSecurityTokenAddress(t).call())}`; + } else { + tickerInfo = `Expires at ${moment.unix(tickerDetails[2]).format('MMMM Do YYYY, HH:mm:ss')}`; + } return `${t} ${tickerInfo}`; })); - if (includeCreate) { - options.push('Register a new ticker'); - } + options.push('Register a new ticker'); let index = readlineSync.keyInSelect(options, 'Select a ticker:'); if (index == -1) { process.exit(0); - } else if (includeCreate && index == options.length - 1) { + } else if (index == options.length - 1) { result = readlineSync.question('Enter a symbol for your new ticker: '); } else { result = userTickers[index]; @@ -1160,7 +205,7 @@ async function approvePoly(spender, fee) { } module.exports = { - executeApp: async function(tokenConfig, mintingConfig, stoConfig, remoteNetwork) { - return executeApp(tokenConfig, mintingConfig, stoConfig, remoteNetwork); + executeApp: async function(ticker, transferOwnership, name, details, divisible, remoteNode) { + return executeApp(ticker, transferOwnership, name, details, divisible, remoteNode); } } diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 98c8d240d..608182dfd 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -17,26 +17,21 @@ const yaml = require('js-yaml'); const fs = require('fs'); program - .version('0.0.1') - .description('CLI for Polymath-core') + .version('1.0.1') + .description('Command Line Interface for Polymath-core') .option('-r, --remote-node ', 'Use Infura to connect to a remote node on selected network'); program .command('st20generator') .alias('st') - .option('-c, --config ', "Uses configuration file to configure ST and STO") + .option('-t, --ticker ', 'Unique token ticker') + .option('-o, --transferOwnership ', `Transfers the ticker's ownership to newOwner account. If newOwner is 'false', this step is skipped`) + .option('-n, --tokenName ', 'Token name') + .option('-d, --details
', 'Off-chain details of the token') + .option('-D, --divisible [div]', 'If token is divisible or not [true]', /^(true|false)/, 'true') .description('Wizard-like script that will guide technical users in the creation and deployment of an ST-20 token') .action(async function(cmd) { - let tokenConfig; - let mintingConfig; - let stoCofig; - if (cmd.config) { - let config = yaml.safeLoad(fs.readFileSync(`${__dirname}/data/${cmd.config}`, 'utf8')); - tokenConfig = config.securityToken; - mintingConfig = config.initialMint; - stoCofig = config.sto; - } - await st20generator.executeApp(tokenConfig, mintingConfig, stoCofig, program.remoteNode); + await st20generator.executeApp(cmd.ticker, cmd.transferOwnership, cmd.tokenName, cmd.details, cmd.divisible, program.remoteNode); }); program From 68bbeadd1b87307f5fb71588e1130f0cddf6f7d5 Mon Sep 17 00:00:00 2001 From: Federico Elgarte Date: Fri, 26 Oct 2018 10:53:30 -0300 Subject: [PATCH 011/139] first draft --- CLI/commands/ST20Generator.js | 36 ++++++------- CLI/commands/common/common_functions.js | 68 ++++++++++++++++--------- 2 files changed, 61 insertions(+), 43 deletions(-) diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index a52499b2f..ccf648c3c 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -122,7 +122,7 @@ async function step_ticker_reg(){ available = true; await approvePoly(securityTokenRegistryAddress, regFee); let registerTickerAction = securityTokenRegistry.methods.registerTicker(Issuer.address, tokenSymbol, ""); - await common.sendTransaction(Issuer, registerTickerAction, defaultGasPrice, 0, 1.5); + await common.sendTransaction(registerTickerAction, {factor: 1.5}); } else if (details[0] == Issuer.address) { available = true; } else { @@ -139,7 +139,7 @@ async function step_ticker_reg(){ limitMessage: "Must be a valid address" }); let transferTickerOwnershipAction = securityTokenRegistry.methods.transferTickerOwnership(newOwner, tokenSymbol); - let receipt = await common.sendTransaction(Issuer, transferTickerOwnershipAction, defaultGasPrice, 0, 1.5); + let receipt = await common.sendTransaction(transferTickerOwnershipAction, {factor: 1.5}); let event = common.getEventFromLogs(securityTokenRegistry._jsonInterface, receipt.logs, 'ChangeTickerOwnership'); console.log(chalk.green(`Ownership trasferred successfully. The new owner is ${event._newOwner}`)); process.exit(0); @@ -183,7 +183,7 @@ async function step_token_deploy(){ await approvePoly(securityTokenRegistryAddress, launchFee); let generateSecurityTokenAction = securityTokenRegistry.methods.generateSecurityToken(tokenName, tokenSymbol, tokenDetails, divisibility); - let receipt = await common.sendTransaction(Issuer, generateSecurityTokenAction, defaultGasPrice); + let receipt = await common.sendTransaction(generateSecurityTokenAction, {}); let event = common.getEventFromLogs(securityTokenRegistry._jsonInterface, receipt.logs, 'NewSecurityToken'); console.log(`Deployed Token at address: ${event._securityTokenAddress}`); let securityTokenABI = abis.securityToken(); @@ -240,7 +240,7 @@ async function step_Wallet_Issuance(){ let generalTransferManagerABI = abis.generalTransferManager(); let generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, generalTransferManagerAddress); let modifyWhitelistAction = generalTransferManager.methods.modifyWhitelist(mintWallet,Math.floor(Date.now()/1000),Math.floor(Date.now()/1000),Math.floor(Date.now()/1000 + 31536000), canBuyFromSTO); - await common.sendTransaction(Issuer, modifyWhitelistAction, defaultGasPrice); + await common.sendTransaction(modifyWhitelistAction, {}); // Mint tokens if (typeof _mintingConfig !== 'undefined' && _mintingConfig.hasOwnProperty('singleMint') && _mintingConfig.singleMint.hasOwnProperty('tokenAmount')) { @@ -251,7 +251,7 @@ async function step_Wallet_Issuance(){ if (issuerTokens == "") issuerTokens = '500000'; let mintAction = securityToken.methods.mint(mintWallet, web3.utils.toWei(issuerTokens)); - await common.sendTransaction(Issuer, mintAction, defaultGasPrice); + await common.sendTransaction(mintAction, {}); } } } @@ -352,7 +352,7 @@ async function cappedSTO_launch() { process.exit(0); } else { let transferAction = polyToken.methods.transfer(securityToken._address, new BigNumber(transferAmount)); - let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice, 0, 2); + let receipt = await common.sendTransaction(transferAction, {factor: 2}); let event = common.getEventFromLogs(polyToken._jsonInterface, receipt.logs, 'Transfer'); console.log(`Number of POLY sent: ${web3.utils.fromWei(new web3.utils.BN(event._value))}`) } @@ -440,7 +440,7 @@ async function cappedSTO_launch() { let cappedSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.STO, "CappedSTO"); let addModuleAction = securityToken.methods.addModule(cappedSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); - let receipt = await common.sendTransaction(Issuer, addModuleAction, defaultGasPrice); + let receipt = await common.sendTransaction(addModuleAction, {}); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`STO deployed at address: ${event._module}`); @@ -757,7 +757,7 @@ async function usdTieredSTO_launch() { process.exit(0); } else { let transferAction = polyToken.methods.transfer(securityToken._address, transferAmount); - let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice, 0, 2); + let receipt = await common.sendTransaction(transferAction, {factor: 2}); let event = common.getEventFromLogs(polyToken._jsonInterface, receipt.logs, 'Transfer'); console.log(`Number of POLY sent: ${web3.utils.fromWei(new web3.utils.BN(event._value))}`) } @@ -826,7 +826,7 @@ async function usdTieredSTO_launch() { let usdTieredSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.STO, 'USDTieredSTO'); let addModuleAction = securityToken.methods.addModule(usdTieredSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); - let receipt = await common.sendTransaction(Issuer, addModuleAction, defaultGasPrice); + let receipt = await common.sendTransaction(addModuleAction, {}); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`STO deployed at address: ${event._module}`); @@ -1004,7 +1004,7 @@ async function usdTieredSTO_configure() { if (isVerified == "2") { if (readlineSync.keyInYNStrict()) { let finalizeAction = currentSTO.methods.finalize(); - await common.sendTransaction(Issuer, finalizeAction, defaultGasPrice); + await common.sendTransaction(finalizeAction, {}); } } else { console.log(chalk.red(`Reserve wallet (${reserveWallet}) is not able to receive remaining tokens. Check if this address is whitelisted.`)); @@ -1017,7 +1017,7 @@ async function usdTieredSTO_configure() { let accredited = [isAccredited]; let changeAccreditedAction = currentSTO.methods.changeAccredited(investors, accredited); // 2 GAS? - await common.sendTransaction(Issuer, changeAccreditedAction, defaultGasPrice); + await common.sendTransaction(changeAccreditedAction, {}); break; case 2: shell.exec(`${__dirname}/scripts/script.sh Accredit ${tokenSymbol} 75 ${network}`); @@ -1029,7 +1029,7 @@ async function usdTieredSTO_configure() { let limits = [web3.utils.toWei(limit)]; let changeNonAccreditedLimitAction = currentSTO.methods.changeNonAccreditedLimit(accounts, limits); // 2 GAS? - await common.sendTransaction(Issuer, changeNonAccreditedLimitAction, defaultGasPrice); + await common.sendTransaction(changeNonAccreditedLimitAction, {}); break; case 4: shell.exec(`${__dirname}/scripts/script.sh NonAccreditedLimit ${tokenSymbol} 75 ${network}`); @@ -1062,25 +1062,25 @@ async function usdTieredSTO_configure() { async function modfifyTimes() { let times = timesConfigUSDTieredSTO(); let modifyTimesAction = currentSTO.methods.modifyTimes(times.startTime, times.endTime); - await common.sendTransaction(Issuer, modifyTimesAction, defaultGasPrice); + await common.sendTransaction(modifyTimesAction, {}); } async function modfifyLimits() { let limits = limitsConfigUSDTieredSTO(); let modifyLimitsAction = currentSTO.methods.modifyLimits(limits.nonAccreditedLimitUSD, limits.minimumInvestmentUSD); - await common.sendTransaction(Issuer, modifyLimitsAction, defaultGasPrice); + await common.sendTransaction(modifyLimitsAction, {}); } async function modfifyFunding() { let funding = fundingConfigUSDTieredSTO(); let modifyFundingAction = currentSTO.methods.modifyFunding(funding.raiseType); - await common.sendTransaction(Issuer, modifyFundingAction, defaultGasPrice); + await common.sendTransaction(modifyFundingAction, {}); } async function modfifyAddresses() { let addresses = addressesConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES.DAI).call()); let modifyAddressesAction = currentSTO.methods.modifyAddresses(addresses.wallet, addresses.reserveWallet, addresses.usdToken); - await common.sendTransaction(Issuer, modifyAddressesAction, defaultGasPrice); + await common.sendTransaction(modifyAddressesAction, {}); } async function modfifyTiers() { @@ -1091,7 +1091,7 @@ async function modfifyTiers() { tiers.tokensPerTier, tiers.tokensPerTierDiscountPoly, ); - await common.sendTransaction(Issuer, modifyTiersAction, defaultGasPrice); + await common.sendTransaction(modifyTiersAction, {}); } ////////////////////// @@ -1148,7 +1148,7 @@ async function approvePoly(spender, fee) { return true; } else { let approveAction = polyToken.methods.approve(spender, web3.utils.toWei(fee.toString(), "ether")); - await common.sendTransaction(Issuer, approveAction, defaultGasPrice); + await common.sendTransaction(approveAction, {}); } } else { let requiredBalance = parseInt(requiredAmount) - parseInt(polyBalance); diff --git a/CLI/commands/common/common_functions.js b/CLI/commands/common/common_functions.js index af3cdc8fa..4e1bb5d94 100644 --- a/CLI/commands/common/common_functions.js +++ b/CLI/commands/common/common_functions.js @@ -2,6 +2,7 @@ const chalk = require('chalk'); const Tx = require('ethereumjs-tx'); const permissionsList = require('./permissions_list'); const abis = require('../helpers/contract_abis'); +const global = require('global'); async function connect(abi, address) { contractRegistry = new web3.eth.Contract(abi, address); @@ -25,6 +26,38 @@ async function checkPermission(contractName, functionName, contractRegistry) { } }; +function getFinalOptions(options) { + const defaultOptions = { + from: Issuer, + gasPrice: defaultGasPrice, + value: 0, + factor: 1.2 + } + return Object.assign(defaultOptions, options) +}; + +async function getGas(options, action) { + let block = await web3.eth.getBlock("latest"); + let networkGasLimit = block.gasLimit; + let gas = Math.round(options.factor * (await action.estimateGas({ from: options.from.address, value: options.value}))); + return (gas > networkGasLimit) ? networkGasLimit : gas; +} + +async function checkPermissions(action) { + let contractRegistry = await connect(action._parent.options.jsonInterface, action._parent._address); + //NOTE this is a condition to verify if the transaction comes from a module or not. + if (contractRegistry.methods.hasOwnProperty('factory')) { + let moduleAddress = await contractRegistry.methods.factory().call(); + let moduleRegistry = await connect(abis.moduleFactory(), moduleAddress) + let parentModule = await moduleRegistry.methods.getName().call(); + let result = await checkPermission(web3.utils.hexToUtf8(parentModule), action._method.name, contractRegistry); + if (!result) { + console.log("You haven't the right permissions to execute this method."); + process.exit(0); + } + } +} + module.exports = { convertToDaysRemaining: function (timeRemaining) { var seconds = parseInt(timeRemaining, 10); @@ -71,45 +104,30 @@ module.exports = { @@@@@@@@@@#%####%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ `); }, - sendTransaction: async function (from, action, gasPrice, value, factor) { - let contractRegistry = await connect(action._parent.options.jsonInterface, action._parent._address); - - //NOTE this is a condition to verify if the transaction comes from a module or not. - if (contractRegistry.methods.hasOwnProperty('factory')) { - let moduleAddress = await contractRegistry.methods.factory().call(); - let moduleRegistry = await connect(abis.moduleFactory(), moduleAddress) - let parentModule = await moduleRegistry.methods.getName().call(); - let result = await checkPermission(web3.utils.hexToUtf8(parentModule), action._method.name, contractRegistry); - if (!result) { - console.log("You haven't the right permissions to execute this method."); - process.exit(0); - } - } - - if (typeof factor === 'undefined') factor = 1.2; + //sendTransaction: async function (from, action, gasPrice, value, factor) { + sendTransaction: async function (action, options) { - let block = await web3.eth.getBlock("latest"); - let networkGasLimit = block.gasLimit; + await checkPermissions(action); - let gas = Math.round(factor * (await action.estimateGas({ from: from.address, value: value}))); - if (gas > networkGasLimit) gas = networkGasLimit; + options = getFinalOptions(options); + let gas = await getGas(options, action); console.log(chalk.black.bgYellowBright(`---- Transaction executed: ${action._method.name} - Gas limit provided: ${gas} ----`)); - let nonce = await web3.eth.getTransactionCount(from.address); + let nonce = await web3.eth.getTransactionCount(options.from.address); let abi = action.encodeABI(); let parameter = { - from: from.address, + from: options.from.address, to: action._parent._address, data: abi, gasLimit: gas, - gasPrice: gasPrice, + gasPrice: options.gasPrice, nonce: nonce, - value: web3.utils.toHex(value) + value: web3.utils.toHex(options.value) }; const transaction = new Tx(parameter); - transaction.sign(Buffer.from(from.privateKey.replace('0x', ''), 'hex')); + transaction.sign(Buffer.from(options.from.privateKey.replace('0x', ''), 'hex')); return await web3.eth.sendSignedTransaction('0x' + transaction.serialize().toString('hex')) .on('transactionHash', function(hash){ console.log(` From 6c5a057d5948b9147292a2dfc44f8d8d0a91dbb9 Mon Sep 17 00:00:00 2001 From: Federico Elgarte Date: Fri, 26 Oct 2018 13:19:51 -0300 Subject: [PATCH 012/139] [WIP] changing all transaction methods calls --- CLI/commands/TickerRollForward.js | 4 ++-- CLI/commands/accredit.js | 2 +- CLI/commands/changeNonAccreditedLimit.js | 2 +- CLI/commands/common/common_functions.js | 4 ++-- CLI/commands/contract_manager.js | 12 +++++------ CLI/commands/dividends_manager.js | 26 ++++++++++++------------ CLI/commands/faucet.js | 4 ++-- CLI/commands/investor_portal.js | 16 +++++++-------- CLI/commands/module_manager.js | 12 +++++------ CLI/commands/multi_mint.js | 2 +- CLI/commands/permission_manager.js | 8 ++++---- CLI/commands/strMigrator.js | 12 +++++------ CLI/commands/transfer.js | 2 +- CLI/commands/transfer_manager.js | 6 +++--- CLI/commands/transfer_ownership.js | 2 +- CLI/commands/whitelist.js | 2 +- 16 files changed, 58 insertions(+), 58 deletions(-) diff --git a/CLI/commands/TickerRollForward.js b/CLI/commands/TickerRollForward.js index 97bd1f519..c3a3a9062 100644 --- a/CLI/commands/TickerRollForward.js +++ b/CLI/commands/TickerRollForward.js @@ -88,7 +88,7 @@ async function registerTickers() { process.exit(0); } else { let approveAction = polyToken.methods.approve(securityTokenRegistryAddress, totalFee); - let receipt = await common.sendTransaction(Issuer, approveAction, defaultGasPrice); + let receipt = await common.sendTransaction(approveAction, {}); totalGas = totalGas.add(receipt.gasUsed); } @@ -115,7 +115,7 @@ async function registerTickers() { if (valid) { try { let registerTickerAction = securityTokenRegistry.methods.registerTicker(owner, ticker_data[i].symbol, ticker_data[i].name); - let receipt = await common.sendTransaction(Issuer, registerTickerAction, defaultGasPrice); + let receipt = await common.sendTransaction(registerTickerAction, {}); registered_tickers.push(ticker_data[i]); console.log(ticker_data[i]); totalGas = totalGas.add(receipt.gasUsed); diff --git a/CLI/commands/accredit.js b/CLI/commands/accredit.js index c4dbd78b6..27d5ec01e 100644 --- a/CLI/commands/accredit.js +++ b/CLI/commands/accredit.js @@ -130,7 +130,7 @@ async function changeAccredited() { } let changeAccreditedAction = usdTieredSTO.methods.changeAccredited(investorArray, isAccreditedArray); - let r = await common.sendTransaction(Issuer, changeAccreditedAction, defaultGasPrice); + let r = await common.sendTransaction(changeAccreditedAction, {}); console.log(`Batch ${i} - Attempting to change accredited accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); console.log("Change accredited transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); diff --git a/CLI/commands/changeNonAccreditedLimit.js b/CLI/commands/changeNonAccreditedLimit.js index b1ececbc7..e6ae47851 100644 --- a/CLI/commands/changeNonAccreditedLimit.js +++ b/CLI/commands/changeNonAccreditedLimit.js @@ -130,7 +130,7 @@ async function changeNonAccreditedLimit() { } let changeNonAccreditedLimitAction = usdTieredSTO.methods.changeNonAccreditedLimit(investorArray, limitArray); - let r = await common.sendTransaction(Issuer, changeNonAccreditedLimitAction, defaultGasPrice); + let r = await common.sendTransaction(changeNonAccreditedLimitAction, {}); console.log(`Batch ${i} - Attempting to change non accredited limits to accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); console.log("Change accredited transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString()), "Ether"); diff --git a/CLI/commands/common/common_functions.js b/CLI/commands/common/common_functions.js index 4e1bb5d94..bb9d7c3fc 100644 --- a/CLI/commands/common/common_functions.js +++ b/CLI/commands/common/common_functions.js @@ -30,7 +30,7 @@ function getFinalOptions(options) { const defaultOptions = { from: Issuer, gasPrice: defaultGasPrice, - value: 0, + value: undefined, factor: 1.2 } return Object.assign(defaultOptions, options) @@ -138,7 +138,7 @@ module.exports = { .on('receipt', function(receipt){ console.log(` Congratulations! The transaction was successfully completed. - Gas used: ${receipt.gasUsed} - Gas spent: ${web3.utils.fromWei((new web3.utils.BN(gasPrice)).mul(new web3.utils.BN(receipt.gasUsed)))} Ether + Gas used: ${receipt.gasUsed} - Gas spent: ${web3.utils.fromWei((new web3.utils.BN(options.gasPrice)).mul(new web3.utils.BN(receipt.gasUsed)))} Ether Review it on Etherscan. TxHash: ${receipt.transactionHash}\n` ); diff --git a/CLI/commands/contract_manager.js b/CLI/commands/contract_manager.js index bea83ce7d..9853d6931 100644 --- a/CLI/commands/contract_manager.js +++ b/CLI/commands/contract_manager.js @@ -108,7 +108,7 @@ async function strActions() { let tickerExpiryDate = readlineSync.question(`Enter the Unix Epoch time on wich the ticker will expire: `); let tickerStatus = readlineSync.keyInYNStrict(`Is the token deployed?`); let modifyTickerAction = currentContract.methods.modifyTicker(tickerOwner, tickerToModify, tickerSTName, tickerRegistrationDate, tickerExpiryDate, tickerStatus); - await common.sendTransaction(Issuer, modifyTickerAction, defaultGasPrice, 0, 1.5); + await common.sendTransaction(modifyTickerAction, {factor: 1.5}); console.log(chalk.green(`Ticker has been updated successfully`)); break; case 'Remove Ticker': @@ -118,7 +118,7 @@ async function strActions() { console.log(chalk.yellow(`${ticker} does not exist.`)); } else { let removeTickerAction = currentContract.methods.removeTicker(tickerToRemove); - await common.sendTransaction(Issuer, removeTickerAction, defaultGasPrice, 0, 3); + await common.sendTransaction(removeTickerAction, {factor: 3}); console.log(chalk.green(`Ticker has been removed successfully`)); } break; @@ -159,7 +159,7 @@ async function strActions() { let tokenDetails = readlineSync.question(`Enter the token details: `); let deployedAt = readlineSync.questionInt(`Enter the Unix Epoch timestamp at which security token was deployed: `); let modifySTAction = currentContract.methods.modifySecurityToken(name, ticker, owner, stAddress, tokenDetails, deployedAt); - await common.sendTransaction(Issuer, modifySTAction, defaultGasPrice, 0, 1.5); + await common.sendTransaction(modifySTAction, {factor: 1.5}); console.log(chalk.green(`Security Token has been updated successfully`)); break; case 'Change Expiry Limit': @@ -167,7 +167,7 @@ async function strActions() { console.log(chalk.yellow(`Current expiry limit is ${Math.floor(parseInt(currentExpiryLimit)/60/60/24)} days`)); let newExpiryLimit = duration.days(readlineSync.questionInt('Enter a new value in days for expiry limit: ')); let changeExpiryLimitAction = currentContract.methods.changeExpiryLimit(newExpiryLimit); - let changeExpiryLimitReceipt = await common.sendTransaction(Issuer, changeExpiryLimitAction, defaultGasPrice); + let changeExpiryLimitReceipt = await common.sendTransaction(changeExpiryLimitAction, {}); let changeExpiryLimitEvent = common.getEventFromLogs(currentContract._jsonInterface, changeExpiryLimitReceipt.logs, 'ChangeExpiryLimit'); console.log(chalk.green(`Expiry limit was changed successfully. New limit is ${Math.floor(parseInt(changeExpiryLimitEvent._newExpiry)/60/60/24)} days\n`)); break; @@ -176,7 +176,7 @@ async function strActions() { console.log(chalk.yellow(`\nCurrent ticker registration fee is ${currentRegFee} POLY`)); let newRegFee = web3.utils.toWei(readlineSync.questionInt('Enter a new value in POLY for ticker registration fee: ').toString()); let changeRegFeeAction = currentContract.methods.changeTickerRegistrationFee(newRegFee); - let changeRegFeeReceipt = await common.sendTransaction(Issuer, changeRegFeeAction, defaultGasPrice); + let changeRegFeeReceipt = await common.sendTransaction(changeRegFeeAction, {}); let changeRegFeeEvent = common.getEventFromLogs(currentContract._jsonInterface, changeRegFeeReceipt.logs, 'ChangeTickerRegistrationFee'); console.log(chalk.green(`Fee was changed successfully. New fee is ${web3.utils.fromWei(changeRegFeeEvent._newFee)} POLY\n`)); break; @@ -185,7 +185,7 @@ async function strActions() { console.log(chalk.yellow(`\nCurrent ST launch fee is ${currentLaunchFee} POLY`)); let newLaunchFee = web3.utils.toWei(readlineSync.questionInt('Enter a new value in POLY for ST launch fee: ').toString()); let changeLaunchFeeAction = currentContract.methods.changeSecurityLaunchFee(newLaunchFee); - let changeLaunchFeeReceipt = await common.sendTransaction(Issuer, changeLaunchFeeAction, defaultGasPrice); + let changeLaunchFeeReceipt = await common.sendTransaction(changeLaunchFeeAction, {}); let changeLaunchFeeEvent = common.getEventFromLogs(currentContract._jsonInterface, changeLaunchFeeReceipt.logs, 'ChangeSecurityLaunchFee'); console.log(chalk.green(`Fee was changed successfully. New fee is ${web3.utils.fromWei(changeLaunchFeeEvent._newFee)} POLY\n`)); break; diff --git a/CLI/commands/dividends_manager.js b/CLI/commands/dividends_manager.js index bde3aa900..917819500 100644 --- a/CLI/commands/dividends_manager.js +++ b/CLI/commands/dividends_manager.js @@ -129,7 +129,7 @@ async function start_explorer(){ break; case 'Create checkpoint': let createCheckpointAction = securityToken.methods.createCheckpoint(); - await common.sendTransaction(Issuer, createCheckpointAction, defaultGasPrice); + await common.sendTransaction(createCheckpointAction, {}); break; case 'Set default exclusions for dividends': await setDefaultExclusions(); @@ -199,7 +199,7 @@ async function mintTokens(address, amount){ try { let mintAction = securityToken.methods.mint(address,web3.utils.toWei(amount)); - let receipt = await common.sendTransaction(Issuer, mintAction, defaultGasPrice); + let receipt = await common.sendTransaction(mintAction, {}); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'Transfer'); console.log(` Minted ${web3.utils.fromWei(event.value)} tokens @@ -217,7 +217,7 @@ async function transferTokens(address, amount){ try{ let transferAction = securityToken.methods.transfer(address,web3.utils.toWei(amount)); - let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice, 0, 1.5); + let receipt = await common.sendTransaction(transferAction, {factor: 1.5}); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'Transfer'); console.log(` Account ${event.from} @@ -260,7 +260,7 @@ async function setDefaultExclusions() { if (readlineSync.keyInYNStrict(`Do you want to continue?`)) { let excluded = getExcludedFromDataFile(); let setDefaultExclusionsActions = currentDividendsModule.methods.setDefaultExcluded(excluded); - let receipt = await common.sendTransaction(Issuer, setDefaultExclusionsActions, defaultGasPrice); + let receipt = await common.sendTransaction(setDefaultExclusionsActions, {}); let event = common.getEventFromLogs(currentDividendsModule._jsonInterface, receipt.logs, 'SetDefaultExcludedAddresses'); console.log(chalk.green(`Exclusions were successfully set.`)); showExcluded(event._excluded); @@ -290,14 +290,14 @@ async function taxHoldingMenu() { }); let percentageWei = web3.utils.toWei((percentage / 100).toString()); let setWithHoldingFixedAction = currentDividendsModule.methods.setWithholdingFixed([address], percentageWei); - let receipt = await common.sendTransaction(Issuer, setWithHoldingFixedAction, defaultGasPrice); + let receipt = await common.sendTransaction(setWithHoldingFixedAction, {}); console.log(chalk.green(`Successfully set tax withholding of ${percentage}% for ${address}.`)); break; case 'Withdraw withholding for dividend': let _dividend = await selectDividend({withRemainingWithheld: true}); if (_dividend !== null) { let withdrawWithholdingAction = currentDividendsModule.methods.withdrawWithholding(_dividend.index); - let receipt = await common.sendTransaction(Issuer, withdrawWithholdingAction, defaultGasPrice); + let receipt = await common.sendTransaction(withdrawWithholdingAction, {}); let eventName; if (dividendsType == 'POLY') { eventName = 'ERC20DividendWithholdingWithdrawn'; @@ -326,7 +326,7 @@ async function createDividends(name, dividend, checkpointId) { let createDividendAction; if (dividendsType == 'POLY') { let approveAction = polyToken.methods.approve(currentDividendsModule._address, web3.utils.toWei(dividend)); - await common.sendTransaction(Issuer, approveAction, defaultGasPrice); + await common.sendTransaction(approveAction, {}); if (checkpointId > 0) { if (useDefaultExcluded) { createDividendAction = currentDividendsModule.methods.createDividendWithCheckpoint(maturityTime, expiryTime, polyToken._address, web3.utils.toWei(dividend), checkpointId, web3.utils.toHex(name)); @@ -342,7 +342,7 @@ async function createDividends(name, dividend, checkpointId) { createDividendAction = currentDividendsModule.methods.createDividendWithExclusions(maturityTime, expiryTime, polyToken._address, web3.utils.toWei(dividend), excluded, web3.utils.toHex(name)); } } - let receipt = await common.sendTransaction(Issuer, createDividendAction, defaultGasPrice); + let receipt = await common.sendTransaction(createDividendAction, {}); let event = common.getEventFromLogs(currentDividendsModule._jsonInterface, receipt.logs, 'ERC20DividendDeposited'); console.log(chalk.green(`Dividend ${event._dividendIndex} deposited`)); } else if (dividendsType == 'ETH') { @@ -361,7 +361,7 @@ async function createDividends(name, dividend, checkpointId) { createDividendAction = currentDividendsModule.methods.createDividendWithExclusions(maturityTime, expiryTime, excluded, web3.utils.toHex(name)); } } - let receipt = await common.sendTransaction(Issuer, createDividendAction, defaultGasPrice, web3.utils.toWei(dividend)); + let receipt = await common.sendTransaction(createDividendAction, {gasPrice: web3.utils.toWei(dividend)}); let event = common.getEventFromLogs(currentDividendsModule._jsonInterface, receipt.logs, 'EtherDividendDeposited'); console.log(` Dividend ${event._dividendIndex} deposited` @@ -372,7 +372,7 @@ async function createDividends(name, dividend, checkpointId) { async function pushDividends(dividend, account){ let accs = account.split(','); let pushDividendPaymentToAddressesAction = currentDividendsModule.methods.pushDividendPaymentToAddresses(dividend.index, accs); - let receipt = await common.sendTransaction(Issuer, pushDividendPaymentToAddressesAction, defaultGasPrice); + let receipt = await common.sendTransaction(pushDividendPaymentToAddressesAction, {}); let successEventName; if (dividendsType == 'POLY') { successEventName = 'ERC20DividendClaimed'; @@ -400,7 +400,7 @@ async function pushDividends(dividend, account){ async function reclaimedDividend(dividend) { let reclaimDividendAction = currentDividendsModule.methods.reclaimDividend(dividend.index); - let receipt = await common.sendTransaction(Issuer, reclaimDividendAction, defaultGasPrice); + let receipt = await common.sendTransaction(reclaimDividendAction, {}); let eventName; if (dividendsType == 'POLY') { eventName = 'ERC20DividendReclaimed'; @@ -417,7 +417,7 @@ async function reclaimedDividend(dividend) { async function whitelistAddress(address) { let now = Math.floor(Date.now() / 1000); let modifyWhitelistAction = generalTransferManager.methods.modifyWhitelist(address, now, now, now + 31536000, true); - await common.sendTransaction(Issuer, modifyWhitelistAction, defaultGasPrice); + await common.sendTransaction(modifyWhitelistAction, {}); console.log(chalk.green(`\nWhitelisting successful for ${address}.`)); } @@ -480,7 +480,7 @@ async function addDividendsModule() { let dividendsFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.DIVIDENDS, dividendsFactoryName); let addModuleAction = securityToken.methods.addModule(dividendsFactoryAddress, web3.utils.fromAscii('', 16), 0, 0); - let receipt = await common.sendTransaction(Issuer, addModuleAction, defaultGasPrice); + let receipt = await common.sendTransaction(addModuleAction, {}); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`Module deployed at address: ${event._module}`); currentDividendsModule = new web3.eth.Contract(dividendsModuleABI, event._module); diff --git a/CLI/commands/faucet.js b/CLI/commands/faucet.js index 556ffa402..6b3d8dde4 100644 --- a/CLI/commands/faucet.js +++ b/CLI/commands/faucet.js @@ -79,7 +79,7 @@ async function send_poly(beneficiary, amount) { beneficiary = readlineSync.question(`Enter beneficiary 10K USD Tokens ('${Issuer.address}'): `); if (beneficiary == "") beneficiary = Issuer.address; let getTokensAction = usdToken.methods.getTokens(web3.utils.toWei('10000'), beneficiary); - await common.sendTransaction(Issuer, getTokensAction, defaultGasPrice); + await common.sendTransaction(getTokensAction, {}); let balance = await usdToken.methods.balanceOf(beneficiary).call(); let balanceInPoly = new BigNumber(balance).dividedBy(new BigNumber(10).pow(18)); console.log(chalk.green(`Congratulations! balance of ${beneficiary} address is ${balanceInPoly.toNumber()} USD Tokens`)); @@ -97,7 +97,7 @@ async function send_poly(beneficiary, amount) { async function transferTokens(to, amount) { try { let getTokensAction = polyToken.methods.getTokens(amount, to); - await common.sendTransaction(Issuer, getTokensAction, defaultGasPrice); + await common.sendTransaction(getTokensAction, {}); } catch (err){ console.log(err.message); return; diff --git a/CLI/commands/investor_portal.js b/CLI/commands/investor_portal.js index 9a5229a7c..5a50bd823 100644 --- a/CLI/commands/investor_portal.js +++ b/CLI/commands/investor_portal.js @@ -427,10 +427,10 @@ async function investCappedSTO(currency, amount) { let allowance = await polyToken.methods.allowance(STOAddress, User.address).call(); if (allowance < costWei) { let approveAction = polyToken.methods.approve(STOAddress, costWei); - await common.sendTransaction(User, approveAction, defaultGasPrice); + await common.sendTransaction(approveAction, {from: User}); } let actionBuyTokensWithPoly = currentSTO.methods.buyTokensWithPoly(costWei); - let receipt = await common.sendTransaction(User, actionBuyTokensWithPoly, defaultGasPrice); + let receipt = await common.sendTransaction(actionBuyTokensWithPoly, {from: User}); logTokensPurchasedCappedSTO(receipt); } else { console.log(chalk.red(`Not enough balance to Buy tokens, Require ${cost} POLY but have ${userBalance} POLY.`)); @@ -439,7 +439,7 @@ async function investCappedSTO(currency, amount) { } } else { let actionBuyTokens = currentSTO.methods.buyTokens(User.address); - let receipt = await common.sendTransaction(User, actionBuyTokens, defaultGasPrice, costWei); + let receipt = await common.sendTransaction(actionBuyTokens, {from: User, value: costWei}); logTokensPurchasedCappedSTO(receipt); } await showTokenInfo(); @@ -493,10 +493,10 @@ async function investUsdTieredSTO(currency, amount) { let allowance = await polyToken.methods.allowance(STOAddress, User.address).call(); if (allowance < costWei) { let approveAction = polyToken.methods.approve(STOAddress, costWei); - await common.sendTransaction(User, approveAction, defaultGasPrice); + await common.sendTransaction(approveAction, {from: User}); } let actionBuyWithPoly = currentSTO.methods.buyWithPOLY(User.address, costWei); - let receipt = await common.sendTransaction(User, actionBuyWithPoly,defaultGasPrice, 0, 2); + let receipt = await common.sendTransaction(actionBuyWithPoly, {from: User, factor: 2}); logTokensPurchasedUSDTieredSTO(receipt); } else { console.log(chalk.red(`Not enough balance to Buy tokens, Require ${cost} POLY but have ${userBalance} POLY.`)); @@ -509,10 +509,10 @@ async function investUsdTieredSTO(currency, amount) { let allowance = await usdToken.methods.allowance(STOAddress, User.address).call(); if (allowance < costWei) { let approveAction = usdToken.methods.approve(STOAddress, costWei); - await common.sendTransaction(User, approveAction, defaultGasPrice); + await common.sendTransaction(approveAction, {from: User}); } let actionBuyWithUSD = currentSTO.methods.buyWithUSD(User.address, costWei); - let receipt = await common.sendTransaction(User, actionBuyWithUSD, defaultGasPrice, 0, 1.5); + let receipt = await common.sendTransaction(actionBuyWithUSD, {from: User, factor: 1.5}); logTokensPurchasedUSDTieredSTO(receipt); } else { console.log(chalk.red(`Not enough balance to Buy tokens, Require ${cost} DAI but have ${userBalance} DAI.`)); @@ -521,7 +521,7 @@ async function investUsdTieredSTO(currency, amount) { } } else { let actionBuyWithETH = currentSTO.methods.buyWithETH(User.address); - let receipt = await common.sendTransaction(User, actionBuyWithETH, defaultGasPrice, costWei); + let receipt = await common.sendTransaction(actionBuyWithETH, {from: User, value: costWei}); logTokensPurchasedUSDTieredSTO(receipt); } diff --git a/CLI/commands/module_manager.js b/CLI/commands/module_manager.js index b91541a9c..1dcc61e72 100644 --- a/CLI/commands/module_manager.js +++ b/CLI/commands/module_manager.js @@ -283,7 +283,7 @@ async function archiveModule() { if (index != -1) { console.log("\nSelected: ",options[index]); let archiveModuleAction = securityToken.methods.archiveModule(modules[index].module.address); - await common.sendTransaction(Issuer, archiveModuleAction, defaultGasPrice, 0, 2); + await common.sendTransaction(archiveModuleAction, {factor: 2}); console.log(chalk.green(`\nSuccessfully archived ${modules[index].module.name}.`)); } backToMenu() @@ -315,7 +315,7 @@ async function unarchiveModule() { if (index != -1) { console.log("\nSelected: ",options[index]); let unarchiveModuleAction = securityToken.methods.unarchiveModule(modules[index].module.address); - await common.sendTransaction(Issuer, unarchiveModuleAction, defaultGasPrice, 0, 2); + await common.sendTransaction(unarchiveModuleAction, {factor: 2}); console.log(chalk.green(`\nSuccessfully unarchived ${modules[index].module.name}.`)); } backToMenu() @@ -348,7 +348,7 @@ async function removeModule() { if (index != -1) { console.log("\nSelected: ",options[index]); let removeModuleAction = securityToken.methods.removeModule(modules[index].module.address); - await common.sendTransaction(Issuer, removeModuleAction, defaultGasPrice, 0, 2); + await common.sendTransaction(defaultGasPrice, {factor: 2}); console.log(chalk.green(`\nSuccessfully removed ${modules[index].module.name}.`)); } backToMenu() @@ -368,7 +368,7 @@ async function whitelist() { let investor = readlineSync.question(chalk.yellow(`Enter the address to be whitelisted: `)); let now = await latestTime(); let modifyWhitelistAction = generalTransferManager.methods.modifyWhitelist(investor, now, now, now + 31556952, true); - await common.sendTransaction(Issuer, modifyWhitelistAction, defaultGasPrice); + await common.sendTransaction(modifyWhitelistAction, {}); console.log(chalk.green(`\nWhitelisting successful for ${investor}.`)); } catch (e) { console.log(e); @@ -390,7 +390,7 @@ async function mintTokens() { let _amount = readlineSync.question(chalk.yellow(`Enter the amount of tokens to mint: `)); try { let mintAction = securityToken.methods.mint(_investor, web3.utils.toWei(_amount)); - await common.sendTransaction(Issuer, mintAction, defaultGasPrice); + await common.sendTransaction(mintAction, {}); console.log(chalk.green(`\nMinting Successful.`)); } catch (e) { console.log(e); @@ -411,7 +411,7 @@ async function freezeMinting() { if (await featureRegistry.methods.getFeatureStatus('freezeMintingAllowed').call()) { let freezeMintingAction = securityToken.methods.freezeMinting(); - await common.sendTransaction(Issuer, freezeMintingAction, defaultGasPrice); + await common.sendTransaction(freezeMintingAction, {}); console.log(chalk.green(`\nFreeze minting was successful.`)); } else { console.log(chalk.red(`\nFreeze minting is not allowed by Polymath.`)); diff --git a/CLI/commands/multi_mint.js b/CLI/commands/multi_mint.js index 0b7c272ca..5ade5c386 100644 --- a/CLI/commands/multi_mint.js +++ b/CLI/commands/multi_mint.js @@ -161,7 +161,7 @@ function readFile() { } } let mintMultiAction = securityToken.methods.mintMulti(affiliatesVerifiedArray, tokensVerifiedArray); - let r = await common.sendTransaction(Issuer, mintMultiAction, defaultGasPrice); + let r = await common.sendTransaction(mintMultiAction, {}); console.log(`Batch ${i} - Attempting to send the Minted tokens to affiliates accounts:\n\n`, affiliatesVerifiedArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); console.log("Multi Mint transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); diff --git a/CLI/commands/permission_manager.js b/CLI/commands/permission_manager.js index a2165f697..266761046 100644 --- a/CLI/commands/permission_manager.js +++ b/CLI/commands/permission_manager.js @@ -77,7 +77,7 @@ async function addPermissionModule() { if (readlineSync.keyInYNStrict('Do you want to add General Permission Manager Module to your Security Token?')) { let permissionManagerFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.PERMISSION, 'GeneralPermissionManager'); let addModuleAction = securityToken.methods.addModule(permissionManagerFactoryAddress, web3.utils.fromAscii('', 16), 0, 0); - let receipt = await common.sendTransaction(Issuer, addModuleAction, defaultGasPrice); + let receipt = await common.sendTransaction(addModuleAction, {}); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`Module deployed at address: ${event._module}`); generalPermissionManagerAddress = event._module; @@ -119,7 +119,7 @@ async function changePermissionAction(selectedDelegate) { async function deleteDelegate(address) { let deleteDelegateAction = generalPermissionManager.methods.deleteDelegate(address); - await common.sendTransaction(Issuer, deleteDelegateAction, defaultGasPrice, 0, 2); + await common.sendTransaction(deleteDelegateAction, {factor: 2}); } // Helper functions @@ -169,7 +169,7 @@ function isPermissionValid() { async function changePermission(delegate, moduleAddress, permission, isValid) { let changePermissionAction = generalPermissionManager.methods.changePermission(delegate, moduleAddress, web3.utils.asciiToHex(permission), isValid); - let receipt = await common.sendTransaction(Issuer, changePermissionAction, defaultGasPrice, 0, 2); + let receipt = await common.sendTransaction(changePermissionAction, {factor: 2}); common.getEventFromLogs(generalPermissionManager._jsonInterface, receipt.logs, 'ChangePermission'); console.log(`Permission changed succesfully,`); } @@ -210,7 +210,7 @@ async function addNewDelegate() { }); let addPermissionAction = generalPermissionManager.methods.addDelegate(newDelegate, web3.utils.asciiToHex(details)); - let receipt = await common.sendTransaction(Issuer, addPermissionAction, defaultGasPrice); + let receipt = await common.sendTransaction(addPermissionAction, {}); let event = common.getEventFromLogs(generalPermissionManager._jsonInterface, receipt.logs, 'AddDelegate'); console.log(`Delegate added succesfully: ${event._delegate} - ${event._details}`); isNewDelegate = true; diff --git a/CLI/commands/strMigrator.js b/CLI/commands/strMigrator.js index 545455f46..fd50d15eb 100644 --- a/CLI/commands/strMigrator.js +++ b/CLI/commands/strMigrator.js @@ -147,7 +147,7 @@ async function step_register_tickers(tickers, securityTokenRegistry) { console.log(``); try { let modifyTickerAction = securityTokenRegistry.methods.modifyTicker(t.owner, t.ticker, t.name, t.registrationDate, t.expiryDate, false); - let receipt = await common.sendTransaction(Issuer, modifyTickerAction, defaultGasPrice); + let receipt = await common.sendTransaction(modifyTickerAction, {}); totalGas = totalGas.add(new web3.utils.BN(receipt.gasUsed)); succeed.push(t); } catch (error) { @@ -277,7 +277,7 @@ async function step_launch_STs(tokens, securityTokenRegistry) { try { // Deploying 2.0.0 Token let deployTokenAction = STFactory.methods.deployToken(t.name, t.ticker, 18, t.details, Issuer.address, t.divisble, polymathRegistryAddress) - let deployTokenReceipt = await common.sendTransaction(Issuer, deployTokenAction, defaultGasPrice); + let deployTokenReceipt = await common.sendTransaction(deployTokenAction, {}); // Instancing Security Token let newTokenAddress = deployTokenReceipt.logs[deployTokenReceipt.logs.length -1].address; //Last log is the ST creation let newTokenABI = abis.securityToken(); @@ -298,25 +298,25 @@ async function step_launch_STs(tokens, securityTokenRegistry) { new web3.utils.BN(gmtEvent.returnValues._expiryTime), gmtEvent.returnValues._canBuyFromSTO ); - let modifyWhitelistReceipt = await common.sendTransaction(Issuer, modifyWhitelistAction, defaultGasPrice); + let modifyWhitelistReceipt = await common.sendTransaction(modifyWhitelistAction, {}); totalGas = totalGas.add(new web3.utils.BN(modifyWhitelistReceipt.gasUsed)); } // Minting tokens for (const mintedEvent of t.mintedEvents) { let mintAction = newToken.methods.mint(mintedEvent.returnValues.to, new web3.utils.BN(mintedEvent.returnValues.value)); - let mintReceipt = await common.sendTransaction(Issuer, mintAction, defaultGasPrice); + let mintReceipt = await common.sendTransaction(mintAction, {}); totalGas = totalGas.add(new web3.utils.BN(mintReceipt.gasUsed)); } } // Transferring onweship to the original owner let transferOwnershipAction = newToken.methods.transferOwnership(t.owner); - let transferOwnershipReceipt = await common.sendTransaction(Issuer, transferOwnershipAction, defaultGasPrice); + let transferOwnershipReceipt = await common.sendTransaction(transferOwnershipAction, {}); totalGas = totalGas.add(new web3.utils.BN(transferOwnershipReceipt.gasUsed)); // Adding 2.0.0 Security Token to SecurityTokenRegistry let modifySecurityTokenAction = securityTokenRegistry.methods.modifySecurityToken(t.name, t.ticker, t.owner, newTokenAddress, t.details, t.deployedAt); - let modifySecurityTokenReceipt = await common.sendTransaction(Issuer, modifySecurityTokenAction, defaultGasPrice); + let modifySecurityTokenReceipt = await common.sendTransaction(modifySecurityTokenAction, {}); totalGas = totalGas.add(new web3.utils.BN(modifySecurityTokenReceipt.gasUsed)); succeed.push(t); diff --git a/CLI/commands/transfer.js b/CLI/commands/transfer.js index 48fbb79e5..bab524210 100644 --- a/CLI/commands/transfer.js +++ b/CLI/commands/transfer.js @@ -46,7 +46,7 @@ async function transfer() { try{ let transferAction = securityToken.methods.transfer(_transferTo,web3.utils.toWei(_transferAmount,"ether")); - let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice); + let receipt = await common.sendTransaction(transferAction, {}); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'Transfer'); console.log(` Account ${event.from} diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index df06c68f4..952b5dc6d 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -71,7 +71,7 @@ async function start_explorer() { case 'Disable controller': if (readlineSync.keyInYNStrict()) { let disableControllerAction = securityToken.methods.disableController(); - await common.sendTransaction(Issuer, disableControllerAction, defaultGasPrice); + await common.sendTransaction(disableControllerAction, {}); console.log(chalk.green(`Forced transfers have been disabled permanently`)); } break; @@ -84,7 +84,7 @@ async function start_explorer() { defaultInput: Issuer.address }); let setControllerAction = securityToken.methods.setController(controllerAddress); - let setControllerReceipt = await common.sendTransaction(Issuer, setControllerAction, defaultGasPrice); + let setControllerReceipt = await common.sendTransaction(setControllerAction, {}); let setControllerEvent = common.getEventFromLogs(securityToken._jsonInterface, setControllerReceipt.logs, 'SetController'); console.log(chalk.green(`New controller is ${setControllerEvent._newController}`)); break; @@ -114,7 +114,7 @@ async function start_explorer() { let data = readlineSync.question('Enter the data to indicate validation: '); let log = readlineSync.question('Enter the data attached to the transfer by controller to emit in event: '); let forceTransferAction = securityToken.methods.forceTransfer(from, to, web3.utils.toWei(amount), web3.utils.asciiToHex(data), web3.utils.asciiToHex(log)); - let forceTransferReceipt = await common.sendTransaction(Issuer, forceTransferAction, defaultGasPrice, 0, 1.5); + let forceTransferReceipt = await common.sendTransaction(forceTransferAction, {factor: 1.5}); let forceTransferEvent = common.getEventFromLogs(securityToken._jsonInterface, forceTransferReceipt.logs, 'ForceTransfer'); console.log(chalk.green(` ${forceTransferEvent._controller} has successfully forced a transfer of ${web3.utils.fromWei(forceTransferEvent._value)} ${tokenSymbol} from ${forceTransferEvent._from} to ${forceTransferEvent._to} diff --git a/CLI/commands/transfer_ownership.js b/CLI/commands/transfer_ownership.js index 68ca7eb7a..7712ad70f 100644 --- a/CLI/commands/transfer_ownership.js +++ b/CLI/commands/transfer_ownership.js @@ -28,7 +28,7 @@ async function transferOwnership(transferTo) { console.log(chalk.red(`You are not the current owner ot this contract. Current owner is ${currentOwner}.`)); } else { let transferOwnershipAction = contract.methods.transferOwnership(transferTo); - let receipt = await common.sendTransaction(Issuer, transferOwnershipAction, defaultGasPrice); + let receipt = await common.sendTransaction(transferOwnershipAction, {}); let event = common.getEventFromLogs(contract._jsonInterface, receipt.logs, 'OwnershipTransferred'); console.log(chalk.green(`Ownership transferred successfully. New owner is ${event.newOwner}`)); } diff --git a/CLI/commands/whitelist.js b/CLI/commands/whitelist.js index 4750adffa..395fd9d77 100644 --- a/CLI/commands/whitelist.js +++ b/CLI/commands/whitelist.js @@ -167,7 +167,7 @@ async function setInvestors() { //toTimes is ability to buy coins TOwards your account (3rd row in csv, 3rd parameter in modifyWhiteList() ) //expiryTime is time at which KYC of investor get expired (4th row in csv, 4rd parameter in modifyWhiteList() ) let modifyWhitelistMultiAction = generalTransferManager.methods.modifyWhitelistMulti(investorArray, fromTimesArray, toTimesArray, expiryTimeArray, canBuyFromSTOArray); - let r = await common.sendTransaction(Issuer, modifyWhitelistMultiAction, defaultGasPrice); + let r = await common.sendTransaction(modifyWhitelistMultiAction, {}); console.log(`Batch ${i} - Attempting to modifyWhitelist accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); console.log("Whitelist transaxction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); From 9b3386ecd3b10268df28da3780f02049efeccd56 Mon Sep 17 00:00:00 2001 From: Federico Elgarte Date: Fri, 26 Oct 2018 13:30:51 -0300 Subject: [PATCH 013/139] [WIP] new ascii logo --- CLI/commands/common/common_functions.js | 53 ++++++++++--------------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/CLI/commands/common/common_functions.js b/CLI/commands/common/common_functions.js index bb9d7c3fc..a2e96286b 100644 --- a/CLI/commands/common/common_functions.js +++ b/CLI/commands/common/common_functions.js @@ -71,40 +71,29 @@ module.exports = { return (days + " days, " + hrs + " Hrs, " + mnts + " Minutes, " + seconds + " Seconds"); }, logAsciiBull: function() { - console.log(` -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(@(&&@@@@@@@@@@@@@@@@@@@@@@@@@@(((@&&&&(/@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(#(((((((#%%%#@@@@@@@@@@@@@@@@@@@@%##(((/@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(%(((((((((((#%%%%%@#@@@@@@@@@@@@(&#####@@@@@@@@%& -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&#((((((((((((((##%%%%%%%&&&%%##@%#####%(@@@@@@@#%#& -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(%((((((((((((((((((###%%%%%((#####%%%####@@@@@@@###((@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(#(((((((((((((((((((((####%%%#((((######%&%@@(##&###(@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(#((((((((((((((((((((((((####%%#(((((((#((((((((((((#(@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(%(((((((((((((((((((((((((((######%(((((((((((((#&(/@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&#(((((((((((((((((((((((((((((((###############(##%%#@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(#((((##############(((((((((((((((((###################%@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@(&#((#(##################((((((((((((((((((##%%##############@@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@/%#(((((((##%((((##############((((((((((((((((((##%%#############%%@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@((((((((((###%%((((((##########(((((((((((((((((((#%%%############%%%#@@@@@@@@@ -@@@@@@@@@@@@@@@@@@%((((((((((####%%%((((((((#######(((((((((((####(((((@%%############%%%#@@@@@@@@@ -@@@@@@@@@####%%%%%#(((((((((#####%%%%(((((((((((###((((#######(((((((((&@@(&#########%%%%&@@@@@@@@@ -@@@@@@@@&(((#####%###(((((((#####%%%%%((((((((####%%%%%%%%&%@%#((((((((@@@@@@(#(####%%%%%%@@@@@@@@@ -@@@@@@@&(((@@@@@@@####(((((######%%%%%%##&########%%%%%#@@@@###(((((#(@@@@@@@@@@@###%%#@@@@@@@@@@@@ -@@@#%&%(((@@@@@@@@#####(((#######%%%%@@@@@@@@@@@((##@@@@@@@@%###((((/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@#%%&%#@@@@@@@@@@############%%%%@@@@@@@@@@@@@@@@@@@@(@&&&&#####(#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@@#%%%%%#((%%%%%%#@@@@@@@@@@@@@@@@@@@@(####%((((%#(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@@&%%%#((((((%%&@@@@@@@@@@@@@@@@@@@@@@###%%#((@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@%%%%((((((((& @@@@@@@@@@@@@@@@@@@@@@@%%&%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@%%(((((&#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@&((###@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@#####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@&####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@&&%##@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@&&&%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@%##%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@#%####%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + console.log(` + /######%%, /#( + ##########%%%%%, ,%%%. % + *#############%%%%%##%%%%%%# ## + (################%%%%#####%%%%//###%, + .####################%%%%#########/ + (#########%%############%%%%%%%%%#%%% + ,(%#%%%%%%%%%%%%############%%%%%%%###%%%. + (######%%###%%%%%%%%##############%%%%%####%%%* + /#######%%%%######%%%%##########%###,.%######%%%( + #%%%%%#######%%%%%%###########%%%%%*###### /####%%%# + #. ,%%####%%%%%%%(/#%%%%%%%%( #%#### ,#%/ + *#%( .%%%##%%%%%% .%%%#* + .%%%%#%%%% .%%%###( + %%%#####% (%%. + #%###(, + *#%# + %%# + * + &% + %%%. `); }, - //sendTransaction: async function (from, action, gasPrice, value, factor) { sendTransaction: async function (action, options) { await checkPermissions(action); From 76af0abacc3feb97f26fc19c1c51e7a7f4e40d4a Mon Sep 17 00:00:00 2001 From: Pablo Ruiz Date: Mon, 5 Nov 2018 13:06:45 +0100 Subject: [PATCH 014/139] Changed PolyToken Kovan address --- migrations/2_deploy_contracts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index 0994e249e..694fdf03e 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -59,7 +59,7 @@ module.exports = function (deployer, network, accounts) { } else if (network === 'kovan') { web3 = new Web3(new Web3.providers.HttpProvider('https://kovan.infura.io/g5xfoQ0jFSE9S5LwM1Ei')) PolymathAccount = accounts[0] - PolyToken = '0xb06d72a24df50d4e2cac133b320c5e7de3ef94cb' // PolyToken Kovan Faucet Address + PolyToken = '0xb347b9f5b56b431b2cf4e1d90a5995f7519ca792' // PolyToken Kovan Faucet Address POLYOracle = '0x461d98EF2A0c7Ac1416EF065840fF5d4C946206C' // Poly Oracle Kovan Address ETHOracle = '0xCE5551FC9d43E9D2CC255139169FC889352405C8' // ETH Oracle Kovan Address } else if (network === 'mainnet') { From 1f07bff5a723c559fd747bb208ca79bbf24d8c88 Mon Sep 17 00:00:00 2001 From: Federico Elgarte Date: Mon, 5 Nov 2018 12:14:51 -0300 Subject: [PATCH 015/139] [WIP] Moving constants to a single file --- CLI/commands/ST20Generator.js | 16 ++------ CLI/commands/common/constants.js | 29 ++++++++++++++ CLI/commands/common/global.js | 64 +++++++++++++++--------------- CLI/commands/contract_manager.js | 10 +---- CLI/commands/dividends_manager.js | 20 +--------- CLI/commands/permission_manager.js | 14 ++----- 6 files changed, 72 insertions(+), 81 deletions(-) create mode 100644 CLI/commands/common/constants.js diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index ccf648c3c..a68bfda66 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -16,14 +16,6 @@ let tokenName; let tokenSymbol; let selectedSTO; -const MODULES_TYPES = { - PERMISSION: 1, - TRANSFER: 2, - STO: 3, - DIVIDENDS: 4, - BURN: 5 -} - const cappedSTOFee = 20000; const usdTieredSTOFee = 100000; const tokenDetails = ""; @@ -192,7 +184,7 @@ async function step_token_deploy(){ } async function step_Wallet_Issuance(){ - let result = await securityToken.methods.getModulesByType(MODULES_TYPES.STO).call(); + let result = await securityToken.methods.getModulesByType(global.constants.MODULES_TYPES.STO).call(); if (result.length > 0) { console.log('\x1b[32m%s\x1b[0m',"STO has already been created at address " + result[0] + ". Skipping initial minting"); } else { @@ -271,7 +263,7 @@ async function step_STO_launch() { console.log("\n"); console.log('\x1b[34m%s\x1b[0m',"Token Creation - STO Configuration"); - let result = await securityToken.methods.getModulesByType(MODULES_TYPES.STO).call(); + let result = await securityToken.methods.getModulesByType(global.constants.MODULES_TYPES.STO).call(); if (result.length > 0) { STO_Address = result[0]; let stoModuleData = await securityToken.methods.getModule(STO_Address).call(); @@ -438,7 +430,7 @@ async function cappedSTO_launch() { ] }, [startTime, endTime, web3.utils.toWei(cap), rate, raiseType, wallet]); - let cappedSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.STO, "CappedSTO"); + let cappedSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, global.constants.MODULES_TYPES.STO, "CappedSTO"); let addModuleAction = securityToken.methods.addModule(cappedSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); let receipt = await common.sendTransaction(addModuleAction, {}); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); @@ -824,7 +816,7 @@ async function usdTieredSTO_launch() { addresses.usdToken ]); - let usdTieredSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.STO, 'USDTieredSTO'); + let usdTieredSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, global.constants.MODULES_TYPES.STO, 'USDTieredSTO'); let addModuleAction = securityToken.methods.addModule(usdTieredSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); let receipt = await common.sendTransaction(addModuleAction, {}); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); diff --git a/CLI/commands/common/constants.js b/CLI/commands/common/constants.js new file mode 100644 index 000000000..a62fae3e2 --- /dev/null +++ b/CLI/commands/common/constants.js @@ -0,0 +1,29 @@ +module.exports = Object.freeze({ + MODULES_TYPES: { + PERMISSION: 1, + TRANSFER: 2, + STO: 3, + DIVIDENDS: 4, + BURN: 5 + }, + DURATION: { + seconds: function(val) { + return val + }, + minutes: function(val) { + return val * this.seconds(60) + }, + hours: function(val) { + return val * this.minutes(60) + }, + days: function(val) { + return val * this.hours(24) + }, + weeks: function(val) { + return val * this.days(7) + }, + years: function(val) { + return val * this.days(365) + } + } +}); \ No newline at end of file diff --git a/CLI/commands/common/global.js b/CLI/commands/common/global.js index fb898a708..8121f8c65 100644 --- a/CLI/commands/common/global.js +++ b/CLI/commands/common/global.js @@ -1,39 +1,41 @@ const Web3 = require('web3'); +const constants = require('./constants'); function getGasPrice (networkId) { - let gasPrice; - switch (networkId) { - case 1: //Mainnet - gasPrice = 4000000000; - break; - case 3: //Ropsten - gasPrice = 50000000000; - break; - case 15: //Ganache - gasPrice = 50000000000; - break; - case 42: //Kovan - gasPrice = 50000000000; - break; - default: - throw new Error('Network ID not identified'); - } - - return gasPrice; + let gasPrice; + switch (networkId) { + case 1: //Mainnet + gasPrice = 4000000000; + break; + case 3: //Ropsten + gasPrice = 50000000000; + break; + case 15: //Ganache + gasPrice = 50000000000; + break; + case 42: //Kovan + gasPrice = 50000000000; + break; + default: + throw new Error('Network ID not identified'); + } + return gasPrice; } + module.exports = { - initialize: async function (remoteNetwork) { - if (typeof web3 === 'undefined' || typeof Issuer === 'undefined' || typeof defaultGasPrice === 'undefined') { - if (typeof remoteNetwork !== 'undefined') { - web3 = new Web3(new Web3.providers.HttpProvider(`https://${remoteNetwork}.infura.io/`)); - let privKey = require('fs').readFileSync('./privKey').toString(); - Issuer = await web3.eth.accounts.privateKeyToAccount("0x" + privKey); - } else { - web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); - let privKeyLocal = require('fs').readFileSync('./privKeyLocal').toString() - Issuer = await web3.eth.accounts.privateKeyToAccount("0x" + privKeyLocal); - } - defaultGasPrice = getGasPrice(await web3.eth.net.getId()); + initialize: async function (remoteNetwork) { + if (typeof web3 === 'undefined' || typeof Issuer === 'undefined' || typeof defaultGasPrice === 'undefined') { + if (typeof remoteNetwork !== 'undefined') { + web3 = new Web3(new Web3.providers.HttpProvider(`https://${remoteNetwork}.infura.io/`)); + let privKey = require('fs').readFileSync('./privKey').toString(); + Issuer = await web3.eth.accounts.privateKeyToAccount("0x" + privKey); + } else { + web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); + let privKeyLocal = require('fs').readFileSync('./privKeyLocal').toString() + Issuer = await web3.eth.accounts.privateKeyToAccount("0x" + privKeyLocal); } + defaultGasPrice = getGasPrice(await web3.eth.net.getId()); } + }, + constants }; \ No newline at end of file diff --git a/CLI/commands/contract_manager.js b/CLI/commands/contract_manager.js index 9853d6931..ff381a7fa 100644 --- a/CLI/commands/contract_manager.js +++ b/CLI/commands/contract_manager.js @@ -1,11 +1,3 @@ -const duration = { - seconds: function (val) { return val; }, - minutes: function (val) { return val * this.seconds(60); }, - hours: function (val) { return val * this.minutes(60); }, - days: function (val) { return val * this.hours(24); }, - weeks: function (val) { return val * this.days(7); }, - years: function (val) { return val * this.days(365); }, -}; var readlineSync = require('readline-sync'); var chalk = require('chalk'); var common = require('./common/common_functions'); @@ -165,7 +157,7 @@ async function strActions() { case 'Change Expiry Limit': let currentExpiryLimit = await currentContract.methods.getExpiryLimit().call(); console.log(chalk.yellow(`Current expiry limit is ${Math.floor(parseInt(currentExpiryLimit)/60/60/24)} days`)); - let newExpiryLimit = duration.days(readlineSync.questionInt('Enter a new value in days for expiry limit: ')); + let newExpiryLimit = global.constants.DURATION.days(readlineSync.questionInt('Enter a new value in days for expiry limit: ')); let changeExpiryLimitAction = currentContract.methods.changeExpiryLimit(newExpiryLimit); let changeExpiryLimitReceipt = await common.sendTransaction(changeExpiryLimitAction, {}); let changeExpiryLimitEvent = common.getEventFromLogs(currentContract._jsonInterface, changeExpiryLimitReceipt.logs, 'ChangeExpiryLimit'); diff --git a/CLI/commands/dividends_manager.js b/CLI/commands/dividends_manager.js index 917819500..9b1c560ad 100644 --- a/CLI/commands/dividends_manager.js +++ b/CLI/commands/dividends_manager.js @@ -1,11 +1,3 @@ -const duration = { - seconds: function (val) { return val; }, - minutes: function (val) { return val * this.seconds(60); }, - hours: function (val) { return val * this.minutes(60); }, - days: function (val) { return val * this.hours(24); }, - weeks: function (val) { return val * this.days(7); }, - years: function (val) { return val * this.days(365); }, -}; var readlineSync = require('readline-sync'); var chalk = require('chalk'); var moment = require('moment'); @@ -14,14 +6,6 @@ var global = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); -const MODULES_TYPES = { - PERMISSION: 1, - TRANSFER: 2, - STO: 3, - DIVIDENDS: 4, - BURN: 5 -} - // App flow let tokenSymbol; let securityToken; @@ -318,7 +302,7 @@ async function createDividends(name, dividend, checkpointId) { let time = Math.floor(Date.now()/1000); let maturityTime = readlineSync.questionInt('Enter the dividend maturity time from which dividend can be paid (Unix Epoch time)\n(Now = ' + time + ' ): ', {defaultInput: time}); - let defaultTime = time + duration.minutes(10); + let defaultTime = time + global.constants.DURATION.minutes(10); let expiryTime = readlineSync.questionInt('Enter the dividend expiry time (Unix Epoch time)\n(10 minutes from now = ' + defaultTime + ' ): ', {defaultInput: defaultTime}); let useDefaultExcluded = readlineSync.keyInYNStrict(`Do you want to use the default excluded addresses for this dividend? If not, data from 'dividendsExclusions_data.csv' will be used instead.`); @@ -478,7 +462,7 @@ async function addDividendsModule() { dividendsModuleABI = abis.etherDividendCheckpoint(); } - let dividendsFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.DIVIDENDS, dividendsFactoryName); + let dividendsFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, global.constants.MODULES_TYPES.DIVIDENDS, dividendsFactoryName); let addModuleAction = securityToken.methods.addModule(dividendsFactoryAddress, web3.utils.fromAscii('', 16), 0, 0); let receipt = await common.sendTransaction(addModuleAction, {}); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); diff --git a/CLI/commands/permission_manager.js b/CLI/commands/permission_manager.js index 266761046..57c3edb45 100644 --- a/CLI/commands/permission_manager.js +++ b/CLI/commands/permission_manager.js @@ -12,14 +12,6 @@ let securityToken; let generalPermissionManager; let isNewDelegate = false; -const MODULES_TYPES = { - PERMISSION: 1, - TRANSFER: 2, - STO: 3, - DIVIDEND: 4, - BURN: 5 -} - async function executeApp(remoteNetwork) { await global.initialize(remoteNetwork); @@ -75,7 +67,7 @@ async function addPermissionModule() { if (result.length == 0) { console.log(chalk.red(`General Permission Manager is not attached.`)); if (readlineSync.keyInYNStrict('Do you want to add General Permission Manager Module to your Security Token?')) { - let permissionManagerFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.PERMISSION, 'GeneralPermissionManager'); + let permissionManagerFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, global.constants.MODULES_TYPES.PERMISSION, 'GeneralPermissionManager'); let addModuleAction = securityToken.methods.addModule(permissionManagerFactoryAddress, web3.utils.fromAscii('', 16), 0, 0); let receipt = await common.sendTransaction(addModuleAction, {}); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); @@ -221,8 +213,8 @@ async function getModulesWithPermissions() { let modules = []; let moduleABI = abis.moduleInterface(); - for (const type in MODULES_TYPES) { - let modulesAttached = await securityToken.methods.getModulesByType(MODULES_TYPES[type]).call(); + for (const type in global.constants.MODULES_TYPES) { + let modulesAttached = await securityToken.methods.getModulesByType(global.constants.MODULES_TYPES[type]).call(); for (const m of modulesAttached) { let contractTemp = new web3.eth.Contract(moduleABI, m); let permissions = await contractTemp.methods.getPermissions().call(); From 50eecf31445be03f63ee21316ab1ecb6c36d1dc7 Mon Sep 17 00:00:00 2001 From: Federico Elgarte Date: Mon, 5 Nov 2018 13:06:32 -0300 Subject: [PATCH 016/139] [WIP] fund raise type --- CLI/commands/ST20Generator.js | 42 +++++++++++++++----------------- CLI/commands/common/constants.js | 5 ++++ CLI/commands/investor_portal.js | 37 ++++++++++++---------------- 3 files changed, 40 insertions(+), 44 deletions(-) diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index a68bfda66..58c22ab86 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -19,11 +19,7 @@ let selectedSTO; const cappedSTOFee = 20000; const usdTieredSTOFee = 100000; const tokenDetails = ""; -const FUND_RAISE_TYPES = { - ETH: 0, - POLY: 1, - DAI: 2 -} + //////////////////////// // Artifacts let securityTokenRegistry; @@ -450,14 +446,14 @@ async function cappedSTO_status() { let displayRaiseType; let displayFundsRaised; let displayWalletBalance; - let raiseType = await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES.ETH).call(); + let raiseType = await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES.ETH).call(); if (raiseType) { displayRaiseType = 'ETH'; - displayFundsRaised = await currentSTO.methods.fundsRaised(FUND_RAISE_TYPES.ETH).call(); + displayFundsRaised = await currentSTO.methods.fundsRaised(global.constants.FUND_RAISE_TYPES.ETH).call(); displayWalletBalance = web3.utils.fromWei(await web3.eth.getBalance(displayWallet)); } else { displayRaiseType = 'POLY'; - displayFundsRaised = await currentSTO.methods.fundsRaised(FUND_RAISE_TYPES.POLY).call(); + displayFundsRaised = await currentSTO.methods.fundsRaised(global.constants.FUND_RAISE_TYPES.POLY).call(); displayWalletBalance = await currentBalance(displayWallet); } let displayTokensSold = await currentSTO.methods.totalTokensSold().call(); @@ -517,16 +513,16 @@ function fundingConfigUSDTieredSTO() { funding.raiseType = []; if (selectedFunding.includes('E')) { - funding.raiseType.push(FUND_RAISE_TYPES.ETH); + funding.raiseType.push(global.constants.FUND_RAISE_TYPES.ETH); } if (selectedFunding.includes('P')) { - funding.raiseType.push(FUND_RAISE_TYPES.POLY); + funding.raiseType.push(global.constants.FUND_RAISE_TYPES.POLY); } if (selectedFunding.includes('D')) { - funding.raiseType.push(FUND_RAISE_TYPES.DAI); + funding.raiseType.push(global.constants.FUND_RAISE_TYPES.DAI); } if (funding.raiseType.length == 0) { - funding.raiseType = [FUND_RAISE_TYPES.ETH, FUND_RAISE_TYPES.POLY, FUND_RAISE_TYPES.DAI]; + funding.raiseType = [global.constants.FUND_RAISE_TYPES.ETH, global.constants.FUND_RAISE_TYPES.POLY, global.constants.FUND_RAISE_TYPES.DAI]; } return funding; @@ -756,8 +752,8 @@ async function usdTieredSTO_launch() { } let funding = fundingConfigUSDTieredSTO(); - let addresses = addressesConfigUSDTieredSTO(funding.raiseType.includes(FUND_RAISE_TYPES.DAI)); - let tiers = tiersConfigUSDTieredSTO(funding.raiseType.includes(FUND_RAISE_TYPES.POLY)); + let addresses = addressesConfigUSDTieredSTO(funding.raiseType.includes(global.constants.FUND_RAISE_TYPES.DAI)); + let tiers = tiersConfigUSDTieredSTO(funding.raiseType.includes(global.constants.FUND_RAISE_TYPES.POLY)); let limits = limitsConfigUSDTieredSTO(); let times = timesConfigUSDTieredSTO(); let bytesSTO = web3.eth.abi.encodeFunctionCall( { @@ -843,8 +839,8 @@ async function usdTieredSTO_status() { let tiersLength = await currentSTO.methods.getNumberOfTiers().call();; let raiseTypes = []; - for (const fundType in FUND_RAISE_TYPES) { - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES[fundType]).call()) { + for (const fundType in global.constants.FUND_RAISE_TYPES) { + if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES[fundType]).call()) { raiseTypes.push(fundType); } } @@ -873,7 +869,7 @@ async function usdTieredSTO_status() { } } - let mintedPerTier = await currentSTO.methods.mintedPerTier(FUND_RAISE_TYPES[type], t).call(); + let mintedPerTier = await currentSTO.methods.mintedPerTier(global.constants.FUND_RAISE_TYPES[type], t).call(); displayMintedPerTierPerType += ` Sold for ${type}:\t\t ${web3.utils.fromWei(mintedPerTier)} ${displayTokenSymbol} ${displayDiscountMinted}`; } @@ -898,23 +894,23 @@ async function usdTieredSTO_status() { for (const type of raiseTypes) { let balance = await getBalance(displayWallet, type); let walletBalance = web3.utils.fromWei(balance); - let walletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(FUND_RAISE_TYPES[type], balance).call()); + let walletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(global.constants.FUND_RAISE_TYPES[type], balance).call()); displayWalletBalancePerType += ` Balance ${type}:\t\t ${walletBalance} ${type} (${walletBalanceUSD} USD)`; balance = await getBalance(displayReserveWallet, type); let reserveWalletBalance = web3.utils.fromWei(balance); - let reserveWalletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(FUND_RAISE_TYPES[type], balance).call()); + let reserveWalletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(global.constants.FUND_RAISE_TYPES[type], balance).call()); displayReserveWalletBalancePerType += ` Balance ${type}:\t\t ${reserveWalletBalance} ${type} (${reserveWalletBalanceUSD} USD)`; - let fundsRaised = web3.utils.fromWei(await currentSTO.methods.fundsRaised(FUND_RAISE_TYPES[type]).call()); + let fundsRaised = web3.utils.fromWei(await currentSTO.methods.fundsRaised(global.constants.FUND_RAISE_TYPES[type]).call()); displayFundsRaisedPerType += ` ${type}:\t\t\t ${fundsRaised} ${type}`; //Only show sold for if more than one raise type are allowed if (raiseTypes.length > 1) { - let tokensSoldPerType = web3.utils.fromWei(await currentSTO.methods.getTokensSoldFor(FUND_RAISE_TYPES[type]).call()); + let tokensSoldPerType = web3.utils.fromWei(await currentSTO.methods.getTokensSoldFor(global.constants.FUND_RAISE_TYPES[type]).call()); displayTokensSoldPerType += ` Sold for ${type}:\t\t ${tokensSoldPerType} ${displayTokenSymbol}`; } @@ -1070,13 +1066,13 @@ async function modfifyFunding() { } async function modfifyAddresses() { - let addresses = addressesConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES.DAI).call()); + let addresses = addressesConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES.DAI).call()); let modifyAddressesAction = currentSTO.methods.modifyAddresses(addresses.wallet, addresses.reserveWallet, addresses.usdToken); await common.sendTransaction(modifyAddressesAction, {}); } async function modfifyTiers() { - let tiers = tiersConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES.POLY).call()); + let tiers = tiersConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES.POLY).call()); let modifyTiersAction = currentSTO.methods.modifyTiers( tiers.ratePerTier, tiers.ratePerTierDiscountPoly, diff --git a/CLI/commands/common/constants.js b/CLI/commands/common/constants.js index a62fae3e2..c3e2b796c 100644 --- a/CLI/commands/common/constants.js +++ b/CLI/commands/common/constants.js @@ -25,5 +25,10 @@ module.exports = Object.freeze({ years: function(val) { return val * this.days(365) } + }, + FUND_RAISE_TYPES: { + ETH: 0, + POLY: 1, + DAI: 2 } }); \ No newline at end of file diff --git a/CLI/commands/investor_portal.js b/CLI/commands/investor_portal.js index 5a50bd823..1bd495b04 100644 --- a/CLI/commands/investor_portal.js +++ b/CLI/commands/investor_portal.js @@ -10,11 +10,6 @@ var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); const STO_KEY = 3; -const FUND_RAISE_TYPES = { - ETH: 0, - POLY: 1, - DAI: 2 -} let securityTokenRegistry; let securityToken; @@ -163,13 +158,13 @@ async function showUserInfo(_user) { console.log(` ******************* User Information ******************** - Address: ${_user}`); - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES.POLY)) { + if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES.POLY)) { console.log(` - POLY balance:\t ${await polyBalance(_user)}`); } - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES.ETH)) { + if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES.ETH)) { console.log(` - ETH balance:\t ${web3.utils.fromWei(await web3.eth.getBalance(_user))}`); } - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES.DAI)) { + if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES.DAI)) { console.log(` - DAI balance:\t ${await usdBalance(_user)}`); } } @@ -185,11 +180,11 @@ async function showCappedSTOInfo() { let displayRaiseType; let displayFundsRaised; - for (const fundType in FUND_RAISE_TYPES) { - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES[fundType]).call()) { + for (const fundType in global.constants.FUND_RAISE_TYPES) { + if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES[fundType]).call()) { raiseTypes.push(fundType); displayRaiseType = fundType; - displayFundsRaised = await currentSTO.methods.fundsRaised(FUND_RAISE_TYPES[fundType]).call(); + displayFundsRaised = await currentSTO.methods.fundsRaised(global.constants.FUND_RAISE_TYPES[fundType]).call(); } } @@ -245,9 +240,9 @@ async function showCappedSTOInfo() { async function showUserInfoForUSDTieredSTO() { - for (const fundType in FUND_RAISE_TYPES) { - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES[fundType]).call()) { - let displayInvestorInvested = web3.utils.fromWei(await currentSTO.methods.investorInvested(User.address, FUND_RAISE_TYPES[fundType]).call()); + for (const fundType in global.constants.FUND_RAISE_TYPES) { + if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES[fundType]).call()) { + let displayInvestorInvested = web3.utils.fromWei(await currentSTO.methods.investorInvested(User.address, global.constants.FUND_RAISE_TYPES[fundType]).call()); console.log(` - Invested in ${fundType}:\t ${displayInvestorInvested} ${fundType}`); } } @@ -287,8 +282,8 @@ async function showUSDTieredSTOInfo() { let displayTokenSymbol = await securityToken.methods.symbol().call(); let tiersLength = await currentSTO.methods.getNumberOfTiers().call(); - for (const fundType in FUND_RAISE_TYPES) { - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES[fundType]).call()) { + for (const fundType in global.constants.FUND_RAISE_TYPES) { + if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES[fundType]).call()) { raiseTypes.push(fundType); } } @@ -317,7 +312,7 @@ async function showUSDTieredSTOInfo() { } } - let mintedPerTier = await currentSTO.methods.mintedPerTier(FUND_RAISE_TYPES[type], t).call(); + let mintedPerTier = await currentSTO.methods.mintedPerTier(global.constants.FUND_RAISE_TYPES[type], t).call(); displayMintedPerTierPerType += ` Sold for ${type}:\t\t ${web3.utils.fromWei(mintedPerTier)} ${displayTokenSymbol} ${displayDiscountMinted}`; } @@ -338,13 +333,13 @@ async function showUSDTieredSTOInfo() { let displayFundsRaisedPerType = ''; let displayTokensSoldPerType = ''; for (const type of raiseTypes) { - let fundsRaised = web3.utils.fromWei(await currentSTO.methods.fundsRaised(FUND_RAISE_TYPES[type]).call()); + let fundsRaised = web3.utils.fromWei(await currentSTO.methods.fundsRaised(global.constants.FUND_RAISE_TYPES[type]).call()); displayFundsRaisedPerType += ` ${type}:\t\t\t ${fundsRaised} ${type}`; //Only show sold per raise type is more than one are allowed if (raiseTypes.length > 1) { - let tokensSoldPerType = web3.utils.fromWei(await currentSTO.methods.getTokensSoldFor(FUND_RAISE_TYPES[type]).call()); + let tokensSoldPerType = web3.utils.fromWei(await currentSTO.methods.getTokensSoldFor(global.constants.FUND_RAISE_TYPES[type]).call()); displayTokensSoldPerType += ` Sold for ${type}:\t\t ${tokensSoldPerType} ${displayTokenSymbol}`; } @@ -457,7 +452,7 @@ async function investUsdTieredSTO(currency, amount) { } } else { for (const type of raiseTypes) { - let displayPrice = web3.utils.fromWei(await currentSTO.methods.convertToUSD(FUND_RAISE_TYPES[type], web3.utils.toWei("1")).call()); + let displayPrice = web3.utils.fromWei(await currentSTO.methods.convertToUSD(global.constants.FUND_RAISE_TYPES[type], web3.utils.toWei("1")).call()); console.log(chalk.green(` Current ${type} price:\t\t ${displayPrice} USD`)); } if (raiseTypes.length > 1) { @@ -473,7 +468,7 @@ async function investUsdTieredSTO(currency, amount) { if (typeof amount === 'undefined') { let investorInvestedUSD = web3.utils.fromWei(await currentSTO.methods.investorInvestedUSD(User.address).call()); let minimumInvestmentUSD = await currentSTO.methods.minimumInvestmentUSD().call(); - let minimumInvestmentRaiseType = await currentSTO.methods.convertFromUSD(FUND_RAISE_TYPES[raiseType], minimumInvestmentUSD).call(); + let minimumInvestmentRaiseType = await currentSTO.methods.convertFromUSD(global.constants.FUND_RAISE_TYPES[raiseType], minimumInvestmentUSD).call(); cost = readlineSync.question(chalk.yellow(`Enter the amount of ${raiseType} you would like to invest or press 'Enter' to exit: `), { limit: function(input) { return investorInvestedUSD != 0 || parseInt(input) > parseInt(web3.utils.fromWei(minimumInvestmentRaiseType)); From e0dec6f218e46be12dd808062d757848c24d0569 Mon Sep 17 00:00:00 2001 From: Federico Elgarte Date: Mon, 5 Nov 2018 16:25:59 -0300 Subject: [PATCH 017/139] [WIP] network name --- CLI/commands/ST20Generator.js | 19 ++++++++----------- CLI/commands/common/constants.js | 1 + CLI/commands/common/global.js | 3 ++- CLI/commands/contract_manager.js | 8 ++++---- CLI/commands/dividends_manager.js | 8 ++++---- CLI/commands/faucet.js | 8 ++++---- CLI/commands/investor_portal.js | 8 ++++---- CLI/commands/module_manager.js | 8 ++++---- CLI/commands/permission_manager.js | 8 ++++---- CLI/commands/strMigrator.js | 13 +++++-------- CLI/commands/transfer.js | 8 ++++---- CLI/commands/transfer_manager.js | 8 ++++---- CLI/commands/transfer_ownership.js | 8 ++++---- CLI/polymath-cli.js | 25 ++++++++++++++----------- 14 files changed, 66 insertions(+), 67 deletions(-) diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index 58c22ab86..2bb196cc5 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -33,15 +33,12 @@ let _tokenConfig; let _mintingConfig; let _stoConfig; -let network; - -async function executeApp(tokenConfig, mintingConfig, stoConfig, remoteNetwork) { +async function executeApp(tokenConfig, mintingConfig, stoConfig) { _tokenConfig = tokenConfig; _mintingConfig = mintingConfig; _stoConfig = stoConfig; - network = remoteNetwork; - await global.initialize(remoteNetwork); + await global.initialize(); common.logAsciiBull(); console.log("********************************************"); @@ -247,11 +244,11 @@ async function step_Wallet_Issuance(){ async function multi_mint_tokens() { //await whitelist.startWhitelisting(tokenSymbol); - shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${network}`); + shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${global.constants.NETWORK}`); console.log(chalk.green(`\nCongrats! All the affiliates get succssfully whitelisted, Now its time to Mint the tokens\n`)); console.log(chalk.red(`WARNING: `) + `Please make sure all the addresses that get whitelisted are only eligible to hold or get Security token\n`); - shell.exec(`${__dirname}/scripts//script.sh Multimint ${tokenSymbol} 75 ${network}`); + shell.exec(`${__dirname}/scripts//script.sh Multimint ${tokenSymbol} 75 ${global.constants.NETWORK}`); console.log(chalk.green(`\nHurray!! Tokens get successfully Minted and transferred to token holders`)); } @@ -1008,7 +1005,7 @@ async function usdTieredSTO_configure() { await common.sendTransaction(changeAccreditedAction, {}); break; case 2: - shell.exec(`${__dirname}/scripts/script.sh Accredit ${tokenSymbol} 75 ${network}`); + shell.exec(`${__dirname}/scripts/script.sh Accredit ${tokenSymbol} 75 ${global.constants.NETWORK}`); break; case 3: let account = readlineSync.question('Enter the address to change non accredited limit: '); @@ -1020,7 +1017,7 @@ async function usdTieredSTO_configure() { await common.sendTransaction(changeNonAccreditedLimitAction, {}); break; case 4: - shell.exec(`${__dirname}/scripts/script.sh NonAccreditedLimit ${tokenSymbol} 75 ${network}`); + shell.exec(`${__dirname}/scripts/script.sh NonAccreditedLimit ${tokenSymbol} 75 ${global.constants.NETWORK}`); break; case 5: await modfifyTimes(); @@ -1148,7 +1145,7 @@ async function approvePoly(spender, fee) { } module.exports = { - executeApp: async function(tokenConfig, mintingConfig, stoConfig, remoteNetwork) { - return executeApp(tokenConfig, mintingConfig, stoConfig, remoteNetwork); + executeApp: async function(tokenConfig, mintingConfig, stoConfig) { + return executeApp(tokenConfig, mintingConfig, stoConfig); } } diff --git a/CLI/commands/common/constants.js b/CLI/commands/common/constants.js index c3e2b796c..92050f428 100644 --- a/CLI/commands/common/constants.js +++ b/CLI/commands/common/constants.js @@ -1,4 +1,5 @@ module.exports = Object.freeze({ + NETWORK: undefined, MODULES_TYPES: { PERMISSION: 1, TRANSFER: 2, diff --git a/CLI/commands/common/global.js b/CLI/commands/common/global.js index 8121f8c65..6942b5509 100644 --- a/CLI/commands/common/global.js +++ b/CLI/commands/common/global.js @@ -23,7 +23,8 @@ function getGasPrice (networkId) { } module.exports = { - initialize: async function (remoteNetwork) { + initialize: async function() { + let remoteNetwork = constants.NETWORK; if (typeof web3 === 'undefined' || typeof Issuer === 'undefined' || typeof defaultGasPrice === 'undefined') { if (typeof remoteNetwork !== 'undefined') { web3 = new Web3(new Web3.providers.HttpProvider(`https://${remoteNetwork}.infura.io/`)); diff --git a/CLI/commands/contract_manager.js b/CLI/commands/contract_manager.js index ff381a7fa..27c6c7569 100644 --- a/CLI/commands/contract_manager.js +++ b/CLI/commands/contract_manager.js @@ -8,8 +8,8 @@ var abis = require('./helpers/contract_abis'); // App flow let currentContract = null; -async function executeApp(remoteNetwork) { - await global.initialize(remoteNetwork); +async function executeApp() { + await global.initialize(); common.logAsciiBull(); console.log("*********************************************"); @@ -189,7 +189,7 @@ async function strActions() { } module.exports = { - executeApp: async function(remoteNetwork) { - return executeApp(remoteNetwork); + executeApp: async function() { + return executeApp(); } } \ No newline at end of file diff --git a/CLI/commands/dividends_manager.js b/CLI/commands/dividends_manager.js index 9b1c560ad..0faad11e0 100644 --- a/CLI/commands/dividends_manager.js +++ b/CLI/commands/dividends_manager.js @@ -14,9 +14,9 @@ let securityTokenRegistry; let generalTransferManager; let currentDividendsModule; -async function executeApp(type, remoteNetwork) { +async function executeApp(type) { dividendsType = type; - await global.initialize(remoteNetwork); + await global.initialize(); common.logAsciiBull(); console.log("**********************************************"); @@ -583,7 +583,7 @@ function showExcluded(excluded) { } module.exports = { - executeApp: async function(type, remoteNetwork) { - return executeApp(type, remoteNetwork); + executeApp: async function(type) { + return executeApp(type); } } diff --git a/CLI/commands/faucet.js b/CLI/commands/faucet.js index 6b3d8dde4..69c28f2dd 100644 --- a/CLI/commands/faucet.js +++ b/CLI/commands/faucet.js @@ -11,8 +11,8 @@ var chalk = require('chalk'); let polyToken; let usdToken; -async function executeApp(beneficiary, amount, remoteNetwork) { - await global.initialize(remoteNetwork); +async function executeApp(beneficiary, amount) { + await global.initialize(); console.log("\n"); console.log("***************************") @@ -108,7 +108,7 @@ async function transferTokens(to, amount) { } module.exports = { - executeApp: async function(beneficiary, amount, remoteNetwork) { - return executeApp(beneficiary, amount, remoteNetwork); + executeApp: async function(beneficiary, amount) { + return executeApp(beneficiary, amount); } } \ No newline at end of file diff --git a/CLI/commands/investor_portal.js b/CLI/commands/investor_portal.js index 1bd495b04..b65348b1a 100644 --- a/CLI/commands/investor_portal.js +++ b/CLI/commands/investor_portal.js @@ -34,8 +34,8 @@ let displayCanBuy; let displayValidKYC; // Start Script -async function executeApp(investorAddress, investorPrivKey, symbol, currency, amount, remoteNetwork) { - await global.initialize(remoteNetwork); +async function executeApp(investorAddress, investorPrivKey, symbol, currency, amount) { + await global.initialize(); common.logAsciiBull(); console.log("********************************************"); @@ -559,7 +559,7 @@ function logTokensPurchasedCappedSTO(receipt) { } module.exports = { - executeApp: async function(investorAddress, investorPrivKey, symbol, currency, amount, remoteNetwork) { - return executeApp(investorAddress, investorPrivKey, symbol, currency, amount, remoteNetwork); + executeApp: async function(investorAddress, investorPrivKey, symbol, currency, amount) { + return executeApp(investorAddress, investorPrivKey, symbol, currency, amount); } } diff --git a/CLI/commands/module_manager.js b/CLI/commands/module_manager.js index 1dcc61e72..a4c8ba92d 100644 --- a/CLI/commands/module_manager.js +++ b/CLI/commands/module_manager.js @@ -47,8 +47,8 @@ async function setup() { } // Start function -async function executeApp(remoteNetwork) { - await global.initialize(remoteNetwork); +async function executeApp() { + await global.initialize(); common.logAsciiBull(); console.log(chalk.yellow(`******************************************`)); @@ -441,7 +441,7 @@ async function polyBalance(_user) { } module.exports = { - executeApp: async function(remoteNetwork) { - return executeApp(remoteNetwork); + executeApp: async function() { + return executeApp(); } } diff --git a/CLI/commands/permission_manager.js b/CLI/commands/permission_manager.js index 57c3edb45..c53e80b21 100644 --- a/CLI/commands/permission_manager.js +++ b/CLI/commands/permission_manager.js @@ -12,8 +12,8 @@ let securityToken; let generalPermissionManager; let isNewDelegate = false; -async function executeApp(remoteNetwork) { - await global.initialize(remoteNetwork); +async function executeApp() { + await global.initialize(); common.logAsciiBull(); console.log("***********************************************"); @@ -232,7 +232,7 @@ async function getModulesWithPermissions() { } module.exports = { - executeApp: async function(remoteNetwork) { - return executeApp(remoteNetwork); + executeApp: async function() { + return executeApp(); } } \ No newline at end of file diff --git a/CLI/commands/strMigrator.js b/CLI/commands/strMigrator.js index fd50d15eb..8dbcb6511 100644 --- a/CLI/commands/strMigrator.js +++ b/CLI/commands/strMigrator.js @@ -6,11 +6,8 @@ var contracts = require('./helpers/contract_addresses'); var common = require('./common/common_functions'); var global = require('./common/global'); -let network; - -async function executeApp(toStrAddress, fromTrAddress, fromStrAddress, remoteNetwork) { - network = remoteNetwork; - await global.initialize(remoteNetwork); +async function executeApp(toStrAddress, fromTrAddress, fromStrAddress) { + await global.initialize(); common.logAsciiBull(); console.log("****************************************"); @@ -360,7 +357,7 @@ ${failed.map(ticker => chalk.red(`${ticker.ticker}`)).join('\n')} } async function getABIfromEtherscan(_address) { - let urlDomain = network == 'kovan' ? 'api-kovan' : 'api'; + let urlDomain = global.constants.NETWORK == 'kovan' ? 'api-kovan' : 'api'; const options = { url: `https://${urlDomain}.etherscan.io/api`, qs: { @@ -377,7 +374,7 @@ async function getABIfromEtherscan(_address) { } module.exports = { - executeApp: async function(toStrAddress, fromTrAddress, fromStrAddress, remoteNetwork) { - return executeApp(toStrAddress, fromTrAddress, fromStrAddress, remoteNetwork); + executeApp: async function(toStrAddress, fromTrAddress, fromStrAddress) { + return executeApp(toStrAddress, fromTrAddress, fromStrAddress); } }; \ No newline at end of file diff --git a/CLI/commands/transfer.js b/CLI/commands/transfer.js index bab524210..ac782a919 100644 --- a/CLI/commands/transfer.js +++ b/CLI/commands/transfer.js @@ -14,12 +14,12 @@ let securityToken; //////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// -async function startScript(tokenSymbol, transferTo, transferAmount, remoteNetwork) { +async function startScript(tokenSymbol, transferTo, transferAmount) { _tokenSymbol = tokenSymbol; _transferTo = transferTo; _transferAmount = transferAmount; - await global.initialize(remoteNetwork); + await global.initialize(); try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); @@ -61,7 +61,7 @@ async function transfer() { }; module.exports = { - executeApp: async function(tokenSymbol, transferTo, transferAmount, remoteNetwork) { - return startScript(tokenSymbol, transferTo, transferAmount, remoteNetwork); + executeApp: async function(tokenSymbol, transferTo, transferAmount) { + return startScript(tokenSymbol, transferTo, transferAmount); } } diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 952b5dc6d..0853254cd 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -11,8 +11,8 @@ let tokenSymbol; let securityToken; let securityTokenRegistry; -async function executeApp(remoteNetwork) { - await global.initialize(remoteNetwork); +async function executeApp() { + await global.initialize(); common.logAsciiBull(); console.log("*********************************************"); @@ -138,7 +138,7 @@ async function start_explorer() { } module.exports = { - executeApp: async function(type, remoteNetwork) { - return executeApp(type, remoteNetwork); + executeApp: async function(type) { + return executeApp(type); } } \ No newline at end of file diff --git a/CLI/commands/transfer_ownership.js b/CLI/commands/transfer_ownership.js index 7712ad70f..0f5e634b4 100644 --- a/CLI/commands/transfer_ownership.js +++ b/CLI/commands/transfer_ownership.js @@ -8,8 +8,8 @@ var abis = require('./helpers/contract_abis') let contract; //////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// -async function startScript(contractAddress, transferTo, remoteNetwork) { - await global.initialize(remoteNetwork); +async function startScript(contractAddress, transferTo) { + await global.initialize(); if (!web3.utils.isAddress(contractAddress) || !web3.utils.isAddress(transferTo)) { console.log(chlak.red(`Please enter valid addresses`)); @@ -35,7 +35,7 @@ async function transferOwnership(transferTo) { }; module.exports = { - executeApp: async function(contractAddress, transferTo, remoteNetwork) { - return startScript(contractAddress, transferTo, remoteNetwork); + executeApp: async function(contractAddress, transferTo) { + return startScript(contractAddress, transferTo); } } diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 49f578df0..40b32cae6 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -13,6 +13,7 @@ var contract_manager = require('./commands/contract_manager'); var strMigrator = require('./commands/strMigrator'); var permission_manager = require('./commands/permission_manager'); var program = require('commander'); +var global = require('./commands/common/global'); const yaml = require('js-yaml'); const fs = require('fs'); @@ -36,7 +37,7 @@ program mintingConfig = config.initialMint; stoCofig = config.sto; } - await st20generator.executeApp(tokenConfig, mintingConfig, stoCofig, program.remoteNode); + await st20generator.executeApp(tokenConfig, mintingConfig, stoCofig); }); program @@ -44,7 +45,7 @@ program .alias('f') .description('Poly faucet for local private netwtorks') .action(async function(beneficiary, amount) { - await faucet.executeApp(beneficiary, amount, program.remoteNode); + await faucet.executeApp(beneficiary, amount); }); program @@ -52,7 +53,7 @@ program .alias('i') .description('Participate in any STO you have been whitelisted for') .action(async function(investor, privateKey, symbol, currency, amount) { - await investor_portal.executeApp(investor, privateKey, symbol, currency, amount, program.remoteNode); + await investor_portal.executeApp(investor, privateKey, symbol, currency, amount); }); program @@ -60,7 +61,7 @@ program .alias('mm') .description('View modules attached to a token and their status') .action(async function() { - await module_manager.executeApp(program.remoteNode); + await module_manager.executeApp(); }); program @@ -76,7 +77,7 @@ program .alias('t') .description('Transfer ST tokens to another account') .action(async function(tokenSymbol, transferTo, transferAmount) { - await transfer.executeApp(tokenSymbol, transferTo, transferAmount, program.remoteNode); + await transfer.executeApp(tokenSymbol, transferTo, transferAmount); }); program @@ -84,7 +85,7 @@ program .alias('to') .description('Transfer Ownership of an own contract to another account') .action(async function(contractAddress, transferTo) { - await transfer_ownership.executeApp(contractAddress, transferTo, program.remoteNode); + await transfer_ownership.executeApp(contractAddress, transferTo); }); program @@ -100,7 +101,7 @@ program .alias('dm') .description('Runs dividends_manager') .action(async function(dividendsType) { - await dividends_manager.executeApp(dividendsType, program.remoteNode); + await dividends_manager.executeApp(dividendsType); }); program @@ -108,7 +109,7 @@ program .alias('tm') .description('Runs transfer_manager') .action(async function() { - await transfer_manager.executeApp(program.remoteNode); + await transfer_manager.executeApp(); }); program @@ -116,7 +117,7 @@ program .alias('cm') .description('Runs contract_manager') .action(async function() { - await contract_manager.executeApp(program.remoteNode); + await contract_manager.executeApp(); }); program @@ -140,7 +141,7 @@ program .alias('str') .description('Runs STR Migrator') .action(async function(toStrAddress, fromTrAddress, fromStrAddress) { - await strMigrator.executeApp(toStrAddress, fromTrAddress, fromStrAddress, program.remoteNode); + await strMigrator.executeApp(toStrAddress, fromTrAddress, fromStrAddress); }); program @@ -148,7 +149,7 @@ program .alias('pm') .description('Runs permission_manager') .action(async function() { - await permission_manager.executeApp(program.remoteNode); + await permission_manager.executeApp(); }); program.parse(process.argv); @@ -156,4 +157,6 @@ program.parse(process.argv); if (typeof program.commands.length == 0) { console.error('No command given!'); process.exit(1); +} else { + global.constants.NETWORK = program.remoteNode } \ No newline at end of file From a8da518d6d4579348d7810b4180e27100f732e0f Mon Sep 17 00:00:00 2001 From: Federico Elgarte Date: Tue, 6 Nov 2018 11:05:03 -0300 Subject: [PATCH 018/139] minor fixes --- CLI/commands/ST20Generator.js | 28 ++++++++++++------------ CLI/commands/TickerRollForward.js | 4 ++-- CLI/commands/accredit.js | 2 +- CLI/commands/changeNonAccreditedLimit.js | 2 +- CLI/commands/common/common_functions.js | 12 +++++----- CLI/commands/contract_manager.js | 6 ++--- CLI/commands/dividends_manager.js | 22 +++++++++---------- CLI/commands/faucet.js | 4 ++-- CLI/commands/module_manager.js | 6 ++--- CLI/commands/multi_mint.js | 2 +- CLI/commands/permission_manager.js | 4 ++-- CLI/commands/strMigrator.js | 12 +++++----- CLI/commands/transfer.js | 2 +- CLI/commands/transfer_manager.js | 4 ++-- CLI/commands/transfer_ownership.js | 2 +- CLI/commands/whitelist.js | 2 +- 16 files changed, 58 insertions(+), 56 deletions(-) diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index 2bb196cc5..591b0dae5 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -168,7 +168,7 @@ async function step_token_deploy(){ await approvePoly(securityTokenRegistryAddress, launchFee); let generateSecurityTokenAction = securityTokenRegistry.methods.generateSecurityToken(tokenName, tokenSymbol, tokenDetails, divisibility); - let receipt = await common.sendTransaction(generateSecurityTokenAction, {}); + let receipt = await common.sendTransaction(generateSecurityTokenAction); let event = common.getEventFromLogs(securityTokenRegistry._jsonInterface, receipt.logs, 'NewSecurityToken'); console.log(`Deployed Token at address: ${event._securityTokenAddress}`); let securityTokenABI = abis.securityToken(); @@ -225,7 +225,7 @@ async function step_Wallet_Issuance(){ let generalTransferManagerABI = abis.generalTransferManager(); let generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, generalTransferManagerAddress); let modifyWhitelistAction = generalTransferManager.methods.modifyWhitelist(mintWallet,Math.floor(Date.now()/1000),Math.floor(Date.now()/1000),Math.floor(Date.now()/1000 + 31536000), canBuyFromSTO); - await common.sendTransaction(modifyWhitelistAction, {}); + await common.sendTransaction(modifyWhitelistAction); // Mint tokens if (typeof _mintingConfig !== 'undefined' && _mintingConfig.hasOwnProperty('singleMint') && _mintingConfig.singleMint.hasOwnProperty('tokenAmount')) { @@ -236,7 +236,7 @@ async function step_Wallet_Issuance(){ if (issuerTokens == "") issuerTokens = '500000'; let mintAction = securityToken.methods.mint(mintWallet, web3.utils.toWei(issuerTokens)); - await common.sendTransaction(mintAction, {}); + await common.sendTransaction(mintAction); } } } @@ -425,7 +425,7 @@ async function cappedSTO_launch() { let cappedSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, global.constants.MODULES_TYPES.STO, "CappedSTO"); let addModuleAction = securityToken.methods.addModule(cappedSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); - let receipt = await common.sendTransaction(addModuleAction, {}); + let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`STO deployed at address: ${event._module}`); @@ -811,7 +811,7 @@ async function usdTieredSTO_launch() { let usdTieredSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, global.constants.MODULES_TYPES.STO, 'USDTieredSTO'); let addModuleAction = securityToken.methods.addModule(usdTieredSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); - let receipt = await common.sendTransaction(addModuleAction, {}); + let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`STO deployed at address: ${event._module}`); @@ -989,7 +989,7 @@ async function usdTieredSTO_configure() { if (isVerified == "2") { if (readlineSync.keyInYNStrict()) { let finalizeAction = currentSTO.methods.finalize(); - await common.sendTransaction(finalizeAction, {}); + await common.sendTransaction(finalizeAction); } } else { console.log(chalk.red(`Reserve wallet (${reserveWallet}) is not able to receive remaining tokens. Check if this address is whitelisted.`)); @@ -1002,7 +1002,7 @@ async function usdTieredSTO_configure() { let accredited = [isAccredited]; let changeAccreditedAction = currentSTO.methods.changeAccredited(investors, accredited); // 2 GAS? - await common.sendTransaction(changeAccreditedAction, {}); + await common.sendTransaction(changeAccreditedAction); break; case 2: shell.exec(`${__dirname}/scripts/script.sh Accredit ${tokenSymbol} 75 ${global.constants.NETWORK}`); @@ -1014,7 +1014,7 @@ async function usdTieredSTO_configure() { let limits = [web3.utils.toWei(limit)]; let changeNonAccreditedLimitAction = currentSTO.methods.changeNonAccreditedLimit(accounts, limits); // 2 GAS? - await common.sendTransaction(changeNonAccreditedLimitAction, {}); + await common.sendTransaction(changeNonAccreditedLimitAction); break; case 4: shell.exec(`${__dirname}/scripts/script.sh NonAccreditedLimit ${tokenSymbol} 75 ${global.constants.NETWORK}`); @@ -1047,25 +1047,25 @@ async function usdTieredSTO_configure() { async function modfifyTimes() { let times = timesConfigUSDTieredSTO(); let modifyTimesAction = currentSTO.methods.modifyTimes(times.startTime, times.endTime); - await common.sendTransaction(modifyTimesAction, {}); + await common.sendTransaction(modifyTimesAction); } async function modfifyLimits() { let limits = limitsConfigUSDTieredSTO(); let modifyLimitsAction = currentSTO.methods.modifyLimits(limits.nonAccreditedLimitUSD, limits.minimumInvestmentUSD); - await common.sendTransaction(modifyLimitsAction, {}); + await common.sendTransaction(modifyLimitsAction); } async function modfifyFunding() { let funding = fundingConfigUSDTieredSTO(); let modifyFundingAction = currentSTO.methods.modifyFunding(funding.raiseType); - await common.sendTransaction(modifyFundingAction, {}); + await common.sendTransaction(modifyFundingAction); } async function modfifyAddresses() { let addresses = addressesConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES.DAI).call()); let modifyAddressesAction = currentSTO.methods.modifyAddresses(addresses.wallet, addresses.reserveWallet, addresses.usdToken); - await common.sendTransaction(modifyAddressesAction, {}); + await common.sendTransaction(modifyAddressesAction); } async function modfifyTiers() { @@ -1076,7 +1076,7 @@ async function modfifyTiers() { tiers.tokensPerTier, tiers.tokensPerTierDiscountPoly, ); - await common.sendTransaction(modifyTiersAction, {}); + await common.sendTransaction(modifyTiersAction); } ////////////////////// @@ -1133,7 +1133,7 @@ async function approvePoly(spender, fee) { return true; } else { let approveAction = polyToken.methods.approve(spender, web3.utils.toWei(fee.toString(), "ether")); - await common.sendTransaction(approveAction, {}); + await common.sendTransaction(approveAction); } } else { let requiredBalance = parseInt(requiredAmount) - parseInt(polyBalance); diff --git a/CLI/commands/TickerRollForward.js b/CLI/commands/TickerRollForward.js index c3a3a9062..0c8db13ca 100644 --- a/CLI/commands/TickerRollForward.js +++ b/CLI/commands/TickerRollForward.js @@ -88,7 +88,7 @@ async function registerTickers() { process.exit(0); } else { let approveAction = polyToken.methods.approve(securityTokenRegistryAddress, totalFee); - let receipt = await common.sendTransaction(approveAction, {}); + let receipt = await common.sendTransaction(approveAction); totalGas = totalGas.add(receipt.gasUsed); } @@ -115,7 +115,7 @@ async function registerTickers() { if (valid) { try { let registerTickerAction = securityTokenRegistry.methods.registerTicker(owner, ticker_data[i].symbol, ticker_data[i].name); - let receipt = await common.sendTransaction(registerTickerAction, {}); + let receipt = await common.sendTransaction(registerTickerAction); registered_tickers.push(ticker_data[i]); console.log(ticker_data[i]); totalGas = totalGas.add(receipt.gasUsed); diff --git a/CLI/commands/accredit.js b/CLI/commands/accredit.js index 27d5ec01e..d9a860f28 100644 --- a/CLI/commands/accredit.js +++ b/CLI/commands/accredit.js @@ -130,7 +130,7 @@ async function changeAccredited() { } let changeAccreditedAction = usdTieredSTO.methods.changeAccredited(investorArray, isAccreditedArray); - let r = await common.sendTransaction(changeAccreditedAction, {}); + let r = await common.sendTransaction(changeAccreditedAction); console.log(`Batch ${i} - Attempting to change accredited accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); console.log("Change accredited transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); diff --git a/CLI/commands/changeNonAccreditedLimit.js b/CLI/commands/changeNonAccreditedLimit.js index e6ae47851..9e1aa59bf 100644 --- a/CLI/commands/changeNonAccreditedLimit.js +++ b/CLI/commands/changeNonAccreditedLimit.js @@ -130,7 +130,7 @@ async function changeNonAccreditedLimit() { } let changeNonAccreditedLimitAction = usdTieredSTO.methods.changeNonAccreditedLimit(investorArray, limitArray); - let r = await common.sendTransaction(changeNonAccreditedLimitAction, {}); + let r = await common.sendTransaction(changeNonAccreditedLimitAction); console.log(`Batch ${i} - Attempting to change non accredited limits to accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); console.log("Change accredited transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString()), "Ether"); diff --git a/CLI/commands/common/common_functions.js b/CLI/commands/common/common_functions.js index a2e96286b..123e158cb 100644 --- a/CLI/commands/common/common_functions.js +++ b/CLI/commands/common/common_functions.js @@ -2,7 +2,6 @@ const chalk = require('chalk'); const Tx = require('ethereumjs-tx'); const permissionsList = require('./permissions_list'); const abis = require('../helpers/contract_abis'); -const global = require('global'); async function connect(abi, address) { contractRegistry = new web3.eth.Contract(abi, address); @@ -27,6 +26,9 @@ async function checkPermission(contractName, functionName, contractRegistry) { }; function getFinalOptions(options) { + if (typeof options != "object") { + options = {} + } const defaultOptions = { from: Issuer, gasPrice: defaultGasPrice, @@ -36,7 +38,7 @@ function getFinalOptions(options) { return Object.assign(defaultOptions, options) }; -async function getGas(options, action) { +async function getGasLimit(options, action) { let block = await web3.eth.getBlock("latest"); let networkGasLimit = block.gasLimit; let gas = Math.round(options.factor * (await action.estimateGas({ from: options.from.address, value: options.value}))); @@ -99,9 +101,9 @@ module.exports = { await checkPermissions(action); options = getFinalOptions(options); - let gas = await getGas(options, action); + let gasLimit = await getGasLimit(options, action); - console.log(chalk.black.bgYellowBright(`---- Transaction executed: ${action._method.name} - Gas limit provided: ${gas} ----`)); + console.log(chalk.black.bgYellowBright(`---- Transaction executed: ${action._method.name} - Gas limit provided: ${gasLimit} ----`)); let nonce = await web3.eth.getTransactionCount(options.from.address); let abi = action.encodeABI(); @@ -109,7 +111,7 @@ module.exports = { from: options.from.address, to: action._parent._address, data: abi, - gasLimit: gas, + gasLimit: gasLimit, gasPrice: options.gasPrice, nonce: nonce, value: web3.utils.toHex(options.value) diff --git a/CLI/commands/contract_manager.js b/CLI/commands/contract_manager.js index 27c6c7569..e87d046d7 100644 --- a/CLI/commands/contract_manager.js +++ b/CLI/commands/contract_manager.js @@ -159,7 +159,7 @@ async function strActions() { console.log(chalk.yellow(`Current expiry limit is ${Math.floor(parseInt(currentExpiryLimit)/60/60/24)} days`)); let newExpiryLimit = global.constants.DURATION.days(readlineSync.questionInt('Enter a new value in days for expiry limit: ')); let changeExpiryLimitAction = currentContract.methods.changeExpiryLimit(newExpiryLimit); - let changeExpiryLimitReceipt = await common.sendTransaction(changeExpiryLimitAction, {}); + let changeExpiryLimitReceipt = await common.sendTransaction(changeExpiryLimitAction); let changeExpiryLimitEvent = common.getEventFromLogs(currentContract._jsonInterface, changeExpiryLimitReceipt.logs, 'ChangeExpiryLimit'); console.log(chalk.green(`Expiry limit was changed successfully. New limit is ${Math.floor(parseInt(changeExpiryLimitEvent._newExpiry)/60/60/24)} days\n`)); break; @@ -168,7 +168,7 @@ async function strActions() { console.log(chalk.yellow(`\nCurrent ticker registration fee is ${currentRegFee} POLY`)); let newRegFee = web3.utils.toWei(readlineSync.questionInt('Enter a new value in POLY for ticker registration fee: ').toString()); let changeRegFeeAction = currentContract.methods.changeTickerRegistrationFee(newRegFee); - let changeRegFeeReceipt = await common.sendTransaction(changeRegFeeAction, {}); + let changeRegFeeReceipt = await common.sendTransaction(changeRegFeeAction); let changeRegFeeEvent = common.getEventFromLogs(currentContract._jsonInterface, changeRegFeeReceipt.logs, 'ChangeTickerRegistrationFee'); console.log(chalk.green(`Fee was changed successfully. New fee is ${web3.utils.fromWei(changeRegFeeEvent._newFee)} POLY\n`)); break; @@ -177,7 +177,7 @@ async function strActions() { console.log(chalk.yellow(`\nCurrent ST launch fee is ${currentLaunchFee} POLY`)); let newLaunchFee = web3.utils.toWei(readlineSync.questionInt('Enter a new value in POLY for ST launch fee: ').toString()); let changeLaunchFeeAction = currentContract.methods.changeSecurityLaunchFee(newLaunchFee); - let changeLaunchFeeReceipt = await common.sendTransaction(changeLaunchFeeAction, {}); + let changeLaunchFeeReceipt = await common.sendTransaction(changeLaunchFeeAction); let changeLaunchFeeEvent = common.getEventFromLogs(currentContract._jsonInterface, changeLaunchFeeReceipt.logs, 'ChangeSecurityLaunchFee'); console.log(chalk.green(`Fee was changed successfully. New fee is ${web3.utils.fromWei(changeLaunchFeeEvent._newFee)} POLY\n`)); break; diff --git a/CLI/commands/dividends_manager.js b/CLI/commands/dividends_manager.js index 0faad11e0..0b9d8d379 100644 --- a/CLI/commands/dividends_manager.js +++ b/CLI/commands/dividends_manager.js @@ -113,7 +113,7 @@ async function start_explorer(){ break; case 'Create checkpoint': let createCheckpointAction = securityToken.methods.createCheckpoint(); - await common.sendTransaction(createCheckpointAction, {}); + await common.sendTransaction(createCheckpointAction); break; case 'Set default exclusions for dividends': await setDefaultExclusions(); @@ -183,7 +183,7 @@ async function mintTokens(address, amount){ try { let mintAction = securityToken.methods.mint(address,web3.utils.toWei(amount)); - let receipt = await common.sendTransaction(mintAction, {}); + let receipt = await common.sendTransaction(mintAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'Transfer'); console.log(` Minted ${web3.utils.fromWei(event.value)} tokens @@ -244,7 +244,7 @@ async function setDefaultExclusions() { if (readlineSync.keyInYNStrict(`Do you want to continue?`)) { let excluded = getExcludedFromDataFile(); let setDefaultExclusionsActions = currentDividendsModule.methods.setDefaultExcluded(excluded); - let receipt = await common.sendTransaction(setDefaultExclusionsActions, {}); + let receipt = await common.sendTransaction(setDefaultExclusionsActions); let event = common.getEventFromLogs(currentDividendsModule._jsonInterface, receipt.logs, 'SetDefaultExcludedAddresses'); console.log(chalk.green(`Exclusions were successfully set.`)); showExcluded(event._excluded); @@ -274,14 +274,14 @@ async function taxHoldingMenu() { }); let percentageWei = web3.utils.toWei((percentage / 100).toString()); let setWithHoldingFixedAction = currentDividendsModule.methods.setWithholdingFixed([address], percentageWei); - let receipt = await common.sendTransaction(setWithHoldingFixedAction, {}); + let receipt = await common.sendTransaction(setWithHoldingFixedAction); console.log(chalk.green(`Successfully set tax withholding of ${percentage}% for ${address}.`)); break; case 'Withdraw withholding for dividend': let _dividend = await selectDividend({withRemainingWithheld: true}); if (_dividend !== null) { let withdrawWithholdingAction = currentDividendsModule.methods.withdrawWithholding(_dividend.index); - let receipt = await common.sendTransaction(withdrawWithholdingAction, {}); + let receipt = await common.sendTransaction(withdrawWithholdingAction); let eventName; if (dividendsType == 'POLY') { eventName = 'ERC20DividendWithholdingWithdrawn'; @@ -310,7 +310,7 @@ async function createDividends(name, dividend, checkpointId) { let createDividendAction; if (dividendsType == 'POLY') { let approveAction = polyToken.methods.approve(currentDividendsModule._address, web3.utils.toWei(dividend)); - await common.sendTransaction(approveAction, {}); + await common.sendTransaction(approveAction); if (checkpointId > 0) { if (useDefaultExcluded) { createDividendAction = currentDividendsModule.methods.createDividendWithCheckpoint(maturityTime, expiryTime, polyToken._address, web3.utils.toWei(dividend), checkpointId, web3.utils.toHex(name)); @@ -326,7 +326,7 @@ async function createDividends(name, dividend, checkpointId) { createDividendAction = currentDividendsModule.methods.createDividendWithExclusions(maturityTime, expiryTime, polyToken._address, web3.utils.toWei(dividend), excluded, web3.utils.toHex(name)); } } - let receipt = await common.sendTransaction(createDividendAction, {}); + let receipt = await common.sendTransaction(createDividendAction); let event = common.getEventFromLogs(currentDividendsModule._jsonInterface, receipt.logs, 'ERC20DividendDeposited'); console.log(chalk.green(`Dividend ${event._dividendIndex} deposited`)); } else if (dividendsType == 'ETH') { @@ -356,7 +356,7 @@ async function createDividends(name, dividend, checkpointId) { async function pushDividends(dividend, account){ let accs = account.split(','); let pushDividendPaymentToAddressesAction = currentDividendsModule.methods.pushDividendPaymentToAddresses(dividend.index, accs); - let receipt = await common.sendTransaction(pushDividendPaymentToAddressesAction, {}); + let receipt = await common.sendTransaction(pushDividendPaymentToAddressesAction); let successEventName; if (dividendsType == 'POLY') { successEventName = 'ERC20DividendClaimed'; @@ -384,7 +384,7 @@ async function pushDividends(dividend, account){ async function reclaimedDividend(dividend) { let reclaimDividendAction = currentDividendsModule.methods.reclaimDividend(dividend.index); - let receipt = await common.sendTransaction(reclaimDividendAction, {}); + let receipt = await common.sendTransaction(reclaimDividendAction); let eventName; if (dividendsType == 'POLY') { eventName = 'ERC20DividendReclaimed'; @@ -401,7 +401,7 @@ async function reclaimedDividend(dividend) { async function whitelistAddress(address) { let now = Math.floor(Date.now() / 1000); let modifyWhitelistAction = generalTransferManager.methods.modifyWhitelist(address, now, now, now + 31536000, true); - await common.sendTransaction(modifyWhitelistAction, {}); + await common.sendTransaction(modifyWhitelistAction); console.log(chalk.green(`\nWhitelisting successful for ${address}.`)); } @@ -464,7 +464,7 @@ async function addDividendsModule() { let dividendsFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, global.constants.MODULES_TYPES.DIVIDENDS, dividendsFactoryName); let addModuleAction = securityToken.methods.addModule(dividendsFactoryAddress, web3.utils.fromAscii('', 16), 0, 0); - let receipt = await common.sendTransaction(addModuleAction, {}); + let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`Module deployed at address: ${event._module}`); currentDividendsModule = new web3.eth.Contract(dividendsModuleABI, event._module); diff --git a/CLI/commands/faucet.js b/CLI/commands/faucet.js index 69c28f2dd..474cb3a6c 100644 --- a/CLI/commands/faucet.js +++ b/CLI/commands/faucet.js @@ -79,7 +79,7 @@ async function send_poly(beneficiary, amount) { beneficiary = readlineSync.question(`Enter beneficiary 10K USD Tokens ('${Issuer.address}'): `); if (beneficiary == "") beneficiary = Issuer.address; let getTokensAction = usdToken.methods.getTokens(web3.utils.toWei('10000'), beneficiary); - await common.sendTransaction(getTokensAction, {}); + await common.sendTransaction(getTokensAction); let balance = await usdToken.methods.balanceOf(beneficiary).call(); let balanceInPoly = new BigNumber(balance).dividedBy(new BigNumber(10).pow(18)); console.log(chalk.green(`Congratulations! balance of ${beneficiary} address is ${balanceInPoly.toNumber()} USD Tokens`)); @@ -97,7 +97,7 @@ async function send_poly(beneficiary, amount) { async function transferTokens(to, amount) { try { let getTokensAction = polyToken.methods.getTokens(amount, to); - await common.sendTransaction(getTokensAction, {}); + await common.sendTransaction(getTokensAction); } catch (err){ console.log(err.message); return; diff --git a/CLI/commands/module_manager.js b/CLI/commands/module_manager.js index a4c8ba92d..d9b550e63 100644 --- a/CLI/commands/module_manager.js +++ b/CLI/commands/module_manager.js @@ -368,7 +368,7 @@ async function whitelist() { let investor = readlineSync.question(chalk.yellow(`Enter the address to be whitelisted: `)); let now = await latestTime(); let modifyWhitelistAction = generalTransferManager.methods.modifyWhitelist(investor, now, now, now + 31556952, true); - await common.sendTransaction(modifyWhitelistAction, {}); + await common.sendTransaction(modifyWhitelistAction); console.log(chalk.green(`\nWhitelisting successful for ${investor}.`)); } catch (e) { console.log(e); @@ -390,7 +390,7 @@ async function mintTokens() { let _amount = readlineSync.question(chalk.yellow(`Enter the amount of tokens to mint: `)); try { let mintAction = securityToken.methods.mint(_investor, web3.utils.toWei(_amount)); - await common.sendTransaction(mintAction, {}); + await common.sendTransaction(mintAction); console.log(chalk.green(`\nMinting Successful.`)); } catch (e) { console.log(e); @@ -411,7 +411,7 @@ async function freezeMinting() { if (await featureRegistry.methods.getFeatureStatus('freezeMintingAllowed').call()) { let freezeMintingAction = securityToken.methods.freezeMinting(); - await common.sendTransaction(freezeMintingAction, {}); + await common.sendTransaction(freezeMintingAction); console.log(chalk.green(`\nFreeze minting was successful.`)); } else { console.log(chalk.red(`\nFreeze minting is not allowed by Polymath.`)); diff --git a/CLI/commands/multi_mint.js b/CLI/commands/multi_mint.js index 5ade5c386..b138ef849 100644 --- a/CLI/commands/multi_mint.js +++ b/CLI/commands/multi_mint.js @@ -161,7 +161,7 @@ function readFile() { } } let mintMultiAction = securityToken.methods.mintMulti(affiliatesVerifiedArray, tokensVerifiedArray); - let r = await common.sendTransaction(mintMultiAction, {}); + let r = await common.sendTransaction(mintMultiAction); console.log(`Batch ${i} - Attempting to send the Minted tokens to affiliates accounts:\n\n`, affiliatesVerifiedArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); console.log("Multi Mint transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); diff --git a/CLI/commands/permission_manager.js b/CLI/commands/permission_manager.js index c53e80b21..333f7704c 100644 --- a/CLI/commands/permission_manager.js +++ b/CLI/commands/permission_manager.js @@ -69,7 +69,7 @@ async function addPermissionModule() { if (readlineSync.keyInYNStrict('Do you want to add General Permission Manager Module to your Security Token?')) { let permissionManagerFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, global.constants.MODULES_TYPES.PERMISSION, 'GeneralPermissionManager'); let addModuleAction = securityToken.methods.addModule(permissionManagerFactoryAddress, web3.utils.fromAscii('', 16), 0, 0); - let receipt = await common.sendTransaction(addModuleAction, {}); + let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`Module deployed at address: ${event._module}`); generalPermissionManagerAddress = event._module; @@ -202,7 +202,7 @@ async function addNewDelegate() { }); let addPermissionAction = generalPermissionManager.methods.addDelegate(newDelegate, web3.utils.asciiToHex(details)); - let receipt = await common.sendTransaction(addPermissionAction, {}); + let receipt = await common.sendTransaction(addPermissionAction); let event = common.getEventFromLogs(generalPermissionManager._jsonInterface, receipt.logs, 'AddDelegate'); console.log(`Delegate added succesfully: ${event._delegate} - ${event._details}`); isNewDelegate = true; diff --git a/CLI/commands/strMigrator.js b/CLI/commands/strMigrator.js index 8dbcb6511..424313d32 100644 --- a/CLI/commands/strMigrator.js +++ b/CLI/commands/strMigrator.js @@ -144,7 +144,7 @@ async function step_register_tickers(tickers, securityTokenRegistry) { console.log(``); try { let modifyTickerAction = securityTokenRegistry.methods.modifyTicker(t.owner, t.ticker, t.name, t.registrationDate, t.expiryDate, false); - let receipt = await common.sendTransaction(modifyTickerAction, {}); + let receipt = await common.sendTransaction(modifyTickerAction); totalGas = totalGas.add(new web3.utils.BN(receipt.gasUsed)); succeed.push(t); } catch (error) { @@ -274,7 +274,7 @@ async function step_launch_STs(tokens, securityTokenRegistry) { try { // Deploying 2.0.0 Token let deployTokenAction = STFactory.methods.deployToken(t.name, t.ticker, 18, t.details, Issuer.address, t.divisble, polymathRegistryAddress) - let deployTokenReceipt = await common.sendTransaction(deployTokenAction, {}); + let deployTokenReceipt = await common.sendTransaction(deployTokenAction); // Instancing Security Token let newTokenAddress = deployTokenReceipt.logs[deployTokenReceipt.logs.length -1].address; //Last log is the ST creation let newTokenABI = abis.securityToken(); @@ -295,25 +295,25 @@ async function step_launch_STs(tokens, securityTokenRegistry) { new web3.utils.BN(gmtEvent.returnValues._expiryTime), gmtEvent.returnValues._canBuyFromSTO ); - let modifyWhitelistReceipt = await common.sendTransaction(modifyWhitelistAction, {}); + let modifyWhitelistReceipt = await common.sendTransaction(modifyWhitelistAction); totalGas = totalGas.add(new web3.utils.BN(modifyWhitelistReceipt.gasUsed)); } // Minting tokens for (const mintedEvent of t.mintedEvents) { let mintAction = newToken.methods.mint(mintedEvent.returnValues.to, new web3.utils.BN(mintedEvent.returnValues.value)); - let mintReceipt = await common.sendTransaction(mintAction, {}); + let mintReceipt = await common.sendTransaction(mintAction); totalGas = totalGas.add(new web3.utils.BN(mintReceipt.gasUsed)); } } // Transferring onweship to the original owner let transferOwnershipAction = newToken.methods.transferOwnership(t.owner); - let transferOwnershipReceipt = await common.sendTransaction(transferOwnershipAction, {}); + let transferOwnershipReceipt = await common.sendTransaction(transferOwnershipAction); totalGas = totalGas.add(new web3.utils.BN(transferOwnershipReceipt.gasUsed)); // Adding 2.0.0 Security Token to SecurityTokenRegistry let modifySecurityTokenAction = securityTokenRegistry.methods.modifySecurityToken(t.name, t.ticker, t.owner, newTokenAddress, t.details, t.deployedAt); - let modifySecurityTokenReceipt = await common.sendTransaction(modifySecurityTokenAction, {}); + let modifySecurityTokenReceipt = await common.sendTransaction(modifySecurityTokenAction); totalGas = totalGas.add(new web3.utils.BN(modifySecurityTokenReceipt.gasUsed)); succeed.push(t); diff --git a/CLI/commands/transfer.js b/CLI/commands/transfer.js index ac782a919..7a60dfe20 100644 --- a/CLI/commands/transfer.js +++ b/CLI/commands/transfer.js @@ -46,7 +46,7 @@ async function transfer() { try{ let transferAction = securityToken.methods.transfer(_transferTo,web3.utils.toWei(_transferAmount,"ether")); - let receipt = await common.sendTransaction(transferAction, {}); + let receipt = await common.sendTransaction(transferAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'Transfer'); console.log(` Account ${event.from} diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 0853254cd..26598ba4f 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -71,7 +71,7 @@ async function start_explorer() { case 'Disable controller': if (readlineSync.keyInYNStrict()) { let disableControllerAction = securityToken.methods.disableController(); - await common.sendTransaction(disableControllerAction, {}); + await common.sendTransaction(disableControllerAction); console.log(chalk.green(`Forced transfers have been disabled permanently`)); } break; @@ -84,7 +84,7 @@ async function start_explorer() { defaultInput: Issuer.address }); let setControllerAction = securityToken.methods.setController(controllerAddress); - let setControllerReceipt = await common.sendTransaction(setControllerAction, {}); + let setControllerReceipt = await common.sendTransaction(setControllerAction); let setControllerEvent = common.getEventFromLogs(securityToken._jsonInterface, setControllerReceipt.logs, 'SetController'); console.log(chalk.green(`New controller is ${setControllerEvent._newController}`)); break; diff --git a/CLI/commands/transfer_ownership.js b/CLI/commands/transfer_ownership.js index 0f5e634b4..d7a1d4c23 100644 --- a/CLI/commands/transfer_ownership.js +++ b/CLI/commands/transfer_ownership.js @@ -28,7 +28,7 @@ async function transferOwnership(transferTo) { console.log(chalk.red(`You are not the current owner ot this contract. Current owner is ${currentOwner}.`)); } else { let transferOwnershipAction = contract.methods.transferOwnership(transferTo); - let receipt = await common.sendTransaction(transferOwnershipAction, {}); + let receipt = await common.sendTransaction(transferOwnershipAction); let event = common.getEventFromLogs(contract._jsonInterface, receipt.logs, 'OwnershipTransferred'); console.log(chalk.green(`Ownership transferred successfully. New owner is ${event.newOwner}`)); } diff --git a/CLI/commands/whitelist.js b/CLI/commands/whitelist.js index 395fd9d77..5ef201195 100644 --- a/CLI/commands/whitelist.js +++ b/CLI/commands/whitelist.js @@ -167,7 +167,7 @@ async function setInvestors() { //toTimes is ability to buy coins TOwards your account (3rd row in csv, 3rd parameter in modifyWhiteList() ) //expiryTime is time at which KYC of investor get expired (4th row in csv, 4rd parameter in modifyWhiteList() ) let modifyWhitelistMultiAction = generalTransferManager.methods.modifyWhitelistMulti(investorArray, fromTimesArray, toTimesArray, expiryTimeArray, canBuyFromSTOArray); - let r = await common.sendTransaction(modifyWhitelistMultiAction, {}); + let r = await common.sendTransaction(modifyWhitelistMultiAction); console.log(`Batch ${i} - Attempting to modifyWhitelist accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); console.log("Whitelist transaxction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); From 3b5013d652f00ce076ab318bf24527a8f910ba21 Mon Sep 17 00:00:00 2001 From: Federico Elgarte Date: Tue, 6 Nov 2018 13:48:01 -0300 Subject: [PATCH 019/139] rename global to glb (reserved name) and other changes --- CLI/commands/ST20Generator.js | 56 ++++++++++++------------ CLI/commands/TickerRollForward.js | 5 --- CLI/commands/accredit.js | 5 +-- CLI/commands/changeNonAccreditedLimit.js | 5 +-- CLI/commands/common/constants.js | 1 - CLI/commands/common/global.js | 5 ++- CLI/commands/contract_manager.js | 5 +-- CLI/commands/dividends_manager.js | 7 ++- CLI/commands/faucet.js | 2 - CLI/commands/investor_portal.js | 35 +++++++-------- CLI/commands/module_manager.js | 2 - CLI/commands/multi_mint.js | 4 -- CLI/commands/permission_manager.js | 9 ++-- CLI/commands/strMigrator.js | 5 +-- CLI/commands/transfer.js | 3 -- CLI/commands/transfer_manager.js | 3 -- CLI/commands/transfer_ownership.js | 2 - CLI/commands/whitelist.js | 4 -- CLI/polymath-cli.js | 19 ++++++-- 19 files changed, 76 insertions(+), 101 deletions(-) diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index 591b0dae5..9a7ac39b6 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -6,7 +6,7 @@ const shell = require('shelljs'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); var common = require('./common/common_functions'); -var global = require('./common/global'); +var gbl = require('./common/global'); let securityTokenRegistryAddress; @@ -38,8 +38,6 @@ async function executeApp(tokenConfig, mintingConfig, stoConfig) { _mintingConfig = mintingConfig; _stoConfig = stoConfig; - await global.initialize(); - common.logAsciiBull(); console.log("********************************************"); console.log("Welcome to the Command-Line ST-20 Generator."); @@ -177,7 +175,7 @@ async function step_token_deploy(){ } async function step_Wallet_Issuance(){ - let result = await securityToken.methods.getModulesByType(global.constants.MODULES_TYPES.STO).call(); + let result = await securityToken.methods.getModulesByType(gbl.constants.MODULES_TYPES.STO).call(); if (result.length > 0) { console.log('\x1b[32m%s\x1b[0m',"STO has already been created at address " + result[0] + ". Skipping initial minting"); } else { @@ -244,11 +242,11 @@ async function step_Wallet_Issuance(){ async function multi_mint_tokens() { //await whitelist.startWhitelisting(tokenSymbol); - shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${global.constants.NETWORK}`); + shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${gbl.constants.NETWORK}`); console.log(chalk.green(`\nCongrats! All the affiliates get succssfully whitelisted, Now its time to Mint the tokens\n`)); console.log(chalk.red(`WARNING: `) + `Please make sure all the addresses that get whitelisted are only eligible to hold or get Security token\n`); - shell.exec(`${__dirname}/scripts//script.sh Multimint ${tokenSymbol} 75 ${global.constants.NETWORK}`); + shell.exec(`${__dirname}/scripts//script.sh Multimint ${tokenSymbol} 75 ${gbl.constants.NETWORK}`); console.log(chalk.green(`\nHurray!! Tokens get successfully Minted and transferred to token holders`)); } @@ -256,7 +254,7 @@ async function step_STO_launch() { console.log("\n"); console.log('\x1b[34m%s\x1b[0m',"Token Creation - STO Configuration"); - let result = await securityToken.methods.getModulesByType(global.constants.MODULES_TYPES.STO).call(); + let result = await securityToken.methods.getModulesByType(gbl.constants.MODULES_TYPES.STO).call(); if (result.length > 0) { STO_Address = result[0]; let stoModuleData = await securityToken.methods.getModule(STO_Address).call(); @@ -423,7 +421,7 @@ async function cappedSTO_launch() { ] }, [startTime, endTime, web3.utils.toWei(cap), rate, raiseType, wallet]); - let cappedSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, global.constants.MODULES_TYPES.STO, "CappedSTO"); + let cappedSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, gbl.constants.MODULES_TYPES.STO, "CappedSTO"); let addModuleAction = securityToken.methods.addModule(cappedSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); @@ -443,14 +441,14 @@ async function cappedSTO_status() { let displayRaiseType; let displayFundsRaised; let displayWalletBalance; - let raiseType = await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES.ETH).call(); + let raiseType = await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.ETH).call(); if (raiseType) { displayRaiseType = 'ETH'; - displayFundsRaised = await currentSTO.methods.fundsRaised(global.constants.FUND_RAISE_TYPES.ETH).call(); + displayFundsRaised = await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES.ETH).call(); displayWalletBalance = web3.utils.fromWei(await web3.eth.getBalance(displayWallet)); } else { displayRaiseType = 'POLY'; - displayFundsRaised = await currentSTO.methods.fundsRaised(global.constants.FUND_RAISE_TYPES.POLY).call(); + displayFundsRaised = await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES.POLY).call(); displayWalletBalance = await currentBalance(displayWallet); } let displayTokensSold = await currentSTO.methods.totalTokensSold().call(); @@ -510,16 +508,16 @@ function fundingConfigUSDTieredSTO() { funding.raiseType = []; if (selectedFunding.includes('E')) { - funding.raiseType.push(global.constants.FUND_RAISE_TYPES.ETH); + funding.raiseType.push(gbl.constants.FUND_RAISE_TYPES.ETH); } if (selectedFunding.includes('P')) { - funding.raiseType.push(global.constants.FUND_RAISE_TYPES.POLY); + funding.raiseType.push(gbl.constants.FUND_RAISE_TYPES.POLY); } if (selectedFunding.includes('D')) { - funding.raiseType.push(global.constants.FUND_RAISE_TYPES.DAI); + funding.raiseType.push(gbl.constants.FUND_RAISE_TYPES.DAI); } if (funding.raiseType.length == 0) { - funding.raiseType = [global.constants.FUND_RAISE_TYPES.ETH, global.constants.FUND_RAISE_TYPES.POLY, global.constants.FUND_RAISE_TYPES.DAI]; + funding.raiseType = [gbl.constants.FUND_RAISE_TYPES.ETH, gbl.constants.FUND_RAISE_TYPES.POLY, gbl.constants.FUND_RAISE_TYPES.DAI]; } return funding; @@ -749,8 +747,8 @@ async function usdTieredSTO_launch() { } let funding = fundingConfigUSDTieredSTO(); - let addresses = addressesConfigUSDTieredSTO(funding.raiseType.includes(global.constants.FUND_RAISE_TYPES.DAI)); - let tiers = tiersConfigUSDTieredSTO(funding.raiseType.includes(global.constants.FUND_RAISE_TYPES.POLY)); + let addresses = addressesConfigUSDTieredSTO(funding.raiseType.includes(gbl.constants.FUND_RAISE_TYPES.DAI)); + let tiers = tiersConfigUSDTieredSTO(funding.raiseType.includes(gbl.constants.FUND_RAISE_TYPES.POLY)); let limits = limitsConfigUSDTieredSTO(); let times = timesConfigUSDTieredSTO(); let bytesSTO = web3.eth.abi.encodeFunctionCall( { @@ -809,7 +807,7 @@ async function usdTieredSTO_launch() { addresses.usdToken ]); - let usdTieredSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, global.constants.MODULES_TYPES.STO, 'USDTieredSTO'); + let usdTieredSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, gbl.constants.MODULES_TYPES.STO, 'USDTieredSTO'); let addModuleAction = securityToken.methods.addModule(usdTieredSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); @@ -836,8 +834,8 @@ async function usdTieredSTO_status() { let tiersLength = await currentSTO.methods.getNumberOfTiers().call();; let raiseTypes = []; - for (const fundType in global.constants.FUND_RAISE_TYPES) { - if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES[fundType]).call()) { + for (const fundType in gbl.constants.FUND_RAISE_TYPES) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES[fundType]).call()) { raiseTypes.push(fundType); } } @@ -866,7 +864,7 @@ async function usdTieredSTO_status() { } } - let mintedPerTier = await currentSTO.methods.mintedPerTier(global.constants.FUND_RAISE_TYPES[type], t).call(); + let mintedPerTier = await currentSTO.methods.mintedPerTier(gbl.constants.FUND_RAISE_TYPES[type], t).call(); displayMintedPerTierPerType += ` Sold for ${type}:\t\t ${web3.utils.fromWei(mintedPerTier)} ${displayTokenSymbol} ${displayDiscountMinted}`; } @@ -891,23 +889,23 @@ async function usdTieredSTO_status() { for (const type of raiseTypes) { let balance = await getBalance(displayWallet, type); let walletBalance = web3.utils.fromWei(balance); - let walletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(global.constants.FUND_RAISE_TYPES[type], balance).call()); + let walletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(gbl.constants.FUND_RAISE_TYPES[type], balance).call()); displayWalletBalancePerType += ` Balance ${type}:\t\t ${walletBalance} ${type} (${walletBalanceUSD} USD)`; balance = await getBalance(displayReserveWallet, type); let reserveWalletBalance = web3.utils.fromWei(balance); - let reserveWalletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(global.constants.FUND_RAISE_TYPES[type], balance).call()); + let reserveWalletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(gbl.constants.FUND_RAISE_TYPES[type], balance).call()); displayReserveWalletBalancePerType += ` Balance ${type}:\t\t ${reserveWalletBalance} ${type} (${reserveWalletBalanceUSD} USD)`; - let fundsRaised = web3.utils.fromWei(await currentSTO.methods.fundsRaised(global.constants.FUND_RAISE_TYPES[type]).call()); + let fundsRaised = web3.utils.fromWei(await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES[type]).call()); displayFundsRaisedPerType += ` ${type}:\t\t\t ${fundsRaised} ${type}`; //Only show sold for if more than one raise type are allowed if (raiseTypes.length > 1) { - let tokensSoldPerType = web3.utils.fromWei(await currentSTO.methods.getTokensSoldFor(global.constants.FUND_RAISE_TYPES[type]).call()); + let tokensSoldPerType = web3.utils.fromWei(await currentSTO.methods.getTokensSoldFor(gbl.constants.FUND_RAISE_TYPES[type]).call()); displayTokensSoldPerType += ` Sold for ${type}:\t\t ${tokensSoldPerType} ${displayTokenSymbol}`; } @@ -1005,7 +1003,7 @@ async function usdTieredSTO_configure() { await common.sendTransaction(changeAccreditedAction); break; case 2: - shell.exec(`${__dirname}/scripts/script.sh Accredit ${tokenSymbol} 75 ${global.constants.NETWORK}`); + shell.exec(`${__dirname}/scripts/script.sh Accredit ${tokenSymbol} 75 ${gbl.constants.NETWORK}`); break; case 3: let account = readlineSync.question('Enter the address to change non accredited limit: '); @@ -1017,7 +1015,7 @@ async function usdTieredSTO_configure() { await common.sendTransaction(changeNonAccreditedLimitAction); break; case 4: - shell.exec(`${__dirname}/scripts/script.sh NonAccreditedLimit ${tokenSymbol} 75 ${global.constants.NETWORK}`); + shell.exec(`${__dirname}/scripts/script.sh NonAccreditedLimit ${tokenSymbol} 75 ${gbl.constants.NETWORK}`); break; case 5: await modfifyTimes(); @@ -1063,13 +1061,13 @@ async function modfifyFunding() { } async function modfifyAddresses() { - let addresses = addressesConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES.DAI).call()); + let addresses = addressesConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.DAI).call()); let modifyAddressesAction = currentSTO.methods.modifyAddresses(addresses.wallet, addresses.reserveWallet, addresses.usdToken); await common.sendTransaction(modifyAddressesAction); } async function modfifyTiers() { - let tiers = tiersConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES.POLY).call()); + let tiers = tiersConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.POLY).call()); let modifyTiersAction = currentSTO.methods.modifyTiers( tiers.ratePerTier, tiers.ratePerTierDiscountPoly, diff --git a/CLI/commands/TickerRollForward.js b/CLI/commands/TickerRollForward.js index 0c8db13ca..69d36575d 100644 --- a/CLI/commands/TickerRollForward.js +++ b/CLI/commands/TickerRollForward.js @@ -3,15 +3,11 @@ var csv = require('fast-csv'); var BigNumber = require('bignumber.js'); var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); ///////////////////////// ARTIFACTS ///////////////////////// var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); -////////////////////////////USER INPUTS////////////////////////////////////////// -let remoteNetwork = process.argv.slice(2)[0]; //batch size - ///////////////////////// GLOBAL VARS ///////////////////////// let ticker_data = []; let registered_tickers = []; @@ -47,7 +43,6 @@ function FailedRegistration(_ticker, _error) { startScript(); async function startScript() { - await global.initialize(remoteNetwork); securityTokenRegistryAddress = await contracts.securityTokenRegistry(); let securityTokenRegistryABI = abis.securityTokenRegistry(); diff --git a/CLI/commands/accredit.js b/CLI/commands/accredit.js index d9a860f28..43fbac4ae 100644 --- a/CLI/commands/accredit.js +++ b/CLI/commands/accredit.js @@ -3,7 +3,6 @@ var csv = require('fast-csv'); var BigNumber = require('bignumber.js'); var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis') @@ -16,7 +15,6 @@ let usdTieredSTO; let tokenSymbol = process.argv.slice(2)[0]; //token symbol let BATCH_SIZE = process.argv.slice(2)[1]; //batch size if (!BATCH_SIZE) BATCH_SIZE = 75; -let remoteNetwork = process.argv.slice(2)[2]; /////////////////////////GLOBAL VARS////////////////////////////////////////// //distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] @@ -33,8 +31,7 @@ let badData = new Array(); startScript(); async function startScript() { - if (remoteNetwork == 'undefined') remoteNetwork = undefined; - await global.initialize(remoteNetwork); + try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); let securityTokenRegistryABI = abis.securityTokenRegistry(); diff --git a/CLI/commands/changeNonAccreditedLimit.js b/CLI/commands/changeNonAccreditedLimit.js index 9e1aa59bf..8a27036a6 100644 --- a/CLI/commands/changeNonAccreditedLimit.js +++ b/CLI/commands/changeNonAccreditedLimit.js @@ -3,7 +3,6 @@ var csv = require('fast-csv'); var BigNumber = require('bignumber.js'); var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis') @@ -16,7 +15,6 @@ let usdTieredSTO; let tokenSymbol = process.argv.slice(2)[0]; //token symbol let BATCH_SIZE = process.argv.slice(2)[1]; //batch size if (!BATCH_SIZE) BATCH_SIZE = 75; -let remoteNetwork = process.argv.slice(2)[2]; /////////////////////////GLOBAL VARS////////////////////////////////////////// //distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] @@ -33,8 +31,7 @@ let badData = new Array(); startScript(); async function startScript() { - if (remoteNetwork == 'undefined') remoteNetwork = undefined; - await global.initialize(remoteNetwork); + try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); let securityTokenRegistryABI = abis.securityTokenRegistry(); diff --git a/CLI/commands/common/constants.js b/CLI/commands/common/constants.js index 92050f428..c3e2b796c 100644 --- a/CLI/commands/common/constants.js +++ b/CLI/commands/common/constants.js @@ -1,5 +1,4 @@ module.exports = Object.freeze({ - NETWORK: undefined, MODULES_TYPES: { PERMISSION: 1, TRANSFER: 2, diff --git a/CLI/commands/common/global.js b/CLI/commands/common/global.js index 6942b5509..b4aa96607 100644 --- a/CLI/commands/common/global.js +++ b/CLI/commands/common/global.js @@ -1,6 +1,8 @@ const Web3 = require('web3'); const constants = require('./constants'); +global.web3, global.Issuer, global.defaultGasPrice; + function getGasPrice (networkId) { let gasPrice; switch (networkId) { @@ -23,8 +25,7 @@ function getGasPrice (networkId) { } module.exports = { - initialize: async function() { - let remoteNetwork = constants.NETWORK; + initialize: async function(remoteNetwork) { if (typeof web3 === 'undefined' || typeof Issuer === 'undefined' || typeof defaultGasPrice === 'undefined') { if (typeof remoteNetwork !== 'undefined') { web3 = new Web3(new Web3.providers.HttpProvider(`https://${remoteNetwork}.infura.io/`)); diff --git a/CLI/commands/contract_manager.js b/CLI/commands/contract_manager.js index e87d046d7..cce93444e 100644 --- a/CLI/commands/contract_manager.js +++ b/CLI/commands/contract_manager.js @@ -1,7 +1,7 @@ var readlineSync = require('readline-sync'); var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); +var gbl = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); @@ -9,7 +9,6 @@ var abis = require('./helpers/contract_abis'); let currentContract = null; async function executeApp() { - await global.initialize(); common.logAsciiBull(); console.log("*********************************************"); @@ -157,7 +156,7 @@ async function strActions() { case 'Change Expiry Limit': let currentExpiryLimit = await currentContract.methods.getExpiryLimit().call(); console.log(chalk.yellow(`Current expiry limit is ${Math.floor(parseInt(currentExpiryLimit)/60/60/24)} days`)); - let newExpiryLimit = global.constants.DURATION.days(readlineSync.questionInt('Enter a new value in days for expiry limit: ')); + let newExpiryLimit = gbl.constants.DURATION.days(readlineSync.questionInt('Enter a new value in days for expiry limit: ')); let changeExpiryLimitAction = currentContract.methods.changeExpiryLimit(newExpiryLimit); let changeExpiryLimitReceipt = await common.sendTransaction(changeExpiryLimitAction); let changeExpiryLimitEvent = common.getEventFromLogs(currentContract._jsonInterface, changeExpiryLimitReceipt.logs, 'ChangeExpiryLimit'); diff --git a/CLI/commands/dividends_manager.js b/CLI/commands/dividends_manager.js index 0b9d8d379..f47d3fd67 100644 --- a/CLI/commands/dividends_manager.js +++ b/CLI/commands/dividends_manager.js @@ -2,7 +2,7 @@ var readlineSync = require('readline-sync'); var chalk = require('chalk'); var moment = require('moment'); var common = require('./common/common_functions'); -var global = require('./common/global'); +var gbl = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); @@ -16,7 +16,6 @@ let currentDividendsModule; async function executeApp(type) { dividendsType = type; - await global.initialize(); common.logAsciiBull(); console.log("**********************************************"); @@ -302,7 +301,7 @@ async function createDividends(name, dividend, checkpointId) { let time = Math.floor(Date.now()/1000); let maturityTime = readlineSync.questionInt('Enter the dividend maturity time from which dividend can be paid (Unix Epoch time)\n(Now = ' + time + ' ): ', {defaultInput: time}); - let defaultTime = time + global.constants.DURATION.minutes(10); + let defaultTime = time + gbl.constants.DURATION.minutes(10); let expiryTime = readlineSync.questionInt('Enter the dividend expiry time (Unix Epoch time)\n(10 minutes from now = ' + defaultTime + ' ): ', {defaultInput: defaultTime}); let useDefaultExcluded = readlineSync.keyInYNStrict(`Do you want to use the default excluded addresses for this dividend? If not, data from 'dividendsExclusions_data.csv' will be used instead.`); @@ -462,7 +461,7 @@ async function addDividendsModule() { dividendsModuleABI = abis.etherDividendCheckpoint(); } - let dividendsFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, global.constants.MODULES_TYPES.DIVIDENDS, dividendsFactoryName); + let dividendsFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, gbl.constants.MODULES_TYPES.DIVIDENDS, dividendsFactoryName); let addModuleAction = securityToken.methods.addModule(dividendsFactoryAddress, web3.utils.fromAscii('', 16), 0, 0); let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); diff --git a/CLI/commands/faucet.js b/CLI/commands/faucet.js index 474cb3a6c..70eadd57b 100644 --- a/CLI/commands/faucet.js +++ b/CLI/commands/faucet.js @@ -1,7 +1,6 @@ var readlineSync = require('readline-sync'); var BigNumber = require('bignumber.js'); var common = require('./common/common_functions'); -var global = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis') var chalk = require('chalk'); @@ -12,7 +11,6 @@ let polyToken; let usdToken; async function executeApp(beneficiary, amount) { - await global.initialize(); console.log("\n"); console.log("***************************") diff --git a/CLI/commands/investor_portal.js b/CLI/commands/investor_portal.js index b65348b1a..276f8bda3 100644 --- a/CLI/commands/investor_portal.js +++ b/CLI/commands/investor_portal.js @@ -3,7 +3,7 @@ var readlineSync = require('readline-sync'); var BigNumber = require('bignumber.js'); var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); +var gbl = require('./common/global'); // Load Contract artifacts var contracts = require('./helpers/contract_addresses'); @@ -35,7 +35,6 @@ let displayValidKYC; // Start Script async function executeApp(investorAddress, investorPrivKey, symbol, currency, amount) { - await global.initialize(); common.logAsciiBull(); console.log("********************************************"); @@ -158,13 +157,13 @@ async function showUserInfo(_user) { console.log(` ******************* User Information ******************** - Address: ${_user}`); - if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES.POLY)) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.POLY)) { console.log(` - POLY balance:\t ${await polyBalance(_user)}`); } - if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES.ETH)) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.ETH)) { console.log(` - ETH balance:\t ${web3.utils.fromWei(await web3.eth.getBalance(_user))}`); } - if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES.DAI)) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.DAI)) { console.log(` - DAI balance:\t ${await usdBalance(_user)}`); } } @@ -180,11 +179,11 @@ async function showCappedSTOInfo() { let displayRaiseType; let displayFundsRaised; - for (const fundType in global.constants.FUND_RAISE_TYPES) { - if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES[fundType]).call()) { + for (const fundType in gbl.constants.FUND_RAISE_TYPES) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES[fundType]).call()) { raiseTypes.push(fundType); displayRaiseType = fundType; - displayFundsRaised = await currentSTO.methods.fundsRaised(global.constants.FUND_RAISE_TYPES[fundType]).call(); + displayFundsRaised = await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES[fundType]).call(); } } @@ -240,9 +239,9 @@ async function showCappedSTOInfo() { async function showUserInfoForUSDTieredSTO() { - for (const fundType in global.constants.FUND_RAISE_TYPES) { - if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES[fundType]).call()) { - let displayInvestorInvested = web3.utils.fromWei(await currentSTO.methods.investorInvested(User.address, global.constants.FUND_RAISE_TYPES[fundType]).call()); + for (const fundType in gbl.constants.FUND_RAISE_TYPES) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES[fundType]).call()) { + let displayInvestorInvested = web3.utils.fromWei(await currentSTO.methods.investorInvested(User.address, gbl.constants.FUND_RAISE_TYPES[fundType]).call()); console.log(` - Invested in ${fundType}:\t ${displayInvestorInvested} ${fundType}`); } } @@ -282,8 +281,8 @@ async function showUSDTieredSTOInfo() { let displayTokenSymbol = await securityToken.methods.symbol().call(); let tiersLength = await currentSTO.methods.getNumberOfTiers().call(); - for (const fundType in global.constants.FUND_RAISE_TYPES) { - if (await currentSTO.methods.fundRaiseTypes(global.constants.FUND_RAISE_TYPES[fundType]).call()) { + for (const fundType in gbl.constants.FUND_RAISE_TYPES) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES[fundType]).call()) { raiseTypes.push(fundType); } } @@ -312,7 +311,7 @@ async function showUSDTieredSTOInfo() { } } - let mintedPerTier = await currentSTO.methods.mintedPerTier(global.constants.FUND_RAISE_TYPES[type], t).call(); + let mintedPerTier = await currentSTO.methods.mintedPerTier(gbl.constants.FUND_RAISE_TYPES[type], t).call(); displayMintedPerTierPerType += ` Sold for ${type}:\t\t ${web3.utils.fromWei(mintedPerTier)} ${displayTokenSymbol} ${displayDiscountMinted}`; } @@ -333,13 +332,13 @@ async function showUSDTieredSTOInfo() { let displayFundsRaisedPerType = ''; let displayTokensSoldPerType = ''; for (const type of raiseTypes) { - let fundsRaised = web3.utils.fromWei(await currentSTO.methods.fundsRaised(global.constants.FUND_RAISE_TYPES[type]).call()); + let fundsRaised = web3.utils.fromWei(await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES[type]).call()); displayFundsRaisedPerType += ` ${type}:\t\t\t ${fundsRaised} ${type}`; //Only show sold per raise type is more than one are allowed if (raiseTypes.length > 1) { - let tokensSoldPerType = web3.utils.fromWei(await currentSTO.methods.getTokensSoldFor(global.constants.FUND_RAISE_TYPES[type]).call()); + let tokensSoldPerType = web3.utils.fromWei(await currentSTO.methods.getTokensSoldFor(gbl.constants.FUND_RAISE_TYPES[type]).call()); displayTokensSoldPerType += ` Sold for ${type}:\t\t ${tokensSoldPerType} ${displayTokenSymbol}`; } @@ -452,7 +451,7 @@ async function investUsdTieredSTO(currency, amount) { } } else { for (const type of raiseTypes) { - let displayPrice = web3.utils.fromWei(await currentSTO.methods.convertToUSD(global.constants.FUND_RAISE_TYPES[type], web3.utils.toWei("1")).call()); + let displayPrice = web3.utils.fromWei(await currentSTO.methods.convertToUSD(gbl.constants.FUND_RAISE_TYPES[type], web3.utils.toWei("1")).call()); console.log(chalk.green(` Current ${type} price:\t\t ${displayPrice} USD`)); } if (raiseTypes.length > 1) { @@ -468,7 +467,7 @@ async function investUsdTieredSTO(currency, amount) { if (typeof amount === 'undefined') { let investorInvestedUSD = web3.utils.fromWei(await currentSTO.methods.investorInvestedUSD(User.address).call()); let minimumInvestmentUSD = await currentSTO.methods.minimumInvestmentUSD().call(); - let minimumInvestmentRaiseType = await currentSTO.methods.convertFromUSD(global.constants.FUND_RAISE_TYPES[raiseType], minimumInvestmentUSD).call(); + let minimumInvestmentRaiseType = await currentSTO.methods.convertFromUSD(gbl.constants.FUND_RAISE_TYPES[raiseType], minimumInvestmentUSD).call(); cost = readlineSync.question(chalk.yellow(`Enter the amount of ${raiseType} you would like to invest or press 'Enter' to exit: `), { limit: function(input) { return investorInvestedUSD != 0 || parseInt(input) > parseInt(web3.utils.fromWei(minimumInvestmentRaiseType)); diff --git a/CLI/commands/module_manager.js b/CLI/commands/module_manager.js index d9b550e63..53f2a863a 100644 --- a/CLI/commands/module_manager.js +++ b/CLI/commands/module_manager.js @@ -2,7 +2,6 @@ var readlineSync = require('readline-sync'); var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); // Load contract artifacts var contracts = require('./helpers/contract_addresses'); @@ -48,7 +47,6 @@ async function setup() { // Start function async function executeApp() { - await global.initialize(); common.logAsciiBull(); console.log(chalk.yellow(`******************************************`)); diff --git a/CLI/commands/multi_mint.js b/CLI/commands/multi_mint.js index b138ef849..064e51bad 100644 --- a/CLI/commands/multi_mint.js +++ b/CLI/commands/multi_mint.js @@ -3,7 +3,6 @@ var csv = require('fast-csv'); var BigNumber = require('bignumber.js'); const chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); /////////////////////////////ARTIFACTS////////////////////////////////////////// var contracts = require('./helpers/contract_addresses'); @@ -17,7 +16,6 @@ let securityToken; let tokenSymbol = process.argv.slice(2)[0]; //token symbol let BATCH_SIZE = process.argv.slice(2)[1]; //batch size if (!BATCH_SIZE) BATCH_SIZE = 75; -let remoteNetwork = process.argv.slice(2)[2]; /////////////////////////GLOBAL VARS////////////////////////////////////////// @@ -35,8 +33,6 @@ let badData = new Array(); startScript(); async function startScript() { - if (remoteNetwork == 'undefined') remoteNetwork = undefined; - await global.initialize(remoteNetwork); try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); diff --git a/CLI/commands/permission_manager.js b/CLI/commands/permission_manager.js index 333f7704c..9bba9d8b0 100644 --- a/CLI/commands/permission_manager.js +++ b/CLI/commands/permission_manager.js @@ -1,7 +1,7 @@ var readlineSync = require('readline-sync'); var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); +var gbl = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); @@ -13,7 +13,6 @@ let generalPermissionManager; let isNewDelegate = false; async function executeApp() { - await global.initialize(); common.logAsciiBull(); console.log("***********************************************"); @@ -67,7 +66,7 @@ async function addPermissionModule() { if (result.length == 0) { console.log(chalk.red(`General Permission Manager is not attached.`)); if (readlineSync.keyInYNStrict('Do you want to add General Permission Manager Module to your Security Token?')) { - let permissionManagerFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, global.constants.MODULES_TYPES.PERMISSION, 'GeneralPermissionManager'); + let permissionManagerFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, gbl.constants.MODULES_TYPES.PERMISSION, 'GeneralPermissionManager'); let addModuleAction = securityToken.methods.addModule(permissionManagerFactoryAddress, web3.utils.fromAscii('', 16), 0, 0); let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); @@ -213,8 +212,8 @@ async function getModulesWithPermissions() { let modules = []; let moduleABI = abis.moduleInterface(); - for (const type in global.constants.MODULES_TYPES) { - let modulesAttached = await securityToken.methods.getModulesByType(global.constants.MODULES_TYPES[type]).call(); + for (const type in gbl.constants.MODULES_TYPES) { + let modulesAttached = await securityToken.methods.getModulesByType(gbl.constants.MODULES_TYPES[type]).call(); for (const m of modulesAttached) { let contractTemp = new web3.eth.Contract(moduleABI, m); let permissions = await contractTemp.methods.getPermissions().call(); diff --git a/CLI/commands/strMigrator.js b/CLI/commands/strMigrator.js index 424313d32..edc965236 100644 --- a/CLI/commands/strMigrator.js +++ b/CLI/commands/strMigrator.js @@ -4,10 +4,9 @@ var request = require('request-promise') var abis = require('./helpers/contract_abis'); var contracts = require('./helpers/contract_addresses'); var common = require('./common/common_functions'); -var global = require('./common/global'); +var gbl = require('./common/global'); async function executeApp(toStrAddress, fromTrAddress, fromStrAddress) { - await global.initialize(); common.logAsciiBull(); console.log("****************************************"); @@ -357,7 +356,7 @@ ${failed.map(ticker => chalk.red(`${ticker.ticker}`)).join('\n')} } async function getABIfromEtherscan(_address) { - let urlDomain = global.constants.NETWORK == 'kovan' ? 'api-kovan' : 'api'; + let urlDomain = gbl.constants.NETWORK == 'kovan' ? 'api-kovan' : 'api'; const options = { url: `https://${urlDomain}.etherscan.io/api`, qs: { diff --git a/CLI/commands/transfer.js b/CLI/commands/transfer.js index 7a60dfe20..5bd6d1859 100644 --- a/CLI/commands/transfer.js +++ b/CLI/commands/transfer.js @@ -1,5 +1,4 @@ var common = require('./common/common_functions'); -var global = require('./common/global'); /////////////////////////////ARTIFACTS////////////////////////////////////////// var contracts = require('./helpers/contract_addresses'); @@ -19,8 +18,6 @@ async function startScript(tokenSymbol, transferTo, transferAmount) { _transferTo = transferTo; _transferAmount = transferAmount; - await global.initialize(); - try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); let securityTokenRegistryABI = abis.securityTokenRegistry(); diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 26598ba4f..eb5eb1a26 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -1,8 +1,6 @@ var readlineSync = require('readline-sync'); var chalk = require('chalk'); -var moment = require('moment'); var common = require('./common/common_functions'); -var global = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); @@ -12,7 +10,6 @@ let securityToken; let securityTokenRegistry; async function executeApp() { - await global.initialize(); common.logAsciiBull(); console.log("*********************************************"); diff --git a/CLI/commands/transfer_ownership.js b/CLI/commands/transfer_ownership.js index d7a1d4c23..99e12b80f 100644 --- a/CLI/commands/transfer_ownership.js +++ b/CLI/commands/transfer_ownership.js @@ -1,6 +1,5 @@ var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); /////////////////////////////ARTIFACTS////////////////////////////////////////// var abis = require('./helpers/contract_abis') @@ -9,7 +8,6 @@ let contract; //////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// async function startScript(contractAddress, transferTo) { - await global.initialize(); if (!web3.utils.isAddress(contractAddress) || !web3.utils.isAddress(transferTo)) { console.log(chlak.red(`Please enter valid addresses`)); diff --git a/CLI/commands/whitelist.js b/CLI/commands/whitelist.js index 5ef201195..8722d3789 100644 --- a/CLI/commands/whitelist.js +++ b/CLI/commands/whitelist.js @@ -2,7 +2,6 @@ var fs = require('fs'); var csv = require('fast-csv'); var BigNumber = require('bignumber.js'); var common = require('./common/common_functions'); -var global = require('./common/global'); /////////////////////////////ARTIFACTS////////////////////////////////////////// var contracts = require('./helpers/contract_addresses'); @@ -12,7 +11,6 @@ var abis = require('./helpers/contract_abis'); let tokenSymbol = process.argv.slice(2)[0]; //token symbol let BATCH_SIZE = process.argv.slice(2)[1]; //batch size if (!BATCH_SIZE) BATCH_SIZE = 70; -let remoteNetwork = process.argv.slice(2)[2]; /////////////////////////GLOBAL VARS////////////////////////////////////////// @@ -32,8 +30,6 @@ const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); startScript(); async function startScript() { - if (remoteNetwork == 'undefined') remoteNetwork = undefined; - await global.initialize(remoteNetwork); try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 40b32cae6..f802ab4c0 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -13,7 +13,7 @@ var contract_manager = require('./commands/contract_manager'); var strMigrator = require('./commands/strMigrator'); var permission_manager = require('./commands/permission_manager'); var program = require('commander'); -var global = require('./commands/common/global'); +var gbl = require('./commands/common/global'); const yaml = require('js-yaml'); const fs = require('fs'); @@ -37,6 +37,7 @@ program mintingConfig = config.initialMint; stoCofig = config.sto; } + await gbl.initialize(program.remoteNode); await st20generator.executeApp(tokenConfig, mintingConfig, stoCofig); }); @@ -45,6 +46,7 @@ program .alias('f') .description('Poly faucet for local private netwtorks') .action(async function(beneficiary, amount) { + await gbl.initialize(program.remoteNode); await faucet.executeApp(beneficiary, amount); }); @@ -53,6 +55,7 @@ program .alias('i') .description('Participate in any STO you have been whitelisted for') .action(async function(investor, privateKey, symbol, currency, amount) { + await gbl.initialize(program.remoteNode); await investor_portal.executeApp(investor, privateKey, symbol, currency, amount); }); @@ -61,6 +64,7 @@ program .alias('mm') .description('View modules attached to a token and their status') .action(async function() { + await gbl.initialize(program.remoteNode); await module_manager.executeApp(); }); @@ -69,6 +73,7 @@ program .alias('mi') .description('Distribute tokens to previously whitelisted investors') .action(async function(tokenSymbol, batchSize) { + await gbl.initialize(program.remoteNode); shell.exec(`${__dirname}/commands/scripts/script.sh Multimint ${tokenSymbol} ${batchSize} ${program.remoteNode}`);; }); @@ -77,6 +82,7 @@ program .alias('t') .description('Transfer ST tokens to another account') .action(async function(tokenSymbol, transferTo, transferAmount) { + await gbl.initialize(program.remoteNode); await transfer.executeApp(tokenSymbol, transferTo, transferAmount); }); @@ -85,6 +91,7 @@ program .alias('to') .description('Transfer Ownership of an own contract to another account') .action(async function(contractAddress, transferTo) { + await gbl.initialize(program.remoteNode); await transfer_ownership.executeApp(contractAddress, transferTo); }); @@ -93,6 +100,7 @@ program .alias('w') .description('Mass-update a whitelist of allowed/known investors') .action(async function(tokenSymbol, batchSize) { + await gbl.initialize(program.remoteNode); shell.exec(`${__dirname}/commands/scripts/script.sh Whitelist ${tokenSymbol} ${batchSize} ${program.remoteNode}`); }); @@ -101,6 +109,7 @@ program .alias('dm') .description('Runs dividends_manager') .action(async function(dividendsType) { + await gbl.initialize(program.remoteNode); await dividends_manager.executeApp(dividendsType); }); @@ -109,6 +118,7 @@ program .alias('tm') .description('Runs transfer_manager') .action(async function() { + await gbl.initialize(program.remoteNode); await transfer_manager.executeApp(); }); @@ -117,6 +127,7 @@ program .alias('cm') .description('Runs contract_manager') .action(async function() { + await gbl.initialize(program.remoteNode); await contract_manager.executeApp(); }); @@ -125,6 +136,7 @@ program .alias('a') .description('Runs accredit') .action(async function(tokenSymbol, batchSize) { + await gbl.initialize(program.remoteNode); shell.exec(`${__dirname}/commands/scripts/script.sh Accredit ${tokenSymbol} ${batchSize} ${program.remoteNode}`);; }); @@ -133,6 +145,7 @@ program .alias('nal') .description('Runs changeNonAccreditedLimit') .action(async function(tokenSymbol, batchSize) { + await gbl.initialize(program.remoteNode); shell.exec(`${__dirname}/commands/scripts/script.sh NonAccreditedLimit ${tokenSymbol} ${batchSize} ${program.remoteNode}`);; }); @@ -141,6 +154,7 @@ program .alias('str') .description('Runs STR Migrator') .action(async function(toStrAddress, fromTrAddress, fromStrAddress) { + await gbl.initialize(program.remoteNode); await strMigrator.executeApp(toStrAddress, fromTrAddress, fromStrAddress); }); @@ -149,6 +163,7 @@ program .alias('pm') .description('Runs permission_manager') .action(async function() { + await gbl.initialize(program.remoteNode); await permission_manager.executeApp(); }); @@ -157,6 +172,4 @@ program.parse(process.argv); if (typeof program.commands.length == 0) { console.error('No command given!'); process.exit(1); -} else { - global.constants.NETWORK = program.remoteNode } \ No newline at end of file From 4c1f7951b8f61c68f2fa298a4b148be942d3204d Mon Sep 17 00:00:00 2001 From: Polymath Date: Wed, 7 Nov 2018 15:20:31 -0300 Subject: [PATCH 020/139] [CLI] [WIP] print json format --- CLI/commands/permission_manager.js | 31 +++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/CLI/commands/permission_manager.js b/CLI/commands/permission_manager.js index a2165f697..fcb6366a9 100644 --- a/CLI/commands/permission_manager.js +++ b/CLI/commands/permission_manager.js @@ -126,11 +126,13 @@ async function deleteDelegate(address) { async function selectDelegate() { let result; let delegates = await getDelegates(); + let permissions = await getDelegatesAndPermissions(); let options = ['Add new delegate']; options = options.concat(delegates.map(function(d) { return `Account: ${d.address} - Details: ${d.details}` + Details: ${d.details} + Permisions: ${JSON.stringify(permissions[d.address])}` })); let index = readlineSync.keyInSelect(options, 'Select a delegate:', {cancel: false}); @@ -239,6 +241,33 @@ async function getModulesWithPermissions() { return modules; } +async function getDelegatesAndPermissions() { + let moduleABI = abis.moduleInterface(); + let result = []; + for (const type in MODULES_TYPES) { + let modulesAttached = await securityToken.methods.getModulesByType(MODULES_TYPES[type]).call(); + for (const module of modulesAttached) { + let contractTemp = new web3.eth.Contract(moduleABI, module); + let permissions = await contractTemp.methods.getPermissions().call(); + if (permissions.length > 0) { + for (const permission of permissions) { + let allDelegates = await generalPermissionManager.methods.getAllDelegatesWithPerm(module, permission).call(); + let moduleName = web3.utils.hexToUtf8((await securityToken.methods.getModule(module).call())[0]); + let permissionName = web3.utils.hexToUtf8(permission); + for (delegateAddr of allDelegates) { + if (result[delegateAddr] != undefined) { + result[delegateAddr].push({module: moduleName, permission: permissionName}) + } else { + result[delegateAddr] = [{module: moduleName, permission: permissionName}] + } + } + } + } + } + } + return result +} + module.exports = { executeApp: async function(remoteNetwork) { return executeApp(remoteNetwork); From d5478a4a55815079b14f5a0e484d2a006d6bfa66 Mon Sep 17 00:00:00 2001 From: Polymath Date: Wed, 7 Nov 2018 17:10:58 -0300 Subject: [PATCH 021/139] permission table --- CLI/commands/permission_manager.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/CLI/commands/permission_manager.js b/CLI/commands/permission_manager.js index fcb6366a9..4fd649467 100644 --- a/CLI/commands/permission_manager.js +++ b/CLI/commands/permission_manager.js @@ -129,10 +129,13 @@ async function selectDelegate() { let permissions = await getDelegatesAndPermissions(); let options = ['Add new delegate']; + options = options.concat(delegates.map(function(d) { + let perm = renderTable(permissions, d.address); + return `Account: ${d.address} Details: ${d.details} - Permisions: ${JSON.stringify(permissions[d.address])}` + Permisions: ${perm}` })); let index = readlineSync.keyInSelect(options, 'Select a delegate:', {cancel: false}); @@ -268,6 +271,19 @@ async function getDelegatesAndPermissions() { return result } +function renderTable(permisions, address) { + let result = ``; + if (permisions[address] != undefined) { + for (const obj of permisions[address]) { + result += ` + ${obj.module} -> ${obj.permission}`; + } + } else { + result = `-`; + } + return result +} + module.exports = { executeApp: async function(remoteNetwork) { return executeApp(remoteNetwork); From 655bf524a60dddb1c40b37f03cfce29eeee72668 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Wed, 7 Nov 2018 17:47:15 -0300 Subject: [PATCH 022/139] Typo --- CLI/commands/permission_manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLI/commands/permission_manager.js b/CLI/commands/permission_manager.js index 4fd649467..bf96eff66 100644 --- a/CLI/commands/permission_manager.js +++ b/CLI/commands/permission_manager.js @@ -217,7 +217,7 @@ async function addNewDelegate() { let addPermissionAction = generalPermissionManager.methods.addDelegate(newDelegate, web3.utils.asciiToHex(details)); let receipt = await common.sendTransaction(Issuer, addPermissionAction, defaultGasPrice); let event = common.getEventFromLogs(generalPermissionManager._jsonInterface, receipt.logs, 'AddDelegate'); - console.log(`Delegate added succesfully: ${event._delegate} - ${event._details}`); + console.log(`Delegate added succesfully: ${event._delegate} - ${web3.utils.hexToAscii(event._details)}`); isNewDelegate = true; return event._delegate; } From e714e48b11e76e739f0461c80c9e3c829901239a Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 8 Nov 2018 12:39:59 +0530 Subject: [PATCH 023/139] Sanity checks --- contracts/modules/Module.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/modules/Module.sol b/contracts/modules/Module.sol index aa3e6d865..1e27d424e 100644 --- a/contracts/modules/Module.sol +++ b/contracts/modules/Module.sol @@ -25,6 +25,7 @@ contract Module is IModule { * @param _polyAddress Address of the polytoken */ constructor (address _securityToken, address _polyAddress) public { + require(_securityToken != address(0) && _polyAddress != address(0), "Invalid address"); securityToken = _securityToken; factory = msg.sender; polyToken = IERC20(_polyAddress); From dbd0e81bcc8054f026c06eaba8d34e5a78895a57 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 8 Nov 2018 12:40:39 +0530 Subject: [PATCH 024/139] Configure reworked --- contracts/modules/STO/USDTieredSTO.sol | 182 +++++++++++++++---------- 1 file changed, 107 insertions(+), 75 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index 894744451..ace8fcdbb 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -17,6 +17,15 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { ///////////// // Storage // ///////////// + struct Tier { + uint256 rate; + uint256 rateDiscountPoly; + uint256 tokenTotal; + uint256 tokensDiscountPoly; + uint256 mintedTotal; + mapping (uint8 => uint256) minted; //fundtype => minted + uint256 mintedDiscountPoly; + } string public POLY_ORACLE = "PolyUsdOracle"; string public ETH_ORACLE = "EthUsdOracle"; @@ -27,32 +36,35 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { // Determine whether users can invest on behalf of a beneficiary bool public allowBeneficialInvestments = false; + // Whether or not the STO has been finalized + bool public isFinalized; + // Address where ETH, POLY & DAI funds are delivered address public wallet; // Address of issuer reserve wallet for unsold tokens address public reserveWallet; - // How many token units a buyer gets per USD per tier (multiplied by 10**18) - uint256[] public ratePerTier; + // // How many token units a buyer gets per USD per tier (multiplied by 10**18) + // uint256[] public ratePerTier; - // How many token units a buyer gets per USD per tier (multiplied by 10**18) when investing in POLY up to tokensPerTierDiscountPoly - uint256[] public ratePerTierDiscountPoly; + // // How many token units a buyer gets per USD per tier (multiplied by 10**18) when investing in POLY up to tokensPerTierDiscountPoly + // uint256[] public ratePerTierDiscountPoly; - // How many tokens are available in each tier (relative to totalSupply) - uint256[] public tokensPerTierTotal; + // // How many tokens are available in each tier (relative to totalSupply) + // uint256[] public tokensPerTierTotal; - // How many token units are available in each tier (relative to totalSupply) at the ratePerTierDiscountPoly rate - uint256[] public tokensPerTierDiscountPoly; + // // How many token units are available in each tier (relative to totalSupply) at the ratePerTierDiscountPoly rate + // uint256[] public tokensPerTierDiscountPoly; - // How many tokens have been minted in each tier (relative to totalSupply) - uint256[] public mintedPerTierTotal; + // // How many tokens have been minted in each tier (relative to totalSupply) + // uint256[] public mintedPerTierTotal; - // How many tokens have been minted in each tier (relative to totalSupply) for each fund raise type - mapping (uint8 => uint256[]) public mintedPerTier; + // // How many tokens have been minted in each tier (relative to totalSupply) for each fund raise type + // mapping (uint8 => uint256[]) public mintedPerTier; - // How many tokens have been minted in each tier (relative to totalSupply) at discounted POLY rate - uint256[] public mintedPerTierDiscountPoly; + // // How many tokens have been minted in each tier (relative to totalSupply) at discounted POLY rate + // uint256[] public mintedPerTierDiscountPoly; // Current tier uint8 public currentTier; @@ -78,12 +90,12 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { // Minimum investable amount in USD uint256 public minimumInvestmentUSD; - // Whether or not the STO has been finalized - bool public isFinalized; - // Final amount of tokens returned to issuer uint256 public finalAmountReturned; + // Tiers + Tier public tiers; + //////////// // Events // //////////// @@ -108,16 +120,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 _spentValue, uint256 _rate ); - event FundsReceivedPOLY( - address indexed _purchaser, - address indexed _beneficiary, - uint256 _usdAmount, - uint256 _receivedValue, - uint256 _spentValue, - uint256 _rate - ); event ReserveTokenMint(address indexed _owner, address indexed _wallet, uint256 _tokens, uint8 _latestTier); - event SetAddresses( address indexed _wallet, address indexed _reserveWallet, @@ -143,19 +146,19 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { /////////////// modifier validETH { - require(_getOracle(bytes32("ETH"), bytes32("USD")) != address(0), "Invalid ETHUSD Oracle"); - require(fundRaiseTypes[uint8(FundRaiseType.ETH)], "Fund raise in ETH should be allowed"); + require(_getOracle(bytes32("ETH"), bytes32("USD")) != address(0), "Invalid Oracle"); + require(fundRaiseTypes[uint8(FundRaiseType.ETH)], "ETH not allowed"); _; } modifier validPOLY { - require(_getOracle(bytes32("POLY"), bytes32("USD")) != address(0), "Invalid POLYUSD Oracle"); - require(fundRaiseTypes[uint8(FundRaiseType.POLY)], "Fund raise in POLY should be allowed"); + require(_getOracle(bytes32("POLY"), bytes32("USD")) != address(0), "Invalid Oracle"); + require(fundRaiseTypes[uint8(FundRaiseType.POLY)], "POLY not allowed"); _; } modifier validDAI { - require(fundRaiseTypes[uint8(FundRaiseType.DAI)], "Fund raise in DAI should be allowed"); + require(fundRaiseTypes[uint8(FundRaiseType.DAI)], "DAI not allowed"); _; } @@ -164,10 +167,10 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { /////////////////////// constructor (address _securityToken, address _polyAddress, address _factory) public Module(_securityToken, _polyAddress) { + require(_factory != address(0), "Invalid factory"); oracleKeys[bytes32("ETH")][bytes32("USD")] = ETH_ORACLE; oracleKeys[bytes32("POLY")][bytes32("USD")] = POLY_ORACLE; - require(_factory != address(0), "In-valid address"); - factory = _factory; + factory = _factory; //Explicitly setting factory as we are using proxy deployment for this module } /** @@ -197,33 +200,26 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { address _reserveWallet, address _usdToken ) public onlyFactory { - modifyTimes(_startTime, _endTime); - // NB - modifyTiers must come before modifyFunding - modifyTiers(_ratePerTier, _ratePerTierDiscountPoly, _tokensPerTierTotal, _tokensPerTierDiscountPoly); - // NB - modifyFunding must come before modifyAddresses - modifyFunding(_fundRaiseTypes); - modifyAddresses(_wallet, _reserveWallet, _usdToken); - modifyLimits(_nonAccreditedLimitUSD, _minimumInvestmentUSD); + _modifyTimes(_startTime, _endTime); + _modifyTimes(_ratePerTier, _ratePerTierDiscountPoly, _tokensPerTierTotal, _tokensPerTierDiscountPoly); + // NB - _setFundRaiseType must come before modifyAddresses + _setFundRaiseType(_fundRaiseTypes); + _modifyAddresses(_wallet, _reserveWallet, _usdToken); + _modifyLimits(_nonAccreditedLimitUSD, _minimumInvestmentUSD); } - function modifyFunding(FundRaiseType[] _fundRaiseTypes) public onlyFactoryOrOwner { + function modifyFunding(FundRaiseType[] _fundRaiseTypes) external { /*solium-disable-next-line security/no-block-members*/ - require(now < startTime, "STO shouldn't be started"); + require(now < startTime, "STO already started"); _setFundRaiseType(_fundRaiseTypes); - uint256 length = getNumberOfTiers(); - mintedPerTierTotal = new uint256[](length); - mintedPerTierDiscountPoly = new uint256[](length); - for (uint8 i = 0; i < _fundRaiseTypes.length; i++) { - mintedPerTier[uint8(_fundRaiseTypes[i])] = new uint256[](length); - } } function modifyLimits( uint256 _nonAccreditedLimitUSD, uint256 _minimumInvestmentUSD - ) public onlyFactoryOrOwner { + ) external onlyFactoryOrOwner { /*solium-disable-next-line security/no-block-members*/ - require(now < startTime, "STO shouldn't be started"); + require(now < startTime, "STO already started"); minimumInvestmentUSD = _minimumInvestmentUSD; nonAccreditedLimitUSD = _nonAccreditedLimitUSD; emit SetLimits(minimumInvestmentUSD, nonAccreditedLimitUSD); @@ -234,32 +230,70 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256[] _ratePerTierDiscountPoly, uint256[] _tokensPerTierTotal, uint256[] _tokensPerTierDiscountPoly - ) public onlyFactoryOrOwner { + ) external onlyFactoryOrOwner { /*solium-disable-next-line security/no-block-members*/ - require(now < startTime, "STO shouldn't be started"); - require(_tokensPerTierTotal.length > 0, "Length should be > 0"); - require(_ratePerTier.length == _tokensPerTierTotal.length, "Mismatch b/w rates & tokens / tier"); - require(_ratePerTierDiscountPoly.length == _tokensPerTierTotal.length, "Mismatch b/w discount rates & tokens / tier"); - require(_tokensPerTierDiscountPoly.length == _tokensPerTierTotal.length, "Mismatch b/w discount tokens / tier & tokens / tier"); - for (uint8 i = 0; i < _ratePerTier.length; i++) { - require(_ratePerTier[i] > 0, "Rate > 0"); - require(_tokensPerTierTotal[i] > 0, "Tokens per tier > 0"); - require(_tokensPerTierDiscountPoly[i] <= _tokensPerTierTotal[i], "Discounted tokens / tier <= tokens / tier"); - require(_ratePerTierDiscountPoly[i] <= _ratePerTier[i], "Discounted rate / tier <= rate / tier"); - } - ratePerTier = _ratePerTier; - ratePerTierDiscountPoly = _ratePerTierDiscountPoly; - tokensPerTierTotal = _tokensPerTierTotal; - tokensPerTierDiscountPoly = _tokensPerTierDiscountPoly; - emit SetTiers(_ratePerTier, _ratePerTierDiscountPoly, _tokensPerTierTotal, _tokensPerTierDiscountPoly); + require(now < startTime, "STO already started"); + _modifyTiers(_ratePerTier, _ratePerTierDiscountPoly, _tokensPerTierTotal, _tokensPerTierDiscountPoly); } function modifyTimes( uint256 _startTime, uint256 _endTime - ) public onlyFactoryOrOwner { + ) external onlyFactoryOrOwner { + _modifyTimes(_startTime, _endTime); + } + + function modifyAddresses( + address _wallet, + address _reserveWallet, + address _usdToken + ) external onlyFactoryOrOwner { /*solium-disable-next-line security/no-block-members*/ - require((startTime == 0) || (now < startTime), "Invalid startTime"); + require(now < startTime, "STO already started"); + _modifyAddresses(_wallet, _reserveWallet, _usdToken); + } + + function _modifyLimits( + uint256 _nonAccreditedLimitUSD, + uint256 _minimumInvestmentUSD + ) internal { + minimumInvestmentUSD = _minimumInvestmentUSD; + nonAccreditedLimitUSD = _nonAccreditedLimitUSD; + emit SetLimits(minimumInvestmentUSD, nonAccreditedLimitUSD); + } + + function _modifyTiers( + uint256[] _ratePerTier, + uint256[] _ratePerTierDiscountPoly, + uint256[] _tokensPerTierTotal, + uint256[] _tokensPerTierDiscountPoly + ) internal { + require(_tokensPerTierTotal.length > 0, "No tiers provided"); + require(_ratePerTier.length == _tokensPerTierTotal.length && + _ratePerTierDiscountPoly.length == _tokensPerTierTotal.length && + _tokensPerTierDiscountPoly.length == _tokensPerTierTotal.length, + "Tier data length mismatch" + ); + delete tiers; + for (uint256 i = 0; i < _ratePerTier.length; i++) { + require(_ratePerTier[i] > 0, "Invalid rate"); + require(_tokensPerTierTotal[i] > 0, "Invalid token amount"); + require(_tokensPerTierDiscountPoly[i] <= _tokensPerTierTotal[i], "Too many discounted tokens"); + require(_ratePerTierDiscountPoly[i] <= _ratePerTier[i], "Invalid discount"); + tiers.length++; + Tier storage currentTier = tiers[i]; + currentTier.rate = _ratePerTier[i]; + currentTier.rateDiscountPoly = _ratePerTierDiscountPoly[i]; + currentTier.tokenTotal = _tokensPerTierTotal[i]; + currentTier.tokensDiscountPoly = _tokensPerTierDiscountPoly[i]; + } + emit SetTiers(_ratePerTier, _ratePerTierDiscountPoly, _tokensPerTierTotal, _tokensPerTierDiscountPoly); + } + + function _modifyTimes( + uint256 _startTime, + uint256 _endTime + ) internal { /*solium-disable-next-line security/no-block-members*/ require((_endTime > _startTime) && (_startTime > now), "Invalid times"); startTime = _startTime; @@ -267,16 +301,14 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { emit SetTimes(_startTime, _endTime); } - function modifyAddresses( + function _modifyAddresses( address _wallet, address _reserveWallet, address _usdToken - ) public onlyFactoryOrOwner { - /*solium-disable-next-line security/no-block-members*/ - require(now < startTime, "STO shouldn't be started"); - require(_wallet != address(0) && _reserveWallet != address(0), "Invalid address"); + ) internal { + require(_wallet != address(0) && _reserveWallet != address(0), "Invalid wallet"); if (fundRaiseTypes[uint8(FundRaiseType.DAI)]) { - require(_usdToken != address(0), "Invalid address"); + require(_usdToken != address(0), "Invalid usdToken"); } wallet = _wallet; reserveWallet = _reserveWallet; From 5b5e4a14b066c7b1e241fb6487fc72dbb07b365d Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 8 Nov 2018 14:21:00 +0530 Subject: [PATCH 025/139] Changes in tier handling --- contracts/modules/STO/USDTieredSTO.sol | 114 +++++++++++++------------ 1 file changed, 60 insertions(+), 54 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index ace8fcdbb..50763604b 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -67,7 +67,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { // uint256[] public mintedPerTierDiscountPoly; // Current tier - uint8 public currentTier; + uint256 public currentTier; // Amount of USD funds raised uint256 public fundsRaisedUSD; @@ -94,7 +94,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 public finalAmountReturned; // Tiers - Tier public tiers; + Tier[] public tiers; //////////// // Events // @@ -109,7 +109,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 _tokens, uint256 _usdAmount, uint256 _tierPrice, - uint8 _tier + uint256 _tier ); event FundsReceived( address indexed _purchaser, @@ -120,7 +120,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 _spentValue, uint256 _rate ); - event ReserveTokenMint(address indexed _owner, address indexed _wallet, uint256 _tokens, uint8 _latestTier); + event ReserveTokenMint(address indexed _owner, address indexed _wallet, uint256 _tokens, uint256 _latestTier); event SetAddresses( address indexed _wallet, address indexed _reserveWallet, @@ -201,7 +201,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { address _usdToken ) public onlyFactory { _modifyTimes(_startTime, _endTime); - _modifyTimes(_ratePerTier, _ratePerTierDiscountPoly, _tokensPerTierTotal, _tokensPerTierDiscountPoly); + _modifyTiers(_ratePerTier, _ratePerTierDiscountPoly, _tokensPerTierTotal, _tokensPerTierDiscountPoly); // NB - _setFundRaiseType must come before modifyAddresses _setFundRaiseType(_fundRaiseTypes); _modifyAddresses(_wallet, _reserveWallet, _usdToken); @@ -280,12 +280,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { require(_tokensPerTierTotal[i] > 0, "Invalid token amount"); require(_tokensPerTierDiscountPoly[i] <= _tokensPerTierTotal[i], "Too many discounted tokens"); require(_ratePerTierDiscountPoly[i] <= _ratePerTier[i], "Invalid discount"); - tiers.length++; - Tier storage currentTier = tiers[i]; - currentTier.rate = _ratePerTier[i]; - currentTier.rateDiscountPoly = _ratePerTierDiscountPoly[i]; - currentTier.tokenTotal = _tokensPerTierTotal[i]; - currentTier.tokensDiscountPoly = _tokensPerTierDiscountPoly[i]; + tiers.push(Tier(_ratePerTier[i], _ratePerTierDiscountPoly[i], _tokensPerTierTotal[i], _tokensPerTierDiscountPoly[i], 0, 0)); } emit SetTiers(_ratePerTier, _ratePerTierDiscountPoly, _tokensPerTierTotal, _tokensPerTierDiscountPoly); } @@ -330,12 +325,12 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 tempReturned; uint256 tempSold; uint256 remainingTokens; - for (uint8 i = 0; i < tokensPerTierTotal.length; i++) { - remainingTokens = tokensPerTierTotal[i].sub(mintedPerTierTotal[i]); + for (uint256 i = 0; i < tiers.length; i++) { + remainingTokens = tiers[i].tokenTotal.sub(tiers[i].mintedTotal); tempReturned = tempReturned.add(remainingTokens); - tempSold = tempSold.add(mintedPerTierTotal[i]); + tempSold = tempSold.add(tiers[i].mintedTotal); if (remainingTokens > 0) { - mintedPerTierTotal[i] = tokensPerTierTotal[i]; + tiers[i].mintedTotal = tiers[i].tokenTotal; } } require(ISecurityToken(securityToken).mint(reserveWallet, tempReturned), "Error in minting"); @@ -366,7 +361,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { //nonAccreditedLimitUSDOverride require(_investors.length == _nonAccreditedLimit.length, "Array length mismatch"); for (uint256 i = 0; i < _investors.length; i++) { - require(_nonAccreditedLimit[i] > 0, "Limit can not be 0"); + require(_nonAccreditedLimit[i] > 0, "Limit = 0"); nonAccreditedLimitUSDOverride[_investors[i]] = _nonAccreditedLimit[i]; emit SetNonAccreditedLimit(_investors[i], _nonAccreditedLimit[i]); } @@ -390,15 +385,18 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { * @notice fallback function - assumes ETH being invested */ function () external payable { - buyWithETH(msg.sender); + uint256 rate = getRate(FundRaiseType.ETH); + buyWithETH(msg.sender, rate); } /** * @notice Purchase tokens using ETH * @param _beneficiary Address where security tokens will be sent + * @param _minRate Minumum conversion rate (FundType => USD) at which buying is authorized */ - function buyWithETH(address _beneficiary) public payable validETH { + function buyWithETH(address _beneficiary, uint256 _minRate) public payable validETH { uint256 rate = getRate(FundRaiseType.ETH); + require(rate >= _minRate, "Current rate below min"); (uint256 spentUSD, uint256 spentValue) = _buyTokens(_beneficiary, msg.value, rate, FundRaiseType.ETH); // Modify storage investorInvested[_beneficiary][uint8(FundRaiseType.ETH)] = investorInvested[_beneficiary][uint8(FundRaiseType.ETH)].add(spentValue); @@ -414,23 +412,26 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { * @notice Purchase tokens using POLY * @param _beneficiary Address where security tokens will be sent * @param _investedPOLY Amount of POLY invested + * @param _minRate Maximum rate at which buying is authorized */ - function buyWithPOLY(address _beneficiary, uint256 _investedPOLY) public validPOLY { - _buyWithTokens(_beneficiary, _investedPOLY, FundRaiseType.POLY); + function buyWithPOLY(address _beneficiary, uint256 _investedPOLY, uint256 _minRate) public validPOLY { + _buyWithTokens(_beneficiary, _investedPOLY, FundRaiseType.POLY, _minRate); } /** * @notice Purchase tokens using POLY * @param _beneficiary Address where security tokens will be sent * @param _investedDAI Amount of POLY invested + * @param _minRate Maximum rate at which buying is authorized */ - function buyWithUSD(address _beneficiary, uint256 _investedDAI) public validDAI { - _buyWithTokens(_beneficiary, _investedDAI, FundRaiseType.DAI); + function buyWithUSD(address _beneficiary, uint256 _investedDAI, uint256 _minRate) public validDAI { + _buyWithTokens(_beneficiary, _investedDAI, FundRaiseType.DAI, _minRate); } - function _buyWithTokens(address _beneficiary, uint256 _tokenAmount, FundRaiseType _fundRaiseType) internal { - require(_fundRaiseType == FundRaiseType.POLY || _fundRaiseType == FundRaiseType.DAI, "POLY & DAI supported"); + function _buyWithTokens(address _beneficiary, uint256 _tokenAmount, FundRaiseType _fundRaiseType, uint256 _minRate) internal { + require(_fundRaiseType == FundRaiseType.POLY || _fundRaiseType == FundRaiseType.DAI, "Invalid raise type"); uint256 rate = getRate(_fundRaiseType); + require(rate >= _minRate, "Current rate below min"); (uint256 spentUSD, uint256 spentValue) = _buyTokens(_beneficiary, _tokenAmount, rate, _fundRaiseType); // Modify storage investorInvested[_beneficiary][uint8(_fundRaiseType)] = investorInvested[_beneficiary][uint8(_fundRaiseType)].add(spentValue); @@ -459,37 +460,40 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { returns(uint256, uint256) { if (!allowBeneficialInvestments) { - require(_beneficiary == msg.sender, "Beneficiary does not match funder"); + require(_beneficiary == msg.sender, "Beneficiary != funder"); } - require(isOpen(), "STO is not open"); + require(isOpen(), "STO not open"); require(_investmentValue > 0, "No funds were sent"); uint256 investedUSD = DecimalMath.mul(_rate, _investmentValue); uint256 originalUSD = investedUSD; // Check for minimum investment - require(investedUSD.add(investorInvestedUSD[_beneficiary]) >= minimumInvestmentUSD, "Total investment < minimumInvestmentUSD"); + //require(investedUSD.add(investorInvestedUSD[_beneficiary]) >= minimumInvestmentUSD, "Total investment < minimumInvestmentUSD"); + require(investedUSD >= minimumInvestmentUSD, "investment < minimumInvestmentUSD"); //Why do we need to add? // Check for non-accredited cap if (!accredited[_beneficiary]) { uint256 investorLimitUSD = (nonAccreditedLimitUSDOverride[_beneficiary] == 0) ? nonAccreditedLimitUSD : nonAccreditedLimitUSDOverride[_beneficiary]; - require(investorInvestedUSD[_beneficiary] < investorLimitUSD, "Non-accredited investor has reached limit"); + //require(investorInvestedUSD[_beneficiary] < investorLimitUSD, "Non-accredited investor has reached limit"); not required. if (investedUSD.add(investorInvestedUSD[_beneficiary]) > investorLimitUSD) investedUSD = investorLimitUSD.sub(investorInvestedUSD[_beneficiary]); } uint256 spentUSD; // Iterate over each tier and process payment - for (uint8 i = currentTier; i < ratePerTier.length; i++) { + for (uint256 i = currentTier; i < tiers.length; i++) { // Update current tier if needed if (currentTier != i) currentTier = i; // If there are tokens remaining, process investment - if (mintedPerTierTotal[i] < tokensPerTierTotal[i]) + if (tiers[i].mintedTotal < tiers[i].tokenTotal) { spentUSD = spentUSD.add(_calculateTier(_beneficiary, i, investedUSD.sub(spentUSD), _fundRaiseType)); - // If all funds have been spent, exit the loop - if (investedUSD == spentUSD) - break; + // If all funds have been spent, exit the loop + if (investedUSD == spentUSD) + break; + } + } // Modify storage @@ -514,7 +518,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { function _calculateTier( address _beneficiary, - uint8 _tier, + uint256 _tier, uint256 _investedUSD, FundRaiseType _fundRaiseType ) @@ -526,25 +530,26 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 tierSpentUSD; uint256 tierPurchasedTokens; uint256 investedUSD = _investedUSD; + Tier storage tierData = tiers[_tier]; // Check whether there are any remaining discounted tokens - if ((_fundRaiseType == FundRaiseType.POLY) && (tokensPerTierDiscountPoly[_tier] > mintedPerTierDiscountPoly[_tier])) { - uint256 discountRemaining = tokensPerTierDiscountPoly[_tier].sub(mintedPerTierDiscountPoly[_tier]); - uint256 totalRemaining = tokensPerTierTotal[_tier].sub(mintedPerTierTotal[_tier]); + if ((_fundRaiseType == FundRaiseType.POLY) && (tierData.tokensDiscountPoly > tierData.mintedDiscountPoly)) { + uint256 discountRemaining = tierData.tokensDiscountPoly.sub(tierData.mintedDiscountPoly); + uint256 totalRemaining = tierData.tokenTotal.sub(tierData.mintedTotal); if (totalRemaining < discountRemaining) - (spentUSD, tierPurchasedTokens) = _purchaseTier(_beneficiary, ratePerTierDiscountPoly[_tier], totalRemaining, investedUSD, _tier); + (spentUSD, tierPurchasedTokens) = _purchaseTier(_beneficiary, tierData.rateDiscountPoly, totalRemaining, investedUSD, _tier); else - (spentUSD, tierPurchasedTokens) = _purchaseTier(_beneficiary, ratePerTierDiscountPoly[_tier], discountRemaining, investedUSD, _tier); + (spentUSD, tierPurchasedTokens) = _purchaseTier(_beneficiary, tierData.rateDiscountPoly, discountRemaining, investedUSD, _tier); investedUSD = investedUSD.sub(spentUSD); - mintedPerTierDiscountPoly[_tier] = mintedPerTierDiscountPoly[_tier].add(tierPurchasedTokens); - mintedPerTier[uint8(FundRaiseType.POLY)][_tier] = mintedPerTier[uint8(FundRaiseType.POLY)][_tier].add(tierPurchasedTokens); - mintedPerTierTotal[_tier] = mintedPerTierTotal[_tier].add(tierPurchasedTokens); + tierData.mintedDiscountPoly = tierData.mintedDiscountPoly.add(tierPurchasedTokens); + tierData.minted[uint8(_fundRaiseType)] = tierData.minted[uint8(_fundRaiseType)].add(tierPurchasedTokens); + tierData.mintedTotal = tierData.mintedTotal.add(tierPurchasedTokens); } // Now, if there is any remaining USD to be invested, purchase at non-discounted rate - if ((investedUSD > 0) && (tokensPerTierTotal[_tier].sub(mintedPerTierTotal[_tier]) > 0)) { - (tierSpentUSD, tierPurchasedTokens) = _purchaseTier(_beneficiary, ratePerTier[_tier], tokensPerTierTotal[_tier].sub(mintedPerTierTotal[_tier]), investedUSD, _tier); + if ((investedUSD > 0) && (tierData.tokenTotal.sub(tierData.mintedTotal) > 0)) { + (tierSpentUSD, tierPurchasedTokens) = _purchaseTier(_beneficiary, tierData.rate, tierData.tokenTotal.sub(tierData.mintedTotal), investedUSD, _tier); spentUSD = spentUSD.add(tierSpentUSD); - mintedPerTier[uint8(_fundRaiseType)][_tier] = mintedPerTier[uint8(_fundRaiseType)][_tier].add(tierPurchasedTokens); - mintedPerTierTotal[_tier] = mintedPerTierTotal[_tier].add(tierPurchasedTokens); + tierData.minted[uint8(_fundRaiseType)] = tierData.minted[uint8(_fundRaiseType)].add(tierPurchasedTokens); + tierData.mintedTotal = tierData.mintedTotal.add(tierPurchasedTokens); } return spentUSD; } @@ -554,12 +559,13 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 _tierPrice, uint256 _tierRemaining, uint256 _investedUSD, - uint8 _tier + uint256 _tier ) internal returns(uint256, uint256) { uint256 maximumTokens = DecimalMath.div(_investedUSD, _tierPrice); + maximumTokens = maximumTokens.sub(maximumTokens.div(ISecurityToken(securityToken).granularity())); uint256 spentUSD; uint256 purchasedTokens; if (maximumTokens > _tierRemaining) { @@ -570,7 +576,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { } purchasedTokens = _tierRemaining; } else { - spentUSD = _investedUSD; + spentUSD = DecimalMath.mul(maximumTokens, _tierPrice); purchasedTokens = maximumTokens; } require(ISecurityToken(securityToken).mint(_beneficiary, purchasedTokens), "Error in minting"); @@ -608,7 +614,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { if (isFinalized) { return (finalAmountReturned == 0); } - return (mintedPerTierTotal[mintedPerTierTotal.length - 1] == tokensPerTierTotal[tokensPerTierTotal.length - 1]); + return (tiers[tiers.length - 1].mintedTotal == tiers[tiers.length - 1].tokenTotal); } function getRate(FundRaiseType _fundRaiseType) public view returns (uint256) { @@ -662,8 +668,8 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { */ function getTokensMinted() public view returns (uint256) { uint256 tokensMinted; - for (uint8 i = 0; i < mintedPerTierTotal.length; i++) { - tokensMinted = tokensMinted.add(mintedPerTierTotal[i]); + for (uint256 i = 0; i < tiers.length; i++) { + tokensMinted = tokensMinted.add(tiers[i].mintedTotal); } return tokensMinted; } @@ -674,8 +680,8 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { */ function getTokensSoldFor(FundRaiseType _fundRaiseType) public view returns (uint256) { uint256 tokensSold; - for (uint8 i = 0; i < mintedPerTier[uint8(_fundRaiseType)].length; i++) { - tokensSold = tokensSold.add(mintedPerTier[uint8(_fundRaiseType)][i]); + for (uint256 i = 0; i < tiers.length; i++) { + tokensSold = tokensSold.add(tiers[i].minted[uint8(_fundRaiseType)]); } return tokensSold; } @@ -685,7 +691,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { * @return uint256 Total number of tiers */ function getNumberOfTiers() public view returns (uint256) { - return tokensPerTierTotal.length; + return tiers.length; } /** From 7c1d555f700cd7942f1bbe2f1e68b5f41f00c8b9 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 8 Nov 2018 15:50:35 +0530 Subject: [PATCH 026/139] bug fixes --- contracts/modules/STO/USDTieredSTO.sol | 30 ++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index 50763604b..225d61895 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -385,8 +385,16 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { * @notice fallback function - assumes ETH being invested */ function () external payable { - uint256 rate = getRate(FundRaiseType.ETH); - buyWithETH(msg.sender, rate); + buyWithETHRateLimited(msg.sender, 0); + } + + // For backwards compatibility + function buyWithETH(address _beneficiary) public payable { + buyWithETHRateLimited(_beneficiary, 0); + } + + function buyWithPOLY(address _beneficiary, uint256 _investedPOLY) public { + _buyWithTokens(_beneficiary, _investedPOLY, FundRaiseType.POLY, 0); } /** @@ -394,7 +402,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { * @param _beneficiary Address where security tokens will be sent * @param _minRate Minumum conversion rate (FundType => USD) at which buying is authorized */ - function buyWithETH(address _beneficiary, uint256 _minRate) public payable validETH { + function buyWithETHRateLimited(address _beneficiary, uint256 _minRate) public payable validETH { uint256 rate = getRate(FundRaiseType.ETH); require(rate >= _minRate, "Current rate below min"); (uint256 spentUSD, uint256 spentValue) = _buyTokens(_beneficiary, msg.value, rate, FundRaiseType.ETH); @@ -414,7 +422,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { * @param _investedPOLY Amount of POLY invested * @param _minRate Maximum rate at which buying is authorized */ - function buyWithPOLY(address _beneficiary, uint256 _investedPOLY, uint256 _minRate) public validPOLY { + function buyWithPOLYRateLimited(address _beneficiary, uint256 _investedPOLY, uint256 _minRate) public validPOLY { _buyWithTokens(_beneficiary, _investedPOLY, FundRaiseType.POLY, _minRate); } @@ -422,10 +430,9 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { * @notice Purchase tokens using POLY * @param _beneficiary Address where security tokens will be sent * @param _investedDAI Amount of POLY invested - * @param _minRate Maximum rate at which buying is authorized */ - function buyWithUSD(address _beneficiary, uint256 _investedDAI, uint256 _minRate) public validDAI { - _buyWithTokens(_beneficiary, _investedDAI, FundRaiseType.DAI, _minRate); + function buyWithUSD(address _beneficiary, uint256 _investedDAI) public validDAI { + _buyWithTokens(_beneficiary, _investedDAI, FundRaiseType.DAI, uint256(10) ** 18); } function _buyWithTokens(address _beneficiary, uint256 _tokenAmount, FundRaiseType _fundRaiseType, uint256 _minRate) internal { @@ -467,7 +474,6 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { require(_investmentValue > 0, "No funds were sent"); uint256 investedUSD = DecimalMath.mul(_rate, _investmentValue); - uint256 originalUSD = investedUSD; // Check for minimum investment //require(investedUSD.add(investorInvestedUSD[_beneficiary]) >= minimumInvestmentUSD, "Total investment < minimumInvestmentUSD"); @@ -476,7 +482,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { // Check for non-accredited cap if (!accredited[_beneficiary]) { uint256 investorLimitUSD = (nonAccreditedLimitUSDOverride[_beneficiary] == 0) ? nonAccreditedLimitUSD : nonAccreditedLimitUSDOverride[_beneficiary]; - //require(investorInvestedUSD[_beneficiary] < investorLimitUSD, "Non-accredited investor has reached limit"); not required. + require(investorInvestedUSD[_beneficiary] < investorLimitUSD, "Over Non-accredited investor limit"); if (investedUSD.add(investorInvestedUSD[_beneficiary]) > investorLimitUSD) investedUSD = investorLimitUSD.sub(investorInvestedUSD[_beneficiary]); } @@ -509,7 +515,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { if (spentUSD == 0) { spentValue = 0; } else { - spentValue = DecimalMath.mul(DecimalMath.div(spentUSD, originalUSD), _investmentValue); + spentValue = DecimalMath.div(spentUSD, _rate); } // Return calculated amounts @@ -565,7 +571,9 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { returns(uint256, uint256) { uint256 maximumTokens = DecimalMath.div(_investedUSD, _tierPrice); - maximumTokens = maximumTokens.sub(maximumTokens.div(ISecurityToken(securityToken).granularity())); + uint256 granularity = ISecurityToken(securityToken).granularity(); + maximumTokens = maximumTokens.div(granularity); + maximumTokens = maximumTokens.mul(granularity); uint256 spentUSD; uint256 purchasedTokens; if (maximumTokens > _tierRemaining) { From 1ee784cd25368d90ea3167ddf469390924fa542e Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 8 Nov 2018 15:54:26 +0530 Subject: [PATCH 027/139] test cases fixed --- test/p_usd_tiered_sto.js | 151 +++++++++++++++++------------------ test/q_usd_tiered_sto_sim.js | 52 ++++++------ 2 files changed, 98 insertions(+), 105 deletions(-) diff --git a/test/p_usd_tiered_sto.js b/test/p_usd_tiered_sto.js index 5332700b4..fb8f8659e 100644 --- a/test/p_usd_tiered_sto.js +++ b/test/p_usd_tiered_sto.js @@ -165,8 +165,8 @@ contract("USDTieredSTO", accounts => { async function convert(_stoID, _tier, _discount, _currencyFrom, _currencyTo, _amount) { let USDTOKEN; - if (_discount) USDTOKEN = await I_USDTieredSTO_Array[_stoID].ratePerTierDiscountPoly.call(_tier); - else USDTOKEN = await I_USDTieredSTO_Array[_stoID].ratePerTier.call(_tier); + if (_discount) USDTOKEN = ((await I_USDTieredSTO_Array[_stoID].tiers.call(_tier))[1]); + else USDTOKEN = ((await I_USDTieredSTO_Array[_stoID].tiers.call(_tier))[0]); if (_currencyFrom == "TOKEN") { let tokenToUSD = _amount .div(10 ** 18) @@ -327,28 +327,28 @@ contract("USDTieredSTO", accounts => { assert.equal(await I_USDTieredSTO_Array[stoId].startTime.call(), _startTime[stoId], "Incorrect _startTime in config"); assert.equal(await I_USDTieredSTO_Array[stoId].endTime.call(), _endTime[stoId], "Incorrect _endTime in config"); - for (var i = 0; i < _ratePerTier[stoId].length; i++) { - assert.equal( - (await I_USDTieredSTO_Array[stoId].ratePerTier.call(i)).toNumber(), - _ratePerTier[stoId][i].toNumber(), - "Incorrect _ratePerTier in config" - ); - assert.equal( - (await I_USDTieredSTO_Array[stoId].ratePerTierDiscountPoly.call(i)).toNumber(), - _ratePerTierDiscountPoly[stoId][i].toNumber(), - "Incorrect _ratePerTierDiscountPoly in config" - ); - assert.equal( - (await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(i)).toNumber(), - _tokensPerTierTotal[stoId][i].toNumber(), - "Incorrect _tokensPerTierTotal in config" - ); - assert.equal( - (await I_USDTieredSTO_Array[stoId].tokensPerTierDiscountPoly.call(i)).toNumber(), - _tokensPerTierDiscountPoly[stoId][i].toNumber(), - "Incorrect _tokensPerTierDiscountPoly in config" - ); - } + // for (var i = 0; i < _ratePerTier[stoId].length; i++) { + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].ratePerTier.call(i)).toNumber(), + // _ratePerTier[stoId][i].toNumber(), + // "Incorrect _ratePerTier in config" + // ); + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].ratePerTierDiscountPoly.call(i)).toNumber(), + // _ratePerTierDiscountPoly[stoId][i].toNumber(), + // "Incorrect _ratePerTierDiscountPoly in config" + // ); + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(i)).toNumber(), + // _tokensPerTierTotal[stoId][i].toNumber(), + // "Incorrect _tokensPerTierTotal in config" + // ); + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].tokensPerTierDiscountPoly.call(i)).toNumber(), + // _tokensPerTierDiscountPoly[stoId][i].toNumber(), + // "Incorrect _tokensPerTierDiscountPoly in config" + // ); + // } assert.equal( (await I_USDTieredSTO_Array[stoId].nonAccreditedLimitUSD.call()).toNumber(), _nonAccreditedLimitUSD[stoId].toNumber(), @@ -512,28 +512,28 @@ contract("USDTieredSTO", accounts => { assert.equal(await I_USDTieredSTO_Array[stoId].startTime.call(), _startTime[stoId], "Incorrect _startTime in config"); assert.equal(await I_USDTieredSTO_Array[stoId].endTime.call(), _endTime[stoId], "Incorrect _endTime in config"); - for (var i = 0; i < _ratePerTier[stoId].length; i++) { - assert.equal( - (await I_USDTieredSTO_Array[stoId].ratePerTier.call(i)).toNumber(), - _ratePerTier[stoId][i].toNumber(), - "Incorrect _ratePerTier in config" - ); - assert.equal( - (await I_USDTieredSTO_Array[stoId].ratePerTierDiscountPoly.call(i)).toNumber(), - _ratePerTierDiscountPoly[stoId][i].toNumber(), - "Incorrect _ratePerTierDiscountPoly in config" - ); - assert.equal( - (await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(i)).toNumber(), - _tokensPerTierTotal[stoId][i].toNumber(), - "Incorrect _tokensPerTierTotal in config" - ); - assert.equal( - (await I_USDTieredSTO_Array[stoId].tokensPerTierDiscountPoly.call(i)).toNumber(), - _tokensPerTierDiscountPoly[stoId][i].toNumber(), - "Incorrect _tokensPerTierDiscountPoly in config" - ); - } + // for (var i = 0; i < _ratePerTier[stoId].length; i++) { + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].ratePerTier.call(i)).toNumber(), + // _ratePerTier[stoId][i].toNumber(), + // "Incorrect _ratePerTier in config" + // ); + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].ratePerTierDiscountPoly.call(i)).toNumber(), + // _ratePerTierDiscountPoly[stoId][i].toNumber(), + // "Incorrect _ratePerTierDiscountPoly in config" + // ); + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(i)).toNumber(), + // _tokensPerTierTotal[stoId][i].toNumber(), + // "Incorrect _tokensPerTierTotal in config" + // ); + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].tokensPerTierDiscountPoly.call(i)).toNumber(), + // _tokensPerTierDiscountPoly[stoId][i].toNumber(), + // "Incorrect _tokensPerTierDiscountPoly in config" + // ); + // } assert.equal( (await I_USDTieredSTO_Array[stoId].nonAccreditedLimitUSD.call()).toNumber(), _nonAccreditedLimitUSD[stoId].toNumber(), @@ -864,26 +864,26 @@ contract("USDTieredSTO", accounts => { [BigNumber(15 * 10 ** 20)], { from: ISSUER } ); - assert.equal( - (await I_USDTieredSTO_Array[stoId].ratePerTier.call(0)).toNumber(), - BigNumber(15 * 10 ** 18).toNumber(), - "STO Configuration doesn't set as expected" - ); - assert.equal( - (await I_USDTieredSTO_Array[stoId].ratePerTierDiscountPoly.call(0)).toNumber(), - BigNumber(13 * 10 ** 18).toNumber(), - "STO Configuration doesn't set as expected" - ); - assert.equal( - await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(0), - BigNumber(15 * 10 ** 20).toNumber(), - "STO Configuration doesn't set as expected" - ); - assert.equal( - await I_USDTieredSTO_Array[stoId].tokensPerTierDiscountPoly.call(0), - BigNumber(15 * 10 ** 20).toNumber(), - "STO Configuration doesn't set as expected" - ); + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].ratePerTier.call(0)).toNumber(), + // BigNumber(15 * 10 ** 18).toNumber(), + // "STO Configuration doesn't set as expected" + // ); + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].ratePerTierDiscountPoly.call(0)).toNumber(), + // BigNumber(13 * 10 ** 18).toNumber(), + // "STO Configuration doesn't set as expected" + // ); + // assert.equal( + // await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(0), + // BigNumber(15 * 10 ** 20).toNumber(), + // "STO Configuration doesn't set as expected" + // ); + // assert.equal( + // await I_USDTieredSTO_Array[stoId].tokensPerTierDiscountPoly.call(0), + // BigNumber(15 * 10 ** 20).toNumber(), + // "STO Configuration doesn't set as expected" + // ); let tempTime1 = latestTime() + duration.days(0.1); let tempTime2 = latestTime() + duration.days(0.2); @@ -989,25 +989,18 @@ contract("USDTieredSTO", accounts => { await I_DaiToken.approve(I_USDTieredSTO_Array[stoId].address, investment_DAI, { from: NONACCREDITED1 }); await I_DaiToken.getTokens(investment_DAI, ACCREDITED1); await I_DaiToken.approve(I_USDTieredSTO_Array[stoId].address, investment_DAI, { from: ACCREDITED1 }); - // NONACCREDITED ETH await catchRevert(I_USDTieredSTO_Array[stoId].buyWithETH(NONACCREDITED1, { from: NONACCREDITED1, value: investment_ETH })); - // NONACCREDITED POLY await catchRevert(I_USDTieredSTO_Array[stoId].buyWithPOLY(NONACCREDITED1, investment_POLY, { from: NONACCREDITED1 })); - // NONACCREDITED DAI await catchRevert(I_USDTieredSTO_Array[stoId].buyWithUSD(NONACCREDITED1, investment_DAI, { from: NONACCREDITED1 })); - // ACCREDITED ETH await catchRevert(I_USDTieredSTO_Array[stoId].buyWithETH(ACCREDITED1, { from: ACCREDITED1, value: investment_ETH })); - // ACCREDITED POLY await catchRevert(I_USDTieredSTO_Array[stoId].buyWithPOLY(ACCREDITED1, investment_POLY, { from: ACCREDITED1 })); - // ACCREDITED DAI await catchRevert(I_USDTieredSTO_Array[stoId].buyWithUSD(ACCREDITED1, investment_DAI, { from: ACCREDITED1 })); - await revertToSnapshot(snapId); }); @@ -2850,7 +2843,7 @@ contract("USDTieredSTO", accounts => { let stoId = 1; let tierId = 5; - let minted = await I_USDTieredSTO_Array[stoId].mintedPerTierTotal.call(tierId); + let minted = (await I_USDTieredSTO_Array[stoId].tiers.call(tierId))[4]; console.log(minted.toNumber() + ":" + _tokensPerTierTotal[stoId][tierId]); let investment_Token = _tokensPerTierTotal[stoId][tierId].sub(minted); console.log(investment_Token.toNumber()); @@ -3840,8 +3833,8 @@ contract("USDTieredSTO", accounts => { let investment_Token = delta_Token.add(delta_Token); // 10 Token let investment_POLY = polyTier0.add(polyTier1); // 0.0025 ETH - let tokensRemaining = (await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(startTier)).sub( - await I_USDTieredSTO_Array[stoId].mintedPerTierTotal.call(startTier) + let tokensRemaining = (await I_USDTieredSTO_Array[stoId].tiers.call(startTier))[2].sub( + (await I_USDTieredSTO_Array[stoId].tiers.call(startTier))[4] ); let prep_Token = tokensRemaining.sub(delta_Token); let prep_POLY = await convert(stoId, startTier, true, "TOKEN", "POLY", prep_Token); @@ -3851,8 +3844,8 @@ contract("USDTieredSTO", accounts => { let tx = await I_USDTieredSTO_Array[stoId].buyWithPOLY(ACCREDITED1, prep_POLY, { from: ACCREDITED1, gasPrice: GAS_PRICE }); console.log(" Gas buyWithPOLY: ".grey + tx.receipt.gasUsed.toString().grey); - let Tier0Token = await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(startTier); - let Tier0Minted = await I_USDTieredSTO_Array[stoId].mintedPerTierTotal.call(startTier); + let Tier0Token = (await I_USDTieredSTO_Array[stoId].tiers.call(startTier))[2]; + let Tier0Minted = (await I_USDTieredSTO_Array[stoId].tiers.call(startTier))[4]; assert.equal(Tier0Minted.toNumber(), Tier0Token.sub(delta_Token).toNumber()); await I_PolyToken.getTokens(investment_POLY, ACCREDITED1); @@ -4027,7 +4020,7 @@ contract("USDTieredSTO", accounts => { let stoId = 2; let tierId = 1; - let minted = await I_USDTieredSTO_Array[stoId].mintedPerTierTotal.call(tierId); + let minted = (await I_USDTieredSTO_Array[stoId].tiers.call(tierId))[4]; let investment_Token = _tokensPerTierTotal[stoId][tierId].sub(minted); let investment_POLY = await convert(stoId, tierId, false, "TOKEN", "POLY", investment_Token); diff --git a/test/q_usd_tiered_sto_sim.js b/test/q_usd_tiered_sto_sim.js index 53a12e74a..e22c9c4ac 100644 --- a/test/q_usd_tiered_sto_sim.js +++ b/test/q_usd_tiered_sto_sim.js @@ -297,28 +297,28 @@ contract("USDTieredSTO Sim", accounts => { assert.equal(await I_USDTieredSTO_Array[stoId].startTime.call(), _startTime[stoId], "Incorrect _startTime in config"); assert.equal(await I_USDTieredSTO_Array[stoId].endTime.call(), _endTime[stoId], "Incorrect _endTime in config"); - for (var i = 0; i < _ratePerTier[stoId].length; i++) { - assert.equal( - (await I_USDTieredSTO_Array[stoId].ratePerTier.call(i)).toNumber(), - _ratePerTier[stoId][i].toNumber(), - "Incorrect _ratePerTier in config" - ); - assert.equal( - (await I_USDTieredSTO_Array[stoId].ratePerTierDiscountPoly.call(i)).toNumber(), - _ratePerTierDiscountPoly[stoId][i].toNumber(), - "Incorrect _ratePerTierDiscountPoly in config" - ); - assert.equal( - (await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(i)).toNumber(), - _tokensPerTierTotal[stoId][i].toNumber(), - "Incorrect _tokensPerTierTotal in config" - ); - assert.equal( - (await I_USDTieredSTO_Array[stoId].tokensPerTierDiscountPoly.call(i)).toNumber(), - _tokensPerTierDiscountPoly[stoId][i].toNumber(), - "Incorrect _tokensPerTierDiscountPoly in config" - ); - } + // for (var i = 0; i < _ratePerTier[stoId].length; i++) { + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].ratePerTier.call(i)).toNumber(), + // _ratePerTier[stoId][i].toNumber(), + // "Incorrect _ratePerTier in config" + // ); + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].ratePerTierDiscountPoly.call(i)).toNumber(), + // _ratePerTierDiscountPoly[stoId][i].toNumber(), + // "Incorrect _ratePerTierDiscountPoly in config" + // ); + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(i)).toNumber(), + // _tokensPerTierTotal[stoId][i].toNumber(), + // "Incorrect _tokensPerTierTotal in config" + // ); + // assert.equal( + // (await I_USDTieredSTO_Array[stoId].tokensPerTierDiscountPoly.call(i)).toNumber(), + // _tokensPerTierDiscountPoly[stoId][i].toNumber(), + // "Incorrect _tokensPerTierDiscountPoly in config" + // ); + // } assert.equal( (await I_USDTieredSTO_Array[stoId].nonAccreditedLimitUSD.call()).toNumber(), _nonAccreditedLimitUSD[stoId].toNumber(), @@ -455,13 +455,13 @@ contract("USDTieredSTO Sim", accounts => { let Tokens_discount = []; for (var i = 0; i < _ratePerTier[stoId].length; i++) { Tokens_total.push( - (await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(i)).sub( - await I_USDTieredSTO_Array[stoId].mintedPerTierTotal.call(i) + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[2].sub( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[4] ) ); Tokens_discount.push( - (await I_USDTieredSTO_Array[stoId].tokensPerTierDiscountPoly.call(i)).sub( - await I_USDTieredSTO_Array[stoId].mintedPerTierDiscountPoly.call(i) + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[3].sub( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[5] ) ); } From 32b3869fadfd96eefd14a51760eb989615f465ef Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 8 Nov 2018 19:58:03 +0530 Subject: [PATCH 028/139] WIP --- contracts/modules/STO/USDTieredSTO.sol | 70 +++-- test/p_usd_tiered_sto.js | 352 ++++++++++++++++++++----- test/q_usd_tiered_sto_sim.js | 44 ++-- 3 files changed, 340 insertions(+), 126 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index 225d61895..694f16e7e 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -18,12 +18,25 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { // Storage // ///////////// struct Tier { + // How many token units a buyer gets per USD in this tier (multiplied by 10**18) uint256 rate; - uint256 rateDiscountPoly; + + // How many token units a buyer gets per USD in this tier (multiplied by 10**18) when investing in POLY up to tokensDiscountPoly + uint256 rateDiscountPoly; + + // How many tokens are available in this tier (relative to totalSupply) uint256 tokenTotal; + + // How many token units are available in this tier (relative to totalSupply) at the ratePerTierDiscountPoly rate uint256 tokensDiscountPoly; + + // How many tokens have been minted in this tier (relative to totalSupply) uint256 mintedTotal; - mapping (uint8 => uint256) minted; //fundtype => minted + + // How many tokens have been minted in this tier (relative to totalSupply) for each fund raise type + mapping (uint8 => uint256) minted; + + // How many tokens have been minted in this tier (relative to totalSupply) at discounted POLY rate uint256 mintedDiscountPoly; } @@ -45,27 +58,6 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { // Address of issuer reserve wallet for unsold tokens address public reserveWallet; - // // How many token units a buyer gets per USD per tier (multiplied by 10**18) - // uint256[] public ratePerTier; - - // // How many token units a buyer gets per USD per tier (multiplied by 10**18) when investing in POLY up to tokensPerTierDiscountPoly - // uint256[] public ratePerTierDiscountPoly; - - // // How many tokens are available in each tier (relative to totalSupply) - // uint256[] public tokensPerTierTotal; - - // // How many token units are available in each tier (relative to totalSupply) at the ratePerTierDiscountPoly rate - // uint256[] public tokensPerTierDiscountPoly; - - // // How many tokens have been minted in each tier (relative to totalSupply) - // uint256[] public mintedPerTierTotal; - - // // How many tokens have been minted in each tier (relative to totalSupply) for each fund raise type - // mapping (uint8 => uint256[]) public mintedPerTier; - - // // How many tokens have been minted in each tier (relative to totalSupply) at discounted POLY rate - // uint256[] public mintedPerTierDiscountPoly; - // Current tier uint256 public currentTier; @@ -93,7 +85,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { // Final amount of tokens returned to issuer uint256 public finalAmountReturned; - // Tiers + // Array of Tiers Tier[] public tiers; //////////// @@ -427,9 +419,9 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { } /** - * @notice Purchase tokens using POLY + * @notice Purchase tokens using DAI * @param _beneficiary Address where security tokens will be sent - * @param _investedDAI Amount of POLY invested + * @param _investedDAI Amount of DAI invested */ function buyWithUSD(address _beneficiary, uint256 _investedDAI) public validDAI { _buyWithTokens(_beneficiary, _investedDAI, FundRaiseType.DAI, uint256(10) ** 18); @@ -487,16 +479,20 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { investedUSD = investorLimitUSD.sub(investorInvestedUSD[_beneficiary]); } uint256 spentUSD; + uint256 spentValue; // Iterate over each tier and process payment for (uint256 i = currentTier; i < tiers.length; i++) { + bool gotoNextTier; // Update current tier if needed if (currentTier != i) currentTier = i; // If there are tokens remaining, process investment if (tiers[i].mintedTotal < tiers[i].tokenTotal) { - spentUSD = spentUSD.add(_calculateTier(_beneficiary, i, investedUSD.sub(spentUSD), _fundRaiseType)); + //spentValue used as temp variable here to prevent stackoverflow + (spentValue, gotoNextTier) = _calculateTier(_beneficiary, i, investedUSD.sub(spentUSD), _fundRaiseType); + spentUSD = spentUSD.add(spentValue); // If all funds have been spent, exit the loop - if (investedUSD == spentUSD) + if (!gotoNextTier) break; } @@ -510,8 +506,6 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { fundsRaisedUSD = fundsRaisedUSD.add(spentUSD); } - // Calculate spent in base currency (ETH, DAI or POLY) - uint256 spentValue; if (spentUSD == 0) { spentValue = 0; } else { @@ -529,10 +523,9 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { FundRaiseType _fundRaiseType ) internal - returns(uint256) + returns(uint256 spentUSD, bool gotoNextTier) { // First purchase any discounted tokens if POLY investment - uint256 spentUSD; uint256 tierSpentUSD; uint256 tierPurchasedTokens; uint256 investedUSD = _investedUSD; @@ -542,9 +535,9 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 discountRemaining = tierData.tokensDiscountPoly.sub(tierData.mintedDiscountPoly); uint256 totalRemaining = tierData.tokenTotal.sub(tierData.mintedTotal); if (totalRemaining < discountRemaining) - (spentUSD, tierPurchasedTokens) = _purchaseTier(_beneficiary, tierData.rateDiscountPoly, totalRemaining, investedUSD, _tier); + (spentUSD, tierPurchasedTokens, gotoNextTier) = _purchaseTier(_beneficiary, tierData.rateDiscountPoly, totalRemaining, investedUSD, _tier); else - (spentUSD, tierPurchasedTokens) = _purchaseTier(_beneficiary, tierData.rateDiscountPoly, discountRemaining, investedUSD, _tier); + (spentUSD, tierPurchasedTokens, gotoNextTier) = _purchaseTier(_beneficiary, tierData.rateDiscountPoly, discountRemaining, investedUSD, _tier); investedUSD = investedUSD.sub(spentUSD); tierData.mintedDiscountPoly = tierData.mintedDiscountPoly.add(tierPurchasedTokens); tierData.minted[uint8(_fundRaiseType)] = tierData.minted[uint8(_fundRaiseType)].add(tierPurchasedTokens); @@ -552,12 +545,11 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { } // Now, if there is any remaining USD to be invested, purchase at non-discounted rate if ((investedUSD > 0) && (tierData.tokenTotal.sub(tierData.mintedTotal) > 0)) { - (tierSpentUSD, tierPurchasedTokens) = _purchaseTier(_beneficiary, tierData.rate, tierData.tokenTotal.sub(tierData.mintedTotal), investedUSD, _tier); + (tierSpentUSD, tierPurchasedTokens, gotoNextTier) = _purchaseTier(_beneficiary, tierData.rate, tierData.tokenTotal.sub(tierData.mintedTotal), investedUSD, _tier); spentUSD = spentUSD.add(tierSpentUSD); tierData.minted[uint8(_fundRaiseType)] = tierData.minted[uint8(_fundRaiseType)].add(tierPurchasedTokens); tierData.mintedTotal = tierData.mintedTotal.add(tierPurchasedTokens); } - return spentUSD; } function _purchaseTier( @@ -568,14 +560,12 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 _tier ) internal - returns(uint256, uint256) + returns(uint256 spentUSD, uint256 purchasedTokens, bool gotoNextTier) { uint256 maximumTokens = DecimalMath.div(_investedUSD, _tierPrice); uint256 granularity = ISecurityToken(securityToken).granularity(); maximumTokens = maximumTokens.div(granularity); maximumTokens = maximumTokens.mul(granularity); - uint256 spentUSD; - uint256 purchasedTokens; if (maximumTokens > _tierRemaining) { spentUSD = DecimalMath.mul(_tierRemaining, _tierPrice); // In case of rounding issues, ensure that spentUSD is never more than investedUSD @@ -583,13 +573,13 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { spentUSD = _investedUSD; } purchasedTokens = _tierRemaining; + gotoNextTier = true; } else { spentUSD = DecimalMath.mul(maximumTokens, _tierPrice); purchasedTokens = maximumTokens; } require(ISecurityToken(securityToken).mint(_beneficiary, purchasedTokens), "Error in minting"); emit TokenPurchase(msg.sender, _beneficiary, purchasedTokens, spentUSD, _tierPrice, _tier); - return (spentUSD, purchasedTokens); } ///////////// diff --git a/test/p_usd_tiered_sto.js b/test/p_usd_tiered_sto.js index fb8f8659e..fedf52294 100644 --- a/test/p_usd_tiered_sto.js +++ b/test/p_usd_tiered_sto.js @@ -327,28 +327,28 @@ contract("USDTieredSTO", accounts => { assert.equal(await I_USDTieredSTO_Array[stoId].startTime.call(), _startTime[stoId], "Incorrect _startTime in config"); assert.equal(await I_USDTieredSTO_Array[stoId].endTime.call(), _endTime[stoId], "Incorrect _endTime in config"); - // for (var i = 0; i < _ratePerTier[stoId].length; i++) { - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].ratePerTier.call(i)).toNumber(), - // _ratePerTier[stoId][i].toNumber(), - // "Incorrect _ratePerTier in config" - // ); - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].ratePerTierDiscountPoly.call(i)).toNumber(), - // _ratePerTierDiscountPoly[stoId][i].toNumber(), - // "Incorrect _ratePerTierDiscountPoly in config" - // ); - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(i)).toNumber(), - // _tokensPerTierTotal[stoId][i].toNumber(), - // "Incorrect _tokensPerTierTotal in config" - // ); - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].tokensPerTierDiscountPoly.call(i)).toNumber(), - // _tokensPerTierDiscountPoly[stoId][i].toNumber(), - // "Incorrect _tokensPerTierDiscountPoly in config" - // ); - // } + for (var i = 0; i < _ratePerTier[stoId].length; i++) { + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[0].toNumber(), + _ratePerTier[stoId][i].toNumber(), + "Incorrect _ratePerTier in config" + ); + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[1].toNumber(), + _ratePerTierDiscountPoly[stoId][i].toNumber(), + "Incorrect _ratePerTierDiscountPoly in config" + ); + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[2].toNumber(), + _tokensPerTierTotal[stoId][i].toNumber(), + "Incorrect _tokensPerTierTotal in config" + ); + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[3].toNumber(), + _tokensPerTierDiscountPoly[stoId][i].toNumber(), + "Incorrect _tokensPerTierDiscountPoly in config" + ); + } assert.equal( (await I_USDTieredSTO_Array[stoId].nonAccreditedLimitUSD.call()).toNumber(), _nonAccreditedLimitUSD[stoId].toNumber(), @@ -512,28 +512,28 @@ contract("USDTieredSTO", accounts => { assert.equal(await I_USDTieredSTO_Array[stoId].startTime.call(), _startTime[stoId], "Incorrect _startTime in config"); assert.equal(await I_USDTieredSTO_Array[stoId].endTime.call(), _endTime[stoId], "Incorrect _endTime in config"); - // for (var i = 0; i < _ratePerTier[stoId].length; i++) { - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].ratePerTier.call(i)).toNumber(), - // _ratePerTier[stoId][i].toNumber(), - // "Incorrect _ratePerTier in config" - // ); - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].ratePerTierDiscountPoly.call(i)).toNumber(), - // _ratePerTierDiscountPoly[stoId][i].toNumber(), - // "Incorrect _ratePerTierDiscountPoly in config" - // ); - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(i)).toNumber(), - // _tokensPerTierTotal[stoId][i].toNumber(), - // "Incorrect _tokensPerTierTotal in config" - // ); - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].tokensPerTierDiscountPoly.call(i)).toNumber(), - // _tokensPerTierDiscountPoly[stoId][i].toNumber(), - // "Incorrect _tokensPerTierDiscountPoly in config" - // ); - // } + for (var i = 0; i < _ratePerTier[stoId].length; i++) { + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[0].toNumber(), + _ratePerTier[stoId][i].toNumber(), + "Incorrect _ratePerTier in config" + ); + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[1].toNumber(), + _ratePerTierDiscountPoly[stoId][i].toNumber(), + "Incorrect _ratePerTierDiscountPoly in config" + ); + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[2].toNumber(), + _tokensPerTierTotal[stoId][i].toNumber(), + "Incorrect _tokensPerTierTotal in config" + ); + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[3].toNumber(), + _tokensPerTierDiscountPoly[stoId][i].toNumber(), + "Incorrect _tokensPerTierDiscountPoly in config" + ); + } assert.equal( (await I_USDTieredSTO_Array[stoId].nonAccreditedLimitUSD.call()).toNumber(), _nonAccreditedLimitUSD[stoId].toNumber(), @@ -637,6 +637,45 @@ contract("USDTieredSTO", accounts => { I_USDTieredSTO_Array.push(USDTieredSTO.at(tx.logs[2].args._module)); }); + it("Should successfully attach the fifth STO module to the security token", async () => { + let stoId = 4; // Non-divisible tokens + + _startTime.push(latestTime() + duration.days(2)); + _endTime.push(_startTime[stoId] + duration.days(100)); + _ratePerTier.push([BigNumber(1 * 10 ** 18), BigNumber(1.5 * 10 ** 18)]); // [ 1 USD/Token, 1.5 USD/Token ] + _ratePerTierDiscountPoly.push([BigNumber(0.5 * 10 ** 18), BigNumber(1 * 10 ** 18)]); // [ 0.5 USD/Token, 1.5 USD/Token ] + _tokensPerTierTotal.push([BigNumber(100 * 10 ** 18), BigNumber(50 * 10 ** 18)]); // [ 100 Token, 50 Token ] + _tokensPerTierDiscountPoly.push([BigNumber(100 * 10 ** 18), BigNumber(25 * 10 ** 18)]); // [ 100 Token, 25 Token ] + _nonAccreditedLimitUSD.push(BigNumber(25 * 10 ** 18)); // [ 25 USD ] + _minimumInvestmentUSD.push(BigNumber(5)); + _fundRaiseTypes.push([0, 1, 2]); + _wallet.push(WALLET); + _reserveWallet.push(RESERVEWALLET); + _usdToken.push(I_DaiToken.address); + + let config = [ + _startTime[stoId], + _endTime[stoId], + _ratePerTier[stoId], + _ratePerTierDiscountPoly[stoId], + _tokensPerTierTotal[stoId], + _tokensPerTierDiscountPoly[stoId], + _nonAccreditedLimitUSD[stoId], + _minimumInvestmentUSD[stoId], + _fundRaiseTypes[stoId], + _wallet[stoId], + _reserveWallet[stoId], + _usdToken[stoId] + ]; + + let bytesSTO = web3.eth.abi.encodeFunctionCall(functionSignature, config); + let tx = await I_SecurityToken.addModule(I_USDTieredSTOFactory.address, bytesSTO, 0, 0, { from: ISSUER, gasPrice: GAS_PRICE }); + console.log(" Gas addModule: ".grey + tx.receipt.gasUsed.toString().grey); + assert.equal(tx.logs[2].args._types[0], STOKEY, "USDTieredSTO doesn't get deployed"); + assert.equal(web3.utils.hexToString(tx.logs[2].args._name), "USDTieredSTO", "USDTieredSTOFactory module was not added"); + I_USDTieredSTO_Array.push(USDTieredSTO.at(tx.logs[2].args._module)); + }); + it("Should fail because rates and tier array of different length", async () => { let stoId = 0; @@ -864,26 +903,26 @@ contract("USDTieredSTO", accounts => { [BigNumber(15 * 10 ** 20)], { from: ISSUER } ); - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].ratePerTier.call(0)).toNumber(), - // BigNumber(15 * 10 ** 18).toNumber(), - // "STO Configuration doesn't set as expected" - // ); - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].ratePerTierDiscountPoly.call(0)).toNumber(), - // BigNumber(13 * 10 ** 18).toNumber(), - // "STO Configuration doesn't set as expected" - // ); - // assert.equal( - // await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(0), - // BigNumber(15 * 10 ** 20).toNumber(), - // "STO Configuration doesn't set as expected" - // ); - // assert.equal( - // await I_USDTieredSTO_Array[stoId].tokensPerTierDiscountPoly.call(0), - // BigNumber(15 * 10 ** 20).toNumber(), - // "STO Configuration doesn't set as expected" - // ); + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(0))[0].toNumber(), + BigNumber(15 * 10 ** 18).toNumber(), + "STO Configuration doesn't set as expected" + ); + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(0))[1].toNumber(), + BigNumber(13 * 10 ** 18).toNumber(), + "STO Configuration doesn't set as expected" + ); + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(0))[2], + BigNumber(15 * 10 ** 20).toNumber(), + "STO Configuration doesn't set as expected" + ); + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(0))[3], + BigNumber(15 * 10 ** 20).toNumber(), + "STO Configuration doesn't set as expected" + ); let tempTime1 = latestTime() + duration.days(0.1); let tempTime2 = latestTime() + duration.days(0.2); @@ -3725,6 +3764,191 @@ contract("USDTieredSTO", accounts => { ); }); + it("should successfully buy a granular amount and refund balance when buying indivisible token with POLY", async () => { + await I_SecurityToken.changeGranularity(10 ** 18, {from: ISSUER}); + let stoId = 4; + let tierId = 0; + await I_USDTieredSTO_Array[stoId].changeAccredited([ACCREDITED1], [true], { from: ISSUER }); + let investment_Tokens = (new BigNumber(10.5)).mul(10 ** 18); + let investment_POLY = await convert(stoId, tierId, true, "TOKEN", "POLY", investment_Tokens); + + let refund_Tokens = (new BigNumber(0.5)).mul(10 ** 18); + let refund_POLY = await convert(stoId, tierId, true, "TOKEN", "POLY", refund_Tokens); + + await I_PolyToken.getTokens(investment_POLY, ACCREDITED1); + await I_PolyToken.approve(I_USDTieredSTO_Array[stoId].address, investment_POLY, { from: ACCREDITED1 }); + + let init_TokenSupply = await I_SecurityToken.totalSupply(); + let init_InvestorTokenBal = await I_SecurityToken.balanceOf(ACCREDITED1); + let init_InvestorETHBal = BigNumber(await web3.eth.getBalance(ACCREDITED1)); + let init_InvestorPOLYBal = await I_PolyToken.balanceOf(ACCREDITED1); + let init_STOTokenSold = await I_USDTieredSTO_Array[stoId].getTokensSold(); + let init_STOETHBal = BigNumber(await web3.eth.getBalance(I_USDTieredSTO_Array[stoId].address)); + let init_STOPOLYBal = await I_PolyToken.balanceOf(I_USDTieredSTO_Array[stoId].address); + let init_RaisedETH = await I_USDTieredSTO_Array[stoId].fundsRaised.call(ETH); + let init_RaisedPOLY = await I_USDTieredSTO_Array[stoId].fundsRaised.call(POLY); + let init_WalletETHBal = BigNumber(await web3.eth.getBalance(WALLET)); + let init_WalletPOLYBal = await I_PolyToken.balanceOf(WALLET); + + // Buy With POLY + let tx2 = await I_USDTieredSTO_Array[stoId].buyWithPOLY(ACCREDITED1, investment_POLY, { + from: ACCREDITED1, + gasPrice: GAS_PRICE + }); + let gasCost2 = BigNumber(GAS_PRICE).mul(tx2.receipt.gasUsed); + console.log(" Gas buyWithPOLY: ".grey + tx2.receipt.gasUsed.toString().grey); + + let final_TokenSupply = await I_SecurityToken.totalSupply(); + let final_InvestorTokenBal = await I_SecurityToken.balanceOf(ACCREDITED1); + let final_InvestorETHBal = BigNumber(await web3.eth.getBalance(ACCREDITED1)); + let final_InvestorPOLYBal = await I_PolyToken.balanceOf(ACCREDITED1); + let final_STOTokenSold = await I_USDTieredSTO_Array[stoId].getTokensSold(); + let final_STOETHBal = BigNumber(await web3.eth.getBalance(I_USDTieredSTO_Array[stoId].address)); + let final_STOPOLYBal = await I_PolyToken.balanceOf(I_USDTieredSTO_Array[stoId].address); + let final_RaisedETH = await I_USDTieredSTO_Array[stoId].fundsRaised.call(ETH); + let final_RaisedPOLY = await I_USDTieredSTO_Array[stoId].fundsRaised.call(POLY); + let final_WalletETHBal = BigNumber(await web3.eth.getBalance(WALLET)); + let final_WalletPOLYBal = await I_PolyToken.balanceOf(WALLET); + + assert.equal( + final_TokenSupply.toNumber(), + init_TokenSupply + .add(investment_Tokens) + .sub(refund_Tokens) + .toNumber(), + "Token Supply not changed as expected" + ); + assert.equal( + final_InvestorTokenBal.toNumber(), + init_InvestorTokenBal + .add(investment_Tokens) + .sub(refund_Tokens) + .toNumber(), + "Investor Token Balance not changed as expected" + ); + assert.equal( + final_InvestorETHBal.toNumber(), + init_InvestorETHBal.sub(gasCost2).toNumber(), + "Investor ETH Balance not changed as expected" + ); + assert.equal( + final_InvestorPOLYBal.toNumber(), + init_InvestorPOLYBal + .sub(investment_POLY) + .add(refund_POLY) + .toNumber(), + "Investor POLY Balance not changed as expected" + ); + assert.equal( + final_STOTokenSold.toNumber(), + init_STOTokenSold + .add(investment_Tokens) + .sub(refund_Tokens) + .toNumber(), + "STO Token Sold not changed as expected" + ); + assert.equal(final_STOETHBal.toNumber(), init_STOETHBal.toNumber(), "STO ETH Balance not changed as expected"); + assert.equal(final_STOPOLYBal.toNumber(), init_STOPOLYBal.toNumber(), "STO POLY Balance not changed as expected"); + assert.equal(final_RaisedETH.toNumber(), init_RaisedETH.toNumber(), "Raised ETH not changed as expected"); + assert.equal( + final_RaisedPOLY.toNumber(), + init_RaisedPOLY + .add(investment_POLY) + .sub(refund_POLY) + .toNumber(), + "Raised POLY not changed as expected" + ); + assert.equal(final_WalletETHBal.toNumber(), init_WalletETHBal.toNumber(), "Wallet ETH Balance not changed as expected"); + assert.equal( + final_WalletPOLYBal.toNumber(), + init_WalletPOLYBal + .add(investment_POLY) + .sub(refund_POLY) + .toNumber(), + "Wallet POLY Balance not changed as expected" + ); + await I_SecurityToken.changeGranularity(1, {from: ISSUER}); + }); + + it("should successfully buy a granular amount and refund balance when buying indivisible token with ETH", async () => { + await I_SecurityToken.changeGranularity(10**18, {from: ISSUER}); + let stoId = 4; + let tierId = 0; + let investment_Tokens = BigNumber(10.5).mul(10**18); + let investment_ETH = await convert(stoId, tierId, true, "TOKEN", "ETH", investment_Tokens); + console.log(investment_ETH.toString()); + let refund_Tokens = BigNumber(0.5).mul(10**18); + let refund_ETH = await convert(stoId, tierId, true, "TOKEN", "ETH", refund_Tokens); + console.log(refund_ETH.toString()); + + let init_TokenSupply = await I_SecurityToken.totalSupply(); + let init_InvestorTokenBal = await I_SecurityToken.balanceOf(ACCREDITED1); + let init_InvestorETHBal = BigNumber(await web3.eth.getBalance(ACCREDITED1)); + let init_STOTokenSold = await I_USDTieredSTO_Array[stoId].getTokensSold(); + let init_STOETHBal = BigNumber(await web3.eth.getBalance(I_USDTieredSTO_Array[stoId].address)); + let init_STOPOLYBal = await I_PolyToken.balanceOf(I_USDTieredSTO_Array[stoId].address); + let init_RaisedETH = await I_USDTieredSTO_Array[stoId].fundsRaised.call(ETH); + let init_RaisedPOLY = await I_USDTieredSTO_Array[stoId].fundsRaised.call(POLY); + + + // Buy With ETH + let tx2 = await I_USDTieredSTO_Array[stoId].buyWithETH(ACCREDITED1, { + from: ACCREDITED1, + gasPrice: GAS_PRICE, + value: investment_ETH + }); + let gasCost2 = BigNumber(GAS_PRICE).mul(tx2.receipt.gasUsed); + console.log(" Gas buyWithETH: ".grey + tx2.receipt.gasUsed.toString().grey); + + let final_TokenSupply = await I_SecurityToken.totalSupply(); + let final_InvestorTokenBal = await I_SecurityToken.balanceOf(ACCREDITED1); + let final_InvestorETHBal = BigNumber(await web3.eth.getBalance(ACCREDITED1)); + let final_STOTokenSold = await I_USDTieredSTO_Array[stoId].getTokensSold(); + let final_STOETHBal = BigNumber(await web3.eth.getBalance(I_USDTieredSTO_Array[stoId].address)); + let final_STOPOLYBal = await I_PolyToken.balanceOf(I_USDTieredSTO_Array[stoId].address); + let final_RaisedETH = await I_USDTieredSTO_Array[stoId].fundsRaised.call(ETH); + let final_RaisedPOLY = await I_USDTieredSTO_Array[stoId].fundsRaised.call(POLY); + + assert.equal( + final_TokenSupply.toNumber(), + init_TokenSupply + .add(investment_Tokens) + .sub(refund_Tokens) + .toNumber(), + "Token Supply not changed as expected" + ); + assert.equal( + final_InvestorTokenBal.toNumber(), + init_InvestorTokenBal + .add(investment_Tokens) + .sub(refund_Tokens) + .toNumber(), + "Investor Token Balance not changed as expected" + ); + assert.equal( + final_InvestorETHBal.toNumber(), + init_InvestorETHBal.sub(investment_ETH).sub(gasCost2).add(refund_ETH).toNumber(), + "Investor ETH Balance not changed as expected" + ); + assert.equal( + final_STOTokenSold.toNumber(), + init_STOTokenSold + .add(investment_Tokens) + .sub(refund_Tokens) + .toNumber(), + "STO Token Sold not changed as expected" + ); + assert.equal(final_STOETHBal.toNumber(), init_STOETHBal.toNumber(), "STO ETH Balance not changed as expected"); + assert.equal(final_STOPOLYBal.toNumber(), init_STOPOLYBal.toNumber(), "STO POLY Balance not changed as expected"); + assert.equal(final_RaisedETH.toNumber(), init_RaisedETH.add(investment_ETH).sub(refund_ETH).toNumber(), "Raised ETH not changed as expected"); + assert.equal( + final_RaisedPOLY.toNumber(), + init_RaisedPOLY, + "Raised POLY not changed as expected" + ); + await I_SecurityToken.changeGranularity(1, {from: ISSUER}); + }); + it("should fail and revert when NONACCREDITED cap reached", async () => { let stoId = 2; let tierId = 0; diff --git a/test/q_usd_tiered_sto_sim.js b/test/q_usd_tiered_sto_sim.js index e22c9c4ac..55f84f2b3 100644 --- a/test/q_usd_tiered_sto_sim.js +++ b/test/q_usd_tiered_sto_sim.js @@ -297,28 +297,28 @@ contract("USDTieredSTO Sim", accounts => { assert.equal(await I_USDTieredSTO_Array[stoId].startTime.call(), _startTime[stoId], "Incorrect _startTime in config"); assert.equal(await I_USDTieredSTO_Array[stoId].endTime.call(), _endTime[stoId], "Incorrect _endTime in config"); - // for (var i = 0; i < _ratePerTier[stoId].length; i++) { - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].ratePerTier.call(i)).toNumber(), - // _ratePerTier[stoId][i].toNumber(), - // "Incorrect _ratePerTier in config" - // ); - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].ratePerTierDiscountPoly.call(i)).toNumber(), - // _ratePerTierDiscountPoly[stoId][i].toNumber(), - // "Incorrect _ratePerTierDiscountPoly in config" - // ); - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].tokensPerTierTotal.call(i)).toNumber(), - // _tokensPerTierTotal[stoId][i].toNumber(), - // "Incorrect _tokensPerTierTotal in config" - // ); - // assert.equal( - // (await I_USDTieredSTO_Array[stoId].tokensPerTierDiscountPoly.call(i)).toNumber(), - // _tokensPerTierDiscountPoly[stoId][i].toNumber(), - // "Incorrect _tokensPerTierDiscountPoly in config" - // ); - // } + for (var i = 0; i < _ratePerTier[stoId].length; i++) { + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[0].toNumber(), + _ratePerTier[stoId][i].toNumber(), + "Incorrect _ratePerTier in config" + ); + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[1].toNumber(), + _ratePerTierDiscountPoly[stoId][i].toNumber(), + "Incorrect _ratePerTierDiscountPoly in config" + ); + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[2].toNumber(), + _tokensPerTierTotal[stoId][i].toNumber(), + "Incorrect _tokensPerTierTotal in config" + ); + assert.equal( + (await I_USDTieredSTO_Array[stoId].tiers.call(i))[3].toNumber(), + _tokensPerTierDiscountPoly[stoId][i].toNumber(), + "Incorrect _tokensPerTierDiscountPoly in config" + ); + } assert.equal( (await I_USDTieredSTO_Array[stoId].nonAccreditedLimitUSD.call()).toNumber(), _nonAccreditedLimitUSD[stoId].toNumber(), From aecda44f7d763a7f056a3c6721533b98e3352be8 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 8 Nov 2018 20:06:26 +0530 Subject: [PATCH 029/139] Minor bug fix in test --- test/p_usd_tiered_sto.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/p_usd_tiered_sto.js b/test/p_usd_tiered_sto.js index fedf52294..bb73757a4 100644 --- a/test/p_usd_tiered_sto.js +++ b/test/p_usd_tiered_sto.js @@ -3875,11 +3875,9 @@ contract("USDTieredSTO", accounts => { let stoId = 4; let tierId = 0; let investment_Tokens = BigNumber(10.5).mul(10**18); - let investment_ETH = await convert(stoId, tierId, true, "TOKEN", "ETH", investment_Tokens); - console.log(investment_ETH.toString()); + let investment_ETH = await convert(stoId, tierId, false, "TOKEN", "ETH", investment_Tokens); let refund_Tokens = BigNumber(0.5).mul(10**18); - let refund_ETH = await convert(stoId, tierId, true, "TOKEN", "ETH", refund_Tokens); - console.log(refund_ETH.toString()); + let refund_ETH = await convert(stoId, tierId, false, "TOKEN", "ETH", refund_Tokens); let init_TokenSupply = await I_SecurityToken.totalSupply(); let init_InvestorTokenBal = await I_SecurityToken.balanceOf(ACCREDITED1); From 001549201e5ea08c50280698f63c6ba965ba35cb Mon Sep 17 00:00:00 2001 From: Polymath Date: Thu, 8 Nov 2018 14:29:29 -0300 Subject: [PATCH 030/139] typo fix --- CLI/commands/permission_manager.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/CLI/commands/permission_manager.js b/CLI/commands/permission_manager.js index 4fd649467..edcf9d5a0 100644 --- a/CLI/commands/permission_manager.js +++ b/CLI/commands/permission_manager.js @@ -258,10 +258,13 @@ async function getDelegatesAndPermissions() { let moduleName = web3.utils.hexToUtf8((await securityToken.methods.getModule(module).call())[0]); let permissionName = web3.utils.hexToUtf8(permission); for (delegateAddr of allDelegates) { - if (result[delegateAddr] != undefined) { - result[delegateAddr].push({module: moduleName, permission: permissionName}) + if (result[delegateAddr] == undefined) { + result[delegateAddr] = [] + } + if (result[delegateAddr][moduleName] == undefined) { + result[delegateAddr][moduleName] = [{permission: permissionName}] } else { - result[delegateAddr] = [{module: moduleName, permission: permissionName}] + result[delegateAddr][moduleName].push({permission: permissionName}) } } } @@ -271,15 +274,19 @@ async function getDelegatesAndPermissions() { return result } -function renderTable(permisions, address) { +function renderTable(permissions, address) { let result = ``; - if (permisions[address] != undefined) { - for (const obj of permisions[address]) { + if (permissions[address] != undefined) { + Object.keys(permissions[address]).forEach((module) => { result += ` - ${obj.module} -> ${obj.permission}`; - } + ${module} -> `; + (permissions[address][module]).forEach((perm) => { + result += `${perm.permission}, `; + }) + result = result.slice(0, -2); + }) } else { - result = `-`; + result += `-`; } return result } From f928a6fd95cde6ddbdecd438341ba0fe1ddd3185 Mon Sep 17 00:00:00 2001 From: Polymath Date: Thu, 8 Nov 2018 15:51:06 -0300 Subject: [PATCH 031/139] WA for external calls --- CLI/commands/accredit.js | 4 ++++ CLI/commands/changeNonAccreditedLimit.js | 4 ++++ CLI/commands/multi_mint.js | 4 ++++ CLI/commands/whitelist.js | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/CLI/commands/accredit.js b/CLI/commands/accredit.js index 43fbac4ae..a0aa306a2 100644 --- a/CLI/commands/accredit.js +++ b/CLI/commands/accredit.js @@ -3,6 +3,7 @@ var csv = require('fast-csv'); var BigNumber = require('bignumber.js'); var chalk = require('chalk'); var common = require('./common/common_functions'); +var global = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis') @@ -15,6 +16,7 @@ let usdTieredSTO; let tokenSymbol = process.argv.slice(2)[0]; //token symbol let BATCH_SIZE = process.argv.slice(2)[1]; //batch size if (!BATCH_SIZE) BATCH_SIZE = 75; +let remoteNetwork = process.argv.slice(2)[2]; /////////////////////////GLOBAL VARS////////////////////////////////////////// //distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] @@ -31,6 +33,8 @@ let badData = new Array(); startScript(); async function startScript() { + if (remoteNetwork == 'undefined') remoteNetwork = undefined; + await global.initialize(remoteNetwork); try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); diff --git a/CLI/commands/changeNonAccreditedLimit.js b/CLI/commands/changeNonAccreditedLimit.js index 8a27036a6..b4d5e3c6b 100644 --- a/CLI/commands/changeNonAccreditedLimit.js +++ b/CLI/commands/changeNonAccreditedLimit.js @@ -3,6 +3,7 @@ var csv = require('fast-csv'); var BigNumber = require('bignumber.js'); var chalk = require('chalk'); var common = require('./common/common_functions'); +var global = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis') @@ -15,6 +16,7 @@ let usdTieredSTO; let tokenSymbol = process.argv.slice(2)[0]; //token symbol let BATCH_SIZE = process.argv.slice(2)[1]; //batch size if (!BATCH_SIZE) BATCH_SIZE = 75; +let remoteNetwork = process.argv.slice(2)[2]; /////////////////////////GLOBAL VARS////////////////////////////////////////// //distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] @@ -31,6 +33,8 @@ let badData = new Array(); startScript(); async function startScript() { + if (remoteNetwork == 'undefined') remoteNetwork = undefined; + await global.initialize(remoteNetwork); try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); diff --git a/CLI/commands/multi_mint.js b/CLI/commands/multi_mint.js index 064e51bad..b138ef849 100644 --- a/CLI/commands/multi_mint.js +++ b/CLI/commands/multi_mint.js @@ -3,6 +3,7 @@ var csv = require('fast-csv'); var BigNumber = require('bignumber.js'); const chalk = require('chalk'); var common = require('./common/common_functions'); +var global = require('./common/global'); /////////////////////////////ARTIFACTS////////////////////////////////////////// var contracts = require('./helpers/contract_addresses'); @@ -16,6 +17,7 @@ let securityToken; let tokenSymbol = process.argv.slice(2)[0]; //token symbol let BATCH_SIZE = process.argv.slice(2)[1]; //batch size if (!BATCH_SIZE) BATCH_SIZE = 75; +let remoteNetwork = process.argv.slice(2)[2]; /////////////////////////GLOBAL VARS////////////////////////////////////////// @@ -33,6 +35,8 @@ let badData = new Array(); startScript(); async function startScript() { + if (remoteNetwork == 'undefined') remoteNetwork = undefined; + await global.initialize(remoteNetwork); try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); diff --git a/CLI/commands/whitelist.js b/CLI/commands/whitelist.js index 8722d3789..5ef201195 100644 --- a/CLI/commands/whitelist.js +++ b/CLI/commands/whitelist.js @@ -2,6 +2,7 @@ var fs = require('fs'); var csv = require('fast-csv'); var BigNumber = require('bignumber.js'); var common = require('./common/common_functions'); +var global = require('./common/global'); /////////////////////////////ARTIFACTS////////////////////////////////////////// var contracts = require('./helpers/contract_addresses'); @@ -11,6 +12,7 @@ var abis = require('./helpers/contract_abis'); let tokenSymbol = process.argv.slice(2)[0]; //token symbol let BATCH_SIZE = process.argv.slice(2)[1]; //batch size if (!BATCH_SIZE) BATCH_SIZE = 70; +let remoteNetwork = process.argv.slice(2)[2]; /////////////////////////GLOBAL VARS////////////////////////////////////////// @@ -30,6 +32,8 @@ const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); startScript(); async function startScript() { + if (remoteNetwork == 'undefined') remoteNetwork = undefined; + await global.initialize(remoteNetwork); try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); From 95d296b186421a7b2b3bdcbcf30bf535bca1a882 Mon Sep 17 00:00:00 2001 From: Polymath Date: Thu, 8 Nov 2018 20:34:15 -0300 Subject: [PATCH 032/139] fixing remoteNetwork error for external execution --- CLI/commands/ST20Generator.js | 8 ++++---- CLI/commands/common/global.js | 5 +++-- CLI/commands/strMigrator.js | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index 9a7ac39b6..a7dabe7d7 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -242,11 +242,11 @@ async function step_Wallet_Issuance(){ async function multi_mint_tokens() { //await whitelist.startWhitelisting(tokenSymbol); - shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${gbl.constants.NETWORK}`); + shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${remoteNetwork}`); console.log(chalk.green(`\nCongrats! All the affiliates get succssfully whitelisted, Now its time to Mint the tokens\n`)); console.log(chalk.red(`WARNING: `) + `Please make sure all the addresses that get whitelisted are only eligible to hold or get Security token\n`); - shell.exec(`${__dirname}/scripts//script.sh Multimint ${tokenSymbol} 75 ${gbl.constants.NETWORK}`); + shell.exec(`${__dirname}/scripts//script.sh Multimint ${tokenSymbol} 75 ${remoteNetwork}`); console.log(chalk.green(`\nHurray!! Tokens get successfully Minted and transferred to token holders`)); } @@ -1003,7 +1003,7 @@ async function usdTieredSTO_configure() { await common.sendTransaction(changeAccreditedAction); break; case 2: - shell.exec(`${__dirname}/scripts/script.sh Accredit ${tokenSymbol} 75 ${gbl.constants.NETWORK}`); + shell.exec(`${__dirname}/scripts/script.sh Accredit ${tokenSymbol} 75 ${remoteNetwork}`); break; case 3: let account = readlineSync.question('Enter the address to change non accredited limit: '); @@ -1015,7 +1015,7 @@ async function usdTieredSTO_configure() { await common.sendTransaction(changeNonAccreditedLimitAction); break; case 4: - shell.exec(`${__dirname}/scripts/script.sh NonAccreditedLimit ${tokenSymbol} 75 ${gbl.constants.NETWORK}`); + shell.exec(`${__dirname}/scripts/script.sh NonAccreditedLimit ${tokenSymbol} 75 ${remoteNetwork}`); break; case 5: await modfifyTimes(); diff --git a/CLI/commands/common/global.js b/CLI/commands/common/global.js index b4aa96607..e1fb648e2 100644 --- a/CLI/commands/common/global.js +++ b/CLI/commands/common/global.js @@ -1,7 +1,7 @@ const Web3 = require('web3'); const constants = require('./constants'); -global.web3, global.Issuer, global.defaultGasPrice; +global.web3, global.Issuer, global.defaultGasPrice, global.remoteNetwork; function getGasPrice (networkId) { let gasPrice; @@ -25,7 +25,8 @@ function getGasPrice (networkId) { } module.exports = { - initialize: async function(remoteNetwork) { + initialize: async function(network) { + remoteNetwork = network; if (typeof web3 === 'undefined' || typeof Issuer === 'undefined' || typeof defaultGasPrice === 'undefined') { if (typeof remoteNetwork !== 'undefined') { web3 = new Web3(new Web3.providers.HttpProvider(`https://${remoteNetwork}.infura.io/`)); diff --git a/CLI/commands/strMigrator.js b/CLI/commands/strMigrator.js index edc965236..1e42ec46d 100644 --- a/CLI/commands/strMigrator.js +++ b/CLI/commands/strMigrator.js @@ -356,7 +356,7 @@ ${failed.map(ticker => chalk.red(`${ticker.ticker}`)).join('\n')} } async function getABIfromEtherscan(_address) { - let urlDomain = gbl.constants.NETWORK == 'kovan' ? 'api-kovan' : 'api'; + let urlDomain = remoteNetwork == 'kovan' ? 'api-kovan' : 'api'; const options = { url: `https://${urlDomain}.etherscan.io/api`, qs: { From df78471efed8d0b658ae1999fc697088bceb407e Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 9 Nov 2018 11:24:13 +0530 Subject: [PATCH 033/139] Update tokenInfo.js --- scripts/tokenInfo.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/tokenInfo.js b/scripts/tokenInfo.js index 2df8c57c4..e8a59ca1a 100644 --- a/scripts/tokenInfo.js +++ b/scripts/tokenInfo.js @@ -14,7 +14,11 @@ async function getTokens() { let strEvents = await web3.eth.getPastLogs({fromBlock:'0x5C5C18', address:securityTokenRegistry.address, topics: ["0x2510d802a0818e71139a7680a6388bcffcd3fa686e02a0f7319488c5bdb38fcb"]}); for (let i = 0; i < strEvents.length; i++) { let tokenAddress = '0x' + strEvents[i].topics[1].slice(26,66) - await getInfo(tokenAddress); + try { + await getInfo(tokenAddress); + } catch(exception) { + console.log('Failed to load info of', tokenAddress, exception); + } } } From a59d1c080b34268ee8c72fc39017dac46c465fc4 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 9 Nov 2018 13:09:21 +0530 Subject: [PATCH 034/139] Code cleanup --- contracts/modules/STO/USDTieredSTO.sol | 30 +++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index 694f16e7e..0f5b083ad 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -389,15 +389,20 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { _buyWithTokens(_beneficiary, _investedPOLY, FundRaiseType.POLY, 0); } + function buyWithUSD(address _beneficiary, uint256 _investedDAI) public validDAI { + _buyWithTokens(_beneficiary, _investedDAI, FundRaiseType.DAI, 0); + } + /** * @notice Purchase tokens using ETH * @param _beneficiary Address where security tokens will be sent - * @param _minRate Minumum conversion rate (FundType => USD) at which buying is authorized + * @param _minTokens Minumum number of tokens to buy or else revert */ - function buyWithETHRateLimited(address _beneficiary, uint256 _minRate) public payable validETH { + function buyWithETHRateLimited(address _beneficiary, uint256 _minTokens) public payable validETH { uint256 rate = getRate(FundRaiseType.ETH); - require(rate >= _minRate, "Current rate below min"); + uint256 initialMinted = getTokensMinted(); (uint256 spentUSD, uint256 spentValue) = _buyTokens(_beneficiary, msg.value, rate, FundRaiseType.ETH); + require(getTokensMinted().sub(initialMinted) >= _minTokens, "Insufficient tokens minted"); // Modify storage investorInvested[_beneficiary][uint8(FundRaiseType.ETH)] = investorInvested[_beneficiary][uint8(FundRaiseType.ETH)].add(spentValue); fundsRaised[uint8(FundRaiseType.ETH)] = fundsRaised[uint8(FundRaiseType.ETH)].add(spentValue); @@ -412,26 +417,28 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { * @notice Purchase tokens using POLY * @param _beneficiary Address where security tokens will be sent * @param _investedPOLY Amount of POLY invested - * @param _minRate Maximum rate at which buying is authorized + * @param _minTokens Minumum number of tokens to buy or else revert */ - function buyWithPOLYRateLimited(address _beneficiary, uint256 _investedPOLY, uint256 _minRate) public validPOLY { - _buyWithTokens(_beneficiary, _investedPOLY, FundRaiseType.POLY, _minRate); + function buyWithPOLYRateLimited(address _beneficiary, uint256 _investedPOLY, uint256 _minTokens) public validPOLY { + _buyWithTokens(_beneficiary, _investedPOLY, FundRaiseType.POLY, _minTokens); } /** * @notice Purchase tokens using DAI * @param _beneficiary Address where security tokens will be sent * @param _investedDAI Amount of DAI invested + * @param _minTokens Minumum number of tokens to buy or else revert */ - function buyWithUSD(address _beneficiary, uint256 _investedDAI) public validDAI { - _buyWithTokens(_beneficiary, _investedDAI, FundRaiseType.DAI, uint256(10) ** 18); + function buyWithUSDRateLimited(address _beneficiary, uint256 _investedDAI, uint256 _minTokens) public validDAI { + _buyWithTokens(_beneficiary, _investedDAI, FundRaiseType.DAI, _minTokens); } - function _buyWithTokens(address _beneficiary, uint256 _tokenAmount, FundRaiseType _fundRaiseType, uint256 _minRate) internal { + function _buyWithTokens(address _beneficiary, uint256 _tokenAmount, FundRaiseType _fundRaiseType, uint256 _minTokens) internal { require(_fundRaiseType == FundRaiseType.POLY || _fundRaiseType == FundRaiseType.DAI, "Invalid raise type"); + uint256 initialMinted = getTokensMinted(); uint256 rate = getRate(_fundRaiseType); - require(rate >= _minRate, "Current rate below min"); (uint256 spentUSD, uint256 spentValue) = _buyTokens(_beneficiary, _tokenAmount, rate, _fundRaiseType); + require(getTokensMinted().sub(initialMinted) >= _minTokens, "Insufficient tokens minted"); // Modify storage investorInvested[_beneficiary][uint8(_fundRaiseType)] = investorInvested[_beneficiary][uint8(_fundRaiseType)].add(spentValue); fundsRaised[uint8(_fundRaiseType)] = fundsRaised[uint8(_fundRaiseType)].add(spentValue); @@ -468,8 +475,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 investedUSD = DecimalMath.mul(_rate, _investmentValue); // Check for minimum investment - //require(investedUSD.add(investorInvestedUSD[_beneficiary]) >= minimumInvestmentUSD, "Total investment < minimumInvestmentUSD"); - require(investedUSD >= minimumInvestmentUSD, "investment < minimumInvestmentUSD"); //Why do we need to add? + require(investedUSD >= minimumInvestmentUSD, "investment < minimumInvestmentUSD"); // Check for non-accredited cap if (!accredited[_beneficiary]) { From 7b8d265fff6045c31585a8b35b1253e9cddb2b20 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 9 Nov 2018 13:09:38 +0530 Subject: [PATCH 035/139] Added test of min rate --- test/p_usd_tiered_sto.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/p_usd_tiered_sto.js b/test/p_usd_tiered_sto.js index bb73757a4..86a2eded4 100644 --- a/test/p_usd_tiered_sto.js +++ b/test/p_usd_tiered_sto.js @@ -3972,6 +3972,30 @@ contract("USDTieredSTO", accounts => { ); }); + it("should fail when rate set my contract is too low", async () => { + let stoId = 4; + let tierId = 0; + await I_USDTieredSTO_Array[stoId].changeAccredited([ACCREDITED1], [true], { from: ISSUER }); + let investment_Tokens = new BigNumber(10 ** 18); + let investment_POLY = await convert(stoId, tierId, true, "TOKEN", "POLY", investment_Tokens); + let investment_ETH = await convert(stoId, tierId, true, "TOKEN", "ETH", investment_Tokens); + const minTokens = new BigNumber(10 ** 20); + + await I_PolyToken.getTokens(investment_POLY, ACCREDITED1); + await I_PolyToken.approve(I_USDTieredSTO_Array[stoId].address, investment_POLY, { from: ACCREDITED1 }); + + // Buy With POLY + await catchRevert(I_USDTieredSTO_Array[stoId].buyWithPOLYRateLimited(ACCREDITED1, investment_POLY, minTokens, { + from: ACCREDITED1, + gasPrice: GAS_PRICE + })); + await catchRevert(I_USDTieredSTO_Array[stoId].buyWithETHRateLimited(ACCREDITED1, minTokens, { + from: ACCREDITED1, + gasPrice: GAS_PRICE, + value: investment_ETH + })); + }); + it("should fail and revert despite oracle price change when NONACCREDITED cap reached", async () => { let stoId = 2; let tierId = 0; From dd6ff86372291226117416075b56724a4aff0ef6 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 9 Nov 2018 13:10:08 +0530 Subject: [PATCH 036/139] Updated changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c5796e34..19b70b8a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file. [__1.5.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __15-08-18__ ## Added +* Added an Array of Tiers that will hold data about every tier in USDSTO. +* Added `buyWithETHRateLimited`, `buyWithPOLYRateLimited` and `buyWithUSDRateLimited` to USDTSTO. * Added `getInvestorsAt` which returns the investors (non-zero balances) at a particular checkpoint * Added `iterateInvestors` to allow an a subset of `investors` to be returned from the security token in case `investors` is large. * `ChangeModuleBudget` in SecurityToken now takes in the change in budget rather than absoulte budget. Added boolean paramter to decide increase/decrease. @@ -42,6 +44,7 @@ All notable changes to this project will be documented in this file. * Change the function name of `withdraPoly` to `withdrawERC20` and make the function generalize to extract tokens from the ST contract. parmeters are contract address and the value need to extract from the securityToken. ## Removed +* Individual mappings for tier data removed in UDSTSTO. * Removed investors list pruning * Remove `swarmHash` from the `registerTicker(), addCustomTicker(), generateSecurityToken(), addCustomSecurityToken()` functions of TickerRegistry.sol and SecurityTokenRegistry.sol. #230 * Remove `Log` prefix from all the event present in the ecosystem. From 38881915551055013184b19a8d9dd67c31bc6610 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 9 Nov 2018 13:18:18 +0530 Subject: [PATCH 037/139] Minor nig fix --- contracts/modules/STO/USDTieredSTO.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index 0f5b083ad..27d714a0e 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -473,7 +473,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { require(_investmentValue > 0, "No funds were sent"); uint256 investedUSD = DecimalMath.mul(_rate, _investmentValue); - + _rate = investedUSD; // Reusing variable to prevent stackoverflow // Check for minimum investment require(investedUSD >= minimumInvestmentUSD, "investment < minimumInvestmentUSD"); @@ -515,7 +515,8 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { if (spentUSD == 0) { spentValue = 0; } else { - spentValue = DecimalMath.div(spentUSD, _rate); + //_rate is actually OriginalUSD. Reusing variable to prevent stackoverflow + spentValue = DecimalMath.mul(DecimalMath.div(spentUSD, _rate), _investmentValue); } // Return calculated amounts From 7dc32254ec1228878074ce431922e44d91685c31 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 9 Nov 2018 14:50:15 +0530 Subject: [PATCH 038/139] Added getSTODetails to USDTSTO --- CHANGELOG.md | 3 ++- contracts/modules/STO/USDTieredSTO.sol | 31 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19b70b8a2..869af0d8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ All notable changes to this project will be documented in this file. [__1.5.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __15-08-18__ ## Added -* Added an Array of Tiers that will hold data about every tier in USDSTO. +* Added `getSTODetails` to USDTSTO. +* Added an Array of Tiers that will hold data about every tier in USDTSTO. * Added `buyWithETHRateLimited`, `buyWithPOLYRateLimited` and `buyWithUSDRateLimited` to USDTSTO. * Added `getInvestorsAt` which returns the investors (non-zero balances) at a particular checkpoint * Added `iterateInvestors` to allow an a subset of `investors` to be returned from the security token in case `investors` is large. diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index 27d714a0e..1a38b559b 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -707,6 +707,37 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { return allPermissions; } + /** + * @notice Return the STO details + * @return Unixtimestamp at which offering gets start. + * @return Unixtimestamp at which offering ends. + * @return Currently active tier + * @return Array of Number of tokens this STO will be allowed to sell at different tiers. + * @return Array Rate at which tokens are sold at different tiers + * @return Amount of funds raised + * @return Number of individual investors this STO have. + * @return Amount of tokens sold. + */ + function getSTODetails() public view returns(uint256, uint256, uint256, uint256[], uint256[], uint256, uint256, uint256) { + uint256 len = tiers.length; + uint256[] memory cap = new uint256[](len); + uint256[] memory rate = new uint256[](len); + for(uint256 i = 0; i < len; i++) { + cap[i] = tiers[i].tokenTotal; + rate[i] = tiers[i].rate; + } + return ( + startTime, + endTime, + currentTier, + cap, + rate, + fundsRaisedUSD, + investorCount, + getTokensSold() + ); + } + /** * @notice This function returns the signature of configure function * @return bytes4 Configure function signature From 6c32108efdf492fc7748c0c2686105065630648d Mon Sep 17 00:00:00 2001 From: Polymath Date: Fri, 9 Nov 2018 09:04:06 -0300 Subject: [PATCH 039/139] gasPrice <-> value --- CLI/commands/dividends_manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLI/commands/dividends_manager.js b/CLI/commands/dividends_manager.js index f47d3fd67..0f423bf5d 100644 --- a/CLI/commands/dividends_manager.js +++ b/CLI/commands/dividends_manager.js @@ -344,7 +344,7 @@ async function createDividends(name, dividend, checkpointId) { createDividendAction = currentDividendsModule.methods.createDividendWithExclusions(maturityTime, expiryTime, excluded, web3.utils.toHex(name)); } } - let receipt = await common.sendTransaction(createDividendAction, {gasPrice: web3.utils.toWei(dividend)}); + let receipt = await common.sendTransaction(createDividendAction, {value: web3.utils.toWei(dividend)}); let event = common.getEventFromLogs(currentDividendsModule._jsonInterface, receipt.logs, 'EtherDividendDeposited'); console.log(` Dividend ${event._dividendIndex} deposited` From 601744478e6defe1c5f00d518d58ff7c72fe0c1e Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 9 Nov 2018 17:56:35 +0530 Subject: [PATCH 040/139] Updated getSTODetails --- contracts/modules/STO/USDTieredSTO.sol | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index 1a38b559b..ebc4517bb 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -717,15 +717,19 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { * @return Amount of funds raised * @return Number of individual investors this STO have. * @return Amount of tokens sold. + * @return Array of bools to show if funding is allowed in ETH, POLY, DAI respectively */ - function getSTODetails() public view returns(uint256, uint256, uint256, uint256[], uint256[], uint256, uint256, uint256) { - uint256 len = tiers.length; - uint256[] memory cap = new uint256[](len); - uint256[] memory rate = new uint256[](len); - for(uint256 i = 0; i < len; i++) { + function getSTODetails() public view returns(uint256, uint256, uint256, uint256[], uint256[], uint256, uint256, uint256, bool[]) { + uint256[] memory cap = new uint256[](tiers.length); + uint256[] memory rate = new uint256[](tiers.length); + for(uint256 i = 0; i < tiers.length; i++) { cap[i] = tiers[i].tokenTotal; rate[i] = tiers[i].rate; } + bool[] memory _fundRaiseTypes = new bool[](3); + _fundRaiseTypes[0] = fundRaiseTypes[uint8(FundRaiseType.ETH)]; + _fundRaiseTypes[1] = fundRaiseTypes[uint8(FundRaiseType.POLY)]; + _fundRaiseTypes[2] = fundRaiseTypes[uint8(FundRaiseType.DAI)]; return ( startTime, endTime, @@ -734,7 +738,8 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { rate, fundsRaisedUSD, investorCount, - getTokensSold() + getTokensSold(), + _fundRaiseTypes ); } From 6f1743453fbdb870c1f9059267c37afb9af1e493 Mon Sep 17 00:00:00 2001 From: Polymath Date: Fri, 9 Nov 2018 14:59:04 -0300 Subject: [PATCH 041/139] adding module address --- CLI/commands/permission_manager.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CLI/commands/permission_manager.js b/CLI/commands/permission_manager.js index c75b7af69..15f73d6c5 100644 --- a/CLI/commands/permission_manager.js +++ b/CLI/commands/permission_manager.js @@ -261,10 +261,10 @@ async function getDelegatesAndPermissions() { if (result[delegateAddr] == undefined) { result[delegateAddr] = [] } - if (result[delegateAddr][moduleName] == undefined) { - result[delegateAddr][moduleName] = [{permission: permissionName}] + if (result[delegateAddr][moduleName + '-' + module] == undefined) { + result[delegateAddr][moduleName + '-' + module] = [{permission: permissionName}] } else { - result[delegateAddr][moduleName].push({permission: permissionName}) + result[delegateAddr][moduleName + '-' + module].push({permission: permissionName}) } } } @@ -279,7 +279,7 @@ function renderTable(permissions, address) { if (permissions[address] != undefined) { Object.keys(permissions[address]).forEach((module) => { result += ` - ${module} -> `; + ${module.split('-')[0]} (${module.split('-')[1]}) -> `; (permissions[address][module]).forEach((perm) => { result += `${perm.permission}, `; }) From 01b7b72bdf2ff5a6ac5058d9204bb8b0f069b3aa Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Fri, 9 Nov 2018 15:23:04 -0300 Subject: [PATCH 042/139] gbl MODULES_TYPES fix --- CLI/commands/permission_manager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CLI/commands/permission_manager.js b/CLI/commands/permission_manager.js index 06fbf69a1..ef3e2ea60 100644 --- a/CLI/commands/permission_manager.js +++ b/CLI/commands/permission_manager.js @@ -238,8 +238,8 @@ async function getModulesWithPermissions() { async function getDelegatesAndPermissions() { let moduleABI = abis.moduleInterface(); let result = []; - for (const type in MODULES_TYPES) { - let modulesAttached = await securityToken.methods.getModulesByType(MODULES_TYPES[type]).call(); + for (const type in gbl.constants.MODULES_TYPES) { + let modulesAttached = await securityToken.methods.getModulesByType(gbl.constants.MODULES_TYPES[type]).call(); for (const module of modulesAttached) { let contractTemp = new web3.eth.Contract(moduleABI, module); let permissions = await contractTemp.methods.getPermissions().call(); From 491c46027d59f2a57b21c6fcd84b86ecdaa74760 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Mon, 12 Nov 2018 14:23:23 +0530 Subject: [PATCH 043/139] Function modifier changes --- contracts/modules/STO/USDTieredSTO.sol | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index ebc4517bb..e2a139ce4 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -200,7 +200,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { _modifyLimits(_nonAccreditedLimitUSD, _minimumInvestmentUSD); } - function modifyFunding(FundRaiseType[] _fundRaiseTypes) external { + function modifyFunding(FundRaiseType[] _fundRaiseTypes) external onlyOwner { /*solium-disable-next-line security/no-block-members*/ require(now < startTime, "STO already started"); _setFundRaiseType(_fundRaiseTypes); @@ -209,12 +209,10 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { function modifyLimits( uint256 _nonAccreditedLimitUSD, uint256 _minimumInvestmentUSD - ) external onlyFactoryOrOwner { + ) external onlyOwner { /*solium-disable-next-line security/no-block-members*/ require(now < startTime, "STO already started"); - minimumInvestmentUSD = _minimumInvestmentUSD; - nonAccreditedLimitUSD = _nonAccreditedLimitUSD; - emit SetLimits(minimumInvestmentUSD, nonAccreditedLimitUSD); + _modifyLimits(_nonAccreditedLimitUSD, _minimumInvestmentUSD); } function modifyTiers( @@ -222,7 +220,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256[] _ratePerTierDiscountPoly, uint256[] _tokensPerTierTotal, uint256[] _tokensPerTierDiscountPoly - ) external onlyFactoryOrOwner { + ) external onlyOwner { /*solium-disable-next-line security/no-block-members*/ require(now < startTime, "STO already started"); _modifyTiers(_ratePerTier, _ratePerTierDiscountPoly, _tokensPerTierTotal, _tokensPerTierDiscountPoly); @@ -231,7 +229,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { function modifyTimes( uint256 _startTime, uint256 _endTime - ) external onlyFactoryOrOwner { + ) external onlyOwner { _modifyTimes(_startTime, _endTime); } @@ -239,7 +237,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { address _wallet, address _reserveWallet, address _usdToken - ) external onlyFactoryOrOwner { + ) external onlyOwner { /*solium-disable-next-line security/no-block-members*/ require(now < startTime, "STO already started"); _modifyAddresses(_wallet, _reserveWallet, _usdToken); @@ -381,16 +379,16 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { } // For backwards compatibility - function buyWithETH(address _beneficiary) public payable { + function buyWithETH(address _beneficiary) external payable { buyWithETHRateLimited(_beneficiary, 0); } - function buyWithPOLY(address _beneficiary, uint256 _investedPOLY) public { - _buyWithTokens(_beneficiary, _investedPOLY, FundRaiseType.POLY, 0); + function buyWithPOLY(address _beneficiary, uint256 _investedPOLY) external { + buyWithPOLYRateLimited(_beneficiary, _investedPOLY, 0); } - function buyWithUSD(address _beneficiary, uint256 _investedDAI) public validDAI { - _buyWithTokens(_beneficiary, _investedDAI, FundRaiseType.DAI, 0); + function buyWithUSD(address _beneficiary, uint256 _investedDAI) external { + buyWithUSDRateLimited(_beneficiary, _investedDAI, 0); } /** From be22b4d7ad4b0006bc977a5bec5bab5edbd32cf6 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Mon, 12 Nov 2018 14:38:45 +0530 Subject: [PATCH 044/139] Minimum investment logic change --- contracts/modules/STO/USDTieredSTO.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index e2a139ce4..bd2df86c3 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -473,7 +473,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 investedUSD = DecimalMath.mul(_rate, _investmentValue); _rate = investedUSD; // Reusing variable to prevent stackoverflow // Check for minimum investment - require(investedUSD >= minimumInvestmentUSD, "investment < minimumInvestmentUSD"); + require(investedUSD.add(investorInvestedUSD[_beneficiary]) >= minimumInvestmentUSD, "Total investment < minimumInvestmentUSD"); // Check for non-accredited cap if (!accredited[_beneficiary]) { From 32d4b3cfb826c324f14d91e0671feb6808f3f097 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Mon, 12 Nov 2018 14:28:00 -0300 Subject: [PATCH 045/139] Merge remote-tracking branch 'origin/dev-2.1.0' into CLI-st20generator-refactoring --- .solcover.js | 4 +- CHANGELOG.md | 4 + CLI/commands/ST20Generator.js | 31 +- CLI/commands/TickerRollForward.js | 9 +- CLI/commands/accredit.js | 3 +- CLI/commands/changeNonAccreditedLimit.js | 3 +- CLI/commands/common/common_functions.js | 127 +++--- CLI/commands/common/constants.js | 34 ++ CLI/commands/common/global.js | 67 +-- CLI/commands/common/permissions_list.js | 2 +- CLI/commands/contract_manager.js | 31 +- CLI/commands/dividends_manager.js | 55 +-- CLI/commands/faucet.js | 12 +- CLI/commands/helpers/contract_addresses.js | 2 +- CLI/commands/investor_portal.js | 62 ++- CLI/commands/module_manager.js | 20 +- CLI/commands/multi_mint.js | 2 +- CLI/commands/permission_manager.js | 87 +++- CLI/commands/strMigrator.js | 26 +- CLI/commands/transfer.js | 11 +- CLI/commands/transfer_manager.js | 15 +- CLI/commands/transfer_ownership.js | 10 +- CLI/commands/whitelist.js | 2 +- CLI/polymath-cli.js | 42 +- README.md | 29 ++ contracts/Migrations.sol | 2 +- contracts/ModuleRegistry.sol | 19 +- contracts/Pausable.sol | 10 +- contracts/PolymathRegistry.sol | 6 +- contracts/ReclaimTokens.sol | 4 +- contracts/RegistryUpdater.sol | 4 +- contracts/SecurityTokenRegistry.sol | 60 ++- contracts/external/IMedianizer.sol | 1 + contracts/external/oraclizeAPI.sol | 2 +- contracts/helpers/PolyToken.sol | 64 +-- contracts/interfaces/IModule.sol | 6 +- contracts/interfaces/IModuleFactory.sol | 41 +- contracts/interfaces/IPolymathRegistry.sol | 4 +- contracts/interfaces/ISTFactory.sol | 15 +- contracts/interfaces/ISecurityToken.sol | 137 +++--- .../interfaces/ISecurityTokenRegistry.sol | 60 ++- contracts/interfaces/IUSDTieredSTOProxy.sol | 6 +- contracts/libraries/TokenLib.sol | 38 +- contracts/libraries/Util.sol | 14 +- contracts/libraries/VersionUtils.sol | 16 +- contracts/mocks/MockBurnFactory.sol | 7 +- contracts/mocks/MockModuleRegistry.sol | 2 +- contracts/mocks/MockRedemptionManager.sol | 11 +- contracts/mocks/PolyTokenFaucet.sol | 24 +- contracts/mocks/SecurityTokenRegistryMock.sol | 2 +- contracts/mocks/TestSTOFactory.sol | 2 +- contracts/modules/Burn/IBurn.sol | 1 + .../modules/Checkpoint/DividendCheckpoint.sol | 48 ++- .../Checkpoint/ERC20DividendCheckpoint.sol | 105 ++++- .../ERC20DividendCheckpointFactory.sol | 40 +- .../Checkpoint/EtherDividendCheckpoint.sol | 63 ++- .../EtherDividendCheckpointFactory.sol | 42 +- contracts/modules/Checkpoint/ICheckpoint.sol | 1 + .../Burn/TrackedRedemption.sol | 13 +- .../Burn/TrackedRedemptionFactory.sol | 44 +- .../Mixed/ScheduledCheckpoint.sol | 155 +++++++ .../Mixed/ScheduledCheckpointFactory.sol | 102 +++++ .../LockupVolumeRestrictionTM.sol | 15 +- .../LockupVolumeRestrictionTMFactory.sol | 42 +- .../SingleTradeVolumeRestrictionTM.sol | 53 ++- .../SingleTradeVolumeRestrictionTMFactory.sol | 49 +-- contracts/modules/ModuleFactory.sol | 52 ++- .../GeneralPermissionManager.sol | 28 +- .../GeneralPermissionManagerFactory.sol | 43 +- .../PermissionManager/IPermissionManager.sol | 18 +- contracts/modules/STO/CappedSTO.sol | 25 +- contracts/modules/STO/CappedSTOFactory.sol | 40 +- contracts/modules/STO/DummySTO.sol | 8 +- contracts/modules/STO/DummySTOFactory.sol | 39 +- contracts/modules/STO/ISTO.sol | 19 +- contracts/modules/STO/PreSaleSTO.sol | 33 +- contracts/modules/STO/PreSaleSTOFactory.sol | 41 +- .../ProxyFactory/USDTieredSTOProxyFactory.sol | 4 +- contracts/modules/STO/USDTieredSTO.sol | 111 +++-- contracts/modules/STO/USDTieredSTOFactory.sol | 42 +- .../TransferManager/CountTransferManager.sol | 15 +- .../CountTransferManagerFactory.sol | 41 +- .../GeneralTransferManager.sol | 40 +- .../GeneralTransferManagerFactory.sol | 43 +- .../ManualApprovalTransferManager.sol | 40 +- .../ManualApprovalTransferManagerFactory.sol | 37 +- .../PercentageTransferManager.sol | 4 +- .../PercentageTransferManagerFactory.sol | 39 +- contracts/oracles/MakerDAOOracle.sol | 4 + contracts/oracles/PolyOracle.sol | 47 ++- contracts/proxy/ModuleRegistryProxy.sol | 1 + contracts/proxy/OwnedUpgradeabilityProxy.sol | 3 +- contracts/proxy/Proxy.sol | 1 + .../proxy/SecurityTokenRegistryProxy.sol | 1 + contracts/proxy/UpgradeabilityProxy.sol | 7 +- contracts/tokens/SecurityToken.sol | 203 +++++---- docs/permissions_list.md | 3 +- migrations/2_deploy_contracts.js | 2 +- package.json | 9 +- scripts/tokenInfo.js | 72 ++++ test/b_capped_sto.js | 12 +- test/d_count_transfer_manager.js | 8 +- test/e_erc20_dividends.js | 8 +- test/f_ether_dividends.js | 10 +- test/g_general_permission_manager.js | 12 +- test/h_general_transfer_manager.js | 77 +++- test/helpers/createInstances.js | 22 +- test/helpers/signData.js | 6 +- test/j_manual_approval_transfer_manager.js | 8 +- test/l_percentage_transfer_manager.js | 47 ++- test/m_presale_sto.js | 6 +- test/o_security_token.js | 82 +++- test/p_usd_tiered_sto.js | 10 +- test/v_tracked_redemptions.js | 8 +- ...kup_volume_restriction_transfer_manager.js | 8 +- test/x_single_trade_volume_restriction.js | 8 +- test/y_scheduled_checkpoints.js | 389 ++++++++++++++++++ 117 files changed, 2397 insertions(+), 1459 deletions(-) create mode 100644 CLI/commands/common/constants.js rename contracts/modules/{ => Experimental}/Burn/TrackedRedemption.sol (81%) rename contracts/modules/{ => Experimental}/Burn/TrackedRedemptionFactory.sol (68%) create mode 100644 contracts/modules/Experimental/Mixed/ScheduledCheckpoint.sol create mode 100644 contracts/modules/Experimental/Mixed/ScheduledCheckpointFactory.sol rename contracts/modules/{ => Experimental}/TransferManager/LockupVolumeRestrictionTM.sol (96%) rename contracts/modules/{ => Experimental}/TransferManager/LockupVolumeRestrictionTMFactory.sol (75%) rename contracts/modules/{ => Experimental}/TransferManager/SingleTradeVolumeRestrictionTM.sol (90%) rename contracts/modules/{ => Experimental}/TransferManager/SingleTradeVolumeRestrictionTMFactory.sol (75%) create mode 100644 scripts/tokenInfo.js create mode 100644 test/y_scheduled_checkpoints.js diff --git a/.solcover.js b/.solcover.js index ffd077e28..23ac4d3ef 100644 --- a/.solcover.js +++ b/.solcover.js @@ -4,6 +4,6 @@ module.exports = { copyPackages: ['openzeppelin-solidity'], testCommand: 'node ../node_modules/.bin/truffle test `find test/*.js ! -name a_poly_oracle.js -and ! -name s_v130_to_v140_upgrade.js` --network coverage', deepSkip: true, - skipFiles: ['external', 'flat', 'helpers', 'mocks', 'oracles', 'libraries/KindMath.sol', 'storage'], - forceParse: ['mocks', 'oracles'] + skipFiles: ['external', 'flat', 'helpers', 'mocks', 'oracles', 'libraries/KindMath.sol', 'storage', 'modules/Experimental'], + forceParse: ['mocks', 'oracles', 'modules/Experimental'] }; diff --git a/CHANGELOG.md b/CHANGELOG.md index 319d15ebb..4c5796e34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ All notable changes to this project will be documented in this file. [__1.5.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __15-08-18__ ## Added +* Added `getInvestorsAt` which returns the investors (non-zero balances) at a particular checkpoint +* Added `iterateInvestors` to allow an a subset of `investors` to be returned from the security token in case `investors` is large. +* `ChangeModuleBudget` in SecurityToken now takes in the change in budget rather than absoulte budget. Added boolean paramter to decide increase/decrease. * Added `createCheckpoint() withPerm(CHECKPOINT)` to dividend checkpoint modules. * Added `deleteDelegate()` to general permission manager. It will disable the delegate but not delete the perms. * Migrated from `npm` to `yarn`. @@ -39,6 +42,7 @@ All notable changes to this project will be documented in this file. * Change the function name of `withdraPoly` to `withdrawERC20` and make the function generalize to extract tokens from the ST contract. parmeters are contract address and the value need to extract from the securityToken. ## Removed +* Removed investors list pruning * Remove `swarmHash` from the `registerTicker(), addCustomTicker(), generateSecurityToken(), addCustomSecurityToken()` functions of TickerRegistry.sol and SecurityTokenRegistry.sol. #230 * Remove `Log` prefix from all the event present in the ecosystem. * Removed `addTagByModuleType` & `removeTagsByModuleType` from MR. diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index ab230af89..556baf8eb 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -1,11 +1,10 @@ -const readlineSync = require('readline-sync'); -const moment = require('moment'); -const chalk = require('chalk'); -const contracts = require('./helpers/contract_addresses'); -const abis = require('./helpers/contract_abis'); -const common = require('./common/common_functions'); -const global = require('./common/global'); -const BigNumber = require('bignumber.js'); +var readlineSync = require('readline-sync'); +var BigNumber = require('bignumber.js'); +var moment = require('moment'); +var chalk = require('chalk'); +var contracts = require('./helpers/contract_addresses'); +var abis = require('./helpers/contract_abis'); +var common = require('./common/common_functions'); //////////////////////// let securityTokenRegistryAddress; @@ -16,9 +15,7 @@ let tokenLaunched; let securityTokenRegistry; let polyToken; -async function executeApp(_ticker, _transferOwnership, _name, _details, _divisible, _remoteNetwork) { - await global.initialize(_remoteNetwork); - +async function executeApp(_ticker, _transferOwnership, _name, _details, _divisible) { common.logAsciiBull(); console.log("********************************************"); console.log("Welcome to the Command-Line ST-20 Generator."); @@ -80,7 +77,7 @@ async function step_ticker_registration(_ticker) { available = true; await approvePoly(securityTokenRegistryAddress, regFee); let registerTickerAction = securityTokenRegistry.methods.registerTicker(Issuer.address, tokenSymbol, ""); - await common.sendTransaction(Issuer, registerTickerAction, defaultGasPrice, 0, 1.5); + await common.sendTransaction(registerTickerAction, {factor: 1.5}); } else if (details[0] == Issuer.address) { // If it has registration date and its owner is Issuer available = true; @@ -108,7 +105,7 @@ async function step_transfer_ticker_ownership(_transferOwnership) { if (newOwner) { let transferTickerOwnershipAction = securityTokenRegistry.methods.transferTickerOwnership(newOwner, tokenSymbol); - let receipt = await common.sendTransaction(Issuer, transferTickerOwnershipAction, defaultGasPrice, 0, 1.5); + let receipt = await common.sendTransaction(transferTickerOwnershipAction, {factor: 1.5}); let event = common.getEventFromLogs(securityTokenRegistry._jsonInterface, receipt.logs, 'ChangeTickerOwnership'); console.log(chalk.green(`Ownership trasferred successfully. The new owner is ${event._newOwner}`)); process.exit(0); @@ -148,7 +145,7 @@ async function step_token_deploy(_name, _details, _divisible) { await approvePoly(securityTokenRegistryAddress, launchFee); let generateSecurityTokenAction = securityTokenRegistry.methods.generateSecurityToken(tokenName, tokenSymbol, tokenDetails, divisibility); - let receipt = await common.sendTransaction(Issuer, generateSecurityTokenAction, defaultGasPrice); + let receipt = await common.sendTransaction(generateSecurityTokenAction); let event = common.getEventFromLogs(securityTokenRegistry._jsonInterface, receipt.logs, 'NewSecurityToken'); console.log(chalk.green(`Security Token has been successfully deployed at address ${event._securityTokenAddress}`)); } @@ -193,7 +190,7 @@ async function approvePoly(spender, fee) { return true; } else { let approveAction = polyToken.methods.approve(spender, web3.utils.toWei(fee.toString(), "ether")); - await common.sendTransaction(Issuer, approveAction, defaultGasPrice); + await common.sendTransaction(approveAction); } } else { let requiredBalance = parseInt(requiredAmount) - parseInt(polyBalance); @@ -205,7 +202,7 @@ async function approvePoly(spender, fee) { } module.exports = { - executeApp: async function(ticker, transferOwnership, name, details, divisible, remoteNode) { - return executeApp(ticker, transferOwnership, name, details, divisible, remoteNode); + executeApp: async function(ticker, transferOwnership, name, details, divisible) { + return executeApp(ticker, transferOwnership, name, details, divisible); } } diff --git a/CLI/commands/TickerRollForward.js b/CLI/commands/TickerRollForward.js index 97bd1f519..69d36575d 100644 --- a/CLI/commands/TickerRollForward.js +++ b/CLI/commands/TickerRollForward.js @@ -3,15 +3,11 @@ var csv = require('fast-csv'); var BigNumber = require('bignumber.js'); var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); ///////////////////////// ARTIFACTS ///////////////////////// var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); -////////////////////////////USER INPUTS////////////////////////////////////////// -let remoteNetwork = process.argv.slice(2)[0]; //batch size - ///////////////////////// GLOBAL VARS ///////////////////////// let ticker_data = []; let registered_tickers = []; @@ -47,7 +43,6 @@ function FailedRegistration(_ticker, _error) { startScript(); async function startScript() { - await global.initialize(remoteNetwork); securityTokenRegistryAddress = await contracts.securityTokenRegistry(); let securityTokenRegistryABI = abis.securityTokenRegistry(); @@ -88,7 +83,7 @@ async function registerTickers() { process.exit(0); } else { let approveAction = polyToken.methods.approve(securityTokenRegistryAddress, totalFee); - let receipt = await common.sendTransaction(Issuer, approveAction, defaultGasPrice); + let receipt = await common.sendTransaction(approveAction); totalGas = totalGas.add(receipt.gasUsed); } @@ -115,7 +110,7 @@ async function registerTickers() { if (valid) { try { let registerTickerAction = securityTokenRegistry.methods.registerTicker(owner, ticker_data[i].symbol, ticker_data[i].name); - let receipt = await common.sendTransaction(Issuer, registerTickerAction, defaultGasPrice); + let receipt = await common.sendTransaction(registerTickerAction); registered_tickers.push(ticker_data[i]); console.log(ticker_data[i]); totalGas = totalGas.add(receipt.gasUsed); diff --git a/CLI/commands/accredit.js b/CLI/commands/accredit.js index c4dbd78b6..a0aa306a2 100644 --- a/CLI/commands/accredit.js +++ b/CLI/commands/accredit.js @@ -35,6 +35,7 @@ startScript(); async function startScript() { if (remoteNetwork == 'undefined') remoteNetwork = undefined; await global.initialize(remoteNetwork); + try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); let securityTokenRegistryABI = abis.securityTokenRegistry(); @@ -130,7 +131,7 @@ async function changeAccredited() { } let changeAccreditedAction = usdTieredSTO.methods.changeAccredited(investorArray, isAccreditedArray); - let r = await common.sendTransaction(Issuer, changeAccreditedAction, defaultGasPrice); + let r = await common.sendTransaction(changeAccreditedAction); console.log(`Batch ${i} - Attempting to change accredited accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); console.log("Change accredited transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); diff --git a/CLI/commands/changeNonAccreditedLimit.js b/CLI/commands/changeNonAccreditedLimit.js index b1ececbc7..b4d5e3c6b 100644 --- a/CLI/commands/changeNonAccreditedLimit.js +++ b/CLI/commands/changeNonAccreditedLimit.js @@ -35,6 +35,7 @@ startScript(); async function startScript() { if (remoteNetwork == 'undefined') remoteNetwork = undefined; await global.initialize(remoteNetwork); + try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); let securityTokenRegistryABI = abis.securityTokenRegistry(); @@ -130,7 +131,7 @@ async function changeNonAccreditedLimit() { } let changeNonAccreditedLimitAction = usdTieredSTO.methods.changeNonAccreditedLimit(investorArray, limitArray); - let r = await common.sendTransaction(Issuer, changeNonAccreditedLimitAction, defaultGasPrice); + let r = await common.sendTransaction(changeNonAccreditedLimitAction); console.log(`Batch ${i} - Attempting to change non accredited limits to accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); console.log("Change accredited transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString()), "Ether"); diff --git a/CLI/commands/common/common_functions.js b/CLI/commands/common/common_functions.js index af3cdc8fa..123e158cb 100644 --- a/CLI/commands/common/common_functions.js +++ b/CLI/commands/common/common_functions.js @@ -25,6 +25,41 @@ async function checkPermission(contractName, functionName, contractRegistry) { } }; +function getFinalOptions(options) { + if (typeof options != "object") { + options = {} + } + const defaultOptions = { + from: Issuer, + gasPrice: defaultGasPrice, + value: undefined, + factor: 1.2 + } + return Object.assign(defaultOptions, options) +}; + +async function getGasLimit(options, action) { + let block = await web3.eth.getBlock("latest"); + let networkGasLimit = block.gasLimit; + let gas = Math.round(options.factor * (await action.estimateGas({ from: options.from.address, value: options.value}))); + return (gas > networkGasLimit) ? networkGasLimit : gas; +} + +async function checkPermissions(action) { + let contractRegistry = await connect(action._parent.options.jsonInterface, action._parent._address); + //NOTE this is a condition to verify if the transaction comes from a module or not. + if (contractRegistry.methods.hasOwnProperty('factory')) { + let moduleAddress = await contractRegistry.methods.factory().call(); + let moduleRegistry = await connect(abis.moduleFactory(), moduleAddress) + let parentModule = await moduleRegistry.methods.getName().call(); + let result = await checkPermission(web3.utils.hexToUtf8(parentModule), action._method.name, contractRegistry); + if (!result) { + console.log("You haven't the right permissions to execute this method."); + process.exit(0); + } + } +} + module.exports = { convertToDaysRemaining: function (timeRemaining) { var seconds = parseInt(timeRemaining, 10); @@ -38,78 +73,52 @@ module.exports = { return (days + " days, " + hrs + " Hrs, " + mnts + " Minutes, " + seconds + " Seconds"); }, logAsciiBull: function() { - console.log(` -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(@(&&@@@@@@@@@@@@@@@@@@@@@@@@@@(((@&&&&(/@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(#(((((((#%%%#@@@@@@@@@@@@@@@@@@@@%##(((/@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(%(((((((((((#%%%%%@#@@@@@@@@@@@@(&#####@@@@@@@@%& -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&#((((((((((((((##%%%%%%%&&&%%##@%#####%(@@@@@@@#%#& -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(%((((((((((((((((((###%%%%%((#####%%%####@@@@@@@###((@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(#(((((((((((((((((((((####%%%#((((######%&%@@(##&###(@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(#((((((((((((((((((((((((####%%#(((((((#((((((((((((#(@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(%(((((((((((((((((((((((((((######%(((((((((((((#&(/@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&#(((((((((((((((((((((((((((((((###############(##%%#@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(#((((##############(((((((((((((((((###################%@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@(&#((#(##################((((((((((((((((((##%%##############@@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@/%#(((((((##%((((##############((((((((((((((((((##%%#############%%@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@((((((((((###%%((((((##########(((((((((((((((((((#%%%############%%%#@@@@@@@@@ -@@@@@@@@@@@@@@@@@@%((((((((((####%%%((((((((#######(((((((((((####(((((@%%############%%%#@@@@@@@@@ -@@@@@@@@@####%%%%%#(((((((((#####%%%%(((((((((((###((((#######(((((((((&@@(&#########%%%%&@@@@@@@@@ -@@@@@@@@&(((#####%###(((((((#####%%%%%((((((((####%%%%%%%%&%@%#((((((((@@@@@@(#(####%%%%%%@@@@@@@@@ -@@@@@@@&(((@@@@@@@####(((((######%%%%%%##&########%%%%%#@@@@###(((((#(@@@@@@@@@@@###%%#@@@@@@@@@@@@ -@@@#%&%(((@@@@@@@@#####(((#######%%%%@@@@@@@@@@@((##@@@@@@@@%###((((/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@#%%&%#@@@@@@@@@@############%%%%@@@@@@@@@@@@@@@@@@@@(@&&&&#####(#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@@#%%%%%#((%%%%%%#@@@@@@@@@@@@@@@@@@@@(####%((((%#(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@@&%%%#((((((%%&@@@@@@@@@@@@@@@@@@@@@@###%%#((@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@%%%%((((((((& @@@@@@@@@@@@@@@@@@@@@@@%%&%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@%%(((((&#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@&((###@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@#####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@&####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@&&%##@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@&&&%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@%##%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@#%####%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + console.log(` + /######%%, /#( + ##########%%%%%, ,%%%. % + *#############%%%%%##%%%%%%# ## + (################%%%%#####%%%%//###%, + .####################%%%%#########/ + (#########%%############%%%%%%%%%#%%% + ,(%#%%%%%%%%%%%%############%%%%%%%###%%%. + (######%%###%%%%%%%%##############%%%%%####%%%* + /#######%%%%######%%%%##########%###,.%######%%%( + #%%%%%#######%%%%%%###########%%%%%*###### /####%%%# + #. ,%%####%%%%%%%(/#%%%%%%%%( #%#### ,#%/ + *#%( .%%%##%%%%%% .%%%#* + .%%%%#%%%% .%%%###( + %%%#####% (%%. + #%###(, + *#%# + %%# + * + &% + %%%. `); }, - sendTransaction: async function (from, action, gasPrice, value, factor) { - let contractRegistry = await connect(action._parent.options.jsonInterface, action._parent._address); - - //NOTE this is a condition to verify if the transaction comes from a module or not. - if (contractRegistry.methods.hasOwnProperty('factory')) { - let moduleAddress = await contractRegistry.methods.factory().call(); - let moduleRegistry = await connect(abis.moduleFactory(), moduleAddress) - let parentModule = await moduleRegistry.methods.getName().call(); - let result = await checkPermission(web3.utils.hexToUtf8(parentModule), action._method.name, contractRegistry); - if (!result) { - console.log("You haven't the right permissions to execute this method."); - process.exit(0); - } - } - - if (typeof factor === 'undefined') factor = 1.2; + sendTransaction: async function (action, options) { - let block = await web3.eth.getBlock("latest"); - let networkGasLimit = block.gasLimit; + await checkPermissions(action); - let gas = Math.round(factor * (await action.estimateGas({ from: from.address, value: value}))); - if (gas > networkGasLimit) gas = networkGasLimit; + options = getFinalOptions(options); + let gasLimit = await getGasLimit(options, action); - console.log(chalk.black.bgYellowBright(`---- Transaction executed: ${action._method.name} - Gas limit provided: ${gas} ----`)); + console.log(chalk.black.bgYellowBright(`---- Transaction executed: ${action._method.name} - Gas limit provided: ${gasLimit} ----`)); - let nonce = await web3.eth.getTransactionCount(from.address); + let nonce = await web3.eth.getTransactionCount(options.from.address); let abi = action.encodeABI(); let parameter = { - from: from.address, + from: options.from.address, to: action._parent._address, data: abi, - gasLimit: gas, - gasPrice: gasPrice, + gasLimit: gasLimit, + gasPrice: options.gasPrice, nonce: nonce, - value: web3.utils.toHex(value) + value: web3.utils.toHex(options.value) }; const transaction = new Tx(parameter); - transaction.sign(Buffer.from(from.privateKey.replace('0x', ''), 'hex')); + transaction.sign(Buffer.from(options.from.privateKey.replace('0x', ''), 'hex')); return await web3.eth.sendSignedTransaction('0x' + transaction.serialize().toString('hex')) .on('transactionHash', function(hash){ console.log(` @@ -120,7 +129,7 @@ module.exports = { .on('receipt', function(receipt){ console.log(` Congratulations! The transaction was successfully completed. - Gas used: ${receipt.gasUsed} - Gas spent: ${web3.utils.fromWei((new web3.utils.BN(gasPrice)).mul(new web3.utils.BN(receipt.gasUsed)))} Ether + Gas used: ${receipt.gasUsed} - Gas spent: ${web3.utils.fromWei((new web3.utils.BN(options.gasPrice)).mul(new web3.utils.BN(receipt.gasUsed)))} Ether Review it on Etherscan. TxHash: ${receipt.transactionHash}\n` ); diff --git a/CLI/commands/common/constants.js b/CLI/commands/common/constants.js new file mode 100644 index 000000000..c3e2b796c --- /dev/null +++ b/CLI/commands/common/constants.js @@ -0,0 +1,34 @@ +module.exports = Object.freeze({ + MODULES_TYPES: { + PERMISSION: 1, + TRANSFER: 2, + STO: 3, + DIVIDENDS: 4, + BURN: 5 + }, + DURATION: { + seconds: function(val) { + return val + }, + minutes: function(val) { + return val * this.seconds(60) + }, + hours: function(val) { + return val * this.minutes(60) + }, + days: function(val) { + return val * this.hours(24) + }, + weeks: function(val) { + return val * this.days(7) + }, + years: function(val) { + return val * this.days(365) + } + }, + FUND_RAISE_TYPES: { + ETH: 0, + POLY: 1, + DAI: 2 + } +}); \ No newline at end of file diff --git a/CLI/commands/common/global.js b/CLI/commands/common/global.js index fb898a708..e1fb648e2 100644 --- a/CLI/commands/common/global.js +++ b/CLI/commands/common/global.js @@ -1,39 +1,44 @@ const Web3 = require('web3'); +const constants = require('./constants'); -function getGasPrice (networkId) { - let gasPrice; - switch (networkId) { - case 1: //Mainnet - gasPrice = 4000000000; - break; - case 3: //Ropsten - gasPrice = 50000000000; - break; - case 15: //Ganache - gasPrice = 50000000000; - break; - case 42: //Kovan - gasPrice = 50000000000; - break; - default: - throw new Error('Network ID not identified'); - } +global.web3, global.Issuer, global.defaultGasPrice, global.remoteNetwork; - return gasPrice; +function getGasPrice (networkId) { + let gasPrice; + switch (networkId) { + case 1: //Mainnet + gasPrice = 4000000000; + break; + case 3: //Ropsten + gasPrice = 50000000000; + break; + case 15: //Ganache + gasPrice = 50000000000; + break; + case 42: //Kovan + gasPrice = 50000000000; + break; + default: + throw new Error('Network ID not identified'); + } + return gasPrice; } + module.exports = { - initialize: async function (remoteNetwork) { - if (typeof web3 === 'undefined' || typeof Issuer === 'undefined' || typeof defaultGasPrice === 'undefined') { - if (typeof remoteNetwork !== 'undefined') { - web3 = new Web3(new Web3.providers.HttpProvider(`https://${remoteNetwork}.infura.io/`)); - let privKey = require('fs').readFileSync('./privKey').toString(); - Issuer = await web3.eth.accounts.privateKeyToAccount("0x" + privKey); - } else { - web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); - let privKeyLocal = require('fs').readFileSync('./privKeyLocal').toString() - Issuer = await web3.eth.accounts.privateKeyToAccount("0x" + privKeyLocal); - } - defaultGasPrice = getGasPrice(await web3.eth.net.getId()); + initialize: async function(network) { + remoteNetwork = network; + if (typeof web3 === 'undefined' || typeof Issuer === 'undefined' || typeof defaultGasPrice === 'undefined') { + if (typeof remoteNetwork !== 'undefined') { + web3 = new Web3(new Web3.providers.HttpProvider(`https://${remoteNetwork}.infura.io/`)); + let privKey = require('fs').readFileSync('./privKey').toString(); + Issuer = await web3.eth.accounts.privateKeyToAccount("0x" + privKey); + } else { + web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); + let privKeyLocal = require('fs').readFileSync('./privKeyLocal').toString() + Issuer = await web3.eth.accounts.privateKeyToAccount("0x" + privKeyLocal); } + defaultGasPrice = getGasPrice(await web3.eth.net.getId()); } + }, + constants }; \ No newline at end of file diff --git a/CLI/commands/common/permissions_list.js b/CLI/commands/common/permissions_list.js index f5779612b..4d2b58cf7 100644 --- a/CLI/commands/common/permissions_list.js +++ b/CLI/commands/common/permissions_list.js @@ -68,7 +68,7 @@ function getPermissionList() { modifyWhitelist: "WHITELIST", modifyWhitelistMulti: "WHITELIST", setAllowPrimaryIssuance: "ADMIN", - changeHolderPercentage: "ONLY_OWNER" + changeHolderPercentage: "ADMIN" }, LockupVolumeRestrictionTM: { addLockup: "ADMIN", diff --git a/CLI/commands/contract_manager.js b/CLI/commands/contract_manager.js index bea83ce7d..cce93444e 100644 --- a/CLI/commands/contract_manager.js +++ b/CLI/commands/contract_manager.js @@ -1,23 +1,14 @@ -const duration = { - seconds: function (val) { return val; }, - minutes: function (val) { return val * this.seconds(60); }, - hours: function (val) { return val * this.minutes(60); }, - days: function (val) { return val * this.hours(24); }, - weeks: function (val) { return val * this.days(7); }, - years: function (val) { return val * this.days(365); }, -}; var readlineSync = require('readline-sync'); var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); +var gbl = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); // App flow let currentContract = null; -async function executeApp(remoteNetwork) { - await global.initialize(remoteNetwork); +async function executeApp() { common.logAsciiBull(); console.log("*********************************************"); @@ -108,7 +99,7 @@ async function strActions() { let tickerExpiryDate = readlineSync.question(`Enter the Unix Epoch time on wich the ticker will expire: `); let tickerStatus = readlineSync.keyInYNStrict(`Is the token deployed?`); let modifyTickerAction = currentContract.methods.modifyTicker(tickerOwner, tickerToModify, tickerSTName, tickerRegistrationDate, tickerExpiryDate, tickerStatus); - await common.sendTransaction(Issuer, modifyTickerAction, defaultGasPrice, 0, 1.5); + await common.sendTransaction(modifyTickerAction, {factor: 1.5}); console.log(chalk.green(`Ticker has been updated successfully`)); break; case 'Remove Ticker': @@ -118,7 +109,7 @@ async function strActions() { console.log(chalk.yellow(`${ticker} does not exist.`)); } else { let removeTickerAction = currentContract.methods.removeTicker(tickerToRemove); - await common.sendTransaction(Issuer, removeTickerAction, defaultGasPrice, 0, 3); + await common.sendTransaction(removeTickerAction, {factor: 3}); console.log(chalk.green(`Ticker has been removed successfully`)); } break; @@ -159,15 +150,15 @@ async function strActions() { let tokenDetails = readlineSync.question(`Enter the token details: `); let deployedAt = readlineSync.questionInt(`Enter the Unix Epoch timestamp at which security token was deployed: `); let modifySTAction = currentContract.methods.modifySecurityToken(name, ticker, owner, stAddress, tokenDetails, deployedAt); - await common.sendTransaction(Issuer, modifySTAction, defaultGasPrice, 0, 1.5); + await common.sendTransaction(modifySTAction, {factor: 1.5}); console.log(chalk.green(`Security Token has been updated successfully`)); break; case 'Change Expiry Limit': let currentExpiryLimit = await currentContract.methods.getExpiryLimit().call(); console.log(chalk.yellow(`Current expiry limit is ${Math.floor(parseInt(currentExpiryLimit)/60/60/24)} days`)); - let newExpiryLimit = duration.days(readlineSync.questionInt('Enter a new value in days for expiry limit: ')); + let newExpiryLimit = gbl.constants.DURATION.days(readlineSync.questionInt('Enter a new value in days for expiry limit: ')); let changeExpiryLimitAction = currentContract.methods.changeExpiryLimit(newExpiryLimit); - let changeExpiryLimitReceipt = await common.sendTransaction(Issuer, changeExpiryLimitAction, defaultGasPrice); + let changeExpiryLimitReceipt = await common.sendTransaction(changeExpiryLimitAction); let changeExpiryLimitEvent = common.getEventFromLogs(currentContract._jsonInterface, changeExpiryLimitReceipt.logs, 'ChangeExpiryLimit'); console.log(chalk.green(`Expiry limit was changed successfully. New limit is ${Math.floor(parseInt(changeExpiryLimitEvent._newExpiry)/60/60/24)} days\n`)); break; @@ -176,7 +167,7 @@ async function strActions() { console.log(chalk.yellow(`\nCurrent ticker registration fee is ${currentRegFee} POLY`)); let newRegFee = web3.utils.toWei(readlineSync.questionInt('Enter a new value in POLY for ticker registration fee: ').toString()); let changeRegFeeAction = currentContract.methods.changeTickerRegistrationFee(newRegFee); - let changeRegFeeReceipt = await common.sendTransaction(Issuer, changeRegFeeAction, defaultGasPrice); + let changeRegFeeReceipt = await common.sendTransaction(changeRegFeeAction); let changeRegFeeEvent = common.getEventFromLogs(currentContract._jsonInterface, changeRegFeeReceipt.logs, 'ChangeTickerRegistrationFee'); console.log(chalk.green(`Fee was changed successfully. New fee is ${web3.utils.fromWei(changeRegFeeEvent._newFee)} POLY\n`)); break; @@ -185,7 +176,7 @@ async function strActions() { console.log(chalk.yellow(`\nCurrent ST launch fee is ${currentLaunchFee} POLY`)); let newLaunchFee = web3.utils.toWei(readlineSync.questionInt('Enter a new value in POLY for ST launch fee: ').toString()); let changeLaunchFeeAction = currentContract.methods.changeSecurityLaunchFee(newLaunchFee); - let changeLaunchFeeReceipt = await common.sendTransaction(Issuer, changeLaunchFeeAction, defaultGasPrice); + let changeLaunchFeeReceipt = await common.sendTransaction(changeLaunchFeeAction); let changeLaunchFeeEvent = common.getEventFromLogs(currentContract._jsonInterface, changeLaunchFeeReceipt.logs, 'ChangeSecurityLaunchFee'); console.log(chalk.green(`Fee was changed successfully. New fee is ${web3.utils.fromWei(changeLaunchFeeEvent._newFee)} POLY\n`)); break; @@ -197,7 +188,7 @@ async function strActions() { } module.exports = { - executeApp: async function(remoteNetwork) { - return executeApp(remoteNetwork); + executeApp: async function() { + return executeApp(); } } \ No newline at end of file diff --git a/CLI/commands/dividends_manager.js b/CLI/commands/dividends_manager.js index bde3aa900..0f423bf5d 100644 --- a/CLI/commands/dividends_manager.js +++ b/CLI/commands/dividends_manager.js @@ -1,27 +1,11 @@ -const duration = { - seconds: function (val) { return val; }, - minutes: function (val) { return val * this.seconds(60); }, - hours: function (val) { return val * this.minutes(60); }, - days: function (val) { return val * this.hours(24); }, - weeks: function (val) { return val * this.days(7); }, - years: function (val) { return val * this.days(365); }, -}; var readlineSync = require('readline-sync'); var chalk = require('chalk'); var moment = require('moment'); var common = require('./common/common_functions'); -var global = require('./common/global'); +var gbl = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); -const MODULES_TYPES = { - PERMISSION: 1, - TRANSFER: 2, - STO: 3, - DIVIDENDS: 4, - BURN: 5 -} - // App flow let tokenSymbol; let securityToken; @@ -30,9 +14,8 @@ let securityTokenRegistry; let generalTransferManager; let currentDividendsModule; -async function executeApp(type, remoteNetwork) { +async function executeApp(type) { dividendsType = type; - await global.initialize(remoteNetwork); common.logAsciiBull(); console.log("**********************************************"); @@ -129,7 +112,7 @@ async function start_explorer(){ break; case 'Create checkpoint': let createCheckpointAction = securityToken.methods.createCheckpoint(); - await common.sendTransaction(Issuer, createCheckpointAction, defaultGasPrice); + await common.sendTransaction(createCheckpointAction); break; case 'Set default exclusions for dividends': await setDefaultExclusions(); @@ -199,7 +182,7 @@ async function mintTokens(address, amount){ try { let mintAction = securityToken.methods.mint(address,web3.utils.toWei(amount)); - let receipt = await common.sendTransaction(Issuer, mintAction, defaultGasPrice); + let receipt = await common.sendTransaction(mintAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'Transfer'); console.log(` Minted ${web3.utils.fromWei(event.value)} tokens @@ -217,7 +200,7 @@ async function transferTokens(address, amount){ try{ let transferAction = securityToken.methods.transfer(address,web3.utils.toWei(amount)); - let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice, 0, 1.5); + let receipt = await common.sendTransaction(transferAction, {factor: 1.5}); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'Transfer'); console.log(` Account ${event.from} @@ -260,7 +243,7 @@ async function setDefaultExclusions() { if (readlineSync.keyInYNStrict(`Do you want to continue?`)) { let excluded = getExcludedFromDataFile(); let setDefaultExclusionsActions = currentDividendsModule.methods.setDefaultExcluded(excluded); - let receipt = await common.sendTransaction(Issuer, setDefaultExclusionsActions, defaultGasPrice); + let receipt = await common.sendTransaction(setDefaultExclusionsActions); let event = common.getEventFromLogs(currentDividendsModule._jsonInterface, receipt.logs, 'SetDefaultExcludedAddresses'); console.log(chalk.green(`Exclusions were successfully set.`)); showExcluded(event._excluded); @@ -290,14 +273,14 @@ async function taxHoldingMenu() { }); let percentageWei = web3.utils.toWei((percentage / 100).toString()); let setWithHoldingFixedAction = currentDividendsModule.methods.setWithholdingFixed([address], percentageWei); - let receipt = await common.sendTransaction(Issuer, setWithHoldingFixedAction, defaultGasPrice); + let receipt = await common.sendTransaction(setWithHoldingFixedAction); console.log(chalk.green(`Successfully set tax withholding of ${percentage}% for ${address}.`)); break; case 'Withdraw withholding for dividend': let _dividend = await selectDividend({withRemainingWithheld: true}); if (_dividend !== null) { let withdrawWithholdingAction = currentDividendsModule.methods.withdrawWithholding(_dividend.index); - let receipt = await common.sendTransaction(Issuer, withdrawWithholdingAction, defaultGasPrice); + let receipt = await common.sendTransaction(withdrawWithholdingAction); let eventName; if (dividendsType == 'POLY') { eventName = 'ERC20DividendWithholdingWithdrawn'; @@ -318,7 +301,7 @@ async function createDividends(name, dividend, checkpointId) { let time = Math.floor(Date.now()/1000); let maturityTime = readlineSync.questionInt('Enter the dividend maturity time from which dividend can be paid (Unix Epoch time)\n(Now = ' + time + ' ): ', {defaultInput: time}); - let defaultTime = time + duration.minutes(10); + let defaultTime = time + gbl.constants.DURATION.minutes(10); let expiryTime = readlineSync.questionInt('Enter the dividend expiry time (Unix Epoch time)\n(10 minutes from now = ' + defaultTime + ' ): ', {defaultInput: defaultTime}); let useDefaultExcluded = readlineSync.keyInYNStrict(`Do you want to use the default excluded addresses for this dividend? If not, data from 'dividendsExclusions_data.csv' will be used instead.`); @@ -326,7 +309,7 @@ async function createDividends(name, dividend, checkpointId) { let createDividendAction; if (dividendsType == 'POLY') { let approveAction = polyToken.methods.approve(currentDividendsModule._address, web3.utils.toWei(dividend)); - await common.sendTransaction(Issuer, approveAction, defaultGasPrice); + await common.sendTransaction(approveAction); if (checkpointId > 0) { if (useDefaultExcluded) { createDividendAction = currentDividendsModule.methods.createDividendWithCheckpoint(maturityTime, expiryTime, polyToken._address, web3.utils.toWei(dividend), checkpointId, web3.utils.toHex(name)); @@ -342,7 +325,7 @@ async function createDividends(name, dividend, checkpointId) { createDividendAction = currentDividendsModule.methods.createDividendWithExclusions(maturityTime, expiryTime, polyToken._address, web3.utils.toWei(dividend), excluded, web3.utils.toHex(name)); } } - let receipt = await common.sendTransaction(Issuer, createDividendAction, defaultGasPrice); + let receipt = await common.sendTransaction(createDividendAction); let event = common.getEventFromLogs(currentDividendsModule._jsonInterface, receipt.logs, 'ERC20DividendDeposited'); console.log(chalk.green(`Dividend ${event._dividendIndex} deposited`)); } else if (dividendsType == 'ETH') { @@ -361,7 +344,7 @@ async function createDividends(name, dividend, checkpointId) { createDividendAction = currentDividendsModule.methods.createDividendWithExclusions(maturityTime, expiryTime, excluded, web3.utils.toHex(name)); } } - let receipt = await common.sendTransaction(Issuer, createDividendAction, defaultGasPrice, web3.utils.toWei(dividend)); + let receipt = await common.sendTransaction(createDividendAction, {value: web3.utils.toWei(dividend)}); let event = common.getEventFromLogs(currentDividendsModule._jsonInterface, receipt.logs, 'EtherDividendDeposited'); console.log(` Dividend ${event._dividendIndex} deposited` @@ -372,7 +355,7 @@ async function createDividends(name, dividend, checkpointId) { async function pushDividends(dividend, account){ let accs = account.split(','); let pushDividendPaymentToAddressesAction = currentDividendsModule.methods.pushDividendPaymentToAddresses(dividend.index, accs); - let receipt = await common.sendTransaction(Issuer, pushDividendPaymentToAddressesAction, defaultGasPrice); + let receipt = await common.sendTransaction(pushDividendPaymentToAddressesAction); let successEventName; if (dividendsType == 'POLY') { successEventName = 'ERC20DividendClaimed'; @@ -400,7 +383,7 @@ async function pushDividends(dividend, account){ async function reclaimedDividend(dividend) { let reclaimDividendAction = currentDividendsModule.methods.reclaimDividend(dividend.index); - let receipt = await common.sendTransaction(Issuer, reclaimDividendAction, defaultGasPrice); + let receipt = await common.sendTransaction(reclaimDividendAction); let eventName; if (dividendsType == 'POLY') { eventName = 'ERC20DividendReclaimed'; @@ -417,7 +400,7 @@ async function reclaimedDividend(dividend) { async function whitelistAddress(address) { let now = Math.floor(Date.now() / 1000); let modifyWhitelistAction = generalTransferManager.methods.modifyWhitelist(address, now, now, now + 31536000, true); - await common.sendTransaction(Issuer, modifyWhitelistAction, defaultGasPrice); + await common.sendTransaction(modifyWhitelistAction); console.log(chalk.green(`\nWhitelisting successful for ${address}.`)); } @@ -478,9 +461,9 @@ async function addDividendsModule() { dividendsModuleABI = abis.etherDividendCheckpoint(); } - let dividendsFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.DIVIDENDS, dividendsFactoryName); + let dividendsFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, gbl.constants.MODULES_TYPES.DIVIDENDS, dividendsFactoryName); let addModuleAction = securityToken.methods.addModule(dividendsFactoryAddress, web3.utils.fromAscii('', 16), 0, 0); - let receipt = await common.sendTransaction(Issuer, addModuleAction, defaultGasPrice); + let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`Module deployed at address: ${event._module}`); currentDividendsModule = new web3.eth.Contract(dividendsModuleABI, event._module); @@ -599,7 +582,7 @@ function showExcluded(excluded) { } module.exports = { - executeApp: async function(type, remoteNetwork) { - return executeApp(type, remoteNetwork); + executeApp: async function(type) { + return executeApp(type); } } diff --git a/CLI/commands/faucet.js b/CLI/commands/faucet.js index 556ffa402..70eadd57b 100644 --- a/CLI/commands/faucet.js +++ b/CLI/commands/faucet.js @@ -1,7 +1,6 @@ var readlineSync = require('readline-sync'); var BigNumber = require('bignumber.js'); var common = require('./common/common_functions'); -var global = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis') var chalk = require('chalk'); @@ -11,8 +10,7 @@ var chalk = require('chalk'); let polyToken; let usdToken; -async function executeApp(beneficiary, amount, remoteNetwork) { - await global.initialize(remoteNetwork); +async function executeApp(beneficiary, amount) { console.log("\n"); console.log("***************************") @@ -79,7 +77,7 @@ async function send_poly(beneficiary, amount) { beneficiary = readlineSync.question(`Enter beneficiary 10K USD Tokens ('${Issuer.address}'): `); if (beneficiary == "") beneficiary = Issuer.address; let getTokensAction = usdToken.methods.getTokens(web3.utils.toWei('10000'), beneficiary); - await common.sendTransaction(Issuer, getTokensAction, defaultGasPrice); + await common.sendTransaction(getTokensAction); let balance = await usdToken.methods.balanceOf(beneficiary).call(); let balanceInPoly = new BigNumber(balance).dividedBy(new BigNumber(10).pow(18)); console.log(chalk.green(`Congratulations! balance of ${beneficiary} address is ${balanceInPoly.toNumber()} USD Tokens`)); @@ -97,7 +95,7 @@ async function send_poly(beneficiary, amount) { async function transferTokens(to, amount) { try { let getTokensAction = polyToken.methods.getTokens(amount, to); - await common.sendTransaction(Issuer, getTokensAction, defaultGasPrice); + await common.sendTransaction(getTokensAction); } catch (err){ console.log(err.message); return; @@ -108,7 +106,7 @@ async function transferTokens(to, amount) { } module.exports = { - executeApp: async function(beneficiary, amount, remoteNetwork) { - return executeApp(beneficiary, amount, remoteNetwork); + executeApp: async function(beneficiary, amount) { + return executeApp(beneficiary, amount); } } \ No newline at end of file diff --git a/CLI/commands/helpers/contract_addresses.js b/CLI/commands/helpers/contract_addresses.js index b6dca4eeb..4d5971714 100644 --- a/CLI/commands/helpers/contract_addresses.js +++ b/CLI/commands/helpers/contract_addresses.js @@ -16,7 +16,7 @@ function getPolymathRegistryAddress(networkId) { result = JSON.parse(require('fs').readFileSync('./build/contracts/PolymathRegistry.json').toString()).networks[networkId].address; break; case 42: // KOVAN - result = "0x05a6519e49e34239f78167abf293d94dae61b299"; + result = "0xad09dc7939f09601674c69a07132bc642abeeb10"; break; } diff --git a/CLI/commands/investor_portal.js b/CLI/commands/investor_portal.js index 9a5229a7c..276f8bda3 100644 --- a/CLI/commands/investor_portal.js +++ b/CLI/commands/investor_portal.js @@ -3,18 +3,13 @@ var readlineSync = require('readline-sync'); var BigNumber = require('bignumber.js'); var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); +var gbl = require('./common/global'); // Load Contract artifacts var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); const STO_KEY = 3; -const FUND_RAISE_TYPES = { - ETH: 0, - POLY: 1, - DAI: 2 -} let securityTokenRegistry; let securityToken; @@ -39,8 +34,7 @@ let displayCanBuy; let displayValidKYC; // Start Script -async function executeApp(investorAddress, investorPrivKey, symbol, currency, amount, remoteNetwork) { - await global.initialize(remoteNetwork); +async function executeApp(investorAddress, investorPrivKey, symbol, currency, amount) { common.logAsciiBull(); console.log("********************************************"); @@ -163,13 +157,13 @@ async function showUserInfo(_user) { console.log(` ******************* User Information ******************** - Address: ${_user}`); - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES.POLY)) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.POLY)) { console.log(` - POLY balance:\t ${await polyBalance(_user)}`); } - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES.ETH)) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.ETH)) { console.log(` - ETH balance:\t ${web3.utils.fromWei(await web3.eth.getBalance(_user))}`); } - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES.DAI)) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.DAI)) { console.log(` - DAI balance:\t ${await usdBalance(_user)}`); } } @@ -185,11 +179,11 @@ async function showCappedSTOInfo() { let displayRaiseType; let displayFundsRaised; - for (const fundType in FUND_RAISE_TYPES) { - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES[fundType]).call()) { + for (const fundType in gbl.constants.FUND_RAISE_TYPES) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES[fundType]).call()) { raiseTypes.push(fundType); displayRaiseType = fundType; - displayFundsRaised = await currentSTO.methods.fundsRaised(FUND_RAISE_TYPES[fundType]).call(); + displayFundsRaised = await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES[fundType]).call(); } } @@ -245,9 +239,9 @@ async function showCappedSTOInfo() { async function showUserInfoForUSDTieredSTO() { - for (const fundType in FUND_RAISE_TYPES) { - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES[fundType]).call()) { - let displayInvestorInvested = web3.utils.fromWei(await currentSTO.methods.investorInvested(User.address, FUND_RAISE_TYPES[fundType]).call()); + for (const fundType in gbl.constants.FUND_RAISE_TYPES) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES[fundType]).call()) { + let displayInvestorInvested = web3.utils.fromWei(await currentSTO.methods.investorInvested(User.address, gbl.constants.FUND_RAISE_TYPES[fundType]).call()); console.log(` - Invested in ${fundType}:\t ${displayInvestorInvested} ${fundType}`); } } @@ -287,8 +281,8 @@ async function showUSDTieredSTOInfo() { let displayTokenSymbol = await securityToken.methods.symbol().call(); let tiersLength = await currentSTO.methods.getNumberOfTiers().call(); - for (const fundType in FUND_RAISE_TYPES) { - if (await currentSTO.methods.fundRaiseTypes(FUND_RAISE_TYPES[fundType]).call()) { + for (const fundType in gbl.constants.FUND_RAISE_TYPES) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES[fundType]).call()) { raiseTypes.push(fundType); } } @@ -317,7 +311,7 @@ async function showUSDTieredSTOInfo() { } } - let mintedPerTier = await currentSTO.methods.mintedPerTier(FUND_RAISE_TYPES[type], t).call(); + let mintedPerTier = await currentSTO.methods.mintedPerTier(gbl.constants.FUND_RAISE_TYPES[type], t).call(); displayMintedPerTierPerType += ` Sold for ${type}:\t\t ${web3.utils.fromWei(mintedPerTier)} ${displayTokenSymbol} ${displayDiscountMinted}`; } @@ -338,13 +332,13 @@ async function showUSDTieredSTOInfo() { let displayFundsRaisedPerType = ''; let displayTokensSoldPerType = ''; for (const type of raiseTypes) { - let fundsRaised = web3.utils.fromWei(await currentSTO.methods.fundsRaised(FUND_RAISE_TYPES[type]).call()); + let fundsRaised = web3.utils.fromWei(await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES[type]).call()); displayFundsRaisedPerType += ` ${type}:\t\t\t ${fundsRaised} ${type}`; //Only show sold per raise type is more than one are allowed if (raiseTypes.length > 1) { - let tokensSoldPerType = web3.utils.fromWei(await currentSTO.methods.getTokensSoldFor(FUND_RAISE_TYPES[type]).call()); + let tokensSoldPerType = web3.utils.fromWei(await currentSTO.methods.getTokensSoldFor(gbl.constants.FUND_RAISE_TYPES[type]).call()); displayTokensSoldPerType += ` Sold for ${type}:\t\t ${tokensSoldPerType} ${displayTokenSymbol}`; } @@ -427,10 +421,10 @@ async function investCappedSTO(currency, amount) { let allowance = await polyToken.methods.allowance(STOAddress, User.address).call(); if (allowance < costWei) { let approveAction = polyToken.methods.approve(STOAddress, costWei); - await common.sendTransaction(User, approveAction, defaultGasPrice); + await common.sendTransaction(approveAction, {from: User}); } let actionBuyTokensWithPoly = currentSTO.methods.buyTokensWithPoly(costWei); - let receipt = await common.sendTransaction(User, actionBuyTokensWithPoly, defaultGasPrice); + let receipt = await common.sendTransaction(actionBuyTokensWithPoly, {from: User}); logTokensPurchasedCappedSTO(receipt); } else { console.log(chalk.red(`Not enough balance to Buy tokens, Require ${cost} POLY but have ${userBalance} POLY.`)); @@ -439,7 +433,7 @@ async function investCappedSTO(currency, amount) { } } else { let actionBuyTokens = currentSTO.methods.buyTokens(User.address); - let receipt = await common.sendTransaction(User, actionBuyTokens, defaultGasPrice, costWei); + let receipt = await common.sendTransaction(actionBuyTokens, {from: User, value: costWei}); logTokensPurchasedCappedSTO(receipt); } await showTokenInfo(); @@ -457,7 +451,7 @@ async function investUsdTieredSTO(currency, amount) { } } else { for (const type of raiseTypes) { - let displayPrice = web3.utils.fromWei(await currentSTO.methods.convertToUSD(FUND_RAISE_TYPES[type], web3.utils.toWei("1")).call()); + let displayPrice = web3.utils.fromWei(await currentSTO.methods.convertToUSD(gbl.constants.FUND_RAISE_TYPES[type], web3.utils.toWei("1")).call()); console.log(chalk.green(` Current ${type} price:\t\t ${displayPrice} USD`)); } if (raiseTypes.length > 1) { @@ -473,7 +467,7 @@ async function investUsdTieredSTO(currency, amount) { if (typeof amount === 'undefined') { let investorInvestedUSD = web3.utils.fromWei(await currentSTO.methods.investorInvestedUSD(User.address).call()); let minimumInvestmentUSD = await currentSTO.methods.minimumInvestmentUSD().call(); - let minimumInvestmentRaiseType = await currentSTO.methods.convertFromUSD(FUND_RAISE_TYPES[raiseType], minimumInvestmentUSD).call(); + let minimumInvestmentRaiseType = await currentSTO.methods.convertFromUSD(gbl.constants.FUND_RAISE_TYPES[raiseType], minimumInvestmentUSD).call(); cost = readlineSync.question(chalk.yellow(`Enter the amount of ${raiseType} you would like to invest or press 'Enter' to exit: `), { limit: function(input) { return investorInvestedUSD != 0 || parseInt(input) > parseInt(web3.utils.fromWei(minimumInvestmentRaiseType)); @@ -493,10 +487,10 @@ async function investUsdTieredSTO(currency, amount) { let allowance = await polyToken.methods.allowance(STOAddress, User.address).call(); if (allowance < costWei) { let approveAction = polyToken.methods.approve(STOAddress, costWei); - await common.sendTransaction(User, approveAction, defaultGasPrice); + await common.sendTransaction(approveAction, {from: User}); } let actionBuyWithPoly = currentSTO.methods.buyWithPOLY(User.address, costWei); - let receipt = await common.sendTransaction(User, actionBuyWithPoly,defaultGasPrice, 0, 2); + let receipt = await common.sendTransaction(actionBuyWithPoly, {from: User, factor: 2}); logTokensPurchasedUSDTieredSTO(receipt); } else { console.log(chalk.red(`Not enough balance to Buy tokens, Require ${cost} POLY but have ${userBalance} POLY.`)); @@ -509,10 +503,10 @@ async function investUsdTieredSTO(currency, amount) { let allowance = await usdToken.methods.allowance(STOAddress, User.address).call(); if (allowance < costWei) { let approveAction = usdToken.methods.approve(STOAddress, costWei); - await common.sendTransaction(User, approveAction, defaultGasPrice); + await common.sendTransaction(approveAction, {from: User}); } let actionBuyWithUSD = currentSTO.methods.buyWithUSD(User.address, costWei); - let receipt = await common.sendTransaction(User, actionBuyWithUSD, defaultGasPrice, 0, 1.5); + let receipt = await common.sendTransaction(actionBuyWithUSD, {from: User, factor: 1.5}); logTokensPurchasedUSDTieredSTO(receipt); } else { console.log(chalk.red(`Not enough balance to Buy tokens, Require ${cost} DAI but have ${userBalance} DAI.`)); @@ -521,7 +515,7 @@ async function investUsdTieredSTO(currency, amount) { } } else { let actionBuyWithETH = currentSTO.methods.buyWithETH(User.address); - let receipt = await common.sendTransaction(User, actionBuyWithETH, defaultGasPrice, costWei); + let receipt = await common.sendTransaction(actionBuyWithETH, {from: User, value: costWei}); logTokensPurchasedUSDTieredSTO(receipt); } @@ -564,7 +558,7 @@ function logTokensPurchasedCappedSTO(receipt) { } module.exports = { - executeApp: async function(investorAddress, investorPrivKey, symbol, currency, amount, remoteNetwork) { - return executeApp(investorAddress, investorPrivKey, symbol, currency, amount, remoteNetwork); + executeApp: async function(investorAddress, investorPrivKey, symbol, currency, amount) { + return executeApp(investorAddress, investorPrivKey, symbol, currency, amount); } } diff --git a/CLI/commands/module_manager.js b/CLI/commands/module_manager.js index b91541a9c..53f2a863a 100644 --- a/CLI/commands/module_manager.js +++ b/CLI/commands/module_manager.js @@ -2,7 +2,6 @@ var readlineSync = require('readline-sync'); var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); // Load contract artifacts var contracts = require('./helpers/contract_addresses'); @@ -47,8 +46,7 @@ async function setup() { } // Start function -async function executeApp(remoteNetwork) { - await global.initialize(remoteNetwork); +async function executeApp() { common.logAsciiBull(); console.log(chalk.yellow(`******************************************`)); @@ -283,7 +281,7 @@ async function archiveModule() { if (index != -1) { console.log("\nSelected: ",options[index]); let archiveModuleAction = securityToken.methods.archiveModule(modules[index].module.address); - await common.sendTransaction(Issuer, archiveModuleAction, defaultGasPrice, 0, 2); + await common.sendTransaction(archiveModuleAction, {factor: 2}); console.log(chalk.green(`\nSuccessfully archived ${modules[index].module.name}.`)); } backToMenu() @@ -315,7 +313,7 @@ async function unarchiveModule() { if (index != -1) { console.log("\nSelected: ",options[index]); let unarchiveModuleAction = securityToken.methods.unarchiveModule(modules[index].module.address); - await common.sendTransaction(Issuer, unarchiveModuleAction, defaultGasPrice, 0, 2); + await common.sendTransaction(unarchiveModuleAction, {factor: 2}); console.log(chalk.green(`\nSuccessfully unarchived ${modules[index].module.name}.`)); } backToMenu() @@ -348,7 +346,7 @@ async function removeModule() { if (index != -1) { console.log("\nSelected: ",options[index]); let removeModuleAction = securityToken.methods.removeModule(modules[index].module.address); - await common.sendTransaction(Issuer, removeModuleAction, defaultGasPrice, 0, 2); + await common.sendTransaction(defaultGasPrice, {factor: 2}); console.log(chalk.green(`\nSuccessfully removed ${modules[index].module.name}.`)); } backToMenu() @@ -368,7 +366,7 @@ async function whitelist() { let investor = readlineSync.question(chalk.yellow(`Enter the address to be whitelisted: `)); let now = await latestTime(); let modifyWhitelistAction = generalTransferManager.methods.modifyWhitelist(investor, now, now, now + 31556952, true); - await common.sendTransaction(Issuer, modifyWhitelistAction, defaultGasPrice); + await common.sendTransaction(modifyWhitelistAction); console.log(chalk.green(`\nWhitelisting successful for ${investor}.`)); } catch (e) { console.log(e); @@ -390,7 +388,7 @@ async function mintTokens() { let _amount = readlineSync.question(chalk.yellow(`Enter the amount of tokens to mint: `)); try { let mintAction = securityToken.methods.mint(_investor, web3.utils.toWei(_amount)); - await common.sendTransaction(Issuer, mintAction, defaultGasPrice); + await common.sendTransaction(mintAction); console.log(chalk.green(`\nMinting Successful.`)); } catch (e) { console.log(e); @@ -411,7 +409,7 @@ async function freezeMinting() { if (await featureRegistry.methods.getFeatureStatus('freezeMintingAllowed').call()) { let freezeMintingAction = securityToken.methods.freezeMinting(); - await common.sendTransaction(Issuer, freezeMintingAction, defaultGasPrice); + await common.sendTransaction(freezeMintingAction); console.log(chalk.green(`\nFreeze minting was successful.`)); } else { console.log(chalk.red(`\nFreeze minting is not allowed by Polymath.`)); @@ -441,7 +439,7 @@ async function polyBalance(_user) { } module.exports = { - executeApp: async function(remoteNetwork) { - return executeApp(remoteNetwork); + executeApp: async function() { + return executeApp(); } } diff --git a/CLI/commands/multi_mint.js b/CLI/commands/multi_mint.js index 0b7c272ca..b138ef849 100644 --- a/CLI/commands/multi_mint.js +++ b/CLI/commands/multi_mint.js @@ -161,7 +161,7 @@ function readFile() { } } let mintMultiAction = securityToken.methods.mintMulti(affiliatesVerifiedArray, tokensVerifiedArray); - let r = await common.sendTransaction(Issuer, mintMultiAction, defaultGasPrice); + let r = await common.sendTransaction(mintMultiAction); console.log(`Batch ${i} - Attempting to send the Minted tokens to affiliates accounts:\n\n`, affiliatesVerifiedArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); console.log("Multi Mint transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); diff --git a/CLI/commands/permission_manager.js b/CLI/commands/permission_manager.js index a2165f697..ef3e2ea60 100644 --- a/CLI/commands/permission_manager.js +++ b/CLI/commands/permission_manager.js @@ -1,7 +1,7 @@ var readlineSync = require('readline-sync'); var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); +var gbl = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); @@ -12,16 +12,7 @@ let securityToken; let generalPermissionManager; let isNewDelegate = false; -const MODULES_TYPES = { - PERMISSION: 1, - TRANSFER: 2, - STO: 3, - DIVIDEND: 4, - BURN: 5 -} - -async function executeApp(remoteNetwork) { - await global.initialize(remoteNetwork); +async function executeApp() { common.logAsciiBull(); console.log("***********************************************"); @@ -75,9 +66,9 @@ async function addPermissionModule() { if (result.length == 0) { console.log(chalk.red(`General Permission Manager is not attached.`)); if (readlineSync.keyInYNStrict('Do you want to add General Permission Manager Module to your Security Token?')) { - let permissionManagerFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.PERMISSION, 'GeneralPermissionManager'); + let permissionManagerFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, gbl.constants.MODULES_TYPES.PERMISSION, 'GeneralPermissionManager'); let addModuleAction = securityToken.methods.addModule(permissionManagerFactoryAddress, web3.utils.fromAscii('', 16), 0, 0); - let receipt = await common.sendTransaction(Issuer, addModuleAction, defaultGasPrice); + let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`Module deployed at address: ${event._module}`); generalPermissionManagerAddress = event._module; @@ -119,18 +110,23 @@ async function changePermissionAction(selectedDelegate) { async function deleteDelegate(address) { let deleteDelegateAction = generalPermissionManager.methods.deleteDelegate(address); - await common.sendTransaction(Issuer, deleteDelegateAction, defaultGasPrice, 0, 2); + await common.sendTransaction(deleteDelegateAction, {factor: 2}); } // Helper functions async function selectDelegate() { let result; let delegates = await getDelegates(); + let permissions = await getDelegatesAndPermissions(); let options = ['Add new delegate']; + options = options.concat(delegates.map(function(d) { + let perm = renderTable(permissions, d.address); + return `Account: ${d.address} - Details: ${d.details}` + Details: ${d.details} + Permisions: ${perm}` })); let index = readlineSync.keyInSelect(options, 'Select a delegate:', {cancel: false}); @@ -169,7 +165,7 @@ function isPermissionValid() { async function changePermission(delegate, moduleAddress, permission, isValid) { let changePermissionAction = generalPermissionManager.methods.changePermission(delegate, moduleAddress, web3.utils.asciiToHex(permission), isValid); - let receipt = await common.sendTransaction(Issuer, changePermissionAction, defaultGasPrice, 0, 2); + let receipt = await common.sendTransaction(changePermissionAction, {factor: 2}); common.getEventFromLogs(generalPermissionManager._jsonInterface, receipt.logs, 'ChangePermission'); console.log(`Permission changed succesfully,`); } @@ -210,9 +206,9 @@ async function addNewDelegate() { }); let addPermissionAction = generalPermissionManager.methods.addDelegate(newDelegate, web3.utils.asciiToHex(details)); - let receipt = await common.sendTransaction(Issuer, addPermissionAction, defaultGasPrice); + let receipt = await common.sendTransaction(addPermissionAction); let event = common.getEventFromLogs(generalPermissionManager._jsonInterface, receipt.logs, 'AddDelegate'); - console.log(`Delegate added succesfully: ${event._delegate} - ${event._details}`); + console.log(`Delegate added succesfully: ${event._delegate} - ${web3.utils.hexToAscii(event._details)}`); isNewDelegate = true; return event._delegate; } @@ -221,8 +217,8 @@ async function getModulesWithPermissions() { let modules = []; let moduleABI = abis.moduleInterface(); - for (const type in MODULES_TYPES) { - let modulesAttached = await securityToken.methods.getModulesByType(MODULES_TYPES[type]).call(); + for (const type in gbl.constants.MODULES_TYPES) { + let modulesAttached = await securityToken.methods.getModulesByType(gbl.constants.MODULES_TYPES[type]).call(); for (const m of modulesAttached) { let contractTemp = new web3.eth.Contract(moduleABI, m); let permissions = await contractTemp.methods.getPermissions().call(); @@ -239,8 +235,55 @@ async function getModulesWithPermissions() { return modules; } +async function getDelegatesAndPermissions() { + let moduleABI = abis.moduleInterface(); + let result = []; + for (const type in gbl.constants.MODULES_TYPES) { + let modulesAttached = await securityToken.methods.getModulesByType(gbl.constants.MODULES_TYPES[type]).call(); + for (const module of modulesAttached) { + let contractTemp = new web3.eth.Contract(moduleABI, module); + let permissions = await contractTemp.methods.getPermissions().call(); + if (permissions.length > 0) { + for (const permission of permissions) { + let allDelegates = await generalPermissionManager.methods.getAllDelegatesWithPerm(module, permission).call(); + let moduleName = web3.utils.hexToUtf8((await securityToken.methods.getModule(module).call())[0]); + let permissionName = web3.utils.hexToUtf8(permission); + for (delegateAddr of allDelegates) { + if (result[delegateAddr] == undefined) { + result[delegateAddr] = [] + } + if (result[delegateAddr][moduleName + '-' + module] == undefined) { + result[delegateAddr][moduleName + '-' + module] = [{permission: permissionName}] + } else { + result[delegateAddr][moduleName + '-' + module].push({permission: permissionName}) + } + } + } + } + } + } + return result +} + +function renderTable(permissions, address) { + let result = ``; + if (permissions[address] != undefined) { + Object.keys(permissions[address]).forEach((module) => { + result += ` + ${module.split('-')[0]} (${module.split('-')[1]}) -> `; + (permissions[address][module]).forEach((perm) => { + result += `${perm.permission}, `; + }) + result = result.slice(0, -2); + }) + } else { + result += `-`; + } + return result +} + module.exports = { - executeApp: async function(remoteNetwork) { - return executeApp(remoteNetwork); + executeApp: async function() { + return executeApp(); } } \ No newline at end of file diff --git a/CLI/commands/strMigrator.js b/CLI/commands/strMigrator.js index 545455f46..1e42ec46d 100644 --- a/CLI/commands/strMigrator.js +++ b/CLI/commands/strMigrator.js @@ -4,13 +4,9 @@ var request = require('request-promise') var abis = require('./helpers/contract_abis'); var contracts = require('./helpers/contract_addresses'); var common = require('./common/common_functions'); -var global = require('./common/global'); +var gbl = require('./common/global'); -let network; - -async function executeApp(toStrAddress, fromTrAddress, fromStrAddress, remoteNetwork) { - network = remoteNetwork; - await global.initialize(remoteNetwork); +async function executeApp(toStrAddress, fromTrAddress, fromStrAddress) { common.logAsciiBull(); console.log("****************************************"); @@ -147,7 +143,7 @@ async function step_register_tickers(tickers, securityTokenRegistry) { console.log(``); try { let modifyTickerAction = securityTokenRegistry.methods.modifyTicker(t.owner, t.ticker, t.name, t.registrationDate, t.expiryDate, false); - let receipt = await common.sendTransaction(Issuer, modifyTickerAction, defaultGasPrice); + let receipt = await common.sendTransaction(modifyTickerAction); totalGas = totalGas.add(new web3.utils.BN(receipt.gasUsed)); succeed.push(t); } catch (error) { @@ -277,7 +273,7 @@ async function step_launch_STs(tokens, securityTokenRegistry) { try { // Deploying 2.0.0 Token let deployTokenAction = STFactory.methods.deployToken(t.name, t.ticker, 18, t.details, Issuer.address, t.divisble, polymathRegistryAddress) - let deployTokenReceipt = await common.sendTransaction(Issuer, deployTokenAction, defaultGasPrice); + let deployTokenReceipt = await common.sendTransaction(deployTokenAction); // Instancing Security Token let newTokenAddress = deployTokenReceipt.logs[deployTokenReceipt.logs.length -1].address; //Last log is the ST creation let newTokenABI = abis.securityToken(); @@ -298,25 +294,25 @@ async function step_launch_STs(tokens, securityTokenRegistry) { new web3.utils.BN(gmtEvent.returnValues._expiryTime), gmtEvent.returnValues._canBuyFromSTO ); - let modifyWhitelistReceipt = await common.sendTransaction(Issuer, modifyWhitelistAction, defaultGasPrice); + let modifyWhitelistReceipt = await common.sendTransaction(modifyWhitelistAction); totalGas = totalGas.add(new web3.utils.BN(modifyWhitelistReceipt.gasUsed)); } // Minting tokens for (const mintedEvent of t.mintedEvents) { let mintAction = newToken.methods.mint(mintedEvent.returnValues.to, new web3.utils.BN(mintedEvent.returnValues.value)); - let mintReceipt = await common.sendTransaction(Issuer, mintAction, defaultGasPrice); + let mintReceipt = await common.sendTransaction(mintAction); totalGas = totalGas.add(new web3.utils.BN(mintReceipt.gasUsed)); } } // Transferring onweship to the original owner let transferOwnershipAction = newToken.methods.transferOwnership(t.owner); - let transferOwnershipReceipt = await common.sendTransaction(Issuer, transferOwnershipAction, defaultGasPrice); + let transferOwnershipReceipt = await common.sendTransaction(transferOwnershipAction); totalGas = totalGas.add(new web3.utils.BN(transferOwnershipReceipt.gasUsed)); // Adding 2.0.0 Security Token to SecurityTokenRegistry let modifySecurityTokenAction = securityTokenRegistry.methods.modifySecurityToken(t.name, t.ticker, t.owner, newTokenAddress, t.details, t.deployedAt); - let modifySecurityTokenReceipt = await common.sendTransaction(Issuer, modifySecurityTokenAction, defaultGasPrice); + let modifySecurityTokenReceipt = await common.sendTransaction(modifySecurityTokenAction); totalGas = totalGas.add(new web3.utils.BN(modifySecurityTokenReceipt.gasUsed)); succeed.push(t); @@ -360,7 +356,7 @@ ${failed.map(ticker => chalk.red(`${ticker.ticker}`)).join('\n')} } async function getABIfromEtherscan(_address) { - let urlDomain = network == 'kovan' ? 'api-kovan' : 'api'; + let urlDomain = remoteNetwork == 'kovan' ? 'api-kovan' : 'api'; const options = { url: `https://${urlDomain}.etherscan.io/api`, qs: { @@ -377,7 +373,7 @@ async function getABIfromEtherscan(_address) { } module.exports = { - executeApp: async function(toStrAddress, fromTrAddress, fromStrAddress, remoteNetwork) { - return executeApp(toStrAddress, fromTrAddress, fromStrAddress, remoteNetwork); + executeApp: async function(toStrAddress, fromTrAddress, fromStrAddress) { + return executeApp(toStrAddress, fromTrAddress, fromStrAddress); } }; \ No newline at end of file diff --git a/CLI/commands/transfer.js b/CLI/commands/transfer.js index 48fbb79e5..5bd6d1859 100644 --- a/CLI/commands/transfer.js +++ b/CLI/commands/transfer.js @@ -1,5 +1,4 @@ var common = require('./common/common_functions'); -var global = require('./common/global'); /////////////////////////////ARTIFACTS////////////////////////////////////////// var contracts = require('./helpers/contract_addresses'); @@ -14,13 +13,11 @@ let securityToken; //////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// -async function startScript(tokenSymbol, transferTo, transferAmount, remoteNetwork) { +async function startScript(tokenSymbol, transferTo, transferAmount) { _tokenSymbol = tokenSymbol; _transferTo = transferTo; _transferAmount = transferAmount; - await global.initialize(remoteNetwork); - try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); let securityTokenRegistryABI = abis.securityTokenRegistry(); @@ -46,7 +43,7 @@ async function transfer() { try{ let transferAction = securityToken.methods.transfer(_transferTo,web3.utils.toWei(_transferAmount,"ether")); - let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice); + let receipt = await common.sendTransaction(transferAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'Transfer'); console.log(` Account ${event.from} @@ -61,7 +58,7 @@ async function transfer() { }; module.exports = { - executeApp: async function(tokenSymbol, transferTo, transferAmount, remoteNetwork) { - return startScript(tokenSymbol, transferTo, transferAmount, remoteNetwork); + executeApp: async function(tokenSymbol, transferTo, transferAmount) { + return startScript(tokenSymbol, transferTo, transferAmount); } } diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index df06c68f4..eb5eb1a26 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -1,8 +1,6 @@ var readlineSync = require('readline-sync'); var chalk = require('chalk'); -var moment = require('moment'); var common = require('./common/common_functions'); -var global = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); @@ -11,8 +9,7 @@ let tokenSymbol; let securityToken; let securityTokenRegistry; -async function executeApp(remoteNetwork) { - await global.initialize(remoteNetwork); +async function executeApp() { common.logAsciiBull(); console.log("*********************************************"); @@ -71,7 +68,7 @@ async function start_explorer() { case 'Disable controller': if (readlineSync.keyInYNStrict()) { let disableControllerAction = securityToken.methods.disableController(); - await common.sendTransaction(Issuer, disableControllerAction, defaultGasPrice); + await common.sendTransaction(disableControllerAction); console.log(chalk.green(`Forced transfers have been disabled permanently`)); } break; @@ -84,7 +81,7 @@ async function start_explorer() { defaultInput: Issuer.address }); let setControllerAction = securityToken.methods.setController(controllerAddress); - let setControllerReceipt = await common.sendTransaction(Issuer, setControllerAction, defaultGasPrice); + let setControllerReceipt = await common.sendTransaction(setControllerAction); let setControllerEvent = common.getEventFromLogs(securityToken._jsonInterface, setControllerReceipt.logs, 'SetController'); console.log(chalk.green(`New controller is ${setControllerEvent._newController}`)); break; @@ -114,7 +111,7 @@ async function start_explorer() { let data = readlineSync.question('Enter the data to indicate validation: '); let log = readlineSync.question('Enter the data attached to the transfer by controller to emit in event: '); let forceTransferAction = securityToken.methods.forceTransfer(from, to, web3.utils.toWei(amount), web3.utils.asciiToHex(data), web3.utils.asciiToHex(log)); - let forceTransferReceipt = await common.sendTransaction(Issuer, forceTransferAction, defaultGasPrice, 0, 1.5); + let forceTransferReceipt = await common.sendTransaction(forceTransferAction, {factor: 1.5}); let forceTransferEvent = common.getEventFromLogs(securityToken._jsonInterface, forceTransferReceipt.logs, 'ForceTransfer'); console.log(chalk.green(` ${forceTransferEvent._controller} has successfully forced a transfer of ${web3.utils.fromWei(forceTransferEvent._value)} ${tokenSymbol} from ${forceTransferEvent._from} to ${forceTransferEvent._to} @@ -138,7 +135,7 @@ async function start_explorer() { } module.exports = { - executeApp: async function(type, remoteNetwork) { - return executeApp(type, remoteNetwork); + executeApp: async function(type) { + return executeApp(type); } } \ No newline at end of file diff --git a/CLI/commands/transfer_ownership.js b/CLI/commands/transfer_ownership.js index 68ca7eb7a..99e12b80f 100644 --- a/CLI/commands/transfer_ownership.js +++ b/CLI/commands/transfer_ownership.js @@ -1,6 +1,5 @@ var chalk = require('chalk'); var common = require('./common/common_functions'); -var global = require('./common/global'); /////////////////////////////ARTIFACTS////////////////////////////////////////// var abis = require('./helpers/contract_abis') @@ -8,8 +7,7 @@ var abis = require('./helpers/contract_abis') let contract; //////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// -async function startScript(contractAddress, transferTo, remoteNetwork) { - await global.initialize(remoteNetwork); +async function startScript(contractAddress, transferTo) { if (!web3.utils.isAddress(contractAddress) || !web3.utils.isAddress(transferTo)) { console.log(chlak.red(`Please enter valid addresses`)); @@ -28,14 +26,14 @@ async function transferOwnership(transferTo) { console.log(chalk.red(`You are not the current owner ot this contract. Current owner is ${currentOwner}.`)); } else { let transferOwnershipAction = contract.methods.transferOwnership(transferTo); - let receipt = await common.sendTransaction(Issuer, transferOwnershipAction, defaultGasPrice); + let receipt = await common.sendTransaction(transferOwnershipAction); let event = common.getEventFromLogs(contract._jsonInterface, receipt.logs, 'OwnershipTransferred'); console.log(chalk.green(`Ownership transferred successfully. New owner is ${event.newOwner}`)); } }; module.exports = { - executeApp: async function(contractAddress, transferTo, remoteNetwork) { - return startScript(contractAddress, transferTo, remoteNetwork); + executeApp: async function(contractAddress, transferTo) { + return startScript(contractAddress, transferTo); } } diff --git a/CLI/commands/whitelist.js b/CLI/commands/whitelist.js index 4750adffa..5ef201195 100644 --- a/CLI/commands/whitelist.js +++ b/CLI/commands/whitelist.js @@ -167,7 +167,7 @@ async function setInvestors() { //toTimes is ability to buy coins TOwards your account (3rd row in csv, 3rd parameter in modifyWhiteList() ) //expiryTime is time at which KYC of investor get expired (4th row in csv, 4rd parameter in modifyWhiteList() ) let modifyWhitelistMultiAction = generalTransferManager.methods.modifyWhitelistMulti(investorArray, fromTimesArray, toTimesArray, expiryTimeArray, canBuyFromSTOArray); - let r = await common.sendTransaction(Issuer, modifyWhitelistMultiAction, defaultGasPrice); + let r = await common.sendTransaction(modifyWhitelistMultiAction); console.log(`Batch ${i} - Attempting to modifyWhitelist accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); console.log("Whitelist transaxction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 608182dfd..4de51588e 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -13,6 +13,7 @@ var contract_manager = require('./commands/contract_manager'); var strMigrator = require('./commands/strMigrator'); var permission_manager = require('./commands/permission_manager'); var program = require('commander'); +var gbl = require('./commands/common/global'); const yaml = require('js-yaml'); const fs = require('fs'); @@ -31,7 +32,8 @@ program .option('-D, --divisible [div]', 'If token is divisible or not [true]', /^(true|false)/, 'true') .description('Wizard-like script that will guide technical users in the creation and deployment of an ST-20 token') .action(async function(cmd) { - await st20generator.executeApp(cmd.ticker, cmd.transferOwnership, cmd.tokenName, cmd.details, cmd.divisible, program.remoteNode); + await gbl.initialize(program.remoteNode); + await st20generator.executeApp(cmd.ticker, cmd.transferOwnership, cmd.tokenName, cmd.details, cmd.divisible); }); program @@ -39,15 +41,17 @@ program .alias('f') .description('Poly faucet for local private netwtorks') .action(async function(beneficiary, amount) { - await faucet.executeApp(beneficiary, amount, program.remoteNode); + await gbl.initialize(program.remoteNode); + await faucet.executeApp(beneficiary, amount); }); program - .command('investor_portal [investor] [symbol] [currency] [amount]') + .command('investor_portal [investor] [privateKey] [symbol] [currency] [amount]') .alias('i') .description('Participate in any STO you have been whitelisted for') - .action(async function(investor, symbol, currency, amount) { - await investor_portal.executeApp(investor, symbol, currency, amount, program.remoteNode); + .action(async function(investor, privateKey, symbol, currency, amount) { + await gbl.initialize(program.remoteNode); + await investor_portal.executeApp(investor, privateKey, symbol, currency, amount); }); program @@ -55,7 +59,8 @@ program .alias('mm') .description('View modules attached to a token and their status') .action(async function() { - await module_manager.executeApp(program.remoteNode); + await gbl.initialize(program.remoteNode); + await module_manager.executeApp(); }); program @@ -63,6 +68,7 @@ program .alias('mi') .description('Distribute tokens to previously whitelisted investors') .action(async function(tokenSymbol, batchSize) { + await gbl.initialize(program.remoteNode); shell.exec(`${__dirname}/commands/scripts/script.sh Multimint ${tokenSymbol} ${batchSize} ${program.remoteNode}`);; }); @@ -71,7 +77,8 @@ program .alias('t') .description('Transfer ST tokens to another account') .action(async function(tokenSymbol, transferTo, transferAmount) { - await transfer.executeApp(tokenSymbol, transferTo, transferAmount, program.remoteNode); + await gbl.initialize(program.remoteNode); + await transfer.executeApp(tokenSymbol, transferTo, transferAmount); }); program @@ -79,7 +86,8 @@ program .alias('to') .description('Transfer Ownership of an own contract to another account') .action(async function(contractAddress, transferTo) { - await transfer_ownership.executeApp(contractAddress, transferTo, program.remoteNode); + await gbl.initialize(program.remoteNode); + await transfer_ownership.executeApp(contractAddress, transferTo); }); program @@ -87,6 +95,7 @@ program .alias('w') .description('Mass-update a whitelist of allowed/known investors') .action(async function(tokenSymbol, batchSize) { + await gbl.initialize(program.remoteNode); shell.exec(`${__dirname}/commands/scripts/script.sh Whitelist ${tokenSymbol} ${batchSize} ${program.remoteNode}`); }); @@ -95,7 +104,8 @@ program .alias('dm') .description('Runs dividends_manager') .action(async function(dividendsType) { - await dividends_manager.executeApp(dividendsType, program.remoteNode); + await gbl.initialize(program.remoteNode); + await dividends_manager.executeApp(dividendsType); }); program @@ -103,7 +113,8 @@ program .alias('tm') .description('Runs transfer_manager') .action(async function() { - await transfer_manager.executeApp(program.remoteNode); + await gbl.initialize(program.remoteNode); + await transfer_manager.executeApp(); }); program @@ -111,7 +122,8 @@ program .alias('cm') .description('Runs contract_manager') .action(async function() { - await contract_manager.executeApp(program.remoteNode); + await gbl.initialize(program.remoteNode); + await contract_manager.executeApp(); }); program @@ -119,6 +131,7 @@ program .alias('a') .description('Runs accredit') .action(async function(tokenSymbol, batchSize) { + await gbl.initialize(program.remoteNode); shell.exec(`${__dirname}/commands/scripts/script.sh Accredit ${tokenSymbol} ${batchSize} ${program.remoteNode}`);; }); @@ -127,6 +140,7 @@ program .alias('nal') .description('Runs changeNonAccreditedLimit') .action(async function(tokenSymbol, batchSize) { + await gbl.initialize(program.remoteNode); shell.exec(`${__dirname}/commands/scripts/script.sh NonAccreditedLimit ${tokenSymbol} ${batchSize} ${program.remoteNode}`);; }); @@ -135,7 +149,8 @@ program .alias('str') .description('Runs STR Migrator') .action(async function(toStrAddress, fromTrAddress, fromStrAddress) { - await strMigrator.executeApp(toStrAddress, fromTrAddress, fromStrAddress, program.remoteNode); + await gbl.initialize(program.remoteNode); + await strMigrator.executeApp(toStrAddress, fromTrAddress, fromStrAddress); }); program @@ -143,7 +158,8 @@ program .alias('pm') .description('Runs permission_manager') .action(async function() { - await permission_manager.executeApp(program.remoteNode); + await gbl.initialize(program.remoteNode); + await permission_manager.executeApp(); }); program.parse(process.argv); diff --git a/README.md b/README.md index 98173db84..64ff0d251 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,35 @@ node CLI/polymath-cli dividends_manager ``` # Setting up Polymath Core + +### v2.0.0 KOVAN + + ----------------------- Polymath Network Smart Contracts: ----------------------- + PolymathRegistry: 0xad09dc7939f09601674c69a07132bc642abeeb10 + SecurityTokenRegistry (Proxy): 0xef600e4904fe0a2f4587ae94bcbed4c9e9aeb37a + ModuleRegistry (Proxy): 0xe8e30fd7d65a5e3b1134ce29d3afb49cc27b7086 + FeatureRegistry: 0x35a8f211763be879541656d692f057d108eec9aa + + ETHOracle: 0xCE5551FC9d43E9D2CC255139169FC889352405C8 + POLYOracle: 0x461d98EF2A0c7Ac1416EF065840fF5d4C946206C + + STFactory: 0x1f08b1473fbb5bfc2bbaea99520291b6120be529 + GeneralTransferManagerFactory: 0xc100ec8f8e397b426a52a5c7acc02892e1d92a53 + GeneralPermissionManagerFactory: 0x96d7d693edd4a2ae773e4dd9739d997f0c38738f + + CappedSTOFactory: 0xfde869904bbc1e881601b2ebde4a77ba3808dfad + USDTieredSTOFactory: 0x01c17f387224148931ce03788e61836e7fe5d753 + USDTieredSTOProxyFactory: 0x63d0371a3dfa419a50670770b55618f6b5269057 + + CountTransferManagerFactory: 0x6691d4e4f8e48c7a3df04c25088169cb101b2882 + PercentageTransferManagerFactory: 0x62dd693e8864874d3d806286983e9da41cd5a035 + ManualApprovalTransferManagerFactory: 0x20ba9fd6907ff42f033df5cfdbaced6426b5e682 + EtherDividendCheckpointFactory: 0xceba16202ce878d1c01a1f5bf3f219b58d712d5f + ERC20DividendCheckpointFactory: 0x5c0051ffdc9655ae7b87a8a79542178be2e973e4 + --------------------------------------------------------------------------------- + + + ## Mainnet ### v1.3.0 (TORO Release) diff --git a/contracts/Migrations.sol b/contracts/Migrations.sol index c8e8a42bf..9f2b50b60 100644 --- a/contracts/Migrations.sol +++ b/contracts/Migrations.sol @@ -8,7 +8,7 @@ contract Migrations { uint public lastCompletedMigration; modifier restricted() { - require(msg.sender == owner); + require(msg.sender == owner, "Sender must be owner"); _; } diff --git a/contracts/ModuleRegistry.sol b/contracts/ModuleRegistry.sol index 4aa1fff74..b2f1fbba5 100644 --- a/contracts/ModuleRegistry.sol +++ b/contracts/ModuleRegistry.sol @@ -166,7 +166,10 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { // NB - here we index by the first type of the module. uint8 moduleType = moduleFactory.getTypes()[0]; set(Encoder.getKey("registry", _moduleFactory), uint256(moduleType)); - set(Encoder.getKey("moduleListIndex", _moduleFactory), uint256(getArrayAddress(Encoder.getKey("moduleList", uint256(moduleType))).length)); + set( + Encoder.getKey("moduleListIndex", _moduleFactory), + uint256(getArrayAddress(Encoder.getKey("moduleList", uint256(moduleType))).length) + ); pushArray(Encoder.getKey("moduleList", uint256(moduleType)), _moduleFactory); emit ModuleRegistered (_moduleFactory, IOwnable(_moduleFactory).owner()); } @@ -179,8 +182,10 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { uint256 moduleType = getUint(Encoder.getKey("registry", _moduleFactory)); require(moduleType != 0, "Module factory should be registered"); - require(msg.sender == IOwnable(_moduleFactory).owner() || msg.sender == owner(),"msg.sender must be the Module Factory owner or registry curator"); - + require( + msg.sender == IOwnable(_moduleFactory).owner() || msg.sender == owner(), + "msg.sender must be the Module Factory owner or registry curator" + ); uint256 index = getUint(Encoder.getKey("moduleListIndex", _moduleFactory)); uint256 last = getArrayAddress(Encoder.getKey("moduleList", moduleType)).length - 1; address temp = getArrayAddress(Encoder.getKey("moduleList", moduleType))[last]; @@ -331,7 +336,7 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { } /** - * @notice Reclaim all ERC20Basic compatible tokens + * @notice Reclaims all ERC20Basic compatible tokens * @param _tokenContract The address of the token contract */ function reclaimERC20(address _tokenContract) external onlyOwner { @@ -346,6 +351,7 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { */ function pause() external whenNotPaused onlyOwner { set(Encoder.getKey("paused"), true); + /*solium-disable-next-line security/no-block-members*/ emit Pause(now); } @@ -354,6 +360,7 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { */ function unpause() external whenPaused onlyOwner { set(Encoder.getKey("paused"), false); + /*solium-disable-next-line security/no-block-members*/ emit Unpause(now); } @@ -368,7 +375,7 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { } /** - * @notice Get the owner of the contract + * @notice Gets the owner of the contract * @return address owner */ function owner() public view returns(address) { @@ -376,7 +383,7 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { } /** - * @notice Check whether the contract operations is paused or not + * @notice Checks whether the contract operations is paused or not * @return bool */ function isPaused() public view returns(bool) { diff --git a/contracts/Pausable.sol b/contracts/Pausable.sol index b542396c3..fe4a3ca28 100644 --- a/contracts/Pausable.sol +++ b/contracts/Pausable.sol @@ -27,18 +27,20 @@ contract Pausable { } /** - * @notice called by the owner to pause, triggers stopped state + * @notice Called by the owner to pause, triggers stopped state */ - function _pause() whenNotPaused internal { + function _pause() internal whenNotPaused { paused = true; + /*solium-disable-next-line security/no-block-members*/ emit Pause(now); } /** - * @notice called by the owner to unpause, returns to normal state + * @notice Called by the owner to unpause, returns to normal state */ - function _unpause() whenPaused internal { + function _unpause() internal whenPaused { paused = false; + /*solium-disable-next-line security/no-block-members*/ emit Unpause(now); } diff --git a/contracts/PolymathRegistry.sol b/contracts/PolymathRegistry.sol index d33ad68f4..0d6a6ac92 100644 --- a/contracts/PolymathRegistry.sol +++ b/contracts/PolymathRegistry.sol @@ -12,18 +12,18 @@ contract PolymathRegistry is ReclaimTokens { event ChangeAddress(string _nameKey, address indexed _oldAddress, address indexed _newAddress); /** - * @notice Get the contract address + * @notice Gets the contract address * @param _nameKey is the key for the contract address mapping * @return address */ - function getAddress(string _nameKey) view external returns(address) { + function getAddress(string _nameKey) external view returns(address) { bytes32 key = keccak256(bytes(_nameKey)); require(storedAddresses[key] != address(0), "Invalid address key"); return storedAddresses[key]; } /** - * @notice change the contract address + * @notice Changes the contract address * @param _nameKey is the key for the contract address mapping * @param _newAddress is the new contract address */ diff --git a/contracts/ReclaimTokens.sol b/contracts/ReclaimTokens.sol index f6ce15641..767442829 100644 --- a/contracts/ReclaimTokens.sol +++ b/contracts/ReclaimTokens.sol @@ -13,9 +13,9 @@ contract ReclaimTokens is Ownable { * @param _tokenContract The address of the token contract */ function reclaimERC20(address _tokenContract) external onlyOwner { - require(_tokenContract != address(0)); + require(_tokenContract != address(0), "Invalid address"); IERC20 token = IERC20(_tokenContract); uint256 balance = token.balanceOf(address(this)); - require(token.transfer(owner, balance)); + require(token.transfer(owner, balance), "Transfer failed"); } } diff --git a/contracts/RegistryUpdater.sol b/contracts/RegistryUpdater.sol index 2ec9a1045..ee325b1cf 100644 --- a/contracts/RegistryUpdater.sol +++ b/contracts/RegistryUpdater.sol @@ -12,11 +12,11 @@ contract RegistryUpdater is Ownable { address public polyToken; constructor (address _polymathRegistry) public { - require(_polymathRegistry != address(0)); + require(_polymathRegistry != address(0), "Invalid address"); polymathRegistry = _polymathRegistry; } - function updateFromRegistry() onlyOwner public { + function updateFromRegistry() public onlyOwner { moduleRegistry = PolymathRegistry(polymathRegistry).getAddress("ModuleRegistry"); securityTokenRegistry = PolymathRegistry(polymathRegistry).getAddress("SecurityTokenRegistry"); featureRegistry = PolymathRegistry(polymathRegistry).getAddress("FeatureRegistry"); diff --git a/contracts/SecurityTokenRegistry.sol b/contracts/SecurityTokenRegistry.sol index fe47915d6..a9642cc20 100644 --- a/contracts/SecurityTokenRegistry.sol +++ b/contracts/SecurityTokenRegistry.sol @@ -156,7 +156,7 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { ///////////////////////////// /** - * @notice initializes instance of STR + * @notice Initializes instance of STR * @param _polymathRegistry is the address of the Polymath Registry * @param _STFactory is the address of the Proxy contract for Security Tokens * @param _stLaunchFee is the fee in POLY required to launch a token @@ -164,9 +164,22 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { * @param _polyToken is the address of the POLY ERC20 token * @param _owner is the owner of the STR */ - function initialize(address _polymathRegistry, address _STFactory, uint256 _stLaunchFee, uint256 _tickerRegFee, address _polyToken, address _owner) payable external { + function initialize( + address _polymathRegistry, + address _STFactory, + uint256 _stLaunchFee, + uint256 _tickerRegFee, + address _polyToken, + address _owner + ) + external + payable + { require(!getBool(INITIALIZE),"already initialized"); - require(_STFactory != address(0) && _polyToken != address(0) && _owner != address(0) && _polymathRegistry != address(0), "Invalid address"); + require( + _STFactory != address(0) && _polyToken != address(0) && _owner != address(0) && _polymathRegistry != address(0), + "Invalid address" + ); require(_stLaunchFee != 0 && _tickerRegFee != 0, "Fees should not be 0"); set(POLYTOKEN, _polyToken); set(STLAUNCHFEE, _stLaunchFee); @@ -205,6 +218,7 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { if (previousOwner != address(0)) { _deleteTickerOwnership(previousOwner, ticker); } + /*solium-disable-next-line security/no-block-members*/ _addTicker(_owner, ticker, _tokenName, now, now.add(getExpiryLimit()), false, false, tickerFee); } @@ -292,6 +306,7 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { _deleteTickerOwnership(owner, ticker); set(Encoder.getKey("tickerToSecurityToken", ticker), address(0)); _storeTickerDetails(ticker, address(0), 0, 0, "", false); + /*solium-disable-next-line security/no-block-members*/ emit TickerRemoved(ticker, now, msg.sender); } @@ -302,6 +317,7 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { */ function _tickerAvailable(string _ticker) internal view returns(bool) { if (_tickerOwner(_ticker) != address(0)) { + /*solium-disable-next-line security/no-block-members*/ if ((now > getUint(Encoder.getKey("registeredTickers_expiryDate", _ticker))) && !_tickerStatus(_ticker)) { return true; } else @@ -414,6 +430,7 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { bytes32[] memory tempList = new bytes32[](tickers.length); for (uint i = 0; i < tickers.length; i++) { string memory ticker = Util.bytes32ToString(tickers[i]); + /*solium-disable-next-line security/no-block-members*/ if (getUint(Encoder.getKey("registeredTickers_expiryDate", ticker)) >= now || _tickerStatus(ticker)) { tempList[counter] = tickers[i]; counter ++; @@ -477,6 +494,7 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { string memory ticker = Util.upper(_ticker); bool tickerStatus = _tickerStatus(ticker); uint256 expiryDate = getUint(Encoder.getKey("registeredTickers_expiryDate", ticker)); + /*solium-disable-next-line security/no-block-members*/ if ((tickerStatus == true) || (expiryDate > now)) { return ( @@ -508,6 +526,7 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { require(!getBool(statusKey), "Already deployed"); set(statusKey, true); require(_tickerOwner(ticker) == msg.sender, "Not authorised"); + /*solium-disable-next-line security/no-block-members*/ require(getUint(Encoder.getKey("registeredTickers_expiryDate", ticker)) >= now, "Ticker gets expired"); uint256 launchFee = getSecurityTokenLaunchFee(); @@ -524,8 +543,10 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { getAddress(POLYMATHREGISTRY) ); + /*solium-disable-next-line security/no-block-members*/ _storeSecurityTokenData(newSecurityTokenAddress, ticker, _tokenDetails, now); set(Encoder.getKey("tickerToSecurityToken", ticker), newSecurityTokenAddress); + /*solium-disable-next-line security/no-block-members*/ emit NewSecurityToken(ticker, _name, newSecurityTokenAddress, msg.sender, now, msg.sender, false, launchFee); } @@ -538,7 +559,17 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { * @param _tokenDetails is the off-chain details of the token * @param _deployedAt is the timestamp at which the security token is deployed */ - function modifySecurityToken(string _name, string _ticker, address _owner, address _securityToken, string _tokenDetails, uint256 _deployedAt) external onlyOwner { + function modifySecurityToken( + string _name, + string _ticker, + address _owner, + address _securityToken, + string _tokenDetails, + uint256 _deployedAt + ) + external + onlyOwner + { require(bytes(_name).length > 0 && bytes(_ticker).length > 0, "String length > 0"); require(bytes(_ticker).length <= 10, "Ticker length range (0,10]"); require(_deployedAt != 0 && _owner != address(0), "0 value params not allowed"); @@ -547,6 +578,7 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { uint256 registrationTime = getUint(Encoder.getKey("registeredTickers_registrationDate", ticker)); uint256 expiryTime = getUint(Encoder.getKey("registeredTickers_expiryDate", ticker)); if (registrationTime == 0) { + /*solium-disable-next-line security/no-block-members*/ registrationTime = now; expiryTime = registrationTime.add(getExpiryLimit()); } @@ -610,24 +642,26 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) external onlyOwner { - require(_newOwner != address(0)); + require(_newOwner != address(0), "Invalid address"); emit OwnershipTransferred(getAddress(OWNER), _newOwner); set(OWNER, _newOwner); } /** - * @notice called by the owner to pause, triggers stopped state + * @notice Called by the owner to pause, triggers stopped state */ function pause() external whenNotPaused onlyOwner { set(PAUSED, true); + /*solium-disable-next-line security/no-block-members*/ emit Pause(now); } /** - * @notice called by the owner to unpause, returns to normal state + * @notice Called by the owner to unpause, returns to normal state */ function unpause() external whenPaused onlyOwner { set(PAUSED, false); + /*solium-disable-next-line security/no-block-members*/ emit Unpause(now); } @@ -637,7 +671,7 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { */ function changeTickerRegistrationFee(uint256 _tickerRegFee) external onlyOwner { uint256 fee = getUint(TICKERREGFEE); - require(fee != _tickerRegFee); + require(fee != _tickerRegFee, "Fee not changed"); emit ChangeTickerRegistrationFee(fee, _tickerRegFee); set(TICKERREGFEE, _tickerRegFee); } @@ -648,7 +682,7 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { */ function changeSecurityLaunchFee(uint256 _stLaunchFee) external onlyOwner { uint256 fee = getUint(STLAUNCHFEE); - require(fee != _stLaunchFee); + require(fee != _stLaunchFee, "Fee not changed"); emit ChangeSecurityLaunchFee(fee, _stLaunchFee); set(STLAUNCHFEE, _stLaunchFee); } @@ -658,10 +692,10 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { * @param _tokenContract is the address of the token contract */ function reclaimERC20(address _tokenContract) external onlyOwner { - require(_tokenContract != address(0)); + require(_tokenContract != address(0), "Invalid address"); IERC20 token = IERC20(_tokenContract); uint256 balance = token.balanceOf(address(this)); - require(token.transfer(owner(), balance)); + require(token.transfer(owner(), balance), "Transfer failed"); } /** @@ -700,7 +734,7 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { } /** - * @notice get Protocol version + * @notice Gets Protocol version */ function getProtocolVersion() public view returns(uint8[]) { return VersionUtils.unpack(uint24(getUint(Encoder.getKey("latestVersion")))); @@ -711,7 +745,7 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage { * @param _newAddress is the address of the polytoken. */ function updatePolyTokenAddress(address _newAddress) external onlyOwner { - require(_newAddress != address(0)); + require(_newAddress != address(0), "Invalid address"); set(POLYTOKEN, _newAddress); } diff --git a/contracts/external/IMedianizer.sol b/contracts/external/IMedianizer.sol index f75804703..755d54a0f 100644 --- a/contracts/external/IMedianizer.sol +++ b/contracts/external/IMedianizer.sol @@ -1,3 +1,4 @@ +/* solium-disable */ pragma solidity ^0.4.24; /** diff --git a/contracts/external/oraclizeAPI.sol b/contracts/external/oraclizeAPI.sol index ee4b3cd17..c8d7a8f18 100644 --- a/contracts/external/oraclizeAPI.sol +++ b/contracts/external/oraclizeAPI.sol @@ -20,7 +20,7 @@ THE SOFTWARE. */ // This api is currently targeted at 0.4.18, please import oraclizeAPI_pre0.4.sol or oraclizeAPI_0.4 where necessary - +/* solium-disable */ pragma solidity >=0.4.18;// Incompatible compiler version... please select one stated within pragma solidity or use different oraclizeAPI version contract OraclizeI { diff --git a/contracts/helpers/PolyToken.sol b/contracts/helpers/PolyToken.sol index aea5f200d..d8f3d48ec 100644 --- a/contracts/helpers/PolyToken.sol +++ b/contracts/helpers/PolyToken.sol @@ -84,40 +84,40 @@ contract PolyToken is IERC20 { * @dev Assigns the totalSupply to the PolyDistribution contract */ constructor (address _polyDistributionContractAddress) public { - require(_polyDistributionContractAddress != address(0)); + require(_polyDistributionContractAddress != address(0), "Invalid address"); balances[_polyDistributionContractAddress] = totalSupply; emit Transfer(address(0), _polyDistributionContractAddress, totalSupply); } /** - * @dev Gets the balance of the specified address. - * @param _owner The address to query the the balance of. - * @return An uint256 representing the amount owned by the passed address. + * @dev Returns the balance of the specified address + * @param _owner The address to query the the balance of + * @return An uint256 representing the amount owned by the passed address */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } /** - * @dev Function to check the amount of tokens that an owner allowed to a spender. - * @param _owner address The address which owns the funds. - * @param _spender address The address which will spend the funds. - * @return A uint256 specifying the amount of tokens still available for the spender. + * @dev Function to check the amount of tokens a spender is allowed to spend + * @param _owner address The address which owns the tokens + * @param _spender address The address which will spend the tokens + * @return A uint256 specifying the amount of tokens left available for the spender */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** - * @dev transfer token for a specified address - * @param _to The address to transfer to. - * @param _value The amount to be transferred. + * @dev Transfer token to a specified address + * @param _to The address to transfer tokens to + * @param _value The amount to be transferred */ function transfer(address _to, uint256 _value) public returns (bool) { - require(_to != address(0)); - require(_value <= balances[msg.sender]); + require(_to != address(0), "Invalid address"); + require(_value <= balances[msg.sender], "Insufficient tokens transferable"); - // SafeMath.sub will throw if there is not enough balance. + // SafeMath.sub will throw if the balance is not enough balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); @@ -125,15 +125,15 @@ contract PolyToken is IERC20 { } /** - * @dev Transfer tokens from one address to another - * @param _from address The address which you want to send tokens from - * @param _to address The address which you want to transfer to - * @param _value uint256 the amount of tokens to be transferred + * @dev Transfers tokens from one address to another + * @param _from address The address to transfer tokens from + * @param _to address The address to transfer tokens to + * @param _value uint256 The amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { - require(_to != address(0)); - require(_value <= balances[_from]); - require(_value <= allowed[_from][msg.sender]); + require(_to != address(0), "Invalid address"); + require(_value <= balances[_from], "Insufficient tokens transferable"); + require(_value <= allowed[_from][msg.sender], "Insufficient tokens allowable"); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); @@ -143,14 +143,14 @@ contract PolyToken is IERC20 { } /** - * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. + * @dev Approves the passed address to spend the specified amount of tokens on behalf of msg.sender * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this - * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: + * race condition is to reduce the spender's allowance to 0 first and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - * @param _spender The address which will spend the funds. - * @param _value The amount of tokens to be spent. + * @param _spender The address which will spend the funds + * @param _value The amount of tokens to be spent */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; @@ -159,10 +159,10 @@ contract PolyToken is IERC20 { } /** - * @dev Increase the amount of tokens that an owner allowed to a spender. + * @dev Increases the amount of tokens that an owner has allowed a spender to spend * * approve should be called when allowed[_spender] == 0. To increment - * allowed value is better to use this function to avoid 2 calls (and wait until + * allowed value, it is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. @@ -175,21 +175,21 @@ contract PolyToken is IERC20 { } /** - * @dev Decrease the amount of tokens that an owner allowed to a spender. + * @dev Decreases the amount of tokens that an owner has allowed a spender to spend * * approve should be called when allowed[_spender] == 0. To decrement - * allowed value is better to use this function to avoid 2 calls (and wait until + * allowed value, it is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol - * @param _spender The address which will spend the funds. - * @param _subtractedValue The amount of tokens to decrease the allowance by. + * @param _spender The address which will spend the funds + * @param _subtractedValue The amount of tokens to decrease the allowance by */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { - allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); + allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; diff --git a/contracts/interfaces/IModule.sol b/contracts/interfaces/IModule.sol index 763e693fd..bc5140ae2 100644 --- a/contracts/interfaces/IModule.sol +++ b/contracts/interfaces/IModule.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; /** - * @title Interface that any module contract should implement + * @title Interface that every module contract should implement */ interface IModule { @@ -11,12 +11,12 @@ interface IModule { function getInitFunction() external pure returns (bytes4); /** - * @notice Return the permissions flag that are associated with a module + * @notice Return the permission flags that are associated with a module */ function getPermissions() external view returns(bytes32[]); /** - * @notice used to withdraw the fee by the factory owner + * @notice Used to withdraw the fee by the factory owner */ function takeFee(uint256 _amount) external returns(bool); diff --git a/contracts/interfaces/IModuleFactory.sol b/contracts/interfaces/IModuleFactory.sol index 9cf834069..9c2ad6bf2 100644 --- a/contracts/interfaces/IModuleFactory.sol +++ b/contracts/interfaces/IModuleFactory.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; /** - * @title Interface that any module factory contract should implement + * @title Interface that every module factory contract should implement */ interface IModuleFactory { @@ -31,21 +31,6 @@ interface IModuleFactory { */ function getName() external view returns(bytes32); - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string); - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string); - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string); - /** * @notice Returns the instructions associated with the module */ @@ -57,44 +42,44 @@ interface IModuleFactory { function getTags() external view returns (bytes32[]); /** - * @notice used to change the fee of the setup cost - * @param _newSetupCost new setup cost + * @notice Used to change the setup fee + * @param _newSetupCost New setup fee */ function changeFactorySetupFee(uint256 _newSetupCost) external; /** - * @notice used to change the fee of the usage cost - * @param _newUsageCost new usage cost + * @notice Used to change the usage fee + * @param _newUsageCost New usage fee */ function changeFactoryUsageFee(uint256 _newUsageCost) external; /** - * @notice used to change the fee of the subscription cost - * @param _newSubscriptionCost new subscription cost + * @notice Used to change the subscription fee + * @param _newSubscriptionCost New subscription fee */ function changeFactorySubscriptionFee(uint256 _newSubscriptionCost) external; /** * @notice Function use to change the lower and upper bound of the compatible version st * @param _boundType Type of bound - * @param _newVersion new version array + * @param _newVersion New version array */ function changeSTVersionBounds(string _boundType, uint8[] _newVersion) external; - /** + /** * @notice Get the setup cost of the module */ function getSetupCost() external view returns (uint256); /** - * @notice use to get the lower bound - * @return lower bound + * @notice Used to get the lower bound + * @return Lower bound */ function getLowerSTVersionBounds() external view returns(uint8[]); /** - * @notice use to get the upper bound - * @return upper bound + * @notice Used to get the upper bound + * @return Upper bound */ function getUpperSTVersionBounds() external view returns(uint8[]); diff --git a/contracts/interfaces/IPolymathRegistry.sol b/contracts/interfaces/IPolymathRegistry.sol index cb2de8d02..4601253fa 100644 --- a/contracts/interfaces/IPolymathRegistry.sol +++ b/contracts/interfaces/IPolymathRegistry.sol @@ -4,11 +4,11 @@ pragma solidity ^0.4.24; interface IPolymathRegistry { /** - * @notice Get the contract address + * @notice Returns the contract address * @param _nameKey is the key for the contract address mapping * @return address */ - function getAddress(string _nameKey) view external returns(address); + function getAddress(string _nameKey) external view returns(address); } \ No newline at end of file diff --git a/contracts/interfaces/ISTFactory.sol b/contracts/interfaces/ISTFactory.sol index a352fb2cb..7b7d6dd77 100644 --- a/contracts/interfaces/ISTFactory.sol +++ b/contracts/interfaces/ISTFactory.sol @@ -6,7 +6,7 @@ pragma solidity ^0.4.24; interface ISTFactory { /** - * @notice deploys the token and adds default modules like permission manager and transfer manager. + * @notice Deploys the token and adds default modules like permission manager and transfer manager. * Future versions of the proxy can attach different modules or pass some other paramters. * @param _name is the name of the Security token * @param _symbol is the symbol of the Security Token @@ -16,6 +16,15 @@ interface ISTFactory { * @param _divisible whether the token is divisible or not * @param _polymathRegistry is the address of the Polymath Registry contract */ - function deployToken(string _name, string _symbol, uint8 _decimals, string _tokenDetails, address _issuer, bool _divisible, address _polymathRegistry) - external returns (address); + function deployToken( + string _name, + string _symbol, + uint8 _decimals, + string _tokenDetails, + address _issuer, + bool _divisible, + address _polymathRegistry + ) + external + returns (address); } diff --git a/contracts/interfaces/ISecurityToken.sol b/contracts/interfaces/ISecurityToken.sol index c845cc30d..f280d6c19 100644 --- a/contracts/interfaces/ISecurityToken.sol +++ b/contracts/interfaces/ISecurityToken.sol @@ -18,38 +18,38 @@ interface ISecurityToken { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); - //transfer, transferFrom must respect use respect the result of verifyTransfer + //transfer, transferFrom must respect the result of verifyTransfer function verifyTransfer(address _from, address _to, uint256 _value) external returns (bool success); /** - * @notice mints new tokens and assigns them to the target _investor. + * @notice Mints new tokens and assigns them to the target _investor. * Can only be called by the STO attached to the token (Or by the ST owner if there's no STO attached yet) - * @param _investor address the tokens will be minted to + * @param _investor Address the tokens will be minted to * @param _value is the amount of tokens that will be minted to the investor */ function mint(address _investor, uint256 _value) external returns (bool success); /** - * @notice mints new tokens and assigns them to the target _investor. + * @notice Mints new tokens and assigns them to the target _investor. * Can only be called by the STO attached to the token (Or by the ST owner if there's no STO attached yet) - * @param _investor address the tokens will be minted to - * @param _value is the amount of tokens that will be minted to the investor - * @param _data data to indicate validation + * @param _investor Address the tokens will be minted to + * @param _value is The amount of tokens that will be minted to the investor + * @param _data Data to indicate validation */ function mintWithData(address _investor, uint256 _value, bytes _data) external returns (bool success); /** - * @notice Burn function used to burn the securityToken on behalf of someone else + * @notice Used to burn the securityToken on behalf of someone else * @param _from Address for whom to burn tokens - * @param _value No. of token that get burned - * @param _data data to indicate validation + * @param _value No. of tokens to be burned + * @param _data Data to indicate validation */ function burnFromWithData(address _from, uint256 _value, bytes _data) external; /** - * @notice Burn function used to burn the securityToken - * @param _value No. of tokens that get burned - * @param _data data to indicate validation + * @notice Used to burn the securityToken + * @param _value No. of tokens to be burned + * @param _data Data to indicate validation */ function burnWithData(uint256 _value, bytes _data) external; @@ -63,29 +63,29 @@ interface ISecurityToken { /** * @notice Returns module list for a module type - * @param _module address of the module - * @return bytes32 name - * @return address module address - * @return address module factory address - * @return bool module archived - * @return uint8 module type - * @return uint256 module index - * @return uint256 name index + * @param _module Address of the module + * @return bytes32 Name + * @return address Module address + * @return address Module factory address + * @return bool Module archived + * @return uint8 Module type + * @return uint256 Module index + * @return uint256 Name index */ function getModule(address _module) external view returns(bytes32, address, address, bool, uint8, uint256, uint256); /** - * @notice returns module list for a module name - * @param _name name of the module - * @return address[] list of modules with this name + * @notice Returns module list for a module name + * @param _name Name of the module + * @return address[] List of modules with this name */ function getModulesByName(bytes32 _name) external view returns (address[]); /** - * @notice returns module list for a module type - * @param _type type of the module - * @return address[] list of modules with this type + * @notice Returns module list for a module type + * @param _type Type of the module + * @return address[] List of modules with this type */ function getModulesByType(uint8 _type) external view returns (address[]); @@ -96,7 +96,7 @@ interface ISecurityToken { function totalSupplyAt(uint256 _checkpointId) external view returns (uint256); /** - * @notice Queries balances at a specified checkpoint + * @notice Queries balance at a specified checkpoint * @param _investor Investor to query balance for * @param _checkpointId Checkpoint ID to query as of */ @@ -108,81 +108,98 @@ interface ISecurityToken { function createCheckpoint() external returns (uint256); /** - * @notice gets length of investors array + * @notice Gets length of investors array * NB - this length may differ from investorCount if the list has not been pruned of zero-balance investors - * @return length + * @return Length */ function getInvestors() external view returns (address[]); /** - * @notice gets current checkpoint ID - * @return id - */ + * @notice returns an array of investors at a given checkpoint + * NB - this length may differ from investorCount as it contains all investors that ever held tokens + * @param _checkpointId Checkpoint id at which investor list is to be populated + * @return list of investors + */ + function getInvestorsAt(uint256 _checkpointId) external view returns(address[]); + + /** + * @notice generates subset of investors + * NB - can be used in batches if investor list is large + * @param _start Position of investor to start iteration from + * @param _end Position of investor to stop iteration at + * @return list of investors + */ + function iterateInvestors(uint256 _start, uint256 _end) external view returns(address[]); + + /** + * @notice Gets current checkpoint ID + * @return Id + */ function currentCheckpointId() external view returns (uint256); /** - * @notice gets an investor at a particular index - * @param _index index to return address from - * @return investor address + * @notice Gets an investor at a particular index + * @param _index Index to return address from + * @return Investor address */ function investors(uint256 _index) external view returns (address); /** - * @notice allows the owner to withdraw unspent POLY stored by them on the ST or any ERC20 token. + * @notice Allows the owner to withdraw unspent POLY stored by them on the ST or any ERC20 token. * @dev Owner can transfer POLY to the ST which will be used to pay for modules that require a POLY fee. * @param _tokenContract Address of the ERC20Basic compliance token - * @param _value amount of POLY to withdraw + * @param _value Amount of POLY to withdraw */ function withdrawERC20(address _tokenContract, uint256 _value) external; /** - * @notice allows owner to approve more POLY to one of the modules - * @param _module module address - * @param _budget new budget + * @notice Allows owner to approve more POLY to one of the modules + * @param _module Module address + * @param _budget New budget */ function changeModuleBudget(address _module, uint256 _budget) external; /** - * @notice changes the tokenDetails + * @notice Changes the tokenDetails * @param _newTokenDetails New token details */ function updateTokenDetails(string _newTokenDetails) external; /** - * @notice allows owner to change token granularity - * @param _granularity granularity level of the token + * @notice Allows the owner to change token granularity + * @param _granularity Granularity level of the token */ function changeGranularity(uint256 _granularity) external; /** - * @notice removes addresses with zero balances from the investors list - * @param _start Index in investor list at which to start removing zero balances + * @notice Removes addresses with zero balances from the investors list + * @param _start Index in investors list at which to start removing zero balances * @param _iters Max number of iterations of the for loop * NB - pruning this list will mean you may not be able to iterate over investors on-chain as of a historical checkpoint */ function pruneInvestors(uint256 _start, uint256 _iters) external; /** - * @notice freeze all the transfers + * @notice Freezes all the transfers */ function freezeTransfers() external; /** - * @notice un-freeze all the transfers + * @notice Un-freezes all the transfers */ function unfreezeTransfers() external; /** - * @notice End token minting period permanently + * @notice Ends token minting period permanently */ function freezeMinting() external; /** - * @notice mints new tokens and assigns them to the target investors. + * @notice Mints new tokens and assigns them to the target investors. * Can only be called by the STO attached to the token or by the Issuer (Security Token contract owner) * @param _investors A list of addresses to whom the minted tokens will be delivered * @param _values A list of the amount of tokens to mint to corresponding addresses from _investor[] list - * @return success + * @return Success */ function mintMulti(address[] _investors, uint256[] _values) external returns (bool success); @@ -223,13 +240,13 @@ interface ISecurityToken { function removeModule(address _module) external; /** - * @notice Use by the issuer to set the controller addresses + * @notice Used by the issuer to set the controller addresses * @param _controller address of the controller */ function setController(address _controller) external; /** - * @notice Use by a controller to execute a forced transfer + * @notice Used by a controller to execute a forced transfer * @param _from address from which to take tokens * @param _to address where to send tokens * @param _value amount of tokens to transfer @@ -239,7 +256,7 @@ interface ISecurityToken { function forceTransfer(address _from, address _to, uint256 _value, bytes _data, bytes _log) external; /** - * @notice Use by a controller to execute a foced burn + * @notice Used by a controller to execute a foced burn * @param _from address from which to take tokens * @param _value amount of tokens to transfer * @param _data data to indicate validation @@ -248,18 +265,18 @@ interface ISecurityToken { function forceBurn(address _from, uint256 _value, bytes _data, bytes _log) external; /** - * @notice Use by the issuer to permanently disable controller functionality + * @notice Used by the issuer to permanently disable controller functionality * @dev enabled via feature switch "disableControllerAllowed" */ function disableController() external; /** - * @notice Use to get the version of the securityToken + * @notice Used to get the version of the securityToken */ function getVersion() external view returns(uint8[]); /** - * @notice gets the investor count + * @notice Gets the investor count */ function getInvestorCount() external view returns(uint256); @@ -281,10 +298,10 @@ interface ISecurityToken { * @return bool success */ function transferFromWithData(address _from, address _to, uint256 _value, bytes _data) external returns(bool); - + /** - * @notice Provide the granularity of the token - * @return uint256 + * @notice Provides the granularity of the token + * @return uint256 */ function granularity() external view returns(uint256); } diff --git a/contracts/interfaces/ISecurityTokenRegistry.sol b/contracts/interfaces/ISecurityTokenRegistry.sol index 2bacd39d7..8db01f8ad 100644 --- a/contracts/interfaces/ISecurityTokenRegistry.sol +++ b/contracts/interfaces/ISecurityTokenRegistry.sol @@ -9,8 +9,8 @@ interface ISecurityTokenRegistry { * @notice Creates a new Security Token and saves it to the registry * @param _name Name of the token * @param _ticker Ticker ticker of the security token - * @param _tokenDetails off-chain details of the token - * @param _divisible whether the token is divisible or not + * @param _tokenDetails Off-chain details of the token + * @param _divisible Whether the token is divisible or not */ function generateSecurityToken(string _name, string _ticker, string _tokenDetails, bool _divisible) external; @@ -20,17 +20,25 @@ interface ISecurityTokenRegistry { * @param _ticker Ticker of the security token * @param _owner Owner of the token * @param _securityToken Address of the securityToken - * @param _tokenDetails off-chain details of the token + * @param _tokenDetails Off-chain details of the token * @param _deployedAt Timestamp at which security token comes deployed on the ethereum blockchain */ - function modifySecurityToken(string _name, string _ticker, address _owner, address _securityToken, string _tokenDetails, uint256 _deployedAt) external; + function modifySecurityToken( + string _name, + string _ticker, + address _owner, + address _securityToken, + string _tokenDetails, + uint256 _deployedAt + ) + external; /** - * @notice Register the token ticker for its particular owner - * @notice Once the token ticker is registered to its owner then no other issuer can claim + * @notice Registers the token ticker for its particular owner + * @notice once the token ticker is registered to its owner then no other issuer can claim * @notice its ownership. If the ticker expires and its issuer hasn't used it, then someone else can take it. * @param _owner Address of the owner of the token - * @param _ticker token ticker + * @param _ticker Token ticker * @param _tokenName Name of the token */ function registerTicker(address _owner, string _ticker, string _tokenName) external; @@ -82,12 +90,12 @@ interface ISecurityTokenRegistry { function getSTFactoryAddress() external view returns(address); /** - * @notice get Protocol version + * @notice Get Protocol version */ function getProtocolVersion() external view returns(uint8[]); /** - * @notice Use to get the ticker list as per the owner + * @notice Used to get the ticker list as per the owner * @param _owner Address which owns the list of tickers */ function getTickersByOwner(address _owner) external view returns(bytes32[]); @@ -111,45 +119,53 @@ interface ISecurityTokenRegistry { function getTickerDetails(string _ticker) external view returns (address, uint256, uint256, string, bool); /** - * @notice Modify the ticker details. Only polymath account has the ability + * @notice Modifies the ticker details. Only polymath account has the ability * to do so. Only allowed to modify the tickers which are not yet deployed * @param _owner Owner of the token - * @param _ticker token ticker + * @param _ticker Token ticker * @param _tokenName Name of the token * @param _registrationDate Date on which ticker get registered * @param _expiryDate Expiry date of the ticker * @param _status Token deployed status */ - function modifyTicker(address _owner, string _ticker, string _tokenName, uint256 _registrationDate, uint256 _expiryDate, bool _status) external; + function modifyTicker( + address _owner, + string _ticker, + string _tokenName, + uint256 _registrationDate, + uint256 _expiryDate, + bool _status + ) + external; /** - * @notice Remove the ticker details and associated ownership & security token mapping - * @param _ticker token ticker + * @notice Removes the ticker details and associated ownership & security token mapping + * @param _ticker Token ticker */ function removeTicker(string _ticker) external; /** - * @notice Transfer the ownership of the ticker + * @notice Transfers the ownership of the ticker * @dev _newOwner Address whom ownership to transfer * @dev _ticker Ticker */ function transferTickerOwnership(address _newOwner, string _ticker) external; /** - * @notice Change the expiry time for the token ticker - * @param _newExpiry new time period for token ticker expiry + * @notice Changes the expiry time for the token ticker + * @param _newExpiry New time period for token ticker expiry */ function changeExpiryLimit(uint256 _newExpiry) external; /** - * @notice set the ticker registration fee in POLY tokens - * @param _tickerRegFee registration fee in POLY tokens (base 18 decimals) + * @notice Sets the ticker registration fee in POLY tokens + * @param _tickerRegFee Registration fee in POLY tokens (base 18 decimals) */ function changeTickerRegistrationFee(uint256 _tickerRegFee) external; /** - * @notice set the ticker registration fee in POLY tokens - * @param _stLaunchFee registration fee in POLY tokens (base 18 decimals) + * @notice Sets the ticker registration fee in POLY tokens + * @param _stLaunchFee Registration fee in POLY tokens (base 18 decimals) */ function changeSecurityLaunchFee(uint256 _stLaunchFee) external; @@ -178,7 +194,7 @@ interface ISecurityTokenRegistry { function getExpiryLimit() external view returns(uint256); /** - * @notice Check whether the registry is paused or not + * @notice Checks whether the registry is paused or not * @return bool */ function isPaused() external view returns(bool); diff --git a/contracts/interfaces/IUSDTieredSTOProxy.sol b/contracts/interfaces/IUSDTieredSTOProxy.sol index 1f0526d5d..3aec141a0 100644 --- a/contracts/interfaces/IUSDTieredSTOProxy.sol +++ b/contracts/interfaces/IUSDTieredSTOProxy.sol @@ -6,16 +6,16 @@ pragma solidity ^0.4.24; interface IUSDTieredSTOProxy { /** - * @notice deploys the STO. + * @notice Deploys the STO. * @param _securityToken Contract address of the securityToken - * @param _polyAddress Contract address of the PolyToken. + * @param _polyAddress Contract address of the PolyToken * @param _factoryAddress Contract address of the factory * @return address Address of the deployed STO */ function deploySTO(address _securityToken, address _polyAddress, address _factoryAddress) external returns (address); /** - * @notice Use to get the init function signature + * @notice Used to get the init function signature * @param _contractAddress Address of the STO contract * @return bytes4 */ diff --git a/contracts/libraries/TokenLib.sol b/contracts/libraries/TokenLib.sol index b7eeca7f4..42e5bebff 100644 --- a/contracts/libraries/TokenLib.sol +++ b/contracts/libraries/TokenLib.sol @@ -25,7 +25,7 @@ library TokenLib { } struct InvestorDataStorage { - // List of investors (may not be pruned to remove old investors with current zero balances) + // List of investors who have ever held a non-zero token balance mapping (address => bool) investorListed; // List of token holders address[] investors; @@ -40,29 +40,31 @@ library TokenLib { /** * @notice Archives a module attached to the SecurityToken - * @param _moduleData storage data - * @param _module address of module to archive + * @param _moduleData Storage data + * @param _module Address of module to archive */ function archiveModule(ModuleData storage _moduleData, address _module) public { require(!_moduleData.isArchived, "Module archived"); require(_moduleData.module != address(0), "Module missing"); + /*solium-disable-next-line security/no-block-members*/ emit ModuleArchived(_moduleData.moduleTypes, _module, now); _moduleData.isArchived = true; } /** * @notice Unarchives a module attached to the SecurityToken - * @param _moduleData storage data - * @param _module address of module to unarchive + * @param _moduleData Storage data + * @param _module Address of module to unarchive */ function unarchiveModule(ModuleData storage _moduleData, address _module) public { require(_moduleData.isArchived, "Module unarchived"); + /*solium-disable-next-line security/no-block-members*/ emit ModuleUnarchived(_moduleData.moduleTypes, _module, now); _moduleData.isArchived = false; } /** - * @notice Validate permissions with PermissionManager if it exists. If there's no permission return false + * @notice Validates permissions with PermissionManager if it exists. If there's no permission return false * @dev Note that IModule withPerm will allow ST owner all permissions by default * @dev this allows individual modules to override this logic if needed (to not allow ST owner all permissions) * @param _modules is the modules to check permissions on @@ -150,13 +152,13 @@ library TokenLib { } /** - * @notice keeps track of the number of non-zero token holders + * @notice Keeps track of the number of non-zero token holders * @param _investorData Date releated to investor metrics - * @param _from sender of transfer - * @param _to receiver of transfer - * @param _value value of transfer - * @param _balanceTo balance of the _to address - * @param _balanceFrom balance of the _from address + * @param _from Sender of transfer + * @param _to Receiver of transfer + * @param _value Value of transfer + * @param _balanceTo Balance of the _to address + * @param _balanceFrom Balance of the _from address */ function adjustInvestorCount( InvestorDataStorage storage _investorData, @@ -185,16 +187,4 @@ library TokenLib { } - /** - * @notice removes addresses with zero balances from the investors list - * @param _investorData is the date related to investor metrics - * @param _index is the index in investor list - * NB - pruning this list will mean you may not be able to iterate over investors on-chain as of a historical checkpoint - */ - function pruneInvestors(InvestorDataStorage storage _investorData, uint256 _index) public { - _investorData.investorListed[_investorData.investors[_index]] = false; - _investorData.investors[_index] = _investorData.investors[_investorData.investors.length - 1]; - _investorData.investors.length--; - } - } diff --git a/contracts/libraries/Util.sol b/contracts/libraries/Util.sol index 4e60c9c59..5d4cce83e 100644 --- a/contracts/libraries/Util.sol +++ b/contracts/libraries/Util.sol @@ -6,8 +6,8 @@ pragma solidity ^0.4.24; library Util { /** - * @notice changes a string to upper case - * @param _base string to change + * @notice Changes a string to upper case + * @param _base String to change */ function upper(string _base) internal pure returns (string) { bytes memory _baseBytes = bytes(_base); @@ -22,16 +22,16 @@ library Util { } /** - * @notice changes the string into bytes32 + * @notice Changes the string into bytes32 * @param _source String that need to convert into bytes32 */ - /// Notice - Maximum length for _source will be 32 chars otherwise returned bytes32 value will have lossy value. + /// Notice - Maximum Length for _source will be 32 chars otherwise returned bytes32 value will have lossy value. function stringToBytes32(string memory _source) internal pure returns (bytes32) { return bytesToBytes32(bytes(_source), 0); } /** - * @notice changes bytes into bytes32 + * @notice Changes bytes into bytes32 * @param _b Bytes that need to convert into bytes32 * @param _offset Offset from which to begin conversion */ @@ -67,8 +67,8 @@ library Util { } /** - * @notice Get function signature from _data - * @param _data passed data + * @notice Gets function signature from _data + * @param _data Passed data * @return bytes4 sig */ function getSig(bytes _data) internal pure returns (bytes4 sig) { diff --git a/contracts/libraries/VersionUtils.sol b/contracts/libraries/VersionUtils.sol index 2650913ce..71376aa45 100644 --- a/contracts/libraries/VersionUtils.sol +++ b/contracts/libraries/VersionUtils.sol @@ -46,15 +46,15 @@ library VersionUtils { } /** - * @notice This function use to compare the lower bound with the latest version + * @notice Used to compare the lower bound with the latest version * @param _version1 Array holds the lower bound of the version * @param _version2 Array holds the latest version of the ST * @return bool */ function compareLowerBound(uint8[] _version1, uint8[] _version2) internal pure returns(bool) { - require(_version1.length == _version2.length); + require(_version1.length == _version2.length, "Input length mismatch"); uint counter = 0; - for (uint8 j = 0; j< _version1.length; j++) { + for (uint8 j = 0; j < _version1.length; j++) { if (_version1[j] == 0) counter ++; } @@ -77,15 +77,15 @@ library VersionUtils { } /** - * @notice This function use to compare the upper bound with the latest version + * @notice Used to compare the upper bound with the latest version * @param _version1 Array holds the upper bound of the version * @param _version2 Array holds the latest version of the ST * @return bool */ function compareUpperBound(uint8[] _version1, uint8[] _version2) internal pure returns(bool) { - require(_version1.length == _version2.length); + require(_version1.length == _version2.length, "Input length mismatch"); uint counter = 0; - for (uint8 j = 0; j< _version1.length; j++) { + for (uint8 j = 0; j < _version1.length; j++) { if (_version1[j] == 0) counter ++; } @@ -109,7 +109,7 @@ library VersionUtils { /** - * @notice Use to pack the uint8[] array data into uint24 value + * @notice Used to pack the uint8[] array data into uint24 value * @param _major Major version * @param _minor Minor version * @param _patch Patch version @@ -119,7 +119,7 @@ library VersionUtils { } /** - * @notice Use to convert packed data into uint8 array + * @notice Used to convert packed data into uint8 array * @param _packedVersion Packed data */ function unpack(uint24 _packedVersion) internal pure returns (uint8[]) { diff --git a/contracts/mocks/MockBurnFactory.sol b/contracts/mocks/MockBurnFactory.sol index c21b474f1..6c0e47c3d 100644 --- a/contracts/mocks/MockBurnFactory.sol +++ b/contracts/mocks/MockBurnFactory.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; import "./MockRedemptionManager.sol"; -import "../modules/Burn/TrackedRedemptionFactory.sol"; +import "../modules/Experimental/Burn/TrackedRedemptionFactory.sol"; /** * @title Mock Contract Not fit for production environment @@ -19,14 +19,15 @@ contract MockBurnFactory is TrackedRedemptionFactory { } /** - * @notice used to launch the Module with the help of factory - * @return address Contract address of the Module + * @notice Used to launch the Module with the help of factory + * @return Address Contract address of the Module */ function deploy(bytes /*_data*/) external returns(address) { if(setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "Unable to pay setup cost"); //Check valid bytes - can only call module init function MockRedemptionManager mockRedemptionManager = new MockRedemptionManager(msg.sender, address(polyToken)); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(mockRedemptionManager), getName(), address(this), msg.sender, setupCost, now); return address(mockRedemptionManager); } diff --git a/contracts/mocks/MockModuleRegistry.sol b/contracts/mocks/MockModuleRegistry.sol index 23af59d58..5711108c1 100644 --- a/contracts/mocks/MockModuleRegistry.sol +++ b/contracts/mocks/MockModuleRegistry.sol @@ -11,7 +11,7 @@ contract MockModuleRegistry is ModuleRegistry { /// Alert! Alert! Do not use it for the mainnet release function addMoreReputation(address _moduleFactory, address[] _tokens) public onlyOwner { for (uint8 i = 0; i < _tokens.length; i++) { - pushArray(Encoder.getKey('reputation', _moduleFactory), _tokens[i]); + pushArray(Encoder.getKey("reputation", _moduleFactory), _tokens[i]); } } diff --git a/contracts/mocks/MockRedemptionManager.sol b/contracts/mocks/MockRedemptionManager.sol index a2a0a6f7c..02fbb2e81 100644 --- a/contracts/mocks/MockRedemptionManager.sol +++ b/contracts/mocks/MockRedemptionManager.sol @@ -1,12 +1,12 @@ pragma solidity ^0.4.24; -import "../modules/Burn/TrackedRedemption.sol"; +import "../modules/Experimental/Burn/TrackedRedemption.sol"; /** * @title Burn module for burning tokens and keeping track of burnt amounts */ contract MockRedemptionManager is TrackedRedemption { - + mapping (address => uint256) tokenToRedeem; event RedeemedTokenByOwner(address _investor, address _byWhoom, uint256 _value, uint256 _timestamp); @@ -22,7 +22,7 @@ contract MockRedemptionManager is TrackedRedemption { } /** - * @notice Transfer tokens to Module to burn + * @notice Transfers tokens to Module to burn * @param _value The number of tokens to redeem */ function transferToRedeem(uint256 _value) public { @@ -31,14 +31,15 @@ contract MockRedemptionManager is TrackedRedemption { } /** - * @notice use to redeem tokens by the module + * @notice Used to redeem tokens by the module * @param _value The number of tokens to redeem */ function redeemTokenByOwner(uint256 _value) public { - require(tokenToRedeem[msg.sender] >= _value); + require(tokenToRedeem[msg.sender] >= _value, "Insufficient tokens redeemable"); tokenToRedeem[msg.sender] = tokenToRedeem[msg.sender].sub(_value); redeemedTokens[msg.sender] = redeemedTokens[msg.sender].add(_value); ISecurityToken(securityToken).burnWithData(_value, ""); + /*solium-disable-next-line security/no-block-members*/ emit RedeemedTokenByOwner(msg.sender, address(this), _value, now); } diff --git a/contracts/mocks/PolyTokenFaucet.sol b/contracts/mocks/PolyTokenFaucet.sol index 4a30fe861..76f1a5596 100644 --- a/contracts/mocks/PolyTokenFaucet.sol +++ b/contracts/mocks/PolyTokenFaucet.sol @@ -30,7 +30,7 @@ contract PolyTokenFaucet { /* Token faucet - Not part of the ERC20 standard */ function getTokens(uint256 _amount, address _recipient) public returns (bool) { - require(_amount <= 1000000 * uint256(10)**decimals, "Amount can not be more than 1 million"); + require(_amount <= 1000000 * uint256(10)**decimals, "Amount should not exceed 1 million"); require(_recipient != address(0), "Recipient address can not be empty"); balances[_recipient] = balances[_recipient].add(_amount); totalSupply_ = totalSupply_.add(_amount); @@ -39,7 +39,7 @@ contract PolyTokenFaucet { } /** - * @notice send `_value` token to `_to` from `msg.sender` + * @notice Sends `_value` tokens to `_to` from `msg.sender` * @param _to The address of the recipient * @param _value The amount of token to be transferred * @return Whether the transfer was successful or not @@ -52,16 +52,16 @@ contract PolyTokenFaucet { } /** - * @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` + * @notice sends `_value` tokens to `_to` from `_from` with the condition it is approved by `_from` * @param _from The address of the sender * @param _to The address of the recipient * @param _value The amount of token to be transferred * @return Whether the transfer was successful or not */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { - require(_to != address(0)); - require(_value <= balances[_from]); - require(_value <= allowed[_from][msg.sender]); + require(_to != address(0), "Invalid address"); + require(_value <= balances[_from], "Insufficient tokens transferable"); + require(_value <= allowed[_from][msg.sender], "Insufficient tokens allowable"); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); @@ -71,7 +71,7 @@ contract PolyTokenFaucet { } /** - * @notice `balanceOf` function to get the balance of token holders + * @notice Returns the balance of a token holder * @param _owner The address from which the balance will be retrieved * @return The balance */ @@ -80,7 +80,7 @@ contract PolyTokenFaucet { } /** - * @notice `msg.sender` approves `_spender` to spend `_value` tokens + * @notice Used by `msg.sender` to approve `_spender` to spend `_value` tokens * @param _spender The address of the account able to transfer the tokens * @param _value The amount of tokens to be approved for transfer * @return Whether the approval was successful or not @@ -94,7 +94,7 @@ contract PolyTokenFaucet { /** * @param _owner The address of the account owning tokens * @param _spender The address of the account able to transfer the tokens - * @return Amount of remaining tokens allowed to spent + * @return Amount of remaining tokens allowed to be spent */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; @@ -105,9 +105,9 @@ contract PolyTokenFaucet { } /** - * @dev Increase the amount of tokens that an owner allowed to a spender. + * @dev Increases the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment - * allowed value is better to use this function to avoid 2 calls (and wait until + * allowed value, it is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. @@ -130,7 +130,7 @@ contract PolyTokenFaucet { * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement - * allowed value is better to use this function to avoid 2 calls (and wait until + * allowed value, it is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. diff --git a/contracts/mocks/SecurityTokenRegistryMock.sol b/contracts/mocks/SecurityTokenRegistryMock.sol index 78faa60d1..d0a6de099 100644 --- a/contracts/mocks/SecurityTokenRegistryMock.sol +++ b/contracts/mocks/SecurityTokenRegistryMock.sol @@ -7,7 +7,7 @@ import "../SecurityTokenRegistry.sol"; */ contract SecurityTokenRegistryMock is SecurityTokenRegistry { - /// @notice It is dummy functionality + /// @notice It is a dummy function /// Alert! Alert! Do not use it for the mainnet release function changeTheDeployedAddress(string _ticker, address _newSecurityTokenAddress) public { set(Encoder.getKey("tickerToSecurityToken", _ticker), _newSecurityTokenAddress); diff --git a/contracts/mocks/TestSTOFactory.sol b/contracts/mocks/TestSTOFactory.sol index eb26bd922..a8bcbbeb6 100644 --- a/contracts/mocks/TestSTOFactory.sol +++ b/contracts/mocks/TestSTOFactory.sol @@ -27,7 +27,7 @@ contract TestSTOFactory is DummySTOFactory { } /** - * @notice Get the tags related to the module factory + * @notice Gets the tags related to the module factory */ function getTags() external view returns(bytes32[]) { bytes32[] memory availableTags = new bytes32[](4); diff --git a/contracts/modules/Burn/IBurn.sol b/contracts/modules/Burn/IBurn.sol index 3af836f40..7a84a802b 100644 --- a/contracts/modules/Burn/IBurn.sol +++ b/contracts/modules/Burn/IBurn.sol @@ -3,6 +3,7 @@ pragma solidity ^0.4.24; /** * @title Interface to be implemented by all checkpoint modules */ +/*solium-disable-next-line no-empty-blocks*/ interface IBurn { } diff --git a/contracts/modules/Checkpoint/DividendCheckpoint.sol b/contracts/modules/Checkpoint/DividendCheckpoint.sol index 4199d06f8..452a48b13 100644 --- a/contracts/modules/Checkpoint/DividendCheckpoint.sol +++ b/contracts/modules/Checkpoint/DividendCheckpoint.sol @@ -1,3 +1,10 @@ +/** + * DISCLAIMER: Under certain conditions, the function pushDividendPayment + * may fail due to block gas limits. + * If the total number of investors that ever held tokens is greater than ~15,000 then + * the function may fail. If this happens investors can pull their dividends, or the Issuer + * can use pushDividendPaymentToAddresses to provide an explict address list in batches + */ pragma solidity ^0.4.24; import "./ICheckpoint.sol"; @@ -22,7 +29,8 @@ contract DividendCheckpoint is ICheckpoint, Module { uint256 checkpointId; uint256 created; // Time at which the dividend was created uint256 maturity; // Time after which dividend can be claimed - set to 0 to bypass - uint256 expiry; // Time until which dividend can be claimed - after this time any remaining amount can be withdrawn by issuer - set to very high value to bypass + uint256 expiry; // Time until which dividend can be claimed - after this time any remaining amount can be withdrawn by issuer - + // set to very high value to bypass uint256 amount; // Dividend amount in WEI uint256 claimedAmount; // Amount of dividend claimed so far uint256 totalSupply; // Total supply at the associated checkpoint (avoids recalculating this) @@ -53,7 +61,9 @@ contract DividendCheckpoint is ICheckpoint, Module { modifier validDividendIndex(uint256 _dividendIndex) { require(_dividendIndex < dividends.length, "Invalid dividend"); require(!dividends[_dividendIndex].reclaimed, "Dividend reclaimed"); + /*solium-disable-next-line security/no-block-members*/ require(now >= dividends[_dividendIndex].maturity, "Dividend maturity in future"); + /*solium-disable-next-line security/no-block-members*/ require(now < dividends[_dividendIndex].expiry, "Dividend expiry in past"); _; } @@ -84,7 +94,7 @@ contract DividendCheckpoint is ICheckpoint, Module { /** * @notice Function to clear and set list of excluded addresses used for future dividends - * @param _excluded addresses of investor + * @param _excluded Addresses of investors */ function setDefaultExcluded(address[] _excluded) public withPerm(MANAGE) { require(_excluded.length <= EXCLUDED_ADDRESS_LIMIT, "Too many excluded addresses"); @@ -95,16 +105,18 @@ contract DividendCheckpoint is ICheckpoint, Module { } } excluded = _excluded; + /*solium-disable-next-line security/no-block-members*/ emit SetDefaultExcludedAddresses(excluded, now); } /** * @notice Function to set withholding tax rates for investors - * @param _investors addresses of investor - * @param _withholding withholding tax for individual investors (multiplied by 10**16) + * @param _investors Addresses of investors + * @param _withholding Withholding tax for individual investors (multiplied by 10**16) */ function setWithholding(address[] _investors, uint256[] _withholding) public withPerm(MANAGE) { require(_investors.length == _withholding.length, "Mismatched input lengths"); + /*solium-disable-next-line security/no-block-members*/ emit SetWithholding(_investors, _withholding, now); for (uint256 i = 0; i < _investors.length; i++) { require(_withholding[i] <= 10**18, "Incorrect withholding tax"); @@ -114,11 +126,12 @@ contract DividendCheckpoint is ICheckpoint, Module { /** * @notice Function to set withholding tax rates for investors - * @param _investors addresses of investor - * @param _withholding withholding tax for all investors (multiplied by 10**16) + * @param _investors Addresses of investor + * @param _withholding Withholding tax for all investors (multiplied by 10**16) */ function setWithholdingFixed(address[] _investors, uint256 _withholding) public withPerm(MANAGE) { require(_withholding <= 10**18, "Incorrect withholding tax"); + /*solium-disable-next-line security/no-block-members*/ emit SetWithholdingFixed(_investors, _withholding, now); for (uint256 i = 0; i < _investors.length; i++) { withholdingTax[_investors[i]] = _withholding; @@ -130,7 +143,14 @@ contract DividendCheckpoint is ICheckpoint, Module { * @param _dividendIndex Dividend to push * @param _payees Addresses to which to push the dividend */ - function pushDividendPaymentToAddresses(uint256 _dividendIndex, address[] _payees) public withPerm(DISTRIBUTE) validDividendIndex(_dividendIndex) { + function pushDividendPaymentToAddresses( + uint256 _dividendIndex, + address[] _payees + ) + public + withPerm(DISTRIBUTE) + validDividendIndex(_dividendIndex) + { Dividend storage dividend = dividends[_dividendIndex]; for (uint256 i = 0; i < _payees.length; i++) { if ((!dividend.claimed[_payees[i]]) && (!dividend.dividendExcluded[_payees[i]])) { @@ -145,7 +165,15 @@ contract DividendCheckpoint is ICheckpoint, Module { * @param _start Index in investor list at which to start pushing dividends * @param _iterations Number of addresses to push dividends for */ - function pushDividendPayment(uint256 _dividendIndex, uint256 _start, uint256 _iterations) public withPerm(DISTRIBUTE) validDividendIndex(_dividendIndex) { + function pushDividendPayment( + uint256 _dividendIndex, + uint256 _start, + uint256 _iterations + ) + public + withPerm(DISTRIBUTE) + validDividendIndex(_dividendIndex) + { Dividend storage dividend = dividends[_dividendIndex]; address[] memory investors = ISecurityToken(securityToken).getInvestors(); uint256 numberInvestors = Math.min256(investors.length, _start.add(_iterations)); @@ -171,8 +199,8 @@ contract DividendCheckpoint is ICheckpoint, Module { /** * @notice Internal function for paying dividends - * @param _payee address of investor - * @param _dividend storage with previously issued dividends + * @param _payee Address of investor + * @param _dividend Storage with previously issued dividends * @param _dividendIndex Dividend to pay */ function _payDividend(address _payee, Dividend storage _dividend, uint256 _dividendIndex) internal; diff --git a/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol b/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol index a23e87c0f..1f7f25cd5 100644 --- a/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol +++ b/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol @@ -12,11 +12,37 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { // Mapping to token address for each dividend mapping (uint256 => address) public dividendTokens; - - event ERC20DividendDeposited(address indexed _depositor, uint256 _checkpointId, uint256 _created, uint256 _maturity, uint256 _expiry, address indexed _token, uint256 _amount, uint256 _totalSupply, uint256 _dividendIndex, bytes32 indexed _name); - event ERC20DividendClaimed(address indexed _payee, uint256 _dividendIndex, address indexed _token, uint256 _amount, uint256 _withheld); - event ERC20DividendReclaimed(address indexed _claimer, uint256 _dividendIndex, address indexed _token, uint256 _claimedAmount); - event ERC20DividendWithholdingWithdrawn(address indexed _claimer, uint256 _dividendIndex, address indexed _token, uint256 _withheldAmount); + event ERC20DividendDeposited( + address indexed _depositor, + uint256 _checkpointId, + uint256 _created, + uint256 _maturity, + uint256 _expiry, + address indexed _token, + uint256 _amount, + uint256 _totalSupply, + uint256 _dividendIndex, + bytes32 indexed _name + ); + event ERC20DividendClaimed( + address indexed _payee, + uint256 _dividendIndex, + address indexed _token, + uint256 _amount, + uint256 _withheld + ); + event ERC20DividendReclaimed( + address indexed _claimer, + uint256 _dividendIndex, + address indexed _token, + uint256 _claimedAmount + ); + event ERC20DividendWithholdingWithdrawn( + address indexed _claimer, + uint256 _dividendIndex, + address indexed _token, + uint256 _withheldAmount + ); /** * @notice Constructor @@ -34,9 +60,18 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { * @param _expiry Time until dividend can no longer be paid, and can be reclaimed by issuer * @param _token Address of ERC20 token in which dividend is to be denominated * @param _amount Amount of specified token for dividend - * @param _name name/title for identification + * @param _name Name/Title for identification */ - function createDividend(uint256 _maturity, uint256 _expiry, address _token, uint256 _amount, bytes32 _name) external withPerm(MANAGE) { + function createDividend( + uint256 _maturity, + uint256 _expiry, + address _token, + uint256 _amount, + bytes32 _name + ) + external + withPerm(MANAGE) + { createDividendWithExclusions(_maturity, _expiry, _token, _amount, excluded, _name); } @@ -47,9 +82,19 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { * @param _token Address of ERC20 token in which dividend is to be denominated * @param _amount Amount of specified token for dividend * @param _checkpointId Checkpoint id from which to create dividends - * @param _name name/title for identification + * @param _name Name/Title for identification */ - function createDividendWithCheckpoint(uint256 _maturity, uint256 _expiry, address _token, uint256 _amount, uint256 _checkpointId, bytes32 _name) external withPerm(MANAGE) { + function createDividendWithCheckpoint( + uint256 _maturity, + uint256 _expiry, + address _token, + uint256 _amount, + uint256 _checkpointId, + bytes32 _name + ) + external + withPerm(MANAGE) + { _createDividendWithCheckpointAndExclusions(_maturity, _expiry, _token, _amount, _checkpointId, excluded, _name); } @@ -60,9 +105,19 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { * @param _token Address of ERC20 token in which dividend is to be denominated * @param _amount Amount of specified token for dividend * @param _excluded List of addresses to exclude - * @param _name name/title for identification + * @param _name Name/Title for identification */ - function createDividendWithExclusions(uint256 _maturity, uint256 _expiry, address _token, uint256 _amount, address[] _excluded, bytes32 _name) public withPerm(MANAGE) { + function createDividendWithExclusions( + uint256 _maturity, + uint256 _expiry, + address _token, + uint256 _amount, + address[] _excluded, + bytes32 _name + ) + public + withPerm(MANAGE) + { uint256 checkpointId = ISecurityToken(securityToken).createCheckpoint(); _createDividendWithCheckpointAndExclusions(_maturity, _expiry, _token, _amount, checkpointId, _excluded, _name); } @@ -75,7 +130,7 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { * @param _amount Amount of specified token for dividend * @param _checkpointId Checkpoint id from which to create dividends * @param _excluded List of addresses to exclude - * @param _name name/title for identification + * @param _name Name/Title for identification */ function createDividendWithCheckpointAndExclusions( uint256 _maturity, @@ -100,7 +155,7 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { * @param _amount Amount of specified token for dividend * @param _checkpointId Checkpoint id from which to create dividends * @param _excluded List of addresses to exclude - * @param _name name/title for identification + * @param _name Name/Title for identification */ function _createDividendWithCheckpointAndExclusions( uint256 _maturity, @@ -116,6 +171,7 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { ISecurityToken securityTokenInstance = ISecurityToken(securityToken); require(_excluded.length <= EXCLUDED_ADDRESS_LIMIT, "Too many addresses excluded"); require(_expiry > _maturity, "Expiry before maturity"); + /*solium-disable-next-line security/no-block-members*/ require(_expiry > now, "Expiry in past"); require(_amount > 0, "No dividend sent"); require(_token != address(0), "Invalid token"); @@ -128,7 +184,7 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { dividends.push( Dividend( _checkpointId, - now, + now, /*solium-disable-line security/no-block-members*/ _maturity, _expiry, _amount, @@ -154,17 +210,29 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { } /** - * @notice emits the ERC20DividendDeposited event. + * @notice Emits the ERC20DividendDeposited event. * Seperated into a different function as a workaround for stack too deep error */ - function _emitERC20DividendDepositedEvent(uint256 _checkpointId, uint256 _maturity, uint256 _expiry, address _token, uint256 _amount, uint256 currentSupply, uint256 dividendIndex, bytes32 _name) internal { + function _emitERC20DividendDepositedEvent( + uint256 _checkpointId, + uint256 _maturity, + uint256 _expiry, + address _token, + uint256 _amount, + uint256 currentSupply, + uint256 dividendIndex, + bytes32 _name + ) + internal + { + /*solium-disable-next-line security/no-block-members*/ emit ERC20DividendDeposited(msg.sender, _checkpointId, now, _maturity, _expiry, _token, _amount, currentSupply, dividendIndex, _name); } /** * @notice Internal function for paying dividends - * @param _payee address of investor - * @param _dividend storage with previously issued dividends + * @param _payee Address of investor + * @param _dividend Storage with previously issued dividends * @param _dividendIndex Dividend to pay */ function _payDividend(address _payee, Dividend storage _dividend, uint256 _dividendIndex) internal { @@ -186,6 +254,7 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { */ function reclaimDividend(uint256 _dividendIndex) external withPerm(MANAGE) { require(_dividendIndex < dividends.length, "Invalid dividend"); + /*solium-disable-next-line security/no-block-members*/ require(now >= dividends[_dividendIndex].expiry, "Dividend expiry in future"); require(!dividends[_dividendIndex].reclaimed, "already claimed"); dividends[_dividendIndex].reclaimed = true; diff --git a/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol b/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol index 669382c15..5fd158c26 100644 --- a/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol +++ b/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol @@ -27,13 +27,14 @@ contract ERC20DividendCheckpointFactory is ModuleFactory { } /** - * @notice used to launch the Module with the help of factory - * @return address Contract address of the Module + * @notice Used to launch the Module with the help of factory + * @return Address Contract address of the Module */ function deploy(bytes /* _data */) external returns(address) { if (setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "insufficent allowance"); address erc20DividendCheckpoint = new ERC20DividendCheckpoint(msg.sender, address(polyToken)); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(erc20DividendCheckpoint, getName(), address(this), msg.sender, setupCost, now); return erc20DividendCheckpoint; } @@ -47,41 +48,6 @@ contract ERC20DividendCheckpointFactory is ModuleFactory { return res; } - /** - * @notice Get the name of the Module - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string) { - return title; - } - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the setup cost of the module - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } - /** * @notice Returns the instructions associated with the module */ diff --git a/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol b/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol index f70935993..4def51468 100644 --- a/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol +++ b/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol @@ -8,8 +8,17 @@ import "../../interfaces/IOwnable.sol"; */ contract EtherDividendCheckpoint is DividendCheckpoint { using SafeMath for uint256; - - event EtherDividendDeposited(address indexed _depositor, uint256 _checkpointId, uint256 _created, uint256 _maturity, uint256 _expiry, uint256 _amount, uint256 _totalSupply, uint256 _dividendIndex, bytes32 indexed _name); + event EtherDividendDeposited( + address indexed _depositor, + uint256 _checkpointId, + uint256 _created, + uint256 _maturity, + uint256 _expiry, + uint256 _amount, + uint256 _totalSupply, + uint256 _dividendIndex, + bytes32 indexed _name + ); event EtherDividendClaimed(address indexed _payee, uint256 _dividendIndex, uint256 _amount, uint256 _withheld); event EtherDividendReclaimed(address indexed _claimer, uint256 _dividendIndex, uint256 _claimedAmount); event EtherDividendClaimFailed(address indexed _payee, uint256 _dividendIndex, uint256 _amount, uint256 _withheld); @@ -29,9 +38,9 @@ contract EtherDividendCheckpoint is DividendCheckpoint { * @notice Creates a dividend and checkpoint for the dividend, using global list of excluded addresses * @param _maturity Time from which dividend can be paid * @param _expiry Time until dividend can no longer be paid, and can be reclaimed by issuer - * @param _name name/title for identification + * @param _name Name/title for identification */ - function createDividend(uint256 _maturity, uint256 _expiry, bytes32 _name) payable external withPerm(MANAGE) { + function createDividend(uint256 _maturity, uint256 _expiry, bytes32 _name) external payable withPerm(MANAGE) { createDividendWithExclusions(_maturity, _expiry, excluded, _name); } @@ -40,9 +49,18 @@ contract EtherDividendCheckpoint is DividendCheckpoint { * @param _maturity Time from which dividend can be paid * @param _expiry Time until dividend can no longer be paid, and can be reclaimed by issuer * @param _checkpointId Id of the checkpoint from which to issue dividend - * @param _name name/title for identification + * @param _name Name/title for identification */ - function createDividendWithCheckpoint(uint256 _maturity, uint256 _expiry, uint256 _checkpointId, bytes32 _name) payable external withPerm(MANAGE) { + function createDividendWithCheckpoint( + uint256 _maturity, + uint256 _expiry, + uint256 _checkpointId, + bytes32 _name + ) + external + payable + withPerm(MANAGE) + { _createDividendWithCheckpointAndExclusions(_maturity, _expiry, _checkpointId, excluded, _name); } @@ -51,9 +69,18 @@ contract EtherDividendCheckpoint is DividendCheckpoint { * @param _maturity Time from which dividend can be paid * @param _expiry Time until dividend can no longer be paid, and can be reclaimed by issuer * @param _excluded List of addresses to exclude - * @param _name name/title for identification + * @param _name Name/title for identification */ - function createDividendWithExclusions(uint256 _maturity, uint256 _expiry, address[] _excluded, bytes32 _name) payable public withPerm(MANAGE) { + function createDividendWithExclusions( + uint256 _maturity, + uint256 _expiry, + address[] _excluded, + bytes32 _name + ) + public + payable + withPerm(MANAGE) + { uint256 checkpointId = ISecurityToken(securityToken).createCheckpoint(); _createDividendWithCheckpointAndExclusions(_maturity, _expiry, checkpointId, _excluded, _name); } @@ -64,7 +91,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { * @param _expiry Time until dividend can no longer be paid, and can be reclaimed by issuer * @param _checkpointId Id of the checkpoint from which to issue dividend * @param _excluded List of addresses to exclude - * @param _name name/title for identification + * @param _name Name/title for identification */ function createDividendWithCheckpointAndExclusions( uint256 _maturity, @@ -72,10 +99,10 @@ contract EtherDividendCheckpoint is DividendCheckpoint { uint256 _checkpointId, address[] _excluded, bytes32 _name - ) - payable - public - withPerm(MANAGE) + ) + public + payable + withPerm(MANAGE) { _createDividendWithCheckpointAndExclusions(_maturity, _expiry, _checkpointId, _excluded, _name); } @@ -86,7 +113,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { * @param _expiry Time until dividend can no longer be paid, and can be reclaimed by issuer * @param _checkpointId Id of the checkpoint from which to issue dividend * @param _excluded List of addresses to exclude - * @param _name name/title for identification + * @param _name Name/title for identification */ function _createDividendWithCheckpointAndExclusions( uint256 _maturity, @@ -99,6 +126,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { { require(_excluded.length <= EXCLUDED_ADDRESS_LIMIT, "Too many addresses excluded"); require(_expiry > _maturity, "Expiry is before maturity"); + /*solium-disable-next-line security/no-block-members*/ require(_expiry > now, "Expiry is in the past"); require(msg.value > 0, "No dividend sent"); require(_checkpointId <= ISecurityToken(securityToken).currentCheckpointId()); @@ -109,7 +137,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { dividends.push( Dividend( _checkpointId, - now, + now, /*solium-disable-line security/no-block-members*/ _maturity, _expiry, msg.value, @@ -129,6 +157,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { dividends[dividendIndex].dividendExcluded[_excluded[j]] = true; } dividends[dividendIndex].totalSupply = currentSupply.sub(excludedSupply); + /*solium-disable-next-line security/no-block-members*/ emit EtherDividendDeposited(msg.sender, _checkpointId, now, _maturity, _expiry, msg.value, currentSupply, dividendIndex, _name); } @@ -143,6 +172,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { _dividend.claimed[_payee] = true; uint256 claimAfterWithheld = claim.sub(withheld); if (claimAfterWithheld > 0) { + /*solium-disable-next-line security/no-send*/ if (_payee.send(claimAfterWithheld)) { _dividend.claimedAmount = _dividend.claimedAmount.add(claim); _dividend.dividendWithheld = _dividend.dividendWithheld.add(withheld); @@ -161,8 +191,9 @@ contract EtherDividendCheckpoint is DividendCheckpoint { */ function reclaimDividend(uint256 _dividendIndex) external withPerm(MANAGE) { require(_dividendIndex < dividends.length, "Incorrect dividend index"); + /*solium-disable-next-line security/no-block-members*/ require(now >= dividends[_dividendIndex].expiry, "Dividend expiry is in the future"); - require(!dividends[_dividendIndex].reclaimed, "Dividend already claimed"); + require(!dividends[_dividendIndex].reclaimed, "Dividend is already claimed"); Dividend storage dividend = dividends[_dividendIndex]; dividend.reclaimed = true; uint256 remainingAmount = dividend.amount.sub(dividend.claimedAmount); diff --git a/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol b/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol index cebc79571..315760be1 100644 --- a/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol +++ b/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol @@ -27,13 +27,14 @@ contract EtherDividendCheckpointFactory is ModuleFactory { } /** - * @notice used to launch the Module with the help of factory + * @notice Used to launch the Module with the help of factory * @return address Contract address of the Module */ function deploy(bytes /* _data */) external returns(address) { if(setupCost > 0) - require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom because of sufficent Allowance is not provided"); + require(polyToken.transferFrom(msg.sender, owner, setupCost), "Insufficent allowance or balance"); address ethDividendCheckpoint = new EtherDividendCheckpoint(msg.sender, address(polyToken)); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(ethDividendCheckpoint, getName(), address(this), msg.sender, setupCost, now); return ethDividendCheckpoint; } @@ -47,46 +48,11 @@ contract EtherDividendCheckpointFactory is ModuleFactory { return res; } - /** - * @notice Get the name of the Module - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string) { - return title; - } - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the setup cost of the module - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } - /** * @notice Returns the instructions associated with the module */ function getInstructions() external view returns(string) { - return "Create a dividend which will be paid out to token holders proportional to their balances at the point the dividend is created"; + return "Create a dividend which will be paid out to token holders proportionally according to their balances at the point the dividend is created"; } /** diff --git a/contracts/modules/Checkpoint/ICheckpoint.sol b/contracts/modules/Checkpoint/ICheckpoint.sol index 3e567ba7b..f2a7417b2 100644 --- a/contracts/modules/Checkpoint/ICheckpoint.sol +++ b/contracts/modules/Checkpoint/ICheckpoint.sol @@ -3,6 +3,7 @@ pragma solidity ^0.4.24; /** * @title Interface to be implemented by all checkpoint modules */ +/*solium-disable-next-line no-empty-blocks*/ interface ICheckpoint { } diff --git a/contracts/modules/Burn/TrackedRedemption.sol b/contracts/modules/Experimental/Burn/TrackedRedemption.sol similarity index 81% rename from contracts/modules/Burn/TrackedRedemption.sol rename to contracts/modules/Experimental/Burn/TrackedRedemption.sol index 60745f778..bc06a99e9 100644 --- a/contracts/modules/Burn/TrackedRedemption.sol +++ b/contracts/modules/Experimental/Burn/TrackedRedemption.sol @@ -1,8 +1,8 @@ pragma solidity ^0.4.24; -import "./IBurn.sol"; -import "../Module.sol"; -import "../../interfaces/ISecurityToken.sol"; +import "../../Burn/IBurn.sol"; +import "../../Module.sol"; +import "../../../interfaces/ISecurityToken.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /** @@ -33,17 +33,18 @@ contract TrackedRedemption is IBurn, Module { } /** - * @notice Redeem tokens and track redemptions + * @notice To redeem tokens and track redemptions * @param _value The number of tokens to redeem */ function redeemTokens(uint256 _value) public { ISecurityToken(securityToken).burnFromWithData(msg.sender, _value, ""); redeemedTokens[msg.sender] = redeemedTokens[msg.sender].add(_value); + /*solium-disable-next-line security/no-block-members*/ emit Redeemed(msg.sender, _value, now); } - + /** - * @notice Return the permissions flag that are associated with CountTransferManager + * @notice Returns the permissions flag that are associated with CountTransferManager */ function getPermissions() public view returns(bytes32[]) { bytes32[] memory allPermissions = new bytes32[](0); diff --git a/contracts/modules/Burn/TrackedRedemptionFactory.sol b/contracts/modules/Experimental/Burn/TrackedRedemptionFactory.sol similarity index 68% rename from contracts/modules/Burn/TrackedRedemptionFactory.sol rename to contracts/modules/Experimental/Burn/TrackedRedemptionFactory.sol index 6b0761865..d1fa010b7 100644 --- a/contracts/modules/Burn/TrackedRedemptionFactory.sol +++ b/contracts/modules/Experimental/Burn/TrackedRedemptionFactory.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; import "./TrackedRedemption.sol"; -import "../ModuleFactory.sol"; +import "../../ModuleFactory.sol"; /** * @title Factory for deploying GeneralTransferManager module @@ -27,13 +27,14 @@ contract TrackedRedemptionFactory is ModuleFactory { } /** - * @notice used to launch the Module with the help of factory - * @return address Contract address of the Module + * @notice Used to launch the Module with the help of factory + * @return Address Contract address of the Module */ function deploy(bytes /* _data */) external returns(address) { if (setupCost > 0) - require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom because of sufficent Allowance is not provided"); + require(polyToken.transferFrom(msg.sender, owner, setupCost), "Insufficent allowance or balance"); address trackedRedemption = new TrackedRedemption(msg.sender, address(polyToken)); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(trackedRedemption), getName(), address(this), msg.sender, setupCost, now); return address(trackedRedemption); } @@ -47,41 +48,6 @@ contract TrackedRedemptionFactory is ModuleFactory { return res; } - /** - * @notice Get the name of the Module - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string) { - return title; - } - - /** - * @notice Get the setup cost of the module - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } - /** * @notice Returns the instructions associated with the module */ diff --git a/contracts/modules/Experimental/Mixed/ScheduledCheckpoint.sol b/contracts/modules/Experimental/Mixed/ScheduledCheckpoint.sol new file mode 100644 index 000000000..097a44f50 --- /dev/null +++ b/contracts/modules/Experimental/Mixed/ScheduledCheckpoint.sol @@ -0,0 +1,155 @@ +pragma solidity ^0.4.24; + +import "./../../Checkpoint/ICheckpoint.sol"; +import "../../TransferManager/ITransferManager.sol"; +import "../../../interfaces/ISecurityToken.sol"; +import "openzeppelin-solidity/contracts/math/SafeMath.sol"; + +/** + * @title Burn module for burning tokens and keeping track of burnt amounts + */ +contract ScheduledCheckpoint is ICheckpoint, ITransferManager { + using SafeMath for uint256; + + struct Schedule { + bytes32 name; + uint256 startTime; + uint256 nextTime; + uint256 interval; + uint256 index; + uint256[] checkpointIds; + uint256[] timestamps; + uint256[] periods; + } + + bytes32[] public names; + + mapping (bytes32 => Schedule) public schedules; + + event AddSchedule(bytes32 _name, uint256 _startTime, uint256 _interval, uint256 _timestamp); + event RemoveSchedule(bytes32 _name, uint256 _timestamp); + + /** + * @notice Constructor + * @param _securityToken Address of the security token + * @param _polyAddress Address of the polytoken + */ + constructor (address _securityToken, address _polyAddress) public + Module(_securityToken, _polyAddress) + { + } + + /** + * @notice This function returns the signature of configure function + */ + function getInitFunction() public pure returns (bytes4) { + return bytes4(0); + } + + /** + * @notice adds a new schedule for checkpoints + * @param _name name of the new schedule (must be unused) + * @param _startTime start time of the schedule (first checkpoint) + * @param _interval interval at which checkpoints should be created + */ + function addSchedule(bytes32 _name, uint256 _startTime, uint256 _interval) external onlyOwner { + require(_startTime > now, "Start time must be in the future"); + require(schedules[_name].name == bytes32(0), "Name already in use"); + schedules[_name].name = _name; + schedules[_name].startTime = _startTime; + schedules[_name].nextTime = _startTime; + schedules[_name].interval = _interval; + schedules[_name].index = names.length; + names.push(_name); + emit AddSchedule(_name, _startTime, _interval, now); + } + + /** + * @notice removes a schedule for checkpoints + * @param _name name of the schedule to be removed + */ + function removeSchedule(bytes32 _name) external onlyOwner { + require(schedules[_name].name == _name, "Name does not exist"); + uint256 index = schedules[_name].index; + names[index] = names[names.length - 1]; + names.length--; + if (index != names.length) { + schedules[names[index]].index = index; + } + delete schedules[_name]; + emit RemoveSchedule(_name, now); + } + + + /** + * @notice Used to create checkpoints that correctly reflect balances + * @param _isTransfer whether or not an actual transfer is occuring + * @return always returns Result.NA + */ + function verifyTransfer(address /* _from */, address /* _to */, uint256 /* _amount */, bytes /* _data */, bool _isTransfer) public returns(Result) { + require(_isTransfer == false || msg.sender == securityToken, "Sender is not owner"); + if (paused || !_isTransfer) { + return Result.NA; + } + _updateAll(); + return Result.NA; + } + + /** + * @notice gets schedule details + * @param _name name of the schedule + */ + function getSchedule(bytes32 _name) view external returns(bytes32, uint256, uint256, uint256, uint256[], uint256[], uint256[]) { + return ( + schedules[_name].name, + schedules[_name].startTime, + schedules[_name].nextTime, + schedules[_name].interval, + schedules[_name].checkpointIds, + schedules[_name].timestamps, + schedules[_name].periods + ); + } + + /** + * @notice manually triggers update outside of transfer request for named schedule (can be used to reduce user gas costs) + * @param _name name of the schedule + */ + function update(bytes32 _name) external onlyOwner { + _update(_name); + } + + function _update(bytes32 _name) internal { + Schedule storage schedule = schedules[_name]; + if (schedule.nextTime <= now) { + uint256 checkpointId = ISecurityToken(securityToken).createCheckpoint(); + uint256 periods = now.sub(schedule.nextTime).div(schedule.interval).add(1); + schedule.timestamps.push(schedule.nextTime); + schedule.nextTime = periods.mul(schedule.interval).add(schedule.nextTime); + schedule.checkpointIds.push(checkpointId); + schedule.periods.push(periods); + } + } + + /** + * @notice manually triggers update outside of transfer request for all schedules (can be used to reduce user gas costs) + */ + function updateAll() onlyOwner external { + _updateAll(); + } + + function _updateAll() internal { + uint256 i; + for (i = 0; i < names.length; i++) { + _update(names[i]); + } + } + + /** + * @notice Return the permissions flag that are associated with CountTransferManager + */ + function getPermissions() view external returns(bytes32[]) { + bytes32[] memory allPermissions = new bytes32[](0); + return allPermissions; + } +} diff --git a/contracts/modules/Experimental/Mixed/ScheduledCheckpointFactory.sol b/contracts/modules/Experimental/Mixed/ScheduledCheckpointFactory.sol new file mode 100644 index 000000000..1b5daac29 --- /dev/null +++ b/contracts/modules/Experimental/Mixed/ScheduledCheckpointFactory.sol @@ -0,0 +1,102 @@ +pragma solidity ^0.4.24; + +import "./ScheduledCheckpoint.sol"; +import "../../ModuleFactory.sol"; + +/** + * @title Factory for deploying EtherDividendCheckpoint module + */ +contract ScheduledCheckpointFactory is ModuleFactory { + + /** + * @notice Constructor + * @param _polyAddress Address of the polytoken + * @param _setupCost Setup cost of the module + * @param _usageCost Usage cost of the module + * @param _subscriptionCost Subscription cost of the module + */ + constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public + ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost) + { + version = "1.0.0"; + name = "ScheduledCheckpoint"; + title = "Schedule Checkpoints"; + description = "Allows you to schedule checkpoints in the future"; + compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); + compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); + } + + /** + * @notice used to launch the Module with the help of factory + * @return address Contract address of the Module + */ + function deploy(bytes /* _data */) external returns(address) { + if(setupCost > 0) + require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom because of sufficent Allowance is not provided"); + address scheduledCheckpoint = new ScheduledCheckpoint(msg.sender, address(polyToken)); + emit GenerateModuleFromFactory(scheduledCheckpoint, getName(), address(this), msg.sender, setupCost, now); + return scheduledCheckpoint; + } + + /** + * @notice Type of the Module factory + */ + function getTypes() external view returns(uint8[]) { + uint8[] memory res = new uint8[](2); + res[0] = 4; + res[1] = 2; + return res; + } + + /** + * @notice Get the name of the Module + */ + function getName() public view returns(bytes32) { + return name; + } + + /** + * @notice Get the description of the Module + */ + function getDescription() external view returns(string) { + return description; + } + + /** + * @notice Get the title of the Module + */ + function getTitle() external view returns(string) { + return title; + } + + /** + * @notice Get the version of the Module + */ + function getVersion() external view returns(string) { + return version; + } + + /** + * @notice Get the setup cost of the module + */ + function getSetupCost() external view returns (uint256) { + return setupCost; + } + + /** + * @notice Get the Instructions that helped to used the module + */ + function getInstructions() external view returns(string) { + return "Schedule a series of future checkpoints by specifying a start time and interval of each checkpoint"; + } + + /** + * @notice Get the tags related to the module factory + */ + function getTags() external view returns(bytes32[]) { + bytes32[] memory availableTags = new bytes32[](2); + availableTags[0] = "Scheduled"; + availableTags[1] = "Checkpoint"; + return availableTags; + } +} diff --git a/contracts/modules/TransferManager/LockupVolumeRestrictionTM.sol b/contracts/modules/Experimental/TransferManager/LockupVolumeRestrictionTM.sol similarity index 96% rename from contracts/modules/TransferManager/LockupVolumeRestrictionTM.sol rename to contracts/modules/Experimental/TransferManager/LockupVolumeRestrictionTM.sol index 4ddb43f29..80f44cdb6 100644 --- a/contracts/modules/TransferManager/LockupVolumeRestrictionTM.sol +++ b/contracts/modules/Experimental/TransferManager/LockupVolumeRestrictionTM.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./ITransferManager.sol"; +import "./../../TransferManager/ITransferManager.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; @@ -96,6 +96,7 @@ contract LockupVolumeRestrictionTM is ITransferManager { // if a startTime of 0 is passed in, then start now. if (startTime == 0) { + /*solium-disable-next-line security/no-block-members*/ startTime = now; } @@ -127,9 +128,9 @@ contract LockupVolumeRestrictionTM is ITransferManager { uint[] _totalAmounts ) external withPerm(ADMIN) { require( - _userAddresses.length == _lockUpPeriodsSeconds.length && - _userAddresses.length == _releaseFrequenciesSeconds.length && - _userAddresses.length == _startTimes.length && + _userAddresses.length == _lockUpPeriodsSeconds.length && /*solium-disable-line operator-whitespace*/ + _userAddresses.length == _releaseFrequenciesSeconds.length && /*solium-disable-line operator-whitespace*/ + _userAddresses.length == _startTimes.length && _userAddresses.length == _totalAmounts.length, "Input array length mismatch" ); @@ -190,6 +191,7 @@ contract LockupVolumeRestrictionTM is ITransferManager { uint256 startTime = _startTime; // if a startTime of 0 is passed in, then start now. if (startTime == 0) { + /*solium-disable-next-line security/no-block-members*/ startTime = now; } @@ -272,12 +274,15 @@ contract LockupVolumeRestrictionTM is ITransferManager { uint allowedAmountForThisLockup = 0; // check if lockup has entirely passed + /*solium-disable-next-line security/no-block-members*/ if (now >= aLockUp.startTime.add(aLockUp.lockUpPeriodSeconds)) { // lockup has passed, or not started yet. allow all. allowedAmountForThisLockup = aLockUp.totalAmount.sub(aLockUp.alreadyWithdrawn); + /*solium-disable-next-line security/no-block-members*/ } else if (now >= aLockUp.startTime) { // lockup is active. calculate how many to allow to be withdrawn right now // calculate how many periods have elapsed already + /*solium-disable-next-line security/no-block-members*/ uint elapsedPeriods = (now.sub(aLockUp.startTime)).div(aLockUp.releaseFrequencySeconds); // calculate the total number of periods, overall uint totalPeriods = aLockUp.lockUpPeriodSeconds.div(aLockUp.releaseFrequencySeconds); @@ -396,7 +401,7 @@ contract LockupVolumeRestrictionTM is ITransferManager { } /** - * @notice Return the permissions flag that are associated with Percentage transfer Manager + * @notice Returns the permissions flag that are associated with Percentage transfer Manager */ function getPermissions() public view returns(bytes32[]) { bytes32[] memory allPermissions = new bytes32[](1); diff --git a/contracts/modules/TransferManager/LockupVolumeRestrictionTMFactory.sol b/contracts/modules/Experimental/TransferManager/LockupVolumeRestrictionTMFactory.sol similarity index 75% rename from contracts/modules/TransferManager/LockupVolumeRestrictionTMFactory.sol rename to contracts/modules/Experimental/TransferManager/LockupVolumeRestrictionTMFactory.sol index 9d0e0fa26..5be77b6e0 100644 --- a/contracts/modules/TransferManager/LockupVolumeRestrictionTMFactory.sol +++ b/contracts/modules/Experimental/TransferManager/LockupVolumeRestrictionTMFactory.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; +import "./../../ModuleFactory.sol"; import "./LockupVolumeRestrictionTM.sol"; -import "../ModuleFactory.sol"; /** * @title Factory for deploying ManualApprovalTransferManager module @@ -27,13 +27,14 @@ contract LockupVolumeRestrictionTMFactory is ModuleFactory { } /** - * @notice used to launch the Module with the help of factory + * @notice Used to launch the Module with the help of factory * @return address Contract address of the Module */ function deploy(bytes /* _data */) external returns(address) { if (setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom because of sufficent Allowance is not provided"); LockupVolumeRestrictionTM lockupVolumeRestrictionTransferManager = new LockupVolumeRestrictionTM(msg.sender, address(polyToken)); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(lockupVolumeRestrictionTransferManager), getName(), address(this), msg.sender, now); return address(lockupVolumeRestrictionTransferManager); } @@ -47,42 +48,7 @@ contract LockupVolumeRestrictionTMFactory is ModuleFactory { res[0] = 2; return res; } - - /** - * @notice Get the name of the Module - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string) { - return title; - } - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the setup cost of the module - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } - + /** * @notice Returns the instructions associated with the module */ diff --git a/contracts/modules/TransferManager/SingleTradeVolumeRestrictionTM.sol b/contracts/modules/Experimental/TransferManager/SingleTradeVolumeRestrictionTM.sol similarity index 90% rename from contracts/modules/TransferManager/SingleTradeVolumeRestrictionTM.sol rename to contracts/modules/Experimental/TransferManager/SingleTradeVolumeRestrictionTM.sol index f9d260fac..b92272167 100644 --- a/contracts/modules/TransferManager/SingleTradeVolumeRestrictionTM.sol +++ b/contracts/modules/Experimental/TransferManager/SingleTradeVolumeRestrictionTM.sol @@ -1,5 +1,6 @@ pragma solidity ^0.4.24; -import "./ITransferManager.sol"; + +import "./../../TransferManager/ITransferManager.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /** @@ -56,7 +57,16 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { * @param _from Address of the sender * @param _amount The amount of tokens to transfer */ - function verifyTransfer(address _from, address /* _to */, uint256 _amount, bytes /* _data */, bool /* _isTransfer */) public returns(Result) { + function verifyTransfer( + address _from, + address /* _to */, + uint256 _amount, + bytes /* _data */, + bool /* _isTransfer */ + ) + public + returns(Result) + { bool validTransfer; if (exemptWallets[_from] || paused) return Result.NA; @@ -102,12 +112,13 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { } /** - * @notice sets whether or not to consider primary issuance transfers + * @notice Sets whether or not to consider primary issuance transfers * @param _allowPrimaryIssuance whether to allow all primary issuance transfers */ function setAllowPrimaryIssuance(bool _allowPrimaryIssuance) public withPerm(ADMIN) { require(_allowPrimaryIssuance != allowPrimaryIssuance, "Must change setting"); allowPrimaryIssuance = _allowPrimaryIssuance; + /*solium-disable-next-line security/no-block-members*/ emit SetAllowPrimaryIssuance(_allowPrimaryIssuance, now); } @@ -135,7 +146,7 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { emit TransferLimitChangedToTokens(); } /** - * @notice Change the global transfer limit + * @notice Changes the global transfer limit * @param _newGlobalTransferLimitInTokens new transfer limit in tokens * @dev This function can be used only when The manager is configured to use limits in tokens */ @@ -148,7 +159,7 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { } /** - * @notice Change the global transfer limit + * @notice Changes the global transfer limit * @param _newGlobalTransferLimitInPercentage new transfer limit in percentage. * Multiply the percentage by 10^16. Eg 22% will be 22*10^16 * @dev This function can be used only when The manager is configured to use limits in percentage @@ -162,7 +173,7 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { } /** - * @notice add an exempt wallet + * @notice Adds an exempt wallet * @param _wallet exempt wallet address */ function addExemptWallet(address _wallet) public withPerm(ADMIN) { @@ -172,7 +183,7 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { } /** - * @notice remove an exempt wallet + * @notice Removes an exempt wallet * @param _wallet exempt wallet address */ function removeExemptWallet(address _wallet) public withPerm(ADMIN) { @@ -182,7 +193,7 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { } /** - * @notice adds an array of exempt wallet + * @notice Adds an array of exempt wallet * @param _wallets array of exempt wallet addresses */ function addExemptWalletMulti(address[] _wallets) public withPerm(ADMIN) { @@ -193,7 +204,7 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { } /** - * @notice removes an array of exempt wallet + * @notice Removes an array of exempt wallet * @param _wallets array of exempt wallet addresses */ function removeExemptWalletMulti(address[] _wallets) public withPerm(ADMIN) { @@ -204,7 +215,7 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { } /** - * @notice set transfer limit per wallet + * @notice Sets transfer limit per wallet * @param _wallet wallet address * @param _transferLimit transfer limit for the wallet in tokens * @dev the manager has to be configured to use limits in tokens @@ -217,7 +228,7 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { } /** - * @notice set transfer limit for a wallet + * @notice Sets transfer limit for a wallet * @param _wallet wallet address * @param _transferLimitInPercentage transfer limit for the wallet in percentage. * Multiply the percentage by 10^16. Eg 22% will be 22*10^16 @@ -232,7 +243,7 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { /** - * @notice removes transfer limit set in percentage for a wallet + * @notice Removes transfer limit set in percentage for a wallet * @param _wallet wallet address */ function removeTransferLimitInPercentage(address _wallet) public withPerm(ADMIN) { @@ -242,7 +253,7 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { } /** - * @notice removes transfer limit set in tokens for a wallet + * @notice Removes transfer limit set in tokens for a wallet * @param _wallet wallet address */ function removeTransferLimitInTokens(address _wallet) public withPerm(ADMIN) { @@ -252,21 +263,21 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { } /** - * @notice sets transfer limits for an array of wallet + * @notice Sets transfer limits for an array of wallet * @param _wallets array of wallet addresses * @param _transferLimits array of transfer limits for each wallet in tokens * @dev The manager has to be configured to use tokens as limit */ function setTransferLimitInTokensMulti(address[] _wallets, uint[] _transferLimits) public withPerm(ADMIN) { require(_wallets.length > 0, "Wallets cannot be empty"); - require(_wallets.length == _transferLimits.length); + require(_wallets.length == _transferLimits.length, "Wallets don't match to transfer limits"); for (uint256 i = 0; i < _wallets.length; i++ ) { setTransferLimitInTokens(_wallets[i], _transferLimits[i]); } } /** - * @notice sets transfer limits for an array of wallet + * @notice Sets transfer limits for an array of wallet * @param _wallets array of wallet addresses * @param _transferLimitsInPercentage array of transfer limits for each wallet in percentages * The percentage has to be multipled by 10 ** 16. Eg: 20% would be 20 * 10 ** 16 @@ -274,14 +285,14 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { */ function setTransferLimitInPercentageMulti(address[] _wallets, uint[] _transferLimitsInPercentage) public withPerm(ADMIN) { require(_wallets.length > 0, "Wallets cannot be empty"); - require(_wallets.length == _transferLimitsInPercentage.length); + require(_wallets.length == _transferLimitsInPercentage.length, "Wallets don't match to percentage limits"); for (uint256 i = 0; i < _wallets.length; i++) { setTransferLimitInPercentage(_wallets[i], _transferLimitsInPercentage[i]); } } /** - * @notice removes transfer limits set in tokens for an array of wallet + * @notice Removes transfer limits set in tokens for an array of wallet * @param _wallets array of wallet addresses */ function removeTransferLimitInTokensMulti(address[] _wallets) public withPerm(ADMIN) { @@ -292,7 +303,7 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { } /** - * @notice removes transfer limits set in percentage for an array of wallet + * @notice Removes transfer limits set in percentage for an array of wallet * @param _wallets array of wallet addresses */ function removeTransferLimitInPercentageMulti(address[] _wallets) public withPerm(ADMIN) { @@ -310,11 +321,11 @@ contract SingleTradeVolumeRestrictionTM is ITransferManager { } /** - * @notice Return the permissions flag that are associated with SingleTradeVolumeRestrictionManager + * @notice Returns the permissions flag that are associated with SingleTradeVolumeRestrictionManager */ function getPermissions() public view returns(bytes32[]) { bytes32[] memory allPermissions = new bytes32[](1); allPermissions[0] = ADMIN; return allPermissions; } -} \ No newline at end of file +} diff --git a/contracts/modules/TransferManager/SingleTradeVolumeRestrictionTMFactory.sol b/contracts/modules/Experimental/TransferManager/SingleTradeVolumeRestrictionTMFactory.sol similarity index 75% rename from contracts/modules/TransferManager/SingleTradeVolumeRestrictionTMFactory.sol rename to contracts/modules/Experimental/TransferManager/SingleTradeVolumeRestrictionTMFactory.sol index d5795647c..e6d8ed2be 100644 --- a/contracts/modules/TransferManager/SingleTradeVolumeRestrictionTMFactory.sol +++ b/contracts/modules/Experimental/TransferManager/SingleTradeVolumeRestrictionTMFactory.sol @@ -1,8 +1,9 @@ pragma solidity ^0.4.24; -import "./../ModuleFactory.sol"; +import "./../../ModuleFactory.sol"; import "./SingleTradeVolumeRestrictionTM.sol"; -import "../../libraries/Util.sol"; +import "../../../libraries/Util.sol"; + /** * @title Factory for deploying SingleTradeVolumeRestrictionManager */ @@ -28,7 +29,7 @@ contract SingleTradeVolumeRestrictionTMFactory is ModuleFactory { } /** - * @notice used to launch the Module with the help of factory + * @notice Used to launch the Module with the help of factory * @return address Contract address of the Module */ function deploy(bytes _data) external returns(address) { @@ -37,7 +38,9 @@ contract SingleTradeVolumeRestrictionTMFactory is ModuleFactory { SingleTradeVolumeRestrictionTM singleTradeVolumeRestrictionManager = new SingleTradeVolumeRestrictionTM(msg.sender, address(polyToken)); require(Util.getSig(_data) == singleTradeVolumeRestrictionManager.getInitFunction(), "Provided data is not valid"); + /*solium-disable-next-line security/no-low-level-calls*/ require(address(singleTradeVolumeRestrictionManager).call(_data), "Unsuccessful call"); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(singleTradeVolumeRestrictionManager), getName(), address(this), msg.sender, setupCost, now); return address(singleTradeVolumeRestrictionManager); } @@ -52,53 +55,15 @@ contract SingleTradeVolumeRestrictionTMFactory is ModuleFactory { return res; } - /** - * @notice Get the name of the Module - * @return bytes32 - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - * @return string - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the title of the Module - * @return string - */ - function getTitle() external view returns(string) { - return title; - } - /** * @notice Get the Instructions that help to use the module * @return string */ function getInstructions() external view returns(string) { + /*solium-disable-next-line max-len*/ return "Allows an issuer to impose volume restriction on a single trade. Init function takes two parameters. First parameter is a bool indicating if restriction is in percentage. The second parameter is the value in percentage or amount of tokens"; } - /** - * @notice Get the version of the Module - * @return string - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the setup cost of the module - * return uint256 - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } /** * @notice Get the tags related to the module factory * @return bytes32[] diff --git a/contracts/modules/ModuleFactory.sol b/contracts/modules/ModuleFactory.sol index a330bd0ea..aca262621 100644 --- a/contracts/modules/ModuleFactory.sol +++ b/contracts/modules/ModuleFactory.sol @@ -12,9 +12,10 @@ import "../libraries/VersionUtils.sol"; contract ModuleFactory is IModuleFactory, Ownable { IERC20 public polyToken; - uint256 public setupCost; uint256 public usageCost; uint256 public monthlySubscriptionCost; + + uint256 public setupCost; string public description; string public version; bytes32 public name; @@ -30,7 +31,13 @@ contract ModuleFactory is IModuleFactory, Ownable { event ChangeFactorySetupFee(uint256 _oldSetupCost, uint256 _newSetupCost, address _moduleFactory); event ChangeFactoryUsageFee(uint256 _oldUsageCost, uint256 _newUsageCost, address _moduleFactory); event ChangeFactorySubscriptionFee(uint256 _oldSubscriptionCost, uint256 _newMonthlySubscriptionCost, address _moduleFactory); - event GenerateModuleFromFactory(address _module, bytes32 indexed _moduleName, address indexed _moduleFactory, address _creator, uint256 _timestamp); + event GenerateModuleFromFactory( + address _module, + bytes32 indexed _moduleName, + address indexed _moduleFactory, + address _creator, + uint256 _timestamp + ); event ChangeSTVersionBound(string _boundType, uint8 _major, uint8 _minor, uint8 _patch); /** @@ -45,7 +52,7 @@ contract ModuleFactory is IModuleFactory, Ownable { } /** - * @notice used to change the fee of the setup cost + * @notice Used to change the fee of the setup cost * @param _newSetupCost new setup cost */ function changeFactorySetupFee(uint256 _newSetupCost) public onlyOwner { @@ -54,7 +61,7 @@ contract ModuleFactory is IModuleFactory, Ownable { } /** - * @notice used to change the fee of the usage cost + * @notice Used to change the fee of the usage cost * @param _newUsageCost new usage cost */ function changeFactoryUsageFee(uint256 _newUsageCost) public onlyOwner { @@ -63,7 +70,7 @@ contract ModuleFactory is IModuleFactory, Ownable { } /** - * @notice used to change the fee of the subscription cost + * @notice Used to change the fee of the subscription cost * @param _newSubscriptionCost new subscription cost */ function changeFactorySubscriptionFee(uint256 _newSubscriptionCost) public onlyOwner { @@ -73,7 +80,7 @@ contract ModuleFactory is IModuleFactory, Ownable { } /** - * @notice Update the title of the ModuleFactory + * @notice Updates the title of the ModuleFactory * @param _newTitle New Title that will replace the old one. */ function changeTitle(string _newTitle) public onlyOwner { @@ -82,7 +89,7 @@ contract ModuleFactory is IModuleFactory, Ownable { } /** - * @notice Update the description of the ModuleFactory + * @notice Updates the description of the ModuleFactory * @param _newDesc New description that will replace the old one. */ function changeDescription(string _newDesc) public onlyOwner { @@ -91,7 +98,7 @@ contract ModuleFactory is IModuleFactory, Ownable { } /** - * @notice Update the name of the ModuleFactory + * @notice Updates the name of the ModuleFactory * @param _newName New name that will replace the old one. */ function changeName(bytes32 _newName) public onlyOwner { @@ -100,7 +107,7 @@ contract ModuleFactory is IModuleFactory, Ownable { } /** - * @notice Update the version of the ModuleFactory + * @notice Updates the version of the ModuleFactory * @param _newVersion New name that will replace the old one. */ function changeVersion(string _newVersion) public onlyOwner { @@ -114,8 +121,11 @@ contract ModuleFactory is IModuleFactory, Ownable { * @param _newVersion new version array */ function changeSTVersionBounds(string _boundType, uint8[] _newVersion) external onlyOwner { - require(keccak256(abi.encodePacked(_boundType)) == keccak256(abi.encodePacked("lowerBound")) || keccak256(abi.encodePacked(_boundType)) == keccak256(abi.encodePacked("upperBound")), - "Must be a valid bound type"); + require( + keccak256(abi.encodePacked(_boundType)) == keccak256(abi.encodePacked("lowerBound")) || + keccak256(abi.encodePacked(_boundType)) == keccak256(abi.encodePacked("upperBound")), + "Must be a valid bound type" + ); require(_newVersion.length == 3); if (compatibleSTVersionRange[_boundType] != uint24(0)) { uint8[] memory _currentVersion = VersionUtils.unpack(compatibleSTVersionRange[_boundType]); @@ -126,19 +136,33 @@ contract ModuleFactory is IModuleFactory, Ownable { } /** - * @notice use to get the lower bound + * @notice Used to get the lower bound * @return lower bound */ function getLowerSTVersionBounds() external view returns(uint8[]) { - return VersionUtils.unpack(compatibleSTVersionRange["lowerBound"]); + return VersionUtils.unpack(compatibleSTVersionRange["lowerBound"]); } /** - * @notice use to get the upper bound + * @notice Used to get the upper bound * @return upper bound */ function getUpperSTVersionBounds() external view returns(uint8[]) { return VersionUtils.unpack(compatibleSTVersionRange["upperBound"]); } + /** + * @notice Get the setup cost of the module + */ + function getSetupCost() external view returns (uint256) { + return setupCost; + } + + /** + * @notice Get the name of the Module + */ + function getName() public view returns(bytes32) { + return name; + } + } diff --git a/contracts/modules/PermissionManager/GeneralPermissionManager.sol b/contracts/modules/PermissionManager/GeneralPermissionManager.sol index 0257da6ec..f85abf675 100644 --- a/contracts/modules/PermissionManager/GeneralPermissionManager.sol +++ b/contracts/modules/PermissionManager/GeneralPermissionManager.sol @@ -21,7 +21,7 @@ contract GeneralPermissionManager is IPermissionManager, Module { /// Event emitted after any permission get changed for the delegate event ChangePermission(address indexed _delegate, address _module, bytes32 _perm, bool _valid, uint256 _timestamp); - /// Use to notify when delegate is added in permission manager contract + /// Used to notify when delegate is added in permission manager contract event AddDelegate(address indexed _delegate, bytes32 _details, uint256 _timestamp); @@ -40,7 +40,7 @@ contract GeneralPermissionManager is IPermissionManager, Module { } /** - * @notice Use to check the permission on delegate corresponds to module contract address + * @notice Used to check the permission on delegate corresponds to module contract address * @param _delegate Ethereum address of the delegate * @param _module Ethereum contract address of the module * @param _perm Permission flag @@ -54,7 +54,7 @@ contract GeneralPermissionManager is IPermissionManager, Module { } /** - * @notice Use to add a delegate + * @notice Used to add a delegate * @param _delegate Ethereum address of the delegate * @param _details Details about the delegate i.e `Belongs to financial firm` */ @@ -64,6 +64,7 @@ contract GeneralPermissionManager is IPermissionManager, Module { require(delegateDetails[_delegate] == bytes32(0), "Already present"); delegateDetails[_delegate] = _details; allDelegates.push(_delegate); + /*solium-disable-next-line security/no-block-members*/ emit AddDelegate(_delegate, _details, now); } @@ -83,12 +84,12 @@ contract GeneralPermissionManager is IPermissionManager, Module { } /** - * @notice use to check if an address is a delegate or not + * @notice Used to check if an address is a delegate or not * @param _potentialDelegate the address of potential delegate * @return bool */ function checkDelegate(address _potentialDelegate) external view returns(bool) { - require(_potentialDelegate != address(0)); + require(_potentialDelegate != address(0), "Invalid address"); if (delegateDetails[_potentialDelegate] != bytes32(0)) { return true; @@ -97,7 +98,7 @@ contract GeneralPermissionManager is IPermissionManager, Module { } /** - * @notice Use to provide/change the permission to the delegate corresponds to the module contract + * @notice Used to provide/change the permission to the delegate corresponds to the module contract * @param _delegate Ethereum address of the delegate * @param _module Ethereum contract address of the module * @param _perm Permission flag @@ -118,7 +119,7 @@ contract GeneralPermissionManager is IPermissionManager, Module { } /** - * @notice Use to change one or more permissions for a single delegate at once + * @notice Used to change one or more permissions for a single delegate at once * @param _delegate Ethereum address of the delegate * @param _modules Multiple module matching the multiperms, needs to be same length * @param _perms Multiple permission flag needs to be changed @@ -144,7 +145,7 @@ contract GeneralPermissionManager is IPermissionManager, Module { } /** - * @notice use to return all delegates with a given permission and module + * @notice Used to return all delegates with a given permission and module * @param _module Ethereum contract address of the module * @param _perm Permission flag * @return address[] @@ -169,7 +170,7 @@ contract GeneralPermissionManager is IPermissionManager, Module { } /** - * @notice use to return all permission of a single or multiple module + * @notice Used to return all permission of a single or multiple module * @dev possible that function get out of gas is there are lot of modules and perm related to them * @param _delegate Ethereum address of the delegate * @param _types uint8[] of types @@ -203,8 +204,8 @@ contract GeneralPermissionManager is IPermissionManager, Module { _allModulePerms = IModule(_currentTypeModules[j]).getPermissions(); for (k = 0; k < _allModulePerms.length; k++) { if (perms[_currentTypeModules[j]][_delegate][_allModulePerms[k]]) { - _allModules[counter]= _currentTypeModules[j]; - _allPerms[counter]=_allModulePerms[k]; + _allModules[counter] = _currentTypeModules[j]; + _allPerms[counter] = _allModulePerms[k]; counter++; } } @@ -215,7 +216,7 @@ contract GeneralPermissionManager is IPermissionManager, Module { } /** - * @notice Use to provide/change the permission to the delegate corresponds to the module contract + * @notice Used to provide/change the permission to the delegate corresponds to the module contract * @param _delegate Ethereum address of the delegate * @param _module Ethereum contract address of the module * @param _perm Permission flag @@ -231,11 +232,12 @@ contract GeneralPermissionManager is IPermissionManager, Module { internal { perms[_module][_delegate][_perm] = _valid; + /*solium-disable-next-line security/no-block-members*/ emit ChangePermission(_delegate, _module, _perm, _valid, now); } /** - * @notice use to get all delegates + * @notice Used to get all delegates * @return address[] */ function getAllDelegates() external view returns(address[]) { diff --git a/contracts/modules/PermissionManager/GeneralPermissionManagerFactory.sol b/contracts/modules/PermissionManager/GeneralPermissionManagerFactory.sol index 7988cc4d7..bfdc73801 100644 --- a/contracts/modules/PermissionManager/GeneralPermissionManagerFactory.sol +++ b/contracts/modules/PermissionManager/GeneralPermissionManagerFactory.sol @@ -24,13 +24,14 @@ contract GeneralPermissionManagerFactory is ModuleFactory { } /** - * @notice used to launch the Module with the help of factory + * @notice Used to launch the Module with the help of factory * @return address Contract address of the Module */ function deploy(bytes /* _data */) external returns(address) { if(setupCost > 0) - require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom because of sufficent Allowance is not provided"); + require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom due to insufficent Allowance provided"); address permissionManager = new GeneralPermissionManager(msg.sender, address(polyToken)); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(permissionManager), getName(), address(this), msg.sender, setupCost, now); return permissionManager; } @@ -44,46 +45,12 @@ contract GeneralPermissionManagerFactory is ModuleFactory { return res; } - /** - * @notice Get the name of the Module - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string) { - return title; - } - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the setup cost of the module - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } - /** * @notice Returns the instructions associated with the module */ function getInstructions() external view returns(string) { - return "Add and remove permissions for the SecurityToken and associated modules. Permission types should be encoded as bytes32 values, and attached using the withPerm modifier to relevant functions.No initFunction required."; + /*solium-disable-next-line max-len*/ + return "Add and remove permissions for the SecurityToken and associated modules. Permission types should be encoded as bytes32 values and attached using withPerm modifier to relevant functions. No initFunction required."; } /** diff --git a/contracts/modules/PermissionManager/IPermissionManager.sol b/contracts/modules/PermissionManager/IPermissionManager.sol index 00afeb3e7..d9b78944d 100644 --- a/contracts/modules/PermissionManager/IPermissionManager.sol +++ b/contracts/modules/PermissionManager/IPermissionManager.sol @@ -6,7 +6,7 @@ pragma solidity ^0.4.24; interface IPermissionManager { /** - * @notice Use to check the permission on delegate corresponds to module contract address + * @notice Used to check the permission on delegate corresponds to module contract address * @param _delegate Ethereum address of the delegate * @param _module Ethereum contract address of the module * @param _perm Permission flag @@ -15,7 +15,7 @@ interface IPermissionManager { function checkPermission(address _delegate, address _module, bytes32 _perm) external view returns(bool); /** - * @notice Use to add a delegate + * @notice Used to add a delegate * @param _delegate Ethereum address of the delegate * @param _details Details about the delegate i.e `Belongs to financial firm` */ @@ -28,14 +28,14 @@ interface IPermissionManager { function deleteDelegate(address _delegate) external; /** - * @notice use to check if an address is a delegate or not + * @notice Used to check if an address is a delegate or not * @param _potentialDelegate the address of potential delegate * @return bool */ function checkDelegate(address _potentialDelegate) external view returns(bool); /** - * @notice Use to provide/change the permission to the delegate corresponds to the module contract + * @notice Used to provide/change the permission to the delegate corresponds to the module contract * @param _delegate Ethereum address of the delegate * @param _module Ethereum contract address of the module * @param _perm Permission flag @@ -51,7 +51,7 @@ interface IPermissionManager { external; /** - * @notice Use to change one or more permissions for a single delegate at once + * @notice Used to change one or more permissions for a single delegate at once * @param _delegate Ethereum address of the delegate * @param _modules Multiple module matching the multiperms, needs to be same length * @param _perms Multiple permission flag needs to be changed @@ -67,7 +67,7 @@ interface IPermissionManager { external; /** - * @notice use to return all delegates with a given permission and module + * @notice Used to return all delegates with a given permission and module * @param _module Ethereum contract address of the module * @param _perm Permission flag * @return address[] @@ -75,7 +75,7 @@ interface IPermissionManager { function getAllDelegatesWithPerm(address _module, bytes32 _perm) external view returns(address[]); /** - * @notice use to return all permission of a single or multiple module + * @notice Used to return all permission of a single or multiple module * @dev possible that function get out of gas is there are lot of modules and perm related to them * @param _delegate Ethereum address of the delegate * @param _types uint8[] of types @@ -85,13 +85,13 @@ interface IPermissionManager { function getAllModulesAndPermsFromTypes(address _delegate, uint8[] _types) external view returns(address[], bytes32[]); /** - * @notice Use to get the Permission flag related the `this` contract + * @notice Used to get the Permission flag related the `this` contract * @return Array of permission flags */ function getPermissions() external view returns(bytes32[]); /** - * @notice use to get all delegates + * @notice Used to get all delegates * @return address[] */ function getAllDelegates() external view returns(address[]); diff --git a/contracts/modules/STO/CappedSTO.sol b/contracts/modules/STO/CappedSTO.sol index 5bd481280..60373ae37 100644 --- a/contracts/modules/STO/CappedSTO.sol +++ b/contracts/modules/STO/CappedSTO.sol @@ -66,6 +66,7 @@ contract CappedSTO is ISTO, ReentrancyGuard { { require(_rate > 0, "Rate of token should be greater than 0"); require(_fundsReceiver != address(0), "Zero address is not permitted"); + /*solium-disable-next-line security/no-block-members*/ require(_startTime >= now && _endTime > _startTime, "Date parameters are not valid"); require(_cap > 0, "Cap should be greater than 0"); require(_fundRaiseTypes.length == 1, "It only selects single fund raise type"); @@ -95,16 +96,16 @@ contract CappedSTO is ISTO, ReentrancyGuard { } /** - * @notice low level token purchase ***DO NOT OVERRIDE*** + * @notice Low level token purchase ***DO NOT OVERRIDE*** * @param _beneficiary Address performing the token purchase */ function buyTokens(address _beneficiary) public payable nonReentrant { if (!allowBeneficialInvestments) { - require(_beneficiary == msg.sender, "Beneficiary must match funding provider"); + require(_beneficiary == msg.sender, "Beneficiary address does not match msg.sender"); } - require(!paused); - require(fundRaiseTypes[uint8(FundRaiseType.ETH)], "ETH should be the mode of investment"); + require(!paused, "Should not be paused"); + require(fundRaiseTypes[uint8(FundRaiseType.ETH)], "Mode of investment is not ETH"); uint256 weiAmount = msg.value; _processTx(_beneficiary, weiAmount); @@ -118,8 +119,8 @@ contract CappedSTO is ISTO, ReentrancyGuard { * @param _investedPOLY Amount of POLY invested */ function buyTokensWithPoly(uint256 _investedPOLY) public nonReentrant{ - require(!paused); - require(fundRaiseTypes[uint8(FundRaiseType.POLY)], "POLY should be the mode of investment"); + require(!paused, "Should not be paused"); + require(fundRaiseTypes[uint8(FundRaiseType.POLY)], "Mode of investment is not POLY"); _processTx(msg.sender, _investedPOLY); _forwardPoly(msg.sender, wallet, _investedPOLY); _postValidatePurchase(msg.sender, _investedPOLY); @@ -150,6 +151,13 @@ contract CappedSTO is ISTO, ReentrancyGuard { /** * @notice Return the STO details + * @return Unixtimestamp at which offering gets start. + * @return Unixtimestamp at which offering ends. + * @return Number of tokens this STO will be allowed to sell to investors. + * @return Amount of funds raised + * @return Number of individual investors this STO have. + * @return Amount of tokens get sold. + * @return Boolean value to justify whether the fund raise type is POLY or not, i.e true for POLY. */ function getSTODetails() public view returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, bool) { return ( @@ -202,6 +210,7 @@ contract CappedSTO is ISTO, ReentrancyGuard { require(_beneficiary != address(0), "Beneficiary address should not be 0x"); require(_investedAmount != 0, "Amount invested should not be equal to 0"); require(totalTokensSold.add(_getTokenAmount(_investedAmount)) <= cap, "Investment more than cap is not allowed"); + /*solium-disable-next-line security/no-block-members*/ require(now >= startTime && now <= endTime, "Offering is closed/Not yet started"); } @@ -238,7 +247,7 @@ contract CappedSTO is ISTO, ReentrancyGuard { } /** - * @notice Override for extensions that require an internal state to check for validity + * @notice Overrides for extensions that require an internal state to check for validity (current user contributions, etc.) */ function _updatePurchasingState(address /*_beneficiary*/, uint256 /*_investedAmount*/) internal pure { @@ -246,7 +255,7 @@ contract CappedSTO is ISTO, ReentrancyGuard { } /** - * @notice Override to extend the way in which ether is converted to tokens. + * @notice Overrides to extend the way in which ether is converted to tokens. * @param _investedAmount Value in wei to be converted into tokens * @return Number of tokens that can be purchased with the specified _investedAmount */ diff --git a/contracts/modules/STO/CappedSTOFactory.sol b/contracts/modules/STO/CappedSTOFactory.sol index 2c17bb299..89f3311d2 100644 --- a/contracts/modules/STO/CappedSTOFactory.sol +++ b/contracts/modules/STO/CappedSTOFactory.sol @@ -25,7 +25,7 @@ contract CappedSTOFactory is ModuleFactory { } /** - * @notice used to launch the Module with the help of factory + * @notice Used to launch the Module with the help of factory * @return address Contract address of the Module */ function deploy(bytes _data) external returns(address) { @@ -35,7 +35,9 @@ contract CappedSTOFactory is ModuleFactory { CappedSTO cappedSTO = new CappedSTO(msg.sender, address(polyToken)); //Checks that _data is valid (not calling anything it shouldn't) require(Util.getSig(_data) == cappedSTO.getInitFunction(), "Invalid data"); + /*solium-disable-next-line security/no-low-level-calls*/ require(address(cappedSTO).call(_data), "Unsuccessfull call"); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(cappedSTO), getName(), address(this), msg.sender, setupCost, now); return address(cappedSTO); } @@ -49,45 +51,11 @@ contract CappedSTOFactory is ModuleFactory { return res; } - /** - * @notice Get the name of the Module - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string) { - return title; - } - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the setup cost of the module - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } - /** * @notice Returns the instructions associated with the module */ function getInstructions() external view returns(string) { + /*solium-disable-next-line max-len*/ return "Initialises a capped STO. Init parameters are _startTime (time STO starts), _endTime (time STO ends), _cap (cap in tokens for STO), _rate (POLY/ETH to token rate), _fundRaiseType (whether you are raising in POLY or ETH), _polyToken (address of POLY token), _fundsReceiver (address which will receive funds)"; } diff --git a/contracts/modules/STO/DummySTO.sol b/contracts/modules/STO/DummySTO.sol index 8e7640d94..1b44d2e9b 100644 --- a/contracts/modules/STO/DummySTO.sol +++ b/contracts/modules/STO/DummySTO.sol @@ -56,7 +56,7 @@ contract DummySTO is ISTO { * @param _amount Amount of ETH or Poly invested by the investor */ function generateTokens(address _investor, uint256 _amount) public withPerm(ADMIN) { - require(!paused); + require(!paused, "Should not be paused"); require(_amount > 0, "Amount should be greater than 0"); ISecurityToken(securityToken).mint(_investor, _amount); if (investors[_investor] == 0) { @@ -68,21 +68,21 @@ contract DummySTO is ISTO { } /** - * @notice Return the total no. of investors + * @notice Returns the total no. of investors */ function getNumberInvestors() public view returns (uint256) { return investorCount; } /** - * @notice Return the total no. of investors + * @notice Returns the total no. of investors */ function getTokensSold() public view returns (uint256) { return 0; } /** - * @notice Return the permissions flag that are associated with STO + * @notice Returns the permissions flag that are associated with STO */ function getPermissions() public view returns(bytes32[]) { bytes32[] memory allPermissions = new bytes32[](1); diff --git a/contracts/modules/STO/DummySTOFactory.sol b/contracts/modules/STO/DummySTOFactory.sol index 94aa9516b..04640ac58 100644 --- a/contracts/modules/STO/DummySTOFactory.sol +++ b/contracts/modules/STO/DummySTOFactory.sol @@ -24,7 +24,7 @@ contract DummySTOFactory is ModuleFactory { compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); } /** - * @notice used to launch the Module with the help of factory + * @notice Used to launch the Module with the help of factory * @return address Contract address of the Module */ function deploy(bytes _data) external returns(address) { @@ -34,7 +34,9 @@ contract DummySTOFactory is ModuleFactory { DummySTO dummySTO = new DummySTO(msg.sender, address(polyToken)); //Checks that _data is valid (not calling anything it shouldn't) require(Util.getSig(_data) == dummySTO.getInitFunction(), "Invalid data"); + /*solium-disable-next-line security/no-low-level-calls*/ require(address(dummySTO).call(_data), "Unsuccessfull call"); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(dummySTO), getName(), address(this), msg.sender, setupCost, now); return address(dummySTO); } @@ -48,41 +50,6 @@ contract DummySTOFactory is ModuleFactory { return res; } - /** - * @notice Get the name of the Module - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string) { - return title; - } - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the setup cost of the module - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } - /** * @notice Returns the instructions associated with the module */ diff --git a/contracts/modules/STO/ISTO.sol b/contracts/modules/STO/ISTO.sol index 7205ca2a8..6ed1d5ba1 100644 --- a/contracts/modules/STO/ISTO.sol +++ b/contracts/modules/STO/ISTO.sol @@ -32,39 +32,40 @@ contract ISTO is Module, Pausable { event SetFundRaiseTypes(FundRaiseType[] _fundRaiseTypes); /** - * @notice Reclaim ERC20Basic compatible tokens + * @notice Reclaims ERC20Basic compatible tokens * @dev We duplicate here due to the overriden owner & onlyOwner * @param _tokenContract The address of the token contract */ function reclaimERC20(address _tokenContract) external onlyOwner { - require(_tokenContract != address(0)); + require(_tokenContract != address(0), "Invalid address"); IERC20 token = IERC20(_tokenContract); uint256 balance = token.balanceOf(address(this)); - require(token.transfer(msg.sender, balance)); + require(token.transfer(msg.sender, balance), "Transfer failed"); } /** - * @notice Return funds raised by the STO + * @notice Returns funds raised by the STO */ function getRaised(FundRaiseType _fundRaiseType) public view returns (uint256) { return fundsRaised[uint8(_fundRaiseType)]; } /** - * @notice Return the total no. of tokens sold + * @notice Returns the total no. of tokens sold */ function getTokensSold() public view returns (uint256); /** - * @notice pause (overridden function) + * @notice Pause (overridden function) */ function pause() public onlyOwner { - require(now < endTime); + /*solium-disable-next-line security/no-block-members*/ + require(now < endTime, "STO has been finalized"); super._pause(); } /** - * @notice unpause (overridden function) + * @notice Unpause (overridden function) */ function unpause() public onlyOwner { super._unpause(); @@ -72,7 +73,7 @@ contract ISTO is Module, Pausable { function _setFundRaiseType(FundRaiseType[] _fundRaiseTypes) internal { // FundRaiseType[] parameter type ensures only valid values for _fundRaiseTypes - require(_fundRaiseTypes.length > 0, "Raise type not specified"); + require(_fundRaiseTypes.length > 0, "Raise type is not specified"); fundRaiseTypes[uint8(FundRaiseType.ETH)] = false; fundRaiseTypes[uint8(FundRaiseType.POLY)] = false; fundRaiseTypes[uint8(FundRaiseType.DAI)] = false; diff --git a/contracts/modules/STO/PreSaleSTO.sol b/contracts/modules/STO/PreSaleSTO.sol index 5e518bea0..7378fb06b 100644 --- a/contracts/modules/STO/PreSaleSTO.sol +++ b/contracts/modules/STO/PreSaleSTO.sol @@ -43,21 +43,21 @@ contract PreSaleSTO is ISTO { } /** - * @notice Return the total no. of investors + * @notice Returns the total no. of investors */ function getNumberInvestors() public view returns (uint256) { return investorCount; } /** - * @notice Return the total no. of tokens sold + * @notice Returns the total no. of tokens sold */ function getTokensSold() public view returns (uint256) { return totalTokensSold; } /** - * @notice Return the permissions flag that are associated with STO + * @notice Returns the permissions flag that are associated with STO */ function getPermissions() public view returns(bytes32[]) { bytes32[] memory allPermissions = new bytes32[](1); @@ -72,9 +72,17 @@ contract PreSaleSTO is ISTO { * @param _etherContributed How much ETH was contributed * @param _polyContributed How much POLY was contributed */ - function allocateTokens(address _investor, uint256 _amount, uint256 _etherContributed, uint256 _polyContributed) public withPerm(PRE_SALE_ADMIN) + function allocateTokens( + address _investor, + uint256 _amount, + uint256 _etherContributed, + uint256 _polyContributed + ) + public + withPerm(PRE_SALE_ADMIN) { - require(now <= endTime, "Current time should less than the endTime"); + /*solium-disable-next-line security/no-block-members*/ + require(now <= endTime, "Already passed Endtime"); require(_amount > 0, "No. of tokens provided should be greater the zero"); ISecurityToken(securityToken).mint(_investor, _amount); if (investors[_investor] == uint256(0)) { @@ -94,11 +102,18 @@ contract PreSaleSTO is ISTO { * @param _etherContributed Array of amount of ETH contributed by each investor * @param _polyContributed Array of amount of POLY contributed by each investor */ - function allocateTokensMulti(address[] _investors, uint256[] _amounts, uint256[] _etherContributed, uint256[] _polyContributed) public withPerm(PRE_SALE_ADMIN) + function allocateTokensMulti( + address[] _investors, + uint256[] _amounts, + uint256[] _etherContributed, + uint256[] _polyContributed + ) + public + withPerm(PRE_SALE_ADMIN) { - require(_investors.length == _amounts.length, "Mis-match in the length of the arrays"); - require(_etherContributed.length == _polyContributed.length, "Mis-match in the length of the arrays"); - require(_etherContributed.length == _investors.length, "Mis-match in the length of the arrays"); + require(_investors.length == _amounts.length, "Mis-match in length of the arrays"); + require(_etherContributed.length == _polyContributed.length, "Mis-match in length of the arrays"); + require(_etherContributed.length == _investors.length, "Mis-match in length of the arrays"); for (uint256 i = 0; i < _investors.length; i++) { allocateTokens(_investors[i], _amounts[i], _etherContributed[i], _polyContributed[i]); } diff --git a/contracts/modules/STO/PreSaleSTOFactory.sol b/contracts/modules/STO/PreSaleSTOFactory.sol index b4faf07a9..035c4bad5 100644 --- a/contracts/modules/STO/PreSaleSTOFactory.sol +++ b/contracts/modules/STO/PreSaleSTOFactory.sol @@ -25,7 +25,7 @@ contract PreSaleSTOFactory is ModuleFactory { } /** - * @notice used to launch the Module with the help of factory + * @notice Used to launch the Module with the help of factory * @param _data Data used for the intialization of the module factory variables * @return address Contract address of the Module */ @@ -37,7 +37,9 @@ contract PreSaleSTOFactory is ModuleFactory { PreSaleSTO preSaleSTO = new PreSaleSTO(msg.sender, address(polyToken)); //Checks that _data is valid (not calling anything it shouldn't) require(Util.getSig(_data) == preSaleSTO.getInitFunction(), "Invalid data"); + /*solium-disable-next-line security/no-low-level-calls*/ require(address(preSaleSTO).call(_data), "Unsuccessfull call"); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(preSaleSTO), getName(), address(this), msg.sender, setupCost, now); return address(preSaleSTO); } @@ -50,42 +52,7 @@ contract PreSaleSTOFactory is ModuleFactory { res[0] = 3; return res; } - - /** - * @notice Get the name of the Module - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string) { - return title; - } - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the setup cost of the module - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } - + /** * @notice Returns the instructions associated with the module */ diff --git a/contracts/modules/STO/ProxyFactory/USDTieredSTOProxyFactory.sol b/contracts/modules/STO/ProxyFactory/USDTieredSTOProxyFactory.sol index 1f241d8cc..d9a48b87d 100644 --- a/contracts/modules/STO/ProxyFactory/USDTieredSTOProxyFactory.sol +++ b/contracts/modules/STO/ProxyFactory/USDTieredSTOProxyFactory.sol @@ -10,7 +10,7 @@ contract USDTieredSTOProxyFactory is IUSDTieredSTOProxy { } /** - * @notice deploys the STO. + * @notice Deploys the STO. * @param _securityToken Contract address of the securityToken * @param _polyAddress Contract address of the PolyToken. * @param _factoryAddress Contract address of the factory @@ -22,7 +22,7 @@ contract USDTieredSTOProxyFactory is IUSDTieredSTOProxy { } /** - * @notice Use to get the init function signature + * @notice Used to get the init function signature * @param _contractAddress Address of the STO contract * @return bytes4 */ diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index b7db53bfd..894744451 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -91,9 +91,31 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { event SetAllowBeneficialInvestments(bool _allowed); event SetNonAccreditedLimit(address _investor, uint256 _limit); event SetAccredited(address _investor, bool _accredited); - event TokenPurchase(address indexed _purchaser, address indexed _beneficiary, uint256 _tokens, uint256 _usdAmount, uint256 _tierPrice, uint8 _tier); - event FundsReceived(address indexed _purchaser, address indexed _beneficiary, uint256 _usdAmount, FundRaiseType _fundRaiseType, uint256 _receivedValue, uint256 _spentValue, uint256 _rate); - event FundsReceivedPOLY(address indexed _purchaser, address indexed _beneficiary, uint256 _usdAmount, uint256 _receivedValue, uint256 _spentValue, uint256 _rate); + event TokenPurchase( + address indexed _purchaser, + address indexed _beneficiary, + uint256 _tokens, + uint256 _usdAmount, + uint256 _tierPrice, + uint8 _tier + ); + event FundsReceived( + address indexed _purchaser, + address indexed _beneficiary, + uint256 _usdAmount, + FundRaiseType _fundRaiseType, + uint256 _receivedValue, + uint256 _spentValue, + uint256 _rate + ); + event FundsReceivedPOLY( + address indexed _purchaser, + address indexed _beneficiary, + uint256 _usdAmount, + uint256 _receivedValue, + uint256 _spentValue, + uint256 _rate + ); event ReserveTokenMint(address indexed _owner, address indexed _wallet, uint256 _tokens, uint8 _latestTier); event SetAddresses( @@ -122,18 +144,18 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { modifier validETH { require(_getOracle(bytes32("ETH"), bytes32("USD")) != address(0), "Invalid ETHUSD Oracle"); - require(fundRaiseTypes[uint8(FundRaiseType.ETH)]); + require(fundRaiseTypes[uint8(FundRaiseType.ETH)], "Fund raise in ETH should be allowed"); _; } modifier validPOLY { require(_getOracle(bytes32("POLY"), bytes32("USD")) != address(0), "Invalid POLYUSD Oracle"); - require(fundRaiseTypes[uint8(FundRaiseType.POLY)]); + require(fundRaiseTypes[uint8(FundRaiseType.POLY)], "Fund raise in POLY should be allowed"); _; } modifier validDAI { - require(fundRaiseTypes[uint8(FundRaiseType.DAI)]); + require(fundRaiseTypes[uint8(FundRaiseType.DAI)], "Fund raise in DAI should be allowed"); _; } @@ -185,7 +207,8 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { } function modifyFunding(FundRaiseType[] _fundRaiseTypes) public onlyFactoryOrOwner { - require(now < startTime); + /*solium-disable-next-line security/no-block-members*/ + require(now < startTime, "STO shouldn't be started"); _setFundRaiseType(_fundRaiseTypes); uint256 length = getNumberOfTiers(); mintedPerTierTotal = new uint256[](length); @@ -199,7 +222,8 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 _nonAccreditedLimitUSD, uint256 _minimumInvestmentUSD ) public onlyFactoryOrOwner { - require(now < startTime); + /*solium-disable-next-line security/no-block-members*/ + require(now < startTime, "STO shouldn't be started"); minimumInvestmentUSD = _minimumInvestmentUSD; nonAccreditedLimitUSD = _nonAccreditedLimitUSD; emit SetLimits(minimumInvestmentUSD, nonAccreditedLimitUSD); @@ -211,15 +235,16 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256[] _tokensPerTierTotal, uint256[] _tokensPerTierDiscountPoly ) public onlyFactoryOrOwner { - require(now < startTime); - require(_tokensPerTierTotal.length > 0); + /*solium-disable-next-line security/no-block-members*/ + require(now < startTime, "STO shouldn't be started"); + require(_tokensPerTierTotal.length > 0, "Length should be > 0"); require(_ratePerTier.length == _tokensPerTierTotal.length, "Mismatch b/w rates & tokens / tier"); require(_ratePerTierDiscountPoly.length == _tokensPerTierTotal.length, "Mismatch b/w discount rates & tokens / tier"); require(_tokensPerTierDiscountPoly.length == _tokensPerTierTotal.length, "Mismatch b/w discount tokens / tier & tokens / tier"); for (uint8 i = 0; i < _ratePerTier.length; i++) { require(_ratePerTier[i] > 0, "Rate > 0"); require(_tokensPerTierTotal[i] > 0, "Tokens per tier > 0"); - require(_tokensPerTierDiscountPoly[i] <= _tokensPerTierTotal[i], "Discounted tokens / tier <= to tokens / tier"); + require(_tokensPerTierDiscountPoly[i] <= _tokensPerTierTotal[i], "Discounted tokens / tier <= tokens / tier"); require(_ratePerTierDiscountPoly[i] <= _ratePerTier[i], "Discounted rate / tier <= rate / tier"); } ratePerTier = _ratePerTier; @@ -233,7 +258,9 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 _startTime, uint256 _endTime ) public onlyFactoryOrOwner { - require((startTime == 0) || (now < startTime)); + /*solium-disable-next-line security/no-block-members*/ + require((startTime == 0) || (now < startTime), "Invalid startTime"); + /*solium-disable-next-line security/no-block-members*/ require((_endTime > _startTime) && (_startTime > now), "Invalid times"); startTime = _startTime; endTime = _endTime; @@ -245,10 +272,11 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { address _reserveWallet, address _usdToken ) public onlyFactoryOrOwner { - require(now < startTime); - require(_wallet != address(0) && _reserveWallet != address(0), "0x address is not allowed"); + /*solium-disable-next-line security/no-block-members*/ + require(now < startTime, "STO shouldn't be started"); + require(_wallet != address(0) && _reserveWallet != address(0), "Invalid address"); if (fundRaiseTypes[uint8(FundRaiseType.DAI)]) { - require(_usdToken != address(0), "0x usdToken address is not allowed"); + require(_usdToken != address(0), "Invalid address"); } wallet = _wallet; reserveWallet = _reserveWallet; @@ -261,11 +289,11 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { //////////////////// /** - * @notice Finalize the STO and mint remaining tokens to reserve address + * @notice Finalizes the STO and mint remaining tokens to reserve address * @notice Reserve address must be whitelisted to successfully finalize */ function finalize() public onlyOwner { - require(!isFinalized); + require(!isFinalized, "STO is already finalized"); isFinalized = true; uint256 tempReturned; uint256 tempSold; @@ -285,12 +313,12 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { } /** - * @notice Modify the list of accredited addresses + * @notice Modifies the list of accredited addresses * @param _investors Array of investor addresses to modify * @param _accredited Array of bools specifying accreditation status */ function changeAccredited(address[] _investors, bool[] _accredited) public onlyOwner { - require(_investors.length == _accredited.length); + require(_investors.length == _accredited.length, "Array length mismatch"); for (uint256 i = 0; i < _investors.length; i++) { accredited[_investors[i]] = _accredited[i]; emit SetAccredited(_investors[i], _accredited[i]); @@ -298,15 +326,15 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { } /** - * @notice Modify the list of overrides for non-accredited limits in USD + * @notice Modifies the list of overrides for non-accredited limits in USD * @param _investors Array of investor addresses to modify * @param _nonAccreditedLimit Array of uints specifying non-accredited limits */ function changeNonAccreditedLimit(address[] _investors, uint256[] _nonAccreditedLimit) public onlyOwner { //nonAccreditedLimitUSDOverride - require(_investors.length == _nonAccreditedLimit.length); + require(_investors.length == _nonAccreditedLimit.length, "Array length mismatch"); for (uint256 i = 0; i < _investors.length; i++) { - require(_nonAccreditedLimit[i] > 0, "Limit can't be 0"); + require(_nonAccreditedLimit[i] > 0, "Limit can not be 0"); nonAccreditedLimitUSDOverride[_investors[i]] = _nonAccreditedLimit[i]; emit SetNonAccreditedLimit(_investors[i], _nonAccreditedLimit[i]); } @@ -377,7 +405,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { fundsRaised[uint8(_fundRaiseType)] = fundsRaised[uint8(_fundRaiseType)].add(spentValue); // Forward DAI to issuer wallet IERC20 token = _fundRaiseType == FundRaiseType.POLY ? polyToken : usdToken; - require(token.transferFrom(msg.sender, wallet, spentValue)); + require(token.transferFrom(msg.sender, wallet, spentValue), "Transfer failed"); emit FundsReceived(msg.sender, _beneficiary, spentUSD, _fundRaiseType, _tokenAmount, spentValue, rate); } @@ -387,9 +415,19 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { * @param _investmentValue Amount of POLY, ETH or DAI invested * @param _fundRaiseType Fund raise type (POLY, ETH, DAI) */ - function _buyTokens(address _beneficiary, uint256 _investmentValue, uint256 _rate, FundRaiseType _fundRaiseType) internal nonReentrant whenNotPaused returns(uint256, uint256) { + function _buyTokens( + address _beneficiary, + uint256 _investmentValue, + uint256 _rate, + FundRaiseType _fundRaiseType + ) + internal + nonReentrant + whenNotPaused + returns(uint256, uint256) + { if (!allowBeneficialInvestments) { - require(_beneficiary == msg.sender, "Beneficiary must match funder"); + require(_beneficiary == msg.sender, "Beneficiary does not match funder"); } require(isOpen(), "STO is not open"); @@ -442,7 +480,15 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { return (spentUSD, spentValue); } - function _calculateTier(address _beneficiary, uint8 _tier, uint256 _investedUSD, FundRaiseType _fundRaiseType) internal returns(uint256) { + function _calculateTier( + address _beneficiary, + uint8 _tier, + uint256 _investedUSD, + FundRaiseType _fundRaiseType + ) + internal + returns(uint256) + { // First purchase any discounted tokens if POLY investment uint256 spentUSD; uint256 tierSpentUSD; @@ -471,7 +517,16 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { return spentUSD; } - function _purchaseTier(address _beneficiary, uint256 _tierPrice, uint256 _tierRemaining, uint256 _investedUSD, uint8 _tier) internal returns(uint256, uint256) { + function _purchaseTier( + address _beneficiary, + uint256 _tierPrice, + uint256 _tierRemaining, + uint256 _investedUSD, + uint8 _tier + ) + internal + returns(uint256, uint256) + { uint256 maximumTokens = DecimalMath.div(_investedUSD, _tierPrice); uint256 spentUSD; uint256 purchasedTokens; @@ -502,8 +557,10 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { function isOpen() public view returns(bool) { if (isFinalized) return false; + /*solium-disable-next-line security/no-block-members*/ if (now < startTime) return false; + /*solium-disable-next-line security/no-block-members*/ if (now >= endTime) return false; if (capReached()) diff --git a/contracts/modules/STO/USDTieredSTOFactory.sol b/contracts/modules/STO/USDTieredSTOFactory.sol index 4c4274ff8..adc3ba628 100644 --- a/contracts/modules/STO/USDTieredSTOFactory.sol +++ b/contracts/modules/STO/USDTieredSTOFactory.sol @@ -23,13 +23,14 @@ contract USDTieredSTOFactory is ModuleFactory { version = "1.0.0"; name = "USDTieredSTO"; title = "USD Tiered STO"; - description = "USD Tiered STO"; + /*solium-disable-next-line max-len*/ + description = "It allows both accredited and non-accredited investors to contribute into the STO. Non-accredited investors will be capped at a maximum investment limit (as a default or specific to their jurisdiction). Tokens will be sold according to tiers sequentially & each tier has its own price and volume of tokens to sell. Upon receipt of funds (ETH, POLY or DAI), security tokens will automatically transfer to investor’s wallet address"; compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); } /** - * @notice used to launch the Module with the help of factory + * @notice Used to launch the Module with the help of factory * @return address Contract address of the Module */ function deploy(bytes _data) external returns(address) { @@ -40,7 +41,9 @@ contract USDTieredSTOFactory is ModuleFactory { address usdTieredSTO = IUSDTieredSTOProxy(USDTieredSTOProxyAddress).deploySTO(msg.sender, address(polyToken), address(this)); //Checks that _data is valid (not calling anything it shouldn't) require(Util.getSig(_data) == IUSDTieredSTOProxy(USDTieredSTOProxyAddress).getInitFunction(usdTieredSTO), "Invalid data"); + /*solium-disable-next-line security/no-low-level-calls*/ require(address(usdTieredSTO).call(_data), "Unsuccessfull call"); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(usdTieredSTO, getName(), address(this), msg.sender, setupCost, now); return address(usdTieredSTO); } @@ -54,41 +57,6 @@ contract USDTieredSTOFactory is ModuleFactory { return res; } - /** - * @notice Get the name of the Module - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string) { - return title; - } - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the setup cost of the module - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } - /** * @notice Returns the instructions associated with the module */ diff --git a/contracts/modules/TransferManager/CountTransferManager.sol b/contracts/modules/TransferManager/CountTransferManager.sol index 7d8edaf58..b54870251 100644 --- a/contracts/modules/TransferManager/CountTransferManager.sol +++ b/contracts/modules/TransferManager/CountTransferManager.sol @@ -28,7 +28,16 @@ contract CountTransferManager is ITransferManager { /** @notice Used to verify the transfer transaction and prevent a transfer if it passes the allowed amount of token holders * @param _to Address of the receiver */ - function verifyTransfer(address /* _from */, address _to, uint256 /* _amount */, bytes /* _data */, bool /* _isTransfer */) public returns(Result) { + function verifyTransfer( + address /* _from */, + address _to, + uint256 /* _amount */, + bytes /* _data */, + bool /* _isTransfer */ + ) + public + returns(Result) + { if (!paused) { if (maxHolderCount < ISecurityToken(securityToken).getInvestorCount()) { // Allow transfers to existing maxHolders @@ -51,7 +60,7 @@ contract CountTransferManager is ITransferManager { } /** - * @notice sets the cap for the amount of token holders there can be + * @notice Sets the cap for the amount of token holders there can be * @param _maxHolderCount is the new maximum amount of token holders */ function changeHolderCount(uint256 _maxHolderCount) public withPerm(ADMIN) { @@ -67,7 +76,7 @@ contract CountTransferManager is ITransferManager { } /** - * @notice Return the permissions flag that are associated with CountTransferManager + * @notice Returns the permissions flag that are associated with CountTransferManager */ function getPermissions() public view returns(bytes32[]) { bytes32[] memory allPermissions = new bytes32[](1); diff --git a/contracts/modules/TransferManager/CountTransferManagerFactory.sol b/contracts/modules/TransferManager/CountTransferManagerFactory.sol index 7469667bb..d9b1328f7 100644 --- a/contracts/modules/TransferManager/CountTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/CountTransferManagerFactory.sol @@ -25,16 +25,18 @@ contract CountTransferManagerFactory is ModuleFactory { } /** - * @notice used to launch the Module with the help of factory + * @notice Used to launch the Module with the help of factory * @param _data Data used for the intialization of the module factory variables * @return address Contract address of the Module */ function deploy(bytes _data) external returns(address) { if(setupCost > 0) - require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom because of sufficent Allowance is not provided"); + require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom due to insufficent Allowance provided"); CountTransferManager countTransferManager = new CountTransferManager(msg.sender, address(polyToken)); require(Util.getSig(_data) == countTransferManager.getInitFunction(), "Provided data is not valid"); + /*solium-disable-next-line security/no-low-level-calls*/ require(address(countTransferManager).call(_data), "Unsuccessful call"); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(countTransferManager), getName(), address(this), msg.sender, setupCost, now); return address(countTransferManager); @@ -49,41 +51,6 @@ contract CountTransferManagerFactory is ModuleFactory { return res; } - /** - * @notice Get the name of the Module - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string) { - return title; - } - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the setup cost of the module - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } - /** * @notice Returns the instructions associated with the module */ diff --git a/contracts/modules/TransferManager/GeneralTransferManager.sol b/contracts/modules/TransferManager/GeneralTransferManager.sol index 92bdcdce2..814d54d7b 100644 --- a/contracts/modules/TransferManager/GeneralTransferManager.sol +++ b/contracts/modules/TransferManager/GeneralTransferManager.sol @@ -30,6 +30,8 @@ contract GeneralTransferManager is ITransferManager { // An address can only send / receive tokens once their corresponding uint256 > block.number // (unless allowAllTransfers == true or allowAllWhitelistTransfers == true) mapping (address => TimeRestriction) public whitelist; + // Map of used nonces by customer + mapping(address => mapping(uint256 => bool)) public nonceMap; //If true, there are no transfer restrictions, for any addresses bool public allowAllTransfers = false; @@ -144,7 +146,7 @@ contract GeneralTransferManager is ITransferManager { } /** - * @notice default implementation of verifyTransfer used by SecurityToken + * @notice Default implementation of verifyTransfer used by SecurityToken * If the transfer request comes from the STO, it only checks that the investor is in the whitelist * If the transfer request comes from a token holder, it checks that: * a) Both are on the whitelist @@ -173,28 +175,39 @@ contract GeneralTransferManager is ITransferManager { return _onWhitelist(_to) ? Result.VALID : Result.NA; } //Anyone on the whitelist can transfer provided the blocknumber is large enough + /*solium-disable-next-line security/no-block-members*/ return ((_onWhitelist(_from) && whitelist[_from].fromTime <= now) && - (_onWhitelist(_to) && whitelist[_to].toTime <= now)) ? Result.VALID : Result.NA; + (_onWhitelist(_to) && whitelist[_to].toTime <= now)) ? Result.VALID : Result.NA; /*solium-disable-line security/no-block-members*/ } return Result.NA; } /** - * @notice adds or removes addresses from the whitelist. + * @notice Adds or removes addresses from the whitelist. * @param _investor is the address to whitelist * @param _fromTime is the moment when the sale lockup period ends and the investor can freely sell his tokens * @param _toTime is the moment when the purchase lockup period ends and the investor can freely purchase tokens from others * @param _expiryTime is the moment till investors KYC will be validated. After that investor need to do re-KYC * @param _canBuyFromSTO is used to know whether the investor is restricted investor or not. */ - function modifyWhitelist(address _investor, uint256 _fromTime, uint256 _toTime, uint256 _expiryTime, bool _canBuyFromSTO) public withPerm(WHITELIST) { + function modifyWhitelist( + address _investor, + uint256 _fromTime, + uint256 _toTime, + uint256 _expiryTime, + bool _canBuyFromSTO + ) + public + withPerm(WHITELIST) + { //Passing a _time == 0 into this function, is equivalent to removing the _investor from the whitelist whitelist[_investor] = TimeRestriction(_fromTime, _toTime, _expiryTime, _canBuyFromSTO); + /*solium-disable-next-line security/no-block-members*/ emit ModifyWhitelist(_investor, now, msg.sender, _fromTime, _toTime, _expiryTime, _canBuyFromSTO); } /** - * @notice adds or removes addresses from the whitelist. + * @notice Adds or removes addresses from the whitelist. * @param _investors List of the addresses to whitelist * @param _fromTimes An array of the moment when the sale lockup period ends and the investor can freely sell his tokens * @param _toTimes An array of the moment when the purchase lockup period ends and the investor can freely purchase tokens from others @@ -218,7 +231,7 @@ contract GeneralTransferManager is ITransferManager { } /** - * @notice adds or removes addresses from the whitelist - can be called by anyone with a valid signature + * @notice Adds or removes addresses from the whitelist - can be called by anyone with a valid signature * @param _investor is the address to whitelist * @param _fromTime is the moment when the sale lockup period ends and the investor can freely sell his tokens * @param _toTime is the moment when the purchase lockup period ends and the investor can freely purchase tokens from others @@ -226,6 +239,7 @@ contract GeneralTransferManager is ITransferManager { * @param _canBuyFromSTO is used to know whether the investor is restricted investor or not. * @param _validFrom is the time that this signature is valid from * @param _validTo is the time that this signature is valid until + * @param _nonce nonce of signature (avoid replay attack) * @param _v issuer signature * @param _r issuer signature * @param _s issuer signature @@ -238,21 +252,29 @@ contract GeneralTransferManager is ITransferManager { bool _canBuyFromSTO, uint256 _validFrom, uint256 _validTo, + uint256 _nonce, uint8 _v, bytes32 _r, bytes32 _s ) public { + /*solium-disable-next-line security/no-block-members*/ require(_validFrom <= now, "ValidFrom is too early"); + /*solium-disable-next-line security/no-block-members*/ require(_validTo >= now, "ValidTo is too late"); - bytes32 hash = keccak256(abi.encodePacked(this, _investor, _fromTime, _toTime, _expiryTime, _canBuyFromSTO, _validFrom, _validTo)); + require(!nonceMap[_investor][_nonce], "Already used signature"); + nonceMap[_investor][_nonce] = true; + bytes32 hash = keccak256( + abi.encodePacked(this, _investor, _fromTime, _toTime, _expiryTime, _canBuyFromSTO, _validFrom, _validTo, _nonce) + ); _checkSig(hash, _v, _r, _s); //Passing a _time == 0 into this function, is equivalent to removing the _investor from the whitelist whitelist[_investor] = TimeRestriction(_fromTime, _toTime, _expiryTime, _canBuyFromSTO); + /*solium-disable-next-line security/no-block-members*/ emit ModifyWhitelist(_investor, now, msg.sender, _fromTime, _toTime, _expiryTime, _canBuyFromSTO); } /** - * @notice used to verify the signature + * @notice Used to verify the signature */ function _checkSig(bytes32 _hash, uint8 _v, bytes32 _r, bytes32 _s) internal view { //Check that the signature is valid @@ -268,7 +290,7 @@ contract GeneralTransferManager is ITransferManager { */ function _onWhitelist(address _investor) internal view returns(bool) { return (((whitelist[_investor].fromTime != 0) || (whitelist[_investor].toTime != 0)) && - (whitelist[_investor].expiryTime >= now)); + (whitelist[_investor].expiryTime >= now)); /*solium-disable-line security/no-block-members*/ } /** diff --git a/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol b/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol index 5ef1953b4..c15eb52aa 100644 --- a/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol @@ -25,13 +25,14 @@ contract GeneralTransferManagerFactory is ModuleFactory { /** - * @notice used to launch the Module with the help of factory + * @notice Used to launch the Module with the help of factory * @return address Contract address of the Module */ function deploy(bytes /* _data */) external returns(address) { if (setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom because of sufficent Allowance is not provided"); address generalTransferManager = new GeneralTransferManager(msg.sender, address(polyToken)); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(generalTransferManager), getName(), address(this), msg.sender, setupCost, now); return address(generalTransferManager); } @@ -46,53 +47,19 @@ contract GeneralTransferManagerFactory is ModuleFactory { return res; } - /** - * @notice Get the name of the Module - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string) { - return title; - } - - /** - * @notice Get the setup cost of the module - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } - /** * @notice Returns the instructions associated with the module */ function getInstructions() external view returns(string) { - return "Allows an issuer to maintain a time based whitelist of authorised token holders.Addresses are added via modifyWhitelist, and take a fromTime (the time from which they can send tokens) and a toTime (the time from which they can receive tokens). There are additional flags, allowAllWhitelistIssuances, allowAllWhitelistTransfers & allowAllTransfers which allow you to set corresponding contract level behaviour. Init function takes no parameters."; + /*solium-disable-next-line max-len*/ + return "Allows an issuer to maintain a time based whitelist of authorised token holders.Addresses are added via modifyWhitelist and take a fromTime (the time from which they can send tokens) and a toTime (the time from which they can receive tokens). There are additional flags, allowAllWhitelistIssuances, allowAllWhitelistTransfers & allowAllTransfers which allow you to set corresponding contract level behaviour. Init function takes no parameters."; } /** * @notice Get the tags related to the module factory */ function getTags() public view returns(bytes32[]) { - bytes32[] memory availableTags = new bytes32[](2); + bytes32[] memory availableTags = new bytes32[](2); availableTags[0] = "General"; availableTags[1] = "Transfer Restriction"; return availableTags; diff --git a/contracts/modules/TransferManager/ManualApprovalTransferManager.sol b/contracts/modules/TransferManager/ManualApprovalTransferManager.sol index 1dcc9f4cd..fd888680a 100644 --- a/contracts/modules/TransferManager/ManualApprovalTransferManager.sol +++ b/contracts/modules/TransferManager/ManualApprovalTransferManager.sol @@ -35,30 +35,30 @@ contract ManualApprovalTransferManager is ITransferManager { mapping (address => mapping (address => ManualBlocking)) public manualBlockings; event AddManualApproval( - address _from, - address _to, + address indexed _from, + address indexed _to, uint256 _allowance, uint256 _expiryTime, - address _addedBy + address indexed _addedBy ); event AddManualBlocking( - address _from, - address _to, + address indexed _from, + address indexed _to, uint256 _expiryTime, - address _addedBy + address indexed _addedBy ); event RevokeManualApproval( - address _from, - address _to, - address _addedBy + address indexed _from, + address indexed _to, + address indexed _addedBy ); event RevokeManualBlocking( - address _from, - address _to, - address _addedBy + address indexed _from, + address indexed _to, + address indexed _addedBy ); /** @@ -87,12 +87,14 @@ contract ManualApprovalTransferManager is ITransferManager { */ function verifyTransfer(address _from, address _to, uint256 _amount, bytes /* _data */, bool _isTransfer) public returns(Result) { // function must only be called by the associated security token if _isTransfer == true - require(_isTransfer == false || msg.sender == securityToken, "Sender is not owner"); + require(_isTransfer == false || msg.sender == securityToken, "Sender is not the owner"); // manual blocking takes precidence over manual approval if (!paused) { + /*solium-disable-next-line security/no-block-members*/ if (manualBlockings[_from][_to].expiryTime >= now) { return Result.INVALID; } + /*solium-disable-next-line security/no-block-members*/ if ((manualApprovals[_from][_to].expiryTime >= now) && (manualApprovals[_from][_to].allowance >= _amount)) { if (_isTransfer) { manualApprovals[_from][_to].allowance = manualApprovals[_from][_to].allowance.sub(_amount); @@ -104,7 +106,7 @@ contract ManualApprovalTransferManager is ITransferManager { } /** - * @notice adds a pair of addresses to manual approvals + * @notice Adds a pair of addresses to manual approvals * @param _from is the address from which transfers are approved * @param _to is the address to which transfers are approved * @param _allowance is the approved amount of tokens @@ -113,6 +115,7 @@ contract ManualApprovalTransferManager is ITransferManager { function addManualApproval(address _from, address _to, uint256 _allowance, uint256 _expiryTime) public withPerm(TRANSFER_APPROVAL) { require(_from != address(0), "Invalid from address"); require(_to != address(0), "Invalid to address"); + /*solium-disable-next-line security/no-block-members*/ require(_expiryTime > now, "Invalid expiry time"); require(manualApprovals[_from][_to].allowance == 0, "Approval already exists"); manualApprovals[_from][_to] = ManualApproval(_allowance, _expiryTime); @@ -120,7 +123,7 @@ contract ManualApprovalTransferManager is ITransferManager { } /** - * @notice adds a pair of addresses to manual blockings + * @notice Adds a pair of addresses to manual blockings * @param _from is the address from which transfers are blocked * @param _to is the address to which transfers are blocked * @param _expiryTime is the time until which the transfer is blocked @@ -128,6 +131,7 @@ contract ManualApprovalTransferManager is ITransferManager { function addManualBlocking(address _from, address _to, uint256 _expiryTime) public withPerm(TRANSFER_APPROVAL) { require(_from != address(0), "Invalid from address"); require(_to != address(0), "Invalid to address"); + /*solium-disable-next-line security/no-block-members*/ require(_expiryTime > now, "Invalid expiry time"); require(manualBlockings[_from][_to].expiryTime == 0, "Blocking already exists"); manualBlockings[_from][_to] = ManualBlocking(_expiryTime); @@ -135,7 +139,7 @@ contract ManualApprovalTransferManager is ITransferManager { } /** - * @notice removes a pairs of addresses from manual approvals + * @notice Removes a pairs of addresses from manual approvals * @param _from is the address from which transfers are approved * @param _to is the address to which transfers are approved */ @@ -147,7 +151,7 @@ contract ManualApprovalTransferManager is ITransferManager { } /** - * @notice removes a pairs of addresses from manual approvals + * @notice Removes a pairs of addresses from manual approvals * @param _from is the address from which transfers are approved * @param _to is the address to which transfers are approved */ @@ -159,7 +163,7 @@ contract ManualApprovalTransferManager is ITransferManager { } /** - * @notice Return the permissions flag that are associated with ManualApproval transfer manager + * @notice Returns the permissions flag that are associated with ManualApproval transfer manager */ function getPermissions() public view returns(bytes32[]) { bytes32[] memory allPermissions = new bytes32[](1); diff --git a/contracts/modules/TransferManager/ManualApprovalTransferManagerFactory.sol b/contracts/modules/TransferManager/ManualApprovalTransferManagerFactory.sol index 4de95959a..f634b33e9 100644 --- a/contracts/modules/TransferManager/ManualApprovalTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/ManualApprovalTransferManagerFactory.sol @@ -34,6 +34,7 @@ contract ManualApprovalTransferManagerFactory is ModuleFactory { if (setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom because of sufficent Allowance is not provided"); address manualTransferManager = new ManualApprovalTransferManager(msg.sender, address(polyToken)); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(manualTransferManager), getName(), address(this), msg.sender, setupCost, now); return address(manualTransferManager); } @@ -47,45 +48,11 @@ contract ManualApprovalTransferManagerFactory is ModuleFactory { return res; } - /** - * @notice Get the name of the Module - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string) { - return title; - } - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the setup cost of the module - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } - /** * @notice Returns the instructions associated with the module */ function getInstructions() external view returns(string) { + /*solium-disable-next-line max-len*/ return "Allows an issuer to set manual approvals or blocks for specific pairs of addresses and amounts. Init function takes no parameters."; } diff --git a/contracts/modules/TransferManager/PercentageTransferManager.sol b/contracts/modules/TransferManager/PercentageTransferManager.sol index 4238cff14..162b090de 100644 --- a/contracts/modules/TransferManager/PercentageTransferManager.sol +++ b/contracts/modules/TransferManager/PercentageTransferManager.sol @@ -92,7 +92,7 @@ contract PercentageTransferManager is ITransferManager { * @notice sets the maximum percentage that an individual token holder can hold * @param _maxHolderPercentage is the new maximum percentage (multiplied by 10**16) */ - function changeHolderPercentage(uint256 _maxHolderPercentage) public onlyOwner { + function changeHolderPercentage(uint256 _maxHolderPercentage) public withPerm(ADMIN) { emit ModifyHolderPercentage(maxHolderPercentage, _maxHolderPercentage); maxHolderPercentage = _maxHolderPercentage; } @@ -104,6 +104,7 @@ contract PercentageTransferManager is ITransferManager { */ function modifyWhitelist(address _investor, bool _valid) public withPerm(WHITELIST) { whitelist[_investor] = _valid; + /*solium-disable-next-line security/no-block-members*/ emit ModifyWhitelist(_investor, now, msg.sender, _valid); } @@ -126,6 +127,7 @@ contract PercentageTransferManager is ITransferManager { function setAllowPrimaryIssuance(bool _allowPrimaryIssuance) public withPerm(ADMIN) { require(_allowPrimaryIssuance != allowPrimaryIssuance, "Must change setting"); allowPrimaryIssuance = _allowPrimaryIssuance; + /*solium-disable-next-line security/no-block-members*/ emit SetAllowPrimaryIssuance(_allowPrimaryIssuance, now); } diff --git a/contracts/modules/TransferManager/PercentageTransferManagerFactory.sol b/contracts/modules/TransferManager/PercentageTransferManagerFactory.sol index 9d6523651..1702b6f08 100644 --- a/contracts/modules/TransferManager/PercentageTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/PercentageTransferManagerFactory.sol @@ -34,7 +34,9 @@ contract PercentageTransferManagerFactory is ModuleFactory { require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom because of sufficent Allowance is not provided"); PercentageTransferManager percentageTransferManager = new PercentageTransferManager(msg.sender, address(polyToken)); require(Util.getSig(_data) == percentageTransferManager.getInitFunction(), "Provided data is not valid"); + /*solium-disable-next-line security/no-low-level-calls*/ require(address(percentageTransferManager).call(_data), "Unsuccessful call"); + /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(percentageTransferManager), getName(), address(this), msg.sender, setupCost, now); return address(percentageTransferManager); @@ -50,41 +52,6 @@ contract PercentageTransferManagerFactory is ModuleFactory { return res; } - /** - * @notice Get the name of the Module - */ - function getName() public view returns(bytes32) { - return name; - } - - /** - * @notice Get the description of the Module - */ - function getDescription() external view returns(string) { - return description; - } - - /** - * @notice Get the title of the Module - */ - function getTitle() external view returns(string) { - return title; - } - - /** - * @notice Get the version of the Module - */ - function getVersion() external view returns(string) { - return version; - } - - /** - * @notice Get the setup cost of the module - */ - function getSetupCost() external view returns (uint256) { - return setupCost; - } - /** * @notice Returns the instructions associated with the module */ @@ -96,7 +63,7 @@ contract PercentageTransferManagerFactory is ModuleFactory { * @notice Get the tags related to the module factory */ function getTags() external view returns(bytes32[]) { - bytes32[] memory availableTags = new bytes32[](2); + bytes32[] memory availableTags = new bytes32[](2); availableTags[0] = "Percentage"; availableTags[1] = "Transfer Restriction"; return availableTags; diff --git a/contracts/oracles/MakerDAOOracle.sol b/contracts/oracles/MakerDAOOracle.sol index 5ed3d02c7..51773cd7d 100644 --- a/contracts/oracles/MakerDAOOracle.sol +++ b/contracts/oracles/MakerDAOOracle.sol @@ -13,6 +13,7 @@ contract MakerDAOOracle is IOracle, Ownable { bool public manualOverride; uint256 public manualPrice; + /*solium-disable-next-line security/no-block-members*/ event ChangeMedianizer(address _newMedianizer, address _oldMedianizer, uint256 _now); event SetManualPrice(uint256 _oldPrice, uint256 _newPrice, uint256 _time); event SetManualOverride(bool _override, uint256 _time); @@ -35,6 +36,7 @@ contract MakerDAOOracle is IOracle, Ownable { */ function changeMedianier(address _medianizer) public onlyOwner { require(_medianizer != address(0), "0x not allowed"); + /*solium-disable-next-line security/no-block-members*/ emit ChangeMedianizer(_medianizer, medianizer, now); medianizer = _medianizer; } @@ -78,6 +80,7 @@ contract MakerDAOOracle is IOracle, Ownable { * @param _price Price to set */ function setManualPrice(uint256 _price) public onlyOwner { + /*solium-disable-next-line security/no-block-members*/ emit SetManualPrice(manualPrice, _price, now); manualPrice = _price; } @@ -88,6 +91,7 @@ contract MakerDAOOracle is IOracle, Ownable { */ function setManualOverride(bool _override) public onlyOwner { manualOverride = _override; + /*solium-disable-next-line security/no-block-members*/ emit SetManualOverride(_override, now); } diff --git a/contracts/oracles/PolyOracle.sol b/contracts/oracles/PolyOracle.sol index 2bcf2b8d1..d46242929 100644 --- a/contracts/oracles/PolyOracle.sol +++ b/contracts/oracles/PolyOracle.sol @@ -8,7 +8,8 @@ import "../interfaces/IOracle.sol"; contract PolyOracle is usingOraclize, IOracle, Ownable { using SafeMath for uint256; - string public oracleURL = '[URL] json(https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?id=2496&convert=USD&CMC_PRO_API_KEY=${[decrypt] BCA0Bqxmn3jkSENepaHxQv09Z/vGdEO9apO+B9RplHyV3qOL/dw5Indlei3hoXrGk9G14My8MFpHJycB7UoVnl+4mlzEsjTlS2UBAYVrl0fAepfiSyM30/GMZAoJmDagY+0YyNZvpkgXn86Q/59Bi48PWEet}).data."2496".quote.USD.price'; + /*solium-disable-next-line max-len*/ + string public oracleURL = "[URL] json(https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?id=2496&convert=USD&CMC_PRO_API_KEY=${[decrypt] BCA0Bqxmn3jkSENepaHxQv09Z/vGdEO9apO+B9RplHyV3qOL/dw5Indlei3hoXrGk9G14My8MFpHJycB7UoVnl+4mlzEsjTlS2UBAYVrl0fAepfiSyM30/GMZAoJmDagY+0YyNZvpkgXn86Q/59Bi48PWEet}).data.\"2496\".quote.USD.price"; string public oracleQueryType = "nested"; uint256 public sanityBounds = 20*10**16; uint256 public gasLimit = 100000; @@ -59,12 +60,13 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { return; } require(requestIds[_requestId] >= latestUpdate, "Result is stale"); + /*solium-disable-next-line security/no-block-members*/ require(requestIds[_requestId] <= now + oraclizeTimeTolerance, "Result is early"); uint256 newPOLYUSD = parseInt(_result, 18); uint256 bound = POLYUSD.mul(sanityBounds).div(10**18); if (latestUpdate != 0) { - require(newPOLYUSD <= POLYUSD.add(bound), "Result is too large"); - require(newPOLYUSD >= POLYUSD.sub(bound), "Result is too small"); + require(newPOLYUSD <= POLYUSD.add(bound), "Result is too large"); + require(newPOLYUSD >= POLYUSD.sub(bound), "Result is too small"); } latestUpdate = requestIds[_requestId]; emit PriceUpdated(newPOLYUSD, POLYUSD, _requestId, latestUpdate); @@ -75,18 +77,22 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @notice Allows owner to schedule future Oraclize calls * @param _times UNIX timestamps to schedule Oraclize calls as of. Empty list means trigger an immediate query. */ - function schedulePriceUpdatesFixed(uint256[] _times) payable isAdminOrOwner public { + function schedulePriceUpdatesFixed(uint256[] _times) public payable isAdminOrOwner { bytes32 requestId; uint256 maximumScheduledUpdated; if (_times.length == 0) { require(oraclize_getPrice(oracleQueryType, gasLimit) <= address(this).balance, "Insufficient Funds"); requestId = oraclize_query(oracleQueryType, oracleURL, gasLimit); + /*solium-disable-next-line security/no-block-members*/ requestIds[requestId] = now; + /*solium-disable-next-line security/no-block-members*/ maximumScheduledUpdated = now; + /*solium-disable-next-line security/no-block-members*/ emit NewOraclizeQuery(now, requestId, oracleURL); } else { require(oraclize_getPrice(oracleQueryType, gasLimit) * _times.length <= address(this).balance, "Insufficient Funds"); for (uint256 i = 0; i < _times.length; i++) { + /*solium-disable-next-line security/no-block-members*/ require(_times[i] >= now, "Past scheduling is not allowed and scheduled time should be absolute timestamp"); requestId = oraclize_query(_times[i], oracleQueryType, oracleURL, gasLimit); requestIds[requestId] = _times[i]; @@ -107,10 +113,11 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @param _interval how long (in seconds) between each subsequent Oraclize query * @param _iters the number of Oraclize queries to schedule. */ - function schedulePriceUpdatesRolling(uint256 _startTime, uint256 _interval, uint256 _iters) payable isAdminOrOwner public { + function schedulePriceUpdatesRolling(uint256 _startTime, uint256 _interval, uint256 _iters) public payable isAdminOrOwner { bytes32 requestId; require(_interval > 0, "Interval between scheduled time should be greater than zero"); require(_iters > 0, "No iterations specified"); + /*solium-disable-next-line security/no-block-members*/ require(_startTime >= now, "Past scheduling is not allowed and scheduled time should be absolute timestamp"); require(oraclize_getPrice(oracleQueryType, gasLimit) * _iters <= address(this).balance, "Insufficient Funds"); for (uint256 i = 0; i < _iters; i++) { @@ -128,9 +135,11 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @notice Allows owner to manually set POLYUSD price * @param _price POLYUSD price */ - function setPOLYUSD(uint256 _price) onlyOwner public { + function setPOLYUSD(uint256 _price) public onlyOwner { + /*solium-disable-next-line security/no-block-members*/ emit PriceUpdated(_price, POLYUSD, 0, now); POLYUSD = _price; + /*solium-disable-next-line security/no-block-members*/ latestUpdate = now; } @@ -138,7 +147,7 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @notice Allows owner to set oracle to ignore all Oraclize pricce updates * @param _frozen true to freeze updates, false to reenable updates */ - function setFreezeOracle(bool _frozen) onlyOwner public { + function setFreezeOracle(bool _frozen) public onlyOwner { freezeOracle = _frozen; } @@ -146,7 +155,7 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @notice Allows owner to set URL used in Oraclize queries * @param _oracleURL URL to use */ - function setOracleURL(string _oracleURL) onlyOwner public { + function setOracleURL(string _oracleURL) public onlyOwner { oracleURL = _oracleURL; } @@ -154,7 +163,7 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @notice Allows owner to set type used in Oraclize queries * @param _oracleQueryType to use */ - function setOracleQueryType(string _oracleQueryType) onlyOwner public { + function setOracleQueryType(string _oracleQueryType) public onlyOwner { oracleQueryType = _oracleQueryType; } @@ -162,7 +171,7 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @notice Allows owner to set new sanity bounds for price updates * @param _sanityBounds sanity bounds as a percentage * 10**16 */ - function setSanityBounds(uint256 _sanityBounds) onlyOwner public { + function setSanityBounds(uint256 _sanityBounds) public onlyOwner { sanityBounds = _sanityBounds; } @@ -171,7 +180,7 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @notice NB - this will only impact newly scheduled Oraclize queries, not future queries which have already been scheduled * @param _gasPrice gas price to use for Oraclize callbacks */ - function setGasPrice(uint256 _gasPrice) onlyOwner public { + function setGasPrice(uint256 _gasPrice) public onlyOwner { oraclize_setCustomGasPrice(_gasPrice); } @@ -180,7 +189,7 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @return latest POLYUSD price * @return timestamp of latest price update */ - function getPriceAndTime() view public returns(uint256, uint256) { + function getPriceAndTime() public view returns(uint256, uint256) { return (POLYUSD, latestUpdate); } @@ -189,7 +198,7 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @notice NB - this will only impact newly scheduled Oraclize queries, not future queries which have already been scheduled * @param _gasLimit gas limit to use for Oraclize callbacks */ - function setGasLimit(uint256 _gasLimit) isAdminOrOwner public { + function setGasLimit(uint256 _gasLimit) public isAdminOrOwner { gasLimit = _gasLimit; } @@ -197,7 +206,7 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @notice Allows owner to set time after which price is considered stale * @param _staleTime elapsed time after which price is considered stale */ - function setStaleTime(uint256 _staleTime) onlyOwner public { + function setStaleTime(uint256 _staleTime) public onlyOwner { staleTime = _staleTime; } @@ -206,7 +215,7 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @param _requestIds Oraclize queryIds (as logged out when Oraclize query is scheduled) * @param _ignore whether or not they should be ignored */ - function setIgnoreRequestIds(bytes32[] _requestIds, bool[] _ignore) onlyOwner public { + function setIgnoreRequestIds(bytes32[] _requestIds, bool[] _ignore) public onlyOwner { require(_requestIds.length == _ignore.length, "Incorrect parameter lengths"); for (uint256 i = 0; i < _requestIds.length; i++) { ignoreRequestIds[_requestIds[i]] = _ignore[i]; @@ -218,8 +227,9 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @param _admin Admin address * @param _valid Whether address should be added or removed from admin list */ - function setAdmin(address _admin, bool _valid) onlyOwner public { + function setAdmin(address _admin, bool _valid) public onlyOwner { admin[_admin] = _valid; + /*solium-disable-next-line security/no-block-members*/ emit AdminSet(_admin, _valid, now); } @@ -227,7 +237,7 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @notice Allows owner to set new time tolerance on Oraclize queries * @param _oraclizeTimeTolerance amount of time in seconds that an Oraclize query can be early */ - function setOraclizeTimeTolerance(uint256 _oraclizeTimeTolerance) onlyOwner public { + function setOraclizeTimeTolerance(uint256 _oraclizeTimeTolerance) public onlyOwner { oraclizeTimeTolerance = _oraclizeTimeTolerance; } @@ -256,7 +266,8 @@ contract PolyOracle is usingOraclize, IOracle, Ownable { * @notice Returns price - should throw if not valid */ function getPrice() external view returns(uint256) { - require(latestUpdate >= now - staleTime); + /*solium-disable-next-line security/no-block-members*/ + require(latestUpdate >= now - staleTime, "Invalid price"); return POLYUSD; } diff --git a/contracts/proxy/ModuleRegistryProxy.sol b/contracts/proxy/ModuleRegistryProxy.sol index ae77cd6b2..aea5a70c5 100644 --- a/contracts/proxy/ModuleRegistryProxy.sol +++ b/contracts/proxy/ModuleRegistryProxy.sol @@ -10,6 +10,7 @@ import "./OwnedUpgradeabilityProxy.sol"; * Besides, it allows upgrading the contract's behaviour towards further implementations, and provides basic * authorization control functionalities */ +/*solium-disable-next-line no-empty-blocks*/ contract ModuleRegistryProxy is EternalStorage, OwnedUpgradeabilityProxy { } \ No newline at end of file diff --git a/contracts/proxy/OwnedUpgradeabilityProxy.sol b/contracts/proxy/OwnedUpgradeabilityProxy.sol index 81a634ec8..7ec520630 100644 --- a/contracts/proxy/OwnedUpgradeabilityProxy.sol +++ b/contracts/proxy/OwnedUpgradeabilityProxy.sol @@ -110,8 +110,9 @@ contract OwnedUpgradeabilityProxy is UpgradeabilityProxy { * @param _data represents the msg.data to bet sent in the low level call. This parameter may include the function * signature of the implementation to be called with the needed payload */ - function upgradeToAndCall(string _newVersion, address _newImplementation, bytes _data) payable external ifOwner { + function upgradeToAndCall(string _newVersion, address _newImplementation, bytes _data) external payable ifOwner { _upgradeTo(_newVersion, _newImplementation); + /*solium-disable-next-line security/no-call-value*/ require(address(this).call.value(msg.value)(_data), "Fail in executing the function of implementation contract"); } diff --git a/contracts/proxy/Proxy.sol b/contracts/proxy/Proxy.sol index adcfc8f46..6cfbce44f 100644 --- a/contracts/proxy/Proxy.sol +++ b/contracts/proxy/Proxy.sol @@ -25,6 +25,7 @@ contract Proxy { * This function will return whatever the implementation call returns */ function _delegate(address implementation) internal { + /*solium-disable-next-line security/no-inline-assembly*/ assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the diff --git a/contracts/proxy/SecurityTokenRegistryProxy.sol b/contracts/proxy/SecurityTokenRegistryProxy.sol index 3ffb3c32e..6acc6e38f 100644 --- a/contracts/proxy/SecurityTokenRegistryProxy.sol +++ b/contracts/proxy/SecurityTokenRegistryProxy.sol @@ -10,6 +10,7 @@ import "./OwnedUpgradeabilityProxy.sol"; * Besides, it allows to upgrade the SecurityTokenRegistry's behaviour towards further implementations, and provides basic * authorization control functionalities */ +/*solium-disable-next-line no-empty-blocks*/ contract SecurityTokenRegistryProxy is EternalStorage, OwnedUpgradeabilityProxy { } \ No newline at end of file diff --git a/contracts/proxy/UpgradeabilityProxy.sol b/contracts/proxy/UpgradeabilityProxy.sol index 52bc121a9..0f7806b71 100644 --- a/contracts/proxy/UpgradeabilityProxy.sol +++ b/contracts/proxy/UpgradeabilityProxy.sol @@ -28,10 +28,13 @@ contract UpgradeabilityProxy is Proxy { * @param _newImplementation representing the address of the new implementation to be set */ function _upgradeTo(string _newVersion, address _newImplementation) internal { - require(__implementation != _newImplementation && _newImplementation != address(0), "Old address is not allowed and implementation address should not be 0x"); + require( + __implementation != _newImplementation && _newImplementation != address(0), + "Old address is not allowed and implementation address should not be 0x" + ); require(AddressUtils.isContract(_newImplementation), "Cannot set a proxy implementation to a non-contract address"); require(bytes(_newVersion).length > 0, "Version should not be empty string"); - require(keccak256(abi.encodePacked(__version)) != keccak256(abi.encodePacked(_newVersion))); + require(keccak256(abi.encodePacked(__version)) != keccak256(abi.encodePacked(_newVersion)), "New version equals to current"); __version = _newVersion; __implementation = _newImplementation; emit Upgraded(_newVersion, _newImplementation); diff --git a/contracts/tokens/SecurityToken.sol b/contracts/tokens/SecurityToken.sol index 2015ab1c7..cfa24baa1 100644 --- a/contracts/tokens/SecurityToken.sol +++ b/contracts/tokens/SecurityToken.sol @@ -38,7 +38,7 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr SemanticVersion securityTokenVersion; - // off-chain data + // off-chain data string public tokenDetails; uint8 constant PERMISSION_KEY = 1; @@ -58,10 +58,10 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr // Used to permanently halt all minting bool public mintingFrozen; - // Use to permanently halt controller actions + // Used to permanently halt controller actions bool public controllerDisabled; - // address whitelisted by issuer as controller + // Address whitelisted by issuer as controller address public controller; // Records added modules - module list should be order agnostic! @@ -111,20 +111,31 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr event CheckpointCreated(uint256 indexed _checkpointId, uint256 _timestamp); // Emit when is permanently frozen by the issuer event FreezeMinting(uint256 _timestamp); - // Change the STR address in the event of a upgrade - event ChangeSTRAddress(address indexed _oldAddress, address indexed _newAddress); // Events to log minting and burning event Minted(address indexed _to, uint256 _value); event Burnt(address indexed _from, uint256 _value); // Events to log controller actions event SetController(address indexed _oldController, address indexed _newController); - event ForceTransfer(address indexed _controller, address indexed _from, address indexed _to, uint256 _value, bool _verifyTransfer, bytes _data); - event ForceBurn(address indexed _controller, address indexed _from, uint256 _value, bool _verifyTransfer, bytes _data); + event ForceTransfer( + address indexed _controller, + address indexed _from, + address indexed _to, + uint256 _value, + bool _verifyTransfer, + bytes _data + ); + event ForceBurn( + address indexed _controller, + address indexed _from, + uint256 _value, + bool _verifyTransfer, + bytes _data + ); event DisableController(uint256 _timestamp); function _isModule(address _module, uint8 _type) internal view returns (bool) { - require(modulesToData[_module].module == _module, "Address mismatch"); + require(modulesToData[_module].module == _module, "Wrong address"); require(!modulesToData[_module].isArchived, "Module archived"); for (uint256 i = 0; i < modulesToData[_module].moduleTypes.length; i++) { if (modulesToData[_module].moduleTypes[i] == _type) { @@ -151,7 +162,7 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr } modifier checkGranularity(uint256 _value) { - require(_value % granularity == 0, "Incorrect granularity"); + require(_value % granularity == 0, "Invalid granularity"); _; } @@ -222,14 +233,14 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr IModuleFactory moduleFactory = IModuleFactory(_moduleFactory); uint8[] memory moduleTypes = moduleFactory.getTypes(); uint256 moduleCost = moduleFactory.getSetupCost(); - require(moduleCost <= _maxCost, "Cost too high"); + require(moduleCost <= _maxCost, "Invalid cost"); //Approve fee for module - require(ERC20(polyToken).approve(_moduleFactory, moduleCost), "Insufficient funds"); + ERC20(polyToken).approve(_moduleFactory, moduleCost); //Creates instance of module from factory address module = moduleFactory.deploy(_data); require(modulesToData[module].module == address(0), "Module exists"); //Approve ongoing budget - require(ERC20(polyToken).approve(module, _budget), "Insufficient funds"); + ERC20(polyToken).approve(module, _budget); //Add to SecurityToken module map bytes32 moduleName = moduleFactory.getName(); uint256[] memory moduleIndexes = new uint256[](moduleTypes.length); @@ -238,9 +249,12 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr moduleIndexes[i] = modules[moduleTypes[i]].length; modules[moduleTypes[i]].push(module); } - modulesToData[module] = TokenLib.ModuleData(moduleName, module, _moduleFactory, false, moduleTypes, moduleIndexes, names[moduleName].length); + modulesToData[module] = TokenLib.ModuleData( + moduleName, module, _moduleFactory, false, moduleTypes, moduleIndexes, names[moduleName].length + ); names[moduleName].push(module); //Emit log event + /*solium-disable-next-line security/no-block-members*/ emit ModuleAdded(moduleTypes, moduleName, _moduleFactory, module, moduleCost, _budget, now); } @@ -265,8 +279,9 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr * @param _module address of module to unarchive */ function removeModule(address _module) external onlyOwner { - require(modulesToData[_module].isArchived, "Module archived"); + require(modulesToData[_module].isArchived, "Not archived"); require(modulesToData[_module].module != address(0), "Module missing"); + /*solium-disable-next-line security/no-block-members*/ emit ModuleRemoved(modulesToData[_module].moduleTypes, _module, now); // Remove from module type list uint8[] memory moduleTypes = modulesToData[_module].moduleTypes; @@ -324,7 +339,7 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr } /** - * @notice returns a list of modules that match the provided name + * @notice Returns a list of modules that match the provided name * @param _name name of the module * @return address[] list of modules with this name */ @@ -333,7 +348,7 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr } /** - * @notice returns a list of modules that match the provided module type + * @notice Returns a list of modules that match the provided module type * @param _type type of the module * @return address[] list of modules with this type */ @@ -342,7 +357,7 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr } /** - * @notice allows the owner to withdraw unspent POLY stored by them on the ST or any ERC20 token. + * @notice Allows the owner to withdraw unspent POLY stored by them on the ST or any ERC20 token. * @dev Owner can transfer POLY to the ST which will be used to pay for modules that require a POLY fee. * @param _tokenContract Address of the ERC20Basic compliance token * @param _value amount of POLY to withdraw @@ -354,19 +369,24 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr } /** - * @notice allows owner to approve more POLY to one of the modules + + * @notice allows owner to increase/decrease POLY approval of one of the modules * @param _module module address - * @param _budget new budget + * @param _change change in allowance + * @param _increase true if budget has to be increased, false if decrease */ - function changeModuleBudget(address _module, uint256 _budget) external onlyOwner { + function changeModuleBudget(address _module, uint256 _change, bool _increase) external onlyOwner { require(modulesToData[_module].module != address(0), "Module missing"); - uint256 _currentAllowance = IERC20(polyToken).allowance(address(this), _module); - if (_budget < _currentAllowance) { - require(IERC20(polyToken).decreaseApproval(_module, _currentAllowance.sub(_budget)), "Insufficient balance"); + uint256 currentAllowance = IERC20(polyToken).allowance(address(this), _module); + uint256 newAllowance; + if (_increase) { + require(IERC20(polyToken).increaseApproval(_module, _change), "IncreaseApproval fail"); + newAllowance = currentAllowance.add(_change); } else { - require(IERC20(polyToken).increaseApproval(_module, _budget.sub(_currentAllowance)), "Insufficient balance"); + require(IERC20(polyToken).decreaseApproval(_module, _change), "Insufficient allowance"); + newAllowance = currentAllowance.sub(_change); } - emit ModuleBudgetChanged(modulesToData[_module].moduleTypes, _module, _currentAllowance, _budget); + emit ModuleBudgetChanged(modulesToData[_module].moduleTypes, _module, currentAllowance, newAllowance); } /** @@ -379,17 +399,17 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr } /** - * @notice allows owner to change token granularity + * @notice Allows owner to change token granularity * @param _granularity granularity level of the token */ function changeGranularity(uint256 _granularity) external onlyOwner { - require(_granularity != 0, "Incorrect granularity"); + require(_granularity != 0, "Invalid granularity"); emit GranularityChanged(granularity, _granularity); granularity = _granularity; } /** - * @notice keeps track of the number of non-zero token holders + * @notice Keeps track of the number of non-zero token holders * @param _from sender of transfer * @param _to receiver of transfer * @param _value value of transfer @@ -399,30 +419,60 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr } /** - * @notice removes addresses with zero balances from the investors list - * @param _start Index in investor list at which to start removing zero balances - * @param _iters Max number of iterations of the for loop - * NB - pruning this list will mean you may not be able to iterate over investors on-chain as of a historical checkpoint - */ - function pruneInvestors(uint256 _start, uint256 _iters) external onlyOwner { - for (uint256 i = _start; i < Math.min256(_start.add(_iters), investorData.investors.length); i++) { - if ((i < investorData.investors.length) && (balanceOf(investorData.investors[i]) == 0)) { - TokenLib.pruneInvestors(investorData, i); + * @notice returns an array of investors + * NB - this length may differ from investorCount as it contains all investors that ever held tokens + * @return list of addresses + */ + function getInvestors() external view returns(address[]) { + return investorData.investors; + } + + /** + * @notice returns an array of investors at a given checkpoint + * NB - this length may differ from investorCount as it contains all investors that ever held tokens + * @param _checkpointId Checkpoint id at which investor list is to be populated + * @return list of investors + */ + function getInvestorsAt(uint256 _checkpointId) external view returns(address[]) { + uint256 count = 0; + uint256 i; + for (i = 0; i < investorData.investors.length; i++) { + if (balanceOfAt(investorData.investors[i], _checkpointId) > 0) { + count++; + } + } + address[] memory investors = new address[](count); + count = 0; + for (i = 0; i < investorData.investors.length; i++) { + if (balanceOfAt(investorData.investors[i], _checkpointId) > 0) { + investors[count] = investorData.investors[i]; + count++; } } + return investors; } /** - * @notice returns an array of investors - * NB - this length may differ from investorCount if list has not been pruned of zero balance investors - * @return length + * @notice generates subset of investors + * NB - can be used in batches if investor list is large + * @param _start Position of investor to start iteration from + * @param _end Position of investor to stop iteration at + * @return list of investors */ - function getInvestors() external view returns(address[]) { - return investorData.investors; + function iterateInvestors(uint256 _start, uint256 _end) external view returns(address[]) { + require(_end <= investorData.investors.length, "Invalid end"); + address[] memory investors = new address[](_end.sub(_start)); + uint256 index = 0; + for (uint256 i = _start; i < _end; i++) { + investors[index] = investorData.investors[i]; + index++; + } + return investors; } /** - * @notice returns the investor count + * @notice Returns the investor count + * @return Investor count */ function getInvestorCount() external view returns(uint256) { return investorData.investorCount; @@ -434,15 +484,17 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr function freezeTransfers() external onlyOwner { require(!transfersFrozen, "Already frozen"); transfersFrozen = true; + /*solium-disable-next-line security/no-block-members*/ emit FreezeTransfers(true, now); } /** - * @notice unfreeze transfers + * @notice Unfreeze transfers */ function unfreezeTransfers() external onlyOwner { require(transfersFrozen, "Not frozen"); transfersFrozen = false; + /*solium-disable-next-line security/no-block-members*/ emit FreezeTransfers(false, now); } @@ -479,7 +531,7 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr * @return bool success */ function transferWithData(address _to, uint256 _value, bytes _data) public returns (bool success) { - require(_updateTransfer(msg.sender, _to, _value, _data), "Transfer not valid"); + require(_updateTransfer(msg.sender, _to, _value, _data), "Transfer invalid"); require(super.transfer(_to, _value)); return true; } @@ -504,7 +556,7 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr * @return bool success */ function transferFromWithData(address _from, address _to, uint256 _value, bytes _data) public returns(bool) { - require(_updateTransfer(_from, _to, _value, _data), "Transfer not valid"); + require(_updateTransfer(_from, _to, _value, _data), "Transfer invalid"); require(super.transferFrom(_from, _to, _value)); return true; } @@ -517,20 +569,28 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr * @param _data data to indicate validation * @return bool success */ - function _updateTransfer(address _from, address _to, uint256 _value, bytes _data) internal returns(bool) { + function _updateTransfer(address _from, address _to, uint256 _value, bytes _data) internal nonReentrant returns(bool) { + // NB - the ordering in this function implies the following: + // - investor counts are updated before transfer managers are called - i.e. transfer managers will see + //investor counts including the current transfer. + // - checkpoints are updated after the transfer managers are called. This allows TMs to create + //checkpoints as though they have been created before the current transactions, + // - to avoid the situation where a transfer manager transfers tokens, and this function is called recursively, + //the function is marked as nonReentrant. This means that no TM can transfer (or mint / burn) tokens. _adjustInvestorCount(_from, _to, _value); + bool verified = _verifyTransfer(_from, _to, _value, _data, true); _adjustBalanceCheckpoints(_from); _adjustBalanceCheckpoints(_to); - return _verifyTransfer(_from, _to, _value, _data, true); + return verified; } /** - * @notice validate transfer with TransferManager module if it exists + * @notice Validate transfer with TransferManager module if it exists * @dev TransferManager module has a key of 2 - * @dev _isTransfer boolean flag is the deciding factor for whether the + * @dev _isTransfer boolean flag is the deciding factor for whether the * state variables gets modified or not within the different modules. i.e isTransfer = true * leads to change in the modules environment otherwise _verifyTransfer() works as a read-only - * function (no change in the state). + * function (no change in the state). * @param _from sender of transfer * @param _to receiver of transfer * @param _value value of transfer @@ -544,28 +604,23 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr uint256 _value, bytes _data, bool _isTransfer - ) internal checkGranularity(_value) returns (bool) { + ) internal checkGranularity(_value) returns (bool) { if (!transfersFrozen) { - if (modules[TRANSFER_KEY].length == 0) { - return true; - } bool isInvalid = false; bool isValid = false; bool isForceValid = false; bool unarchived = false; address module; - for (uint8 i = 0; i < modules[TRANSFER_KEY].length; i++) { + for (uint256 i = 0; i < modules[TRANSFER_KEY].length; i++) { module = modules[TRANSFER_KEY][i]; if (!modulesToData[module].isArchived) { unarchived = true; ITransferManager.Result valid = ITransferManager(module).verifyTransfer(_from, _to, _value, _data, _isTransfer); if (valid == ITransferManager.Result.INVALID) { isInvalid = true; - } - if (valid == ITransferManager.Result.VALID) { + } else if (valid == ITransferManager.Result.VALID) { isValid = true; - } - if (valid == ITransferManager.Result.FORCE_VALID) { + } else if (valid == ITransferManager.Result.FORCE_VALID) { isForceValid = true; } } @@ -577,7 +632,7 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr } /** - * @notice validates a transfer with a TransferManager module if it exists + * @notice Validates a transfer with a TransferManager module if it exists * @dev TransferManager module has a key of 2 * @param _from sender of transfer * @param _to receiver of transfer @@ -595,11 +650,12 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr */ function freezeMinting() external isMintingAllowed() isEnabled("freezeMintingAllowed") onlyOwner { mintingFrozen = true; + /*solium-disable-next-line security/no-block-members*/ emit FreezeMinting(now); } /** - * @notice mints new tokens and assigns them to the target _investor. + * @notice Mints new tokens and assigns them to the target _investor. * @dev Can only be called by the issuer or STO attached to the token * @param _investor Address where the minted tokens will be delivered * @param _value Number of tokens be minted @@ -623,7 +679,7 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr bytes _data ) public onlyModuleOrOwner(MINT_KEY) isMintingAllowed() returns (bool success) { require(_investor != address(0), "Investor is 0"); - require(_updateTransfer(address(0), _investor, _value, _data), "Transfer not valid"); + require(_updateTransfer(address(0), _investor, _value, _data), "Transfer invalid"); _adjustTotalSupplyCheckpoints(); totalSupply_ = totalSupply_.add(_value); balances[_investor] = balances[_investor].add(_value); @@ -633,13 +689,13 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr } /** - * @notice mints new tokens and assigns them to the target _investor. + * @notice Mints new tokens and assigns them to the target _investor. * @dev Can only be called by the issuer or STO attached to the token. * @param _investors A list of addresses to whom the minted tokens will be dilivered * @param _values A list of number of tokens get minted and transfer to corresponding address of the investor from _investor[] list * @return success */ - function mintMulti(address[] _investors, uint256[] _values) external onlyModuleOrOwner(MINT_KEY) returns (bool success) { + function mintMulti(address[] _investors, uint256[] _values) external returns (bool success) { require(_investors.length == _values.length, "Incorrect inputs"); for (uint256 i = 0; i < _investors.length; i++) { mint(_investors[i], _values[i]); @@ -681,7 +737,7 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr * @param _data data to indicate validation */ function burnWithData(uint256 _value, bytes _data) public onlyModule(BURN_KEY) { - require(_burn(msg.sender, _value, _data), "Burn not valid"); + require(_burn(msg.sender, _value, _data), "Burn invalid"); } /** @@ -693,7 +749,7 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr function burnFromWithData(address _from, uint256 _value, bytes _data) public onlyModule(BURN_KEY) { require(_value <= allowed[_from][msg.sender], "Value too high"); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); - require(_burn(_from, _value, _data), "Burn not valid"); + require(_burn(_from, _value, _data), "Burn invalid"); } /** @@ -703,7 +759,9 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr function createCheckpoint() external onlyModuleOrOwner(CHECKPOINT_KEY) returns(uint256) { require(currentCheckpointId < 2**256 - 1); currentCheckpointId = currentCheckpointId + 1; + /*solium-disable-next-line security/no-block-members*/ checkpointTimes.push(now); + /*solium-disable-next-line security/no-block-members*/ emit CheckpointCreated(currentCheckpointId, now); return currentCheckpointId; } @@ -741,24 +799,25 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr * @param _controller address of the controller */ function setController(address _controller) public onlyOwner { - require(!controllerDisabled,"Controller disabled"); + require(!controllerDisabled); emit SetController(controller, _controller); controller = _controller; } /** - * @notice Use by the issuer to permanently disable controller functionality + * @notice Used by the issuer to permanently disable controller functionality * @dev enabled via feature switch "disableControllerAllowed" */ function disableController() external isEnabled("disableControllerAllowed") onlyOwner { - require(!controllerDisabled,"Controller disabled"); + require(!controllerDisabled); controllerDisabled = true; delete controller; + /*solium-disable-next-line security/no-block-members*/ emit DisableController(now); } /** - * @notice Use by a controller to execute a forced transfer + * @notice Used by a controller to execute a forced transfer * @param _from address from which to take tokens * @param _to address where to send tokens * @param _value amount of tokens to transfer @@ -776,7 +835,7 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr } /** - * @notice Use by a controller to execute a forced burn + * @notice Used by a controller to execute a forced burn * @param _from address from which to take tokens * @param _value amount of tokens to transfer * @param _data data to indicate validation diff --git a/docs/permissions_list.md b/docs/permissions_list.md index 4592474ea..b49c95a0e 100644 --- a/docs/permissions_list.md +++ b/docs/permissions_list.md @@ -199,11 +199,10 @@ setAllowPrimaryIssuance() - withPerm(ADMIN) + withPerm(ADMIN) changeHolderPercentage() - onlyOwner() LockupVolumeRestrictionTM diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index 0994e249e..694fdf03e 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -59,7 +59,7 @@ module.exports = function (deployer, network, accounts) { } else if (network === 'kovan') { web3 = new Web3(new Web3.providers.HttpProvider('https://kovan.infura.io/g5xfoQ0jFSE9S5LwM1Ei')) PolymathAccount = accounts[0] - PolyToken = '0xb06d72a24df50d4e2cac133b320c5e7de3ef94cb' // PolyToken Kovan Faucet Address + PolyToken = '0xb347b9f5b56b431b2cf4e1d90a5995f7519ca792' // PolyToken Kovan Faucet Address POLYOracle = '0x461d98EF2A0c7Ac1416EF065840fF5d4C946206C' // Poly Oracle Kovan Address ETHOracle = '0xCE5551FC9d43E9D2CC255139169FC889352405C8' // ETH Oracle Kovan Address } else if (network === 'mainnet') { diff --git a/package.json b/package.json index 8c322e8c0..b350b4ac6 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "lint:all": "npm run lint && npm run lint:sol", "lint:all:fix": "npm run lint:fix && npm run lint:sol:fix", "compile": "truffle compile --optimize-runs 200", - "ganache-cli": "node_modules/.bin/ganache-cli -i 15 --gasLimit 90000000", + "ganache-cli": "node_modules/.bin/ganache-cli -i 15 --gasLimit 8000000", "migrate:local": "truffle migrate --network=development --reset --all", "migrate:ropsten": "truffle migrate --network=ropsten --reset --all", "migrate:kovan": "truffle migrate --network=kovan --reset --all", @@ -28,7 +28,9 @@ "flatten-token": "sol-merger './contracts/tokens/*.sol' ./flat/tokens", "flatten-mocks": "sol-merger './contracts/mocks/*.sol' ./flat/mocks", "flatten-oracles": "sol-merger './contracts/oracles/*.sol' ./flat/oracles", + "flatten-proxies": "sol-merger './contracts/proxy/*.sol' ./flat/proxy", "flatten": "sol-merger './contracts/*.sol' ./flat", + "flatten-all": "npm run flatten-modules && npm run flatten-token && npm run flatten-mocks && npm run flatten-oracles && npm run flatten-proxies && npm run flatten", "ethereum-bridge": "node_modules/.bin/ethereum-bridge -H localhost:8545 -a 9 --dev", "st20generator": "node demo/ST20Generator", "pretty": "prettier --write --print-width 140 --tab-width 4 \"**/*.js\"" @@ -93,5 +95,10 @@ "solium": "^1.1.6", "truffle": "^4.1.13", "truffle-wallet-provider": "0.0.5" + }, + "greenkeeper": { + "ignore": [ + "openzeppelin-solidity" + ] } } diff --git a/scripts/tokenInfo.js b/scripts/tokenInfo.js new file mode 100644 index 000000000..e8a59ca1a --- /dev/null +++ b/scripts/tokenInfo.js @@ -0,0 +1,72 @@ +const Web3 = require("web3"); +const fs = require("fs"); +const async = require("async"); +const path = require("path"); +const web3 = new Web3(new Web3.providers.HttpProvider("https://mainnet.infura.io/")); + +const securityTokenRegistryABI = JSON.parse(require('fs').readFileSync('../build/contracts/SecurityTokenRegistry.json').toString()).abi; +const securityTokenABI = JSON.parse(require('fs').readFileSync('../build/contracts/SecurityToken.json').toString()).abi; +const generalTransferManagerABI = JSON.parse(require('fs').readFileSync('../build/contracts/GeneralTransferManager.json').toString()).abi; +const securityTokenRegistryAddress = "0xEf58491224958d978fACF55D2120c55A24516B98"; +const securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); + +async function getTokens() { + let strEvents = await web3.eth.getPastLogs({fromBlock:'0x5C5C18', address:securityTokenRegistry.address, topics: ["0x2510d802a0818e71139a7680a6388bcffcd3fa686e02a0f7319488c5bdb38fcb"]}); + for (let i = 0; i < strEvents.length; i++) { + let tokenAddress = '0x' + strEvents[i].topics[1].slice(26,66) + try { + await getInfo(tokenAddress); + } catch(exception) { + console.log('Failed to load info of', tokenAddress, exception); + } + } +} + +async function getInfo(tokenAddress) { + let token = new web3.eth.Contract(securityTokenABI, tokenAddress); + console.log("Token - " + tokenAddress); + console.log("----------------------"); + console.log("Owner: " + await token.methods.owner().call()); + console.log("Name: " + await token.methods.name().call()); + console.log("Symbol: " + await token.methods.symbol().call()); + console.log("Total Supply: " + await token.methods.totalSupply().call()); + console.log("Frozen: " + await token.methods.freeze().call()); + console.log("Investors: " + await token.methods.investorCount().call()); + console.log("Latest Checkpoint: " + await token.methods.currentCheckpointId().call()); + console.log("Finished Issuer Minting: " + await token.methods.finishedIssuerMinting().call()); + console.log("Finished STO Minting: " + await token.methods.finishedSTOMinting().call()); + let gtmRes = await token.methods.modules(2, 0).call(); + let gtmEvents = await web3.eth.getPastLogs({fromBlock:'0x5C5C18', address:gtmRes.moduleAddress}); + console.log("Count of GeneralTransferManager Events: " + gtmEvents.length); + console.log("Modules Attached (TransferManager):"); + await getModules(2, token); + console.log("Modules Attached (PermissionManager):"); + await getModules(1, token); + console.log("Modules Attached (STO):"); + await getModules(3, token); + console.log("Modules Attached (Checkpoint):"); + await getModules(4, token); + console.log("") + console.log(); + console.log(); +} + +async function getModules(type, token) { + let index = 0; + while (true) { + try { + let res = await token.methods.modules(type, index).call(); + console.log(" Name: " + web3.utils.toAscii(res.name)); + console.log(" Address: " + res.moduleAddress); + } catch (err) { + // console.log(err); + if (index == 0) { + console.log(" None"); + } + return; + } + index = index + 1; + } +} + +getTokens(); diff --git a/test/b_capped_sto.js b/test/b_capped_sto.js index 58d2335d3..d89fe6eba 100644 --- a/test/b_capped_sto.js +++ b/test/b_capped_sto.js @@ -850,15 +850,15 @@ contract("CappedSTO", accounts => { describe("Test cases for the CappedSTOFactory", async () => { it("should get the exact details of the factory", async () => { - assert.equal((await I_CappedSTOFactory.setupCost.call()).toNumber(), cappedSTOSetupCost); + assert.equal((await I_CappedSTOFactory.getSetupCost.call()).toNumber(), cappedSTOSetupCost); assert.equal((await I_CappedSTOFactory.getTypes.call())[0], 3); assert.equal(web3.utils.hexToString(await I_CappedSTOFactory.getName.call()), "CappedSTO", "Wrong Module added"); assert.equal( - await I_CappedSTOFactory.getDescription.call(), + await I_CappedSTOFactory.description.call(), "Use to collects the funds and once the cap is reached then investment will be no longer entertained", "Wrong Module added" ); - assert.equal(await I_CappedSTOFactory.getTitle.call(), "Capped STO", "Wrong Module added"); + assert.equal(await I_CappedSTOFactory.title.call(), "Capped STO", "Wrong Module added"); assert.equal( await I_CappedSTOFactory.getInstructions.call(), "Initialises a capped STO. Init parameters are _startTime (time STO starts), _endTime (time STO ends), _cap (cap in tokens for STO), _rate (POLY/ETH to token rate), _fundRaiseType (whether you are raising in POLY or ETH), _polyToken (address of POLY token), _fundsReceiver (address which will receive funds)", @@ -866,7 +866,7 @@ contract("CappedSTO", accounts => { ); let tags = await I_CappedSTOFactory.getTags.call(); assert.equal(web3.utils.hexToString(tags[0]), "Capped"); - assert.equal(await I_CappedSTOFactory.getVersion.call(), "1.0.0"); + assert.equal(await I_CappedSTOFactory.version.call(), "1.0.0"); }); it("Should fail to change the title -- bad owner", async () => { @@ -879,7 +879,7 @@ contract("CappedSTO", accounts => { it("Should successfully change the title", async () => { await I_CappedSTOFactory.changeTitle("STO Capped", { from: token_owner }); - assert.equal(await I_CappedSTOFactory.getTitle.call(), "STO Capped", "Title doesn't get changed"); + assert.equal(await I_CappedSTOFactory.title.call(), "STO Capped", "Title doesn't get changed"); }); it("Should fail to change the description -- bad owner", async () => { @@ -892,7 +892,7 @@ contract("CappedSTO", accounts => { it("Should successfully change the description", async () => { await I_CappedSTOFactory.changeDescription("It is only a STO", { from: token_owner }); - assert.equal(await I_CappedSTOFactory.getDescription.call(), "It is only a STO", "Description doesn't get changed"); + assert.equal(await I_CappedSTOFactory.description.call(), "It is only a STO", "Description doesn't get changed"); }); it("Should fail to change the name -- bad owner", async () => { diff --git a/test/d_count_transfer_manager.js b/test/d_count_transfer_manager.js index 6db725c74..1a1e7717a 100644 --- a/test/d_count_transfer_manager.js +++ b/test/d_count_transfer_manager.js @@ -350,7 +350,7 @@ contract("CountTransferManager", accounts => { describe("Test cases for the factory", async () => { it("should get the exact details of the factory", async () => { - assert.equal(await I_CountTransferManagerFactory.setupCost.call(), 0); + assert.equal(await I_CountTransferManagerFactory.getSetupCost.call(), 0); assert.equal((await I_CountTransferManagerFactory.getTypes.call())[0], 2); assert.equal( web3.utils.toAscii(await I_CountTransferManagerFactory.getName.call()).replace(/\u0000/g, ""), @@ -358,11 +358,11 @@ contract("CountTransferManager", accounts => { "Wrong Module added" ); assert.equal( - await I_CountTransferManagerFactory.getDescription.call(), + await I_CountTransferManagerFactory.description.call(), "Restrict the number of investors", "Wrong Module added" ); - assert.equal(await I_CountTransferManagerFactory.getTitle.call(), "Count Transfer Manager", "Wrong Module added"); + assert.equal(await I_CountTransferManagerFactory.title.call(), "Count Transfer Manager", "Wrong Module added"); assert.equal( await I_CountTransferManagerFactory.getInstructions.call(), "Allows an issuer to restrict the total number of non-zero token holders", @@ -424,7 +424,7 @@ contract("CountTransferManager", accounts => { it("Should successfully change the version of the fatory", async() => { await I_CountTransferManagerFactory.changeVersion("5.0.0", {from: account_polymath}); - assert.equal(await I_CountTransferManagerFactory.getVersion.call(), "5.0.0"); + assert.equal(await I_CountTransferManagerFactory.version.call(), "5.0.0"); }); }) diff --git a/test/e_erc20_dividends.js b/test/e_erc20_dividends.js index f2186845d..b832bcee2 100644 --- a/test/e_erc20_dividends.js +++ b/test/e_erc20_dividends.js @@ -1103,20 +1103,20 @@ contract("ERC20DividendCheckpoint", accounts => { describe("Test cases for the ERC20DividendCheckpointFactory", async () => { it("should get the exact details of the factory", async () => { - assert.equal((await I_ERC20DividendCheckpointFactory.setupCost.call()).toNumber(), 0); + assert.equal((await I_ERC20DividendCheckpointFactory.getSetupCost.call()).toNumber(), 0); assert.equal((await I_ERC20DividendCheckpointFactory.getTypes.call())[0], 4); - assert.equal(await I_ERC20DividendCheckpointFactory.getVersion.call(), "1.0.0"); + assert.equal(await I_ERC20DividendCheckpointFactory.version.call(), "1.0.0"); assert.equal( web3.utils.toAscii(await I_ERC20DividendCheckpointFactory.getName.call()).replace(/\u0000/g, ""), "ERC20DividendCheckpoint", "Wrong Module added" ); assert.equal( - await I_ERC20DividendCheckpointFactory.getDescription.call(), + await I_ERC20DividendCheckpointFactory.description.call(), "Create ERC20 dividends for token holders at a specific checkpoint", "Wrong Module added" ); - assert.equal(await I_ERC20DividendCheckpointFactory.getTitle.call(), "ERC20 Dividend Checkpoint", "Wrong Module added"); + assert.equal(await I_ERC20DividendCheckpointFactory.title.call(), "ERC20 Dividend Checkpoint", "Wrong Module added"); assert.equal( await I_ERC20DividendCheckpointFactory.getInstructions.call(), "Create ERC20 dividend to be paid out to token holders based on their balances at dividend creation time", diff --git a/test/f_ether_dividends.js b/test/f_ether_dividends.js index 1e6884e39..b4e5bbf2b 100644 --- a/test/f_ether_dividends.js +++ b/test/f_ether_dividends.js @@ -952,23 +952,23 @@ contract("EtherDividendCheckpoint", accounts => { describe("Test cases for the EtherDividendCheckpointFactory", async () => { it("should get the exact details of the factory", async () => { - assert.equal((await I_EtherDividendCheckpointFactory.setupCost.call()).toNumber(), 0); + assert.equal((await I_EtherDividendCheckpointFactory.getSetupCost.call()).toNumber(), 0); assert.equal((await I_EtherDividendCheckpointFactory.getTypes.call())[0], 4); - assert.equal(await I_EtherDividendCheckpointFactory.getVersion.call(), "1.0.0"); + assert.equal(await I_EtherDividendCheckpointFactory.version.call(), "1.0.0"); assert.equal( web3.utils.toAscii(await I_EtherDividendCheckpointFactory.getName.call()).replace(/\u0000/g, ""), "EtherDividendCheckpoint", "Wrong Module added" ); assert.equal( - await I_EtherDividendCheckpointFactory.getDescription.call(), + await I_EtherDividendCheckpointFactory.description.call(), "Create ETH dividends for token holders at a specific checkpoint", "Wrong Module added" ); - assert.equal(await I_EtherDividendCheckpointFactory.getTitle.call(), "Ether Dividend Checkpoint", "Wrong Module added"); + assert.equal(await I_EtherDividendCheckpointFactory.title.call(), "Ether Dividend Checkpoint", "Wrong Module added"); assert.equal( await I_EtherDividendCheckpointFactory.getInstructions.call(), - "Create a dividend which will be paid out to token holders proportional to their balances at the point the dividend is created", + "Create a dividend which will be paid out to token holders proportionally according to their balances at the point the dividend is created", "Wrong Module added" ); let tags = await I_EtherDividendCheckpointFactory.getTags.call(); diff --git a/test/g_general_permission_manager.js b/test/g_general_permission_manager.js index 29da205b3..d554891ee 100644 --- a/test/g_general_permission_manager.js +++ b/test/g_general_permission_manager.js @@ -392,23 +392,23 @@ contract('GeneralPermissionManager', accounts => { describe("General Permission Manager Factory test cases", async () => { it("should get the exact details of the factory", async () => { - assert.equal(await I_GeneralPermissionManagerFactory.setupCost.call(), 0); + assert.equal(await I_GeneralPermissionManagerFactory.getSetupCost.call(), 0); assert.equal((await I_GeneralPermissionManagerFactory.getTypes.call())[0], 1); - assert.equal(await I_GeneralPermissionManagerFactory.getVersion.call(), "1.0.0"); + assert.equal(await I_GeneralPermissionManagerFactory.version.call(), "1.0.0"); assert.equal( web3.utils.toAscii(await I_GeneralPermissionManagerFactory.getName.call()).replace(/\u0000/g, ""), "GeneralPermissionManager", "Wrong Module added" ); assert.equal( - await I_GeneralPermissionManagerFactory.getDescription.call(), + await I_GeneralPermissionManagerFactory.description.call(), "Manage permissions within the Security Token and attached modules", "Wrong Module added" ); - assert.equal(await I_GeneralPermissionManagerFactory.getTitle.call(), "General Permission Manager", "Wrong Module added"); + assert.equal(await I_GeneralPermissionManagerFactory.title.call(), "General Permission Manager", "Wrong Module added"); assert.equal( await I_GeneralPermissionManagerFactory.getInstructions.call(), - "Add and remove permissions for the SecurityToken and associated modules. Permission types should be encoded as bytes32 values, and attached using the withPerm modifier to relevant functions.No initFunction required.", + "Add and remove permissions for the SecurityToken and associated modules. Permission types should be encoded as bytes32 values and attached using withPerm modifier to relevant functions. No initFunction required.", "Wrong Module added" ); }); @@ -419,7 +419,7 @@ contract('GeneralPermissionManager', accounts => { }); it("Should ge the version of the factory", async() => { - let version = await I_GeneralPermissionManagerFactory.getVersion.call(); + let version = await I_GeneralPermissionManagerFactory.version.call(); assert.equal(version, "1.0.0"); }) }); diff --git a/test/h_general_transfer_manager.js b/test/h_general_transfer_manager.js index c40809d8b..3e060c288 100644 --- a/test/h_general_transfer_manager.js +++ b/test/h_general_transfer_manager.js @@ -352,6 +352,7 @@ contract("GeneralTransferManager", accounts => { //tmAddress, investorAddress, fromTime, toTime, validFrom, validTo, pk let validFrom = latestTime(); let validTo = latestTime() + duration.days(5); + let nonce = 5; const sig = signData( account_investor2, account_investor2, @@ -361,6 +362,7 @@ contract("GeneralTransferManager", accounts => { true, validFrom, validTo, + nonce, token_owner_pk ); @@ -377,6 +379,7 @@ contract("GeneralTransferManager", accounts => { true, validFrom, validTo, + nonce, v, r, s, @@ -393,6 +396,7 @@ contract("GeneralTransferManager", accounts => { //tmAddress, investorAddress, fromTime, toTime, validFrom, validTo, pk let validFrom = latestTime() - 100; let validTo = latestTime() - 1; + let nonce = 5; const sig = signData( I_GeneralTransferManager.address, account_investor2, @@ -402,6 +406,7 @@ contract("GeneralTransferManager", accounts => { true, validFrom, validTo, + nonce, token_owner_pk ); @@ -418,6 +423,7 @@ contract("GeneralTransferManager", accounts => { true, validFrom, validTo, + nonce, v, r, s, @@ -434,7 +440,7 @@ contract("GeneralTransferManager", accounts => { //tmAddress, investorAddress, fromTime, toTime, validFrom, validTo, pk let validFrom = latestTime(); let validTo = latestTime() + 60 * 60; - + let nonce = 5; const sig = signData( account_investor2, account_investor2, @@ -444,6 +450,7 @@ contract("GeneralTransferManager", accounts => { true, validFrom, validTo, + nonce, "2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501200" ); @@ -460,6 +467,7 @@ contract("GeneralTransferManager", accounts => { true, validFrom, validTo, + nonce, v, r, s, @@ -476,6 +484,7 @@ contract("GeneralTransferManager", accounts => { //tmAddress, investorAddress, fromTime, toTime, validFrom, validTo, pk let validFrom = latestTime(); let validTo = latestTime() + duration.days(5); + let nonce = 5; const sig = signData( I_GeneralTransferManager.address, account_investor2, @@ -485,12 +494,14 @@ contract("GeneralTransferManager", accounts => { true, validFrom, validTo, + nonce, token_owner_pk ); const r = `0x${sig.r.toString("hex")}`; const s = `0x${sig.s.toString("hex")}`; const v = sig.v; + let tx = await I_GeneralTransferManager.modifyWhitelistSigned( account_investor2, latestTime(), @@ -499,6 +510,7 @@ contract("GeneralTransferManager", accounts => { true, validFrom, validTo, + nonce, v, r, s, @@ -523,6 +535,49 @@ contract("GeneralTransferManager", accounts => { assert.equal((await I_SecurityToken.balanceOf(account_investor2)).toNumber(), web3.utils.toWei("1", "ether")); }); + it("Should fail if the txn is generated with same nonce", async() => { + // Add the Investor in to the whitelist + //tmAddress, investorAddress, fromTime, toTime, validFrom, validTo, pk + let validFrom = latestTime(); + let validTo = latestTime() + duration.days(5); + let nonce = 5; + const sig = signData( + I_GeneralTransferManager.address, + account_investor2, + latestTime(), + latestTime() + duration.days(80), + expiryTime + duration.days(200), + true, + validFrom, + validTo, + nonce, + token_owner_pk + ); + + const r = `0x${sig.r.toString("hex")}`; + const s = `0x${sig.s.toString("hex")}`; + const v = sig.v; + + await catchRevert(I_GeneralTransferManager.modifyWhitelistSigned( + account_investor2, + latestTime(), + latestTime() + duration.days(80), + expiryTime + duration.days(200), + true, + validFrom, + validTo, + nonce, + v, + r, + s, + { + from: account_investor2, + gas: 6000000 + } + ) + ); + }) + it("Should fail in changing the signing address", async () => { await catchRevert(I_GeneralTransferManager.changeSigningAddress(account_polymath, { from: account_investor4 })); }); @@ -554,7 +609,7 @@ contract("GeneralTransferManager", accounts => { }); it("Should set a budget for the GeneralTransferManager", async () => { - await I_SecurityToken.changeModuleBudget(I_GeneralTransferManager.address, 10 * Math.pow(10, 18), { from: token_owner }); + await I_SecurityToken.changeModuleBudget(I_GeneralTransferManager.address, 10 * Math.pow(10, 18), true, { from: token_owner }); await catchRevert(I_GeneralTransferManager.takeFee(web3.utils.toWei("1", "ether"), { from: token_owner })); await I_PolyToken.getTokens(10 * Math.pow(10, 18), token_owner); @@ -706,7 +761,7 @@ contract("GeneralTransferManager", accounts => { describe("General Transfer Manager Factory test cases", async () => { it("Should get the exact details of the factory", async () => { - assert.equal(await I_GeneralTransferManagerFactory.setupCost.call(), 0); + assert.equal(await I_GeneralTransferManagerFactory.getSetupCost.call(), 0); assert.equal((await I_GeneralTransferManagerFactory.getTypes.call())[0], 2); assert.equal( web3.utils.toAscii(await I_GeneralTransferManagerFactory.getName.call()).replace(/\u0000/g, ""), @@ -714,17 +769,17 @@ contract("GeneralTransferManager", accounts => { "Wrong Module added" ); assert.equal( - await I_GeneralTransferManagerFactory.getDescription.call(), + await I_GeneralTransferManagerFactory.description.call(), "Manage transfers using a time based whitelist", "Wrong Module added" ); - assert.equal(await I_GeneralTransferManagerFactory.getTitle.call(), "General Transfer Manager", "Wrong Module added"); + assert.equal(await I_GeneralTransferManagerFactory.title.call(), "General Transfer Manager", "Wrong Module added"); assert.equal( await I_GeneralTransferManagerFactory.getInstructions.call(), - "Allows an issuer to maintain a time based whitelist of authorised token holders.Addresses are added via modifyWhitelist, and take a fromTime (the time from which they can send tokens) and a toTime (the time from which they can receive tokens). There are additional flags, allowAllWhitelistIssuances, allowAllWhitelistTransfers & allowAllTransfers which allow you to set corresponding contract level behaviour. Init function takes no parameters.", + "Allows an issuer to maintain a time based whitelist of authorised token holders.Addresses are added via modifyWhitelist and take a fromTime (the time from which they can send tokens) and a toTime (the time from which they can receive tokens). There are additional flags, allowAllWhitelistIssuances, allowAllWhitelistTransfers & allowAllTransfers which allow you to set corresponding contract level behaviour. Init function takes no parameters.", "Wrong Module added" ); - assert.equal(await I_GeneralPermissionManagerFactory.getVersion.call(), "1.0.0"); + assert.equal(await I_GeneralPermissionManagerFactory.version.call(), "1.0.0"); }); it("Should get the tags of the factory", async () => { @@ -735,15 +790,15 @@ contract("GeneralTransferManager", accounts => { describe("Dummy STO Factory test cases", async () => { it("should get the exact details of the factory", async () => { - assert.equal(await I_DummySTOFactory.setupCost.call(), 0); + assert.equal(await I_DummySTOFactory.getSetupCost.call(), 0); assert.equal((await I_DummySTOFactory.getTypes.call())[0], 3); assert.equal( web3.utils.toAscii(await I_DummySTOFactory.getName.call()).replace(/\u0000/g, ""), "DummySTO", "Wrong Module added" ); - assert.equal(await I_DummySTOFactory.getDescription.call(), "Dummy STO", "Wrong Module added"); - assert.equal(await I_DummySTOFactory.getTitle.call(), "Dummy STO", "Wrong Module added"); + assert.equal(await I_DummySTOFactory.description.call(), "Dummy STO", "Wrong Module added"); + assert.equal(await I_DummySTOFactory.title.call(), "Dummy STO", "Wrong Module added"); assert.equal(await I_DummySTOFactory.getInstructions.call(), "Dummy STO - you can mint tokens at will", "Wrong Module added"); }); @@ -753,7 +808,7 @@ contract("GeneralTransferManager", accounts => { }); it("Should get the version of factory", async() => { - let version = await I_DummySTOFactory.getVersion.call(); + let version = await I_DummySTOFactory.version.call(); assert.equal(version, "1.0.0"); }); }); diff --git a/test/helpers/createInstances.js b/test/helpers/createInstances.js index f72ab54e3..2021d350e 100644 --- a/test/helpers/createInstances.js +++ b/test/helpers/createInstances.js @@ -14,6 +14,7 @@ const ManualApprovalTransferManagerFactory = artifacts.require("./ManualApproval const SingleTradeVolumeRestrictionManagerFactory = artifacts.require('./SingleTradeVolumeRestrictionTMFactory.sol'); const TrackedRedemptionFactory = artifacts.require("./TrackedRedemptionFactory.sol"); const PercentageTransferManagerFactory = artifacts.require("./PercentageTransferManagerFactory.sol"); +const ScheduledCheckpointFactory = artifacts.require('./ScheduledCheckpointFactory.sol'); const USDTieredSTOFactory = artifacts.require("./USDTieredSTOFactory.sol"); const USDTieredSTOProxyFactory = artifacts.require("./USDTieredSTOProxyFactory"); const ManualApprovalTransferManager = artifacts.require("./ManualApprovalTransferManager"); @@ -37,6 +38,7 @@ const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); let I_USDTieredSTOProxyFactory; let I_USDTieredSTOFactory; let I_TrackedRedemptionFactory; +let I_ScheduledCheckpointFactory; let I_MockBurnFactory; let I_MockWrongTypeBurnFactory; let I_SingleTradeVolumeRestrictionManagerFactory; @@ -265,6 +267,18 @@ export async function deploySingleTradeVolumeRMAndVerified(accountPolymath, MRPr return new Array(I_SingleTradeVolumeRestrictionManagerFactory); } +export async function deployScheduleCheckpointAndVerified(accountPolymath, MRProxyInstance, polyToken, setupCost) { + I_ScheduledCheckpointFactory = await ScheduledCheckpointFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath }); + assert.notEqual( + I_ScheduledCheckpointFactory.address.valueOf(), + "0x0000000000000000000000000000000000000000", + "ScheduledCheckpointFactory contract was not deployed" + ); + + await registerAndVerifyByMR(I_ScheduledCheckpointFactory.address, accountPolymath, MRProxyInstance); + return new Array(I_ScheduledCheckpointFactory); +} + /// Deploy the Permission Manager export async function deployGPMAndVerifyed(accountPolymath, MRProxyInstance, polyToken, setupCost) { @@ -311,7 +325,7 @@ export async function deployCappedSTOAndVerifyed(accountPolymath, MRProxyInstanc export async function deployPresaleSTOAndVerified(accountPolymath, MRProxyInstance, polyToken, setupCost) { I_PreSaleSTOFactory = await PreSaleSTOFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath }); - + assert.notEqual( I_PreSaleSTOFactory.address.valueOf(), "0x0000000000000000000000000000000000000000", @@ -326,14 +340,14 @@ export async function deployUSDTieredSTOAndVerified(accountPolymath, MRProxyInst I_USDTieredSTOProxyFactory = await USDTieredSTOProxyFactory.new({from: accountPolymath}); I_USDTieredSTOFactory = await USDTieredSTOFactory.new(polyToken, setupCost, 0, 0, I_USDTieredSTOProxyFactory.address, { from: accountPolymath }); - + assert.notEqual( I_USDTieredSTOFactory.address.valueOf(), "0x0000000000000000000000000000000000000000", "USDTieredSTOFactory contract was not deployed" ); - await registerAndVerifyByMR(I_USDTieredSTOFactory.address, accountPolymath, MRProxyInstance); + await registerAndVerifyByMR(I_USDTieredSTOFactory.address, accountPolymath, MRProxyInstance); return new Array(I_USDTieredSTOFactory); } @@ -419,4 +433,4 @@ function mergeReturn(returnData) { } } return returnArray; -} \ No newline at end of file +} diff --git a/test/helpers/signData.js b/test/helpers/signData.js index 9d8b33380..ea7476cc3 100644 --- a/test/helpers/signData.js +++ b/test/helpers/signData.js @@ -3,11 +3,11 @@ const utils = ethers.utils; const ethUtil = require("ethereumjs-util"); //this, _investor, _fromTime, _toTime, _validTo -function signData(tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, pk) { +function signData(tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, nonce, pk) { let packedData = utils .solidityKeccak256( - ["address", "address", "uint256", "uint256", "uint256", "bool", "uint256", "uint256"], - [tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo] + ["address", "address", "uint256", "uint256", "uint256", "bool", "uint256", "uint256", "uint256"], + [tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, nonce] ) .slice(2); packedData = new Buffer(packedData, "hex"); diff --git a/test/j_manual_approval_transfer_manager.js b/test/j_manual_approval_transfer_manager.js index 0a1346f31..709991b92 100644 --- a/test/j_manual_approval_transfer_manager.js +++ b/test/j_manual_approval_transfer_manager.js @@ -536,13 +536,13 @@ contract("ManualApprovalTransferManager", accounts => { describe("ManualApproval Transfer Manager Factory test cases", async () => { it("Should get the exact details of the factory", async () => { - assert.equal(await I_ManualApprovalTransferManagerFactory.setupCost.call(), 0); + assert.equal(await I_ManualApprovalTransferManagerFactory.getSetupCost.call(), 0); assert.equal((await I_ManualApprovalTransferManagerFactory.getTypes.call())[0], 2); let name = web3.utils.toUtf8(await I_ManualApprovalTransferManagerFactory.getName.call()); assert.equal(name, "ManualApprovalTransferManager", "Wrong Module added"); - let desc = await I_ManualApprovalTransferManagerFactory.getDescription.call(); + let desc = await I_ManualApprovalTransferManagerFactory.description.call(); assert.equal(desc, "Manage transfers using single approvals / blocking", "Wrong Module added"); - let title = await I_ManualApprovalTransferManagerFactory.getTitle.call(); + let title = await I_ManualApprovalTransferManagerFactory.title.call(); assert.equal(title, "Manual Approval Transfer Manager", "Wrong Module added"); let inst = await I_ManualApprovalTransferManagerFactory.getInstructions.call(); assert.equal( @@ -550,7 +550,7 @@ contract("ManualApprovalTransferManager", accounts => { "Allows an issuer to set manual approvals or blocks for specific pairs of addresses and amounts. Init function takes no parameters.", "Wrong Module added" ); - assert.equal(await I_ManualApprovalTransferManagerFactory.getVersion.call(), "1.0.0"); + assert.equal(await I_ManualApprovalTransferManagerFactory.version.call(), "1.0.0"); }); it("Should get the tags of the factory", async () => { diff --git a/test/l_percentage_transfer_manager.js b/test/l_percentage_transfer_manager.js index 3a62463ac..b15ee41a0 100644 --- a/test/l_percentage_transfer_manager.js +++ b/test/l_percentage_transfer_manager.js @@ -22,6 +22,7 @@ contract("PercentageTransferManager", accounts => { let account_investor2; let account_investor3; let account_investor4; + let account_delegate; // investor Details let fromTime = latestTime(); @@ -57,6 +58,7 @@ contract("PercentageTransferManager", accounts => { const tokenDetails = "This is equity type of issuance"; const decimals = 18; const contact = "team@polymath.network"; + const delegateDetails = "Hello I am legit delegate"; // Module key const delegateManagerKey = 1; @@ -92,6 +94,7 @@ contract("PercentageTransferManager", accounts => { account_investor1 = accounts[7]; account_investor2 = accounts[8]; account_investor3 = accounts[9]; + account_delegate = accounts[6]; let instances = await setUpPolymathNetwork(account_polymath, token_owner); @@ -166,6 +169,18 @@ contract("PercentageTransferManager", accounts => { let moduleData = (await I_SecurityToken.getModulesByType(2))[0]; I_GeneralTransferManager = GeneralTransferManager.at(moduleData); }); + + it("Should successfully attach the General permission manager factory with the security token", async () => { + const tx = await I_SecurityToken.addModule(I_GeneralPermissionManagerFactory.address, "0x", 0, 0, { from: token_owner }); + assert.equal(tx.logs[2].args._types[0].toNumber(), delegateManagerKey, "General Permission Manager doesn't get deployed"); + assert.equal( + web3.utils.toAscii(tx.logs[2].args._name).replace(/\u0000/g, ""), + "GeneralPermissionManager", + "GeneralPermissionManagerFactory module was not added" + ); + I_GeneralPermissionManager = GeneralPermissionManager.at(tx.logs[2].args._module); + }); + }); describe("Buy tokens using on-chain whitelist", async () => { @@ -333,10 +348,32 @@ contract("PercentageTransferManager", accounts => { ) }); + it("Should not be able to modify holder percentage to 100 - Unauthorized msg.sender", async () => { + await catchRevert( + I_PercentageTransferManager.changeHolderPercentage(100 * 10 ** 16, { from: account_delegate }) + ) + }); + + it("Should successfully add the delegate", async() => { + let tx = await I_GeneralPermissionManager.addDelegate(account_delegate, delegateDetails, { from: token_owner}); + assert.equal(tx.logs[0].args._delegate, account_delegate); + }); + + it("Should provide the permission", async() => { + let tx = await I_GeneralPermissionManager.changePermission( + account_delegate, + I_PercentageTransferManager.address, + "ADMIN", + true, + {from: token_owner} + ); + assert.equal(tx.logs[0].args._delegate, account_delegate); + }); + it("Modify holder percentage to 100", async () => { // Add the Investor in to the whitelist // Mint some tokens - await I_PercentageTransferManager.changeHolderPercentage(100 * 10 ** 16, { from: token_owner }); + await I_PercentageTransferManager.changeHolderPercentage(100 * 10 ** 16, { from: account_delegate }); assert.equal((await I_PercentageTransferManager.maxHolderPercentage()).toNumber(), 100 * 10 ** 16); }); @@ -372,7 +409,7 @@ contract("PercentageTransferManager", accounts => { describe("Percentage Transfer Manager Factory test cases", async () => { it("Should get the exact details of the factory", async () => { - assert.equal(await I_PercentageTransferManagerFactory.setupCost.call(), 0); + assert.equal(await I_PercentageTransferManagerFactory.getSetupCost.call(), 0); assert.equal((await I_PercentageTransferManagerFactory.getTypes.call())[0], 2); assert.equal( web3.utils.toAscii(await I_PercentageTransferManagerFactory.getName.call()).replace(/\u0000/g, ""), @@ -380,17 +417,17 @@ contract("PercentageTransferManager", accounts => { "Wrong Module added" ); assert.equal( - await I_PercentageTransferManagerFactory.getDescription.call(), + await I_PercentageTransferManagerFactory.description.call(), "Restrict the number of investors", "Wrong Module added" ); - assert.equal(await I_PercentageTransferManagerFactory.getTitle.call(), "Percentage Transfer Manager", "Wrong Module added"); + assert.equal(await I_PercentageTransferManagerFactory.title.call(), "Percentage Transfer Manager", "Wrong Module added"); assert.equal( await I_PercentageTransferManagerFactory.getInstructions.call(), "Allows an issuer to restrict the total number of non-zero token holders", "Wrong Module added" ); - assert.equal(await I_PercentageTransferManagerFactory.getVersion.call(), "1.0.0"); + assert.equal(await I_PercentageTransferManagerFactory.version.call(), "1.0.0"); }); it("Should get the tags of the factory", async () => { diff --git a/test/m_presale_sto.js b/test/m_presale_sto.js index e21ac6df3..a89932dc4 100644 --- a/test/m_presale_sto.js +++ b/test/m_presale_sto.js @@ -413,7 +413,7 @@ contract("PreSaleSTO", accounts => { describe("Test cases for the PresaleSTOFactory", async () => { it("should get the exact details of the factory", async () => { - assert.equal(await I_PreSaleSTOFactory.setupCost.call(), 0); + assert.equal(await I_PreSaleSTOFactory.getSetupCost.call(), 0); assert.equal((await I_PreSaleSTOFactory.getTypes.call())[0], 3); assert.equal( web3.utils.toAscii(await I_PreSaleSTOFactory.getName.call()).replace(/\u0000/g, ""), @@ -421,11 +421,11 @@ contract("PreSaleSTO", accounts => { "Wrong Module added" ); assert.equal( - await I_PreSaleSTOFactory.getDescription.call(), + await I_PreSaleSTOFactory.description.call(), "Allows Issuer to configure pre-sale token allocations", "Wrong Module added" ); - assert.equal(await I_PreSaleSTOFactory.getTitle.call(), "PreSale STO", "Wrong Module added"); + assert.equal(await I_PreSaleSTOFactory.title.call(), "PreSale STO", "Wrong Module added"); assert.equal( await I_PreSaleSTOFactory.getInstructions.call(), "Configure and track pre-sale token allocations", diff --git a/test/o_security_token.js b/test/o_security_token.js index 619b80035..52521181e 100644 --- a/test/o_security_token.js +++ b/test/o_security_token.js @@ -3,7 +3,7 @@ import { duration, ensureException, promisifyLogWatch, latestBlock } from "./hel import takeSnapshot, { increaseTime, revertToSnapshot } from "./helpers/time"; import { encodeProxyCall, encodeModuleCall } from "./helpers/encodeCall"; import { catchRevert } from "./helpers/exceptions"; -import { +import { setUpPolymathNetwork, deployGPMAndVerifyed, deployCappedSTOAndVerifyed, @@ -68,7 +68,6 @@ contract("SecurityToken", accounts => { let I_MockRedemptionManagerFactory; let I_MockRedemptionManager; - // SecurityToken Details (Launched ST on the behalf of the issuer) const name = "Demo Token"; const symbol = "DET"; @@ -481,27 +480,31 @@ contract("SecurityToken", accounts => { }); it("Should change the budget of the module - fail incorrect address", async () => { - await catchRevert(I_SecurityToken.changeModuleBudget(0, 100 * Math.pow(10, 18), { from: token_owner })); + await catchRevert(I_SecurityToken.changeModuleBudget(0, 100 * Math.pow(10, 18), true, { from: token_owner })); }); it("Should change the budget of the module", async () => { - let tx = await I_SecurityToken.changeModuleBudget(I_CappedSTO.address, 100 * Math.pow(10, 18), { from: token_owner }); + let budget = await I_PolyToken.allowance.call(I_SecurityToken.address, I_CappedSTO.address); + let increaseAmount = 100 * Math.pow(10, 18); + let tx = await I_SecurityToken.changeModuleBudget(I_CappedSTO.address, increaseAmount, true, { from: token_owner }); assert.equal(tx.logs[1].args._moduleTypes[0], stoKey); assert.equal(tx.logs[1].args._module, I_CappedSTO.address); - assert.equal(tx.logs[1].args._budget.dividedBy(new BigNumber(10).pow(18)).toNumber(), 100); + assert.equal(tx.logs[1].args._budget.toNumber(), budget.plus(increaseAmount).toNumber()); }); it("Should change the budget of the module (decrease it)", async() => { - let tx = await I_SecurityToken.changeModuleBudget(I_CappedSTO.address, 50 * Math.pow(10, 18), { from: token_owner }); + let budget = await I_PolyToken.allowance.call(I_SecurityToken.address, I_CappedSTO.address); + let decreaseAmount = 100 * Math.pow(10, 18); + let tx = await I_SecurityToken.changeModuleBudget(I_CappedSTO.address, decreaseAmount, false, { from: token_owner }); assert.equal(tx.logs[1].args._moduleTypes[0], stoKey); assert.equal(tx.logs[1].args._module, I_CappedSTO.address); - assert.equal(tx.logs[1].args._budget.dividedBy(new BigNumber(10).pow(18)).toNumber(), 50); + assert.equal(tx.logs[1].args._budget.toNumber(), budget.minus(decreaseAmount).toNumber()); }); it("Should fail to get the total supply -- because checkpoint id is greater than present", async() => { await catchRevert( I_SecurityToken.totalSupplyAt.call(50) - ); + ); }) }); @@ -854,11 +857,10 @@ contract("SecurityToken", accounts => { assert.equal(newInvestorCount.toNumber() + 1, currentInvestorCount.toNumber(), "Investor count drops by one"); }); - it("Should prune investor length", async () => { - await I_SecurityToken.pruneInvestors(0, 10, { from: token_owner }); - // Hardcode list of expected accounts based on transfers above - - let investors = await I_SecurityToken.getInvestors.call(); + it("Should use getInvestorsAt to determine balances now", async () => { + await I_SecurityToken.createCheckpoint({ from: token_owner }); + let investors = await I_SecurityToken.getInvestorsAt.call(1); + console.log("Filtered investors:" + investors); let expectedAccounts = [account_affiliate1, account_affiliate2, account_investor1]; for (let i = 0; i < expectedAccounts.length; i++) { assert.equal(investors[i], expectedAccounts[i]); @@ -866,6 +868,54 @@ contract("SecurityToken", accounts => { assert.equal(investors.length, 3); }); + it("Should prune investor length test #2", async () => { + let balance = await I_SecurityToken.balanceOf(account_affiliate2); + let balance2 = await I_SecurityToken.balanceOf(account_investor1); + await I_SecurityToken.transfer(account_affiliate1, balance, { from: account_affiliate2}); + await I_SecurityToken.transfer(account_affiliate1, balance2, { from: account_investor1}); + await I_SecurityToken.createCheckpoint({ from: token_owner }); + let investors = await I_SecurityToken.getInvestors.call(); + console.log("All investors:" + investors); + let expectedAccounts = [account_affiliate1, account_affiliate2, account_investor1, account_temp]; + for (let i = 0; i < expectedAccounts.length; i++) { + assert.equal(investors[i], expectedAccounts[i]); + } + assert.equal(investors.length, 4); + investors = await I_SecurityToken.getInvestorsAt.call(2); + console.log("Filtered investors:" + investors); + expectedAccounts = [account_affiliate1]; + for (let i = 0; i < expectedAccounts.length; i++) { + assert.equal(investors[i], expectedAccounts[i]); + } + assert.equal(investors.length, 1); + await I_SecurityToken.transfer(account_affiliate2, balance, { from: account_affiliate1}); + await I_SecurityToken.transfer(account_investor1, balance2, { from: account_affiliate1}); + }); + + it("Should get filtered investors", async () => { + let investors = await I_SecurityToken.getInvestors.call(); + console.log("All Investors: " + investors); + let filteredInvestors = await I_SecurityToken.iterateInvestors.call(0, 1); + console.log("Filtered Investors (0, 1): " + filteredInvestors); + assert.equal(filteredInvestors[0], investors[0]); + assert.equal(filteredInvestors.length, 1); + filteredInvestors = await I_SecurityToken.iterateInvestors.call(2, 4); + console.log("Filtered Investors (2, 4): " + filteredInvestors); + assert.equal(filteredInvestors[0], investors[2]); + assert.equal(filteredInvestors[1], investors[3]); + assert.equal(filteredInvestors.length, 2); + filteredInvestors = await I_SecurityToken.iterateInvestors.call(0, 4); + console.log("Filtered Investors (0, 4): " + filteredInvestors); + assert.equal(filteredInvestors[0], investors[0]); + assert.equal(filteredInvestors[1], investors[1]); + assert.equal(filteredInvestors[2], investors[2]); + assert.equal(filteredInvestors[3], investors[3]); + assert.equal(filteredInvestors.length, 4); + await catchRevert( + I_SecurityToken.iterateInvestors(0, 5) + ); + }); + it("Should check the balance of investor at checkpoint", async () => { await catchRevert(I_SecurityToken.balanceOfAt(account_investor1, 5)); }); @@ -877,7 +927,7 @@ contract("SecurityToken", accounts => { }); describe("Test cases for the Mock TrackedRedeemption", async() => { - + it("Should add the tracked redeemption module successfully", async() => { [I_MockRedemptionManagerFactory] = await deployMockRedemptionAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, 0); let tx = await I_SecurityToken.addModule(I_MockRedemptionManagerFactory.address, "", 0, 0, {from: token_owner }); @@ -943,7 +993,7 @@ contract("SecurityToken", accounts => { await I_SecurityToken.approve(I_MockRedemptionManager.address, web3.utils.toWei("500"), {from: account_investor1}); // Transfer the tokens to module (Burn) await I_MockRedemptionManager.transferToRedeem(web3.utils.toWei("500"), { from: account_investor1}); - + await catchRevert( // Redeem tokens I_MockRedemptionManager.redeemTokenByOwner(web3.utils.toWei("250"), {from: account_investor1}) @@ -1089,4 +1139,4 @@ contract("SecurityToken", accounts => { }); }); -}); \ No newline at end of file +}); diff --git a/test/p_usd_tiered_sto.js b/test/p_usd_tiered_sto.js index 62cd4cc05..5332700b4 100644 --- a/test/p_usd_tiered_sto.js +++ b/test/p_usd_tiered_sto.js @@ -4303,13 +4303,15 @@ contract("USDTieredSTO", accounts => { describe("Test cases for the USDTieredSTOFactory", async () => { it("should get the exact details of the factory", async () => { - assert.equal((await I_USDTieredSTOFactory.setupCost.call()).toNumber(), STOSetupCost); + assert.equal((await I_USDTieredSTOFactory.getSetupCost.call()).toNumber(), STOSetupCost); assert.equal((await I_USDTieredSTOFactory.getTypes.call())[0], 3); assert.equal(web3.utils.hexToString(await I_USDTieredSTOFactory.getName.call()), "USDTieredSTO", "Wrong Module added"); - assert.equal(await I_USDTieredSTOFactory.getDescription.call(), "USD Tiered STO", "Wrong Module added"); - assert.equal(await I_USDTieredSTOFactory.getTitle.call(), "USD Tiered STO", "Wrong Module added"); + assert.equal(await I_USDTieredSTOFactory.description.call(), + "It allows both accredited and non-accredited investors to contribute into the STO. Non-accredited investors will be capped at a maximum investment limit (as a default or specific to their jurisdiction). Tokens will be sold according to tiers sequentially & each tier has its own price and volume of tokens to sell. Upon receipt of funds (ETH, POLY or DAI), security tokens will automatically transfer to investor’s wallet address", + "Wrong Module added"); + assert.equal(await I_USDTieredSTOFactory.title.call(), "USD Tiered STO", "Wrong Module added"); assert.equal(await I_USDTieredSTOFactory.getInstructions.call(), "Initialises a USD tiered STO.", "Wrong Module added"); - assert.equal(await I_USDTieredSTOFactory.getVersion.call(), "1.0.0"); + assert.equal(await I_USDTieredSTOFactory.version.call(), "1.0.0"); let tags = await I_USDTieredSTOFactory.getTags.call(); assert.equal(web3.utils.hexToString(tags[0]), "USD"); assert.equal(web3.utils.hexToString(tags[1]), "Tiered"); diff --git a/test/v_tracked_redemptions.js b/test/v_tracked_redemptions.js index a8a11f66d..159564651 100644 --- a/test/v_tracked_redemptions.js +++ b/test/v_tracked_redemptions.js @@ -265,16 +265,16 @@ contract("TrackedRedemption", accounts => { describe("Test cases for the TrackedRedemptionFactory", async () => { it("should get the exact details of the factory", async () => { - assert.equal((await I_TrackedRedemptionFactory.setupCost.call()).toNumber(), 0); + assert.equal((await I_TrackedRedemptionFactory.getSetupCost.call()).toNumber(), 0); assert.equal((await I_TrackedRedemptionFactory.getTypes.call())[0], 5); - assert.equal(await I_TrackedRedemptionFactory.getVersion.call(), "1.0.0"); + assert.equal(await I_TrackedRedemptionFactory.version.call(), "1.0.0"); assert.equal( web3.utils.toAscii(await I_TrackedRedemptionFactory.getName.call()).replace(/\u0000/g, ""), "TrackedRedemption", "Wrong Module added" ); - assert.equal(await I_TrackedRedemptionFactory.getDescription.call(), "Track token redemptions", "Wrong Module added"); - assert.equal(await I_TrackedRedemptionFactory.getTitle.call(), "Tracked Redemption", "Wrong Module added"); + assert.equal(await I_TrackedRedemptionFactory.description.call(), "Track token redemptions", "Wrong Module added"); + assert.equal(await I_TrackedRedemptionFactory.title.call(), "Tracked Redemption", "Wrong Module added"); assert.equal( await I_TrackedRedemptionFactory.getInstructions.call(), "Allows an investor to redeem security tokens which are tracked by this module", diff --git a/test/w_lockup_volume_restriction_transfer_manager.js b/test/w_lockup_volume_restriction_transfer_manager.js index fda65be4f..fe06f3f5c 100644 --- a/test/w_lockup_volume_restriction_transfer_manager.js +++ b/test/w_lockup_volume_restriction_transfer_manager.js @@ -781,22 +781,22 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { describe("VolumeRestriction Transfer Manager Factory test cases", async() => { it("Should get the exact details of the factory", async() => { - assert.equal(await I_VolumeRestrictionTransferManagerFactory.setupCost.call(),0); + assert.equal(await I_VolumeRestrictionTransferManagerFactory.getSetupCost.call(),0); assert.equal((await I_VolumeRestrictionTransferManagerFactory.getTypes.call())[0],2); assert.equal(web3.utils.toAscii(await I_VolumeRestrictionTransferManagerFactory.getName.call()) .replace(/\u0000/g, ''), "LockupVolumeRestrictionTM", "Wrong Module added"); - assert.equal(await I_VolumeRestrictionTransferManagerFactory.getDescription.call(), + assert.equal(await I_VolumeRestrictionTransferManagerFactory.description.call(), "Manage transfers using lock ups over time", "Wrong Module added"); - assert.equal(await I_VolumeRestrictionTransferManagerFactory.getTitle.call(), + assert.equal(await I_VolumeRestrictionTransferManagerFactory.title.call(), "Lockup Volume Restriction Transfer Manager", "Wrong Module added"); assert.equal(await I_VolumeRestrictionTransferManagerFactory.getInstructions.call(), "Allows an issuer to set lockup periods for user addresses, with funds distributed over time. Init function takes no parameters.", "Wrong Module added"); - assert.equal(await I_VolumeRestrictionTransferManagerFactory.getVersion.call(), "1.0.0"); + assert.equal(await I_VolumeRestrictionTransferManagerFactory.version.call(), "1.0.0"); }); it("Should get the tags of the factory", async() => { diff --git a/test/x_single_trade_volume_restriction.js b/test/x_single_trade_volume_restriction.js index a0e1fb3f0..15c01e68c 100644 --- a/test/x_single_trade_volume_restriction.js +++ b/test/x_single_trade_volume_restriction.js @@ -700,17 +700,17 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { describe("SingleTradeVolumeRestrictionManager Factory test cases", async () => { it("Should get the exact details of the factory", async () => { - assert.equal(await I_SingleTradeVolumeRestrictionManagerFactory.setupCost.call(), 0); + assert.equal(await I_SingleTradeVolumeRestrictionManagerFactory.getSetupCost.call(), 0); assert.equal((await I_SingleTradeVolumeRestrictionManagerFactory.getTypes.call())[0], 2); let name = web3.utils.toUtf8(await I_SingleTradeVolumeRestrictionManagerFactory.getName.call()); assert.equal(name, "SingleTradeVolumeRestrictionTM", "Wrong Module added"); - let desc = await I_SingleTradeVolumeRestrictionManagerFactory.getDescription.call(); + let desc = await I_SingleTradeVolumeRestrictionManagerFactory.description.call(); assert.equal(desc, "Imposes volume restriction on a single trade", "Wrong Module added"); - let title = await I_SingleTradeVolumeRestrictionManagerFactory.getTitle.call(); + let title = await I_SingleTradeVolumeRestrictionManagerFactory.title.call(); assert.equal(title, "Single Trade Volume Restriction Manager", "Wrong Module added"); let inst = await I_SingleTradeVolumeRestrictionManagerFactory.getInstructions.call(); assert.equal(inst, "Allows an issuer to impose volume restriction on a single trade. Init function takes two parameters. First parameter is a bool indicating if restriction is in percentage. The second parameter is the value in percentage or amount of tokens", "Wrong Module added"); - let version = await I_SingleTradeVolumeRestrictionManagerFactory.getVersion.call(); + let version = await I_SingleTradeVolumeRestrictionManagerFactory.version.call(); assert.equal(version, "1.0.0", "Version not correct"); }); diff --git a/test/y_scheduled_checkpoints.js b/test/y_scheduled_checkpoints.js new file mode 100644 index 000000000..5fcc03a74 --- /dev/null +++ b/test/y_scheduled_checkpoints.js @@ -0,0 +1,389 @@ +import latestTime from './helpers/latestTime'; +import { duration, promisifyLogWatch, latestBlock } from './helpers/utils'; +import takeSnapshot, { increaseTime, revertToSnapshot } from './helpers/time'; +import { encodeProxyCall, encodeModuleCall } from './helpers/encodeCall'; +import { setUpPolymathNetwork, deployScheduleCheckpointAndVerified } from "./helpers/createInstances"; + +const SecurityToken = artifacts.require('./SecurityToken.sol'); +const GeneralTransferManager = artifacts.require('./GeneralTransferManager'); +const ScheduledCheckpoint = artifacts.require('./ScheduledCheckpoint.sol'); + + +const Web3 = require('web3'); +const BigNumber = require('bignumber.js'); +const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")) // Hardcoded development port + +contract('ScheduledCheckpoint', accounts => { + + // Accounts Variable declaration + let account_polymath; + let account_issuer; + let token_owner; + let account_investor1; + let account_investor2; + let account_investor3; + let account_investor4; + + // investor Details + let fromTime = latestTime(); + let toTime = latestTime(); + let expiryTime = toTime + duration.days(15); + + let message = "Transaction Should Fail!"; + + // Contract Instance Declaration + let I_SecurityTokenRegistryProxy; + let I_GeneralTransferManagerFactory; + let I_ScheduledCheckpointFactory; + let I_GeneralPermissionManager; + let I_ScheduledCheckpoint; + let I_GeneralTransferManager; + let I_ModuleRegistryProxy; + let I_ModuleRegistry; + let I_FeatureRegistry; + let I_SecurityTokenRegistry; + let I_STRProxied; + let I_MRProxied; + let I_STFactory; + let I_SecurityToken; + let I_PolyToken; + let I_PolymathRegistry; + + // SecurityToken Details + const name = "Team"; + const symbol = "sap"; + const tokenDetails = "This is equity type of issuance"; + const decimals = 18; + const contact = "team@polymath.network"; + + // Module key + const delegateManagerKey = 1; + const transferManagerKey = 2; + const stoKey = 3; + + // Initial fee for ticker registry and security token registry + const initRegFee = web3.utils.toWei("250"); + + before(async() => { + // Accounts setup + account_polymath = accounts[0]; + account_issuer = accounts[1]; + + token_owner = account_issuer; + + account_investor1 = accounts[7]; + account_investor2 = accounts[8]; + account_investor3 = accounts[9]; + + // Step 1: Deploy the genral PM ecosystem + let instances = await setUpPolymathNetwork(account_polymath, token_owner); + + [ + I_PolymathRegistry, + I_PolyToken, + I_FeatureRegistry, + I_ModuleRegistry, + I_ModuleRegistryProxy, + I_MRProxied, + I_GeneralTransferManagerFactory, + I_STFactory, + I_SecurityTokenRegistry, + I_SecurityTokenRegistryProxy, + I_STRProxied + ] = instances; + + // STEP 2: Deploy the ScheduleCheckpointModule + [I_ScheduledCheckpointFactory] = await deployScheduleCheckpointAndVerified(account_polymath, I_MRProxied, I_PolyToken.address, 0); + + // Printing all the contract addresses + console.log(` + --------------------- Polymath Network Smart Contracts: --------------------- + PolymathRegistry: ${I_PolymathRegistry.address} + SecurityTokenRegistryProxy: ${I_SecurityTokenRegistryProxy.address} + SecurityTokenRegistry: ${I_SecurityTokenRegistry.address} + ModuleRegistry: ${I_ModuleRegistry.address} + ModuleRegistryProxy: ${I_ModuleRegistryProxy.address} + FeatureRegistry: ${I_FeatureRegistry.address} + + STFactory: ${I_STFactory.address} + GeneralTransferManagerFactory: ${I_GeneralTransferManagerFactory.address} + + + ----------------------------------------------------------------------------- + `); + }); + + describe("Generate the SecurityToken", async() => { + + it("Should register the ticker before the generation of the security token", async () => { + await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); + let tx = await I_STRProxied.registerTicker(token_owner, symbol, contact, { from : token_owner }); + assert.equal(tx.logs[0].args._owner, token_owner); + assert.equal(tx.logs[0].args._ticker, symbol.toUpperCase()); + }); + + it("Should generate the new security token with the same symbol as registered above", async () => { + await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); + let _blockNo = latestBlock(); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + + // Verify the successful generation of the security token + assert.equal(tx.logs[1].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); + + I_SecurityToken = SecurityToken.at(tx.logs[1].args._securityTokenAddress); + + const log = await promisifyLogWatch(I_SecurityToken.ModuleAdded({from: _blockNo}), 1); + + // Verify that GeneralTransferManager module get added successfully or not + assert.equal(log.args._types[0].toNumber(), 2); + assert.equal( + web3.utils.toAscii(log.args._name) + .replace(/\u0000/g, ''), + "GeneralTransferManager" + ); + }); + + it("Should intialize the auto attached modules", async () => { + let moduleData = (await I_SecurityToken.getModulesByType(2))[0]; + I_GeneralTransferManager = GeneralTransferManager.at(moduleData); + + }); + + }); + + describe("Buy tokens using on-chain whitelist", async() => { + + it("Should successfully attach the ScheduledCheckpoint with the security token", async () => { + await I_SecurityToken.changeGranularity(1, {from: token_owner}); + const tx = await I_SecurityToken.addModule(I_ScheduledCheckpointFactory.address, "", 0, 0, { from: token_owner }); + assert.equal(tx.logs[2].args._types[0].toNumber(), 4, "ScheduledCheckpoint doesn't get deployed"); + assert.equal(tx.logs[2].args._types[1].toNumber(), 2, "ScheduledCheckpoint doesn't get deployed"); + assert.equal( + web3.utils.toAscii(tx.logs[2].args._name) + .replace(/\u0000/g, ''), + "ScheduledCheckpoint", + "ScheduledCheckpoint module was not added" + ); + I_ScheduledCheckpoint = ScheduledCheckpoint.at(tx.logs[2].args._module); + }); + + let startTime; + let interval; + it("Should create a daily checkpoint", async () => { + startTime = latestTime() + 100; + interval = 24 * 60 * 60; + console.log("Creating scheduled CP: " + startTime, interval); + await I_ScheduledCheckpoint.addSchedule("CP1", startTime, interval, {from: token_owner}); + console.log("2: " + latestTime()); + }); + + it("Remove (temp) daily checkpoint", async () => { + let snap_Id = await takeSnapshot(); + await I_ScheduledCheckpoint.removeSchedule("CP1", {from: token_owner}); + await revertToSnapshot(snap_Id); + }); + + it("Should Buy the tokens for account_investor1", async() => { + // Add the Investor in to the whitelist + console.log("3: " + latestTime()); + + let tx = await I_GeneralTransferManager.modifyWhitelist( + account_investor1, + latestTime(), + latestTime(), + latestTime() + duration.days(10), + true, + { + from: account_issuer, + gas: 6000000 + }); + + assert.equal(tx.logs[0].args._investor.toLowerCase(), account_investor1.toLowerCase(), "Failed in adding the investor in whitelist"); + + // Jump time + console.log("4: " + latestTime()); + + await increaseTime(5000); + // We should be after the first scheduled checkpoint, and before the second + console.log("5: " + latestTime()); + + assert.isTrue(latestTime() > startTime); + assert.isTrue(latestTime() <= startTime + interval); + console.log("6: " + latestTime()); + + // Mint some tokens + await I_SecurityToken.mint(account_investor1, web3.utils.toWei('1', 'ether'), { from: token_owner }); + + assert.equal( + (await I_SecurityToken.balanceOf(account_investor1)).toNumber(), + web3.utils.toWei('1', 'ether') + ); + }); + + it("Should have checkpoint created with correct balances", async() => { + let cp1 = await I_ScheduledCheckpoint.getSchedule("CP1"); + checkSchedule(cp1, "CP1", startTime, startTime + interval, interval, [1], [startTime], [1]); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 0)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 1)).toNumber(), 0); + }); + + it("Should Buy some more tokens for account_investor2", async() => { + // Add the Investor in to the whitelist + + let tx = await I_GeneralTransferManager.modifyWhitelist( + account_investor2, + latestTime(), + latestTime(), + latestTime() + duration.days(10), + true, + { + from: account_issuer, + gas: 6000000 + }); + + assert.equal(tx.logs[0].args._investor.toLowerCase(), account_investor2.toLowerCase(), "Failed in adding the investor in whitelist"); + + // We should be after the first scheduled checkpoint, and before the second + assert.isTrue(latestTime() > startTime); + assert.isTrue(latestTime() <= startTime + interval); + + // Mint some tokens + await I_SecurityToken.mint(account_investor2, web3.utils.toWei('1', 'ether'), { from: token_owner }); + + assert.equal( + (await I_SecurityToken.balanceOf(account_investor2)).toNumber(), + web3.utils.toWei('1', 'ether') + ); + }); + + it("No additional checkpoints created", async() => { + let cp1 = await I_ScheduledCheckpoint.getSchedule("CP1"); + checkSchedule(cp1, "CP1", startTime, startTime + interval, interval, [1], [startTime], [1]); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 0)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 1)).toNumber(), 0); + }); + + it("Add a new token holder - account_investor3", async() => { + + let tx = await I_GeneralTransferManager.modifyWhitelist( + account_investor3, + latestTime(), + latestTime(), + latestTime() + duration.days(10), + true, + { + from: account_issuer, + gas: 6000000 + }); + + assert.equal(tx.logs[0].args._investor.toLowerCase(), account_investor3.toLowerCase(), "Failed in adding the investor in whitelist"); + + // Jump time + await increaseTime(interval); + // We should be after the first scheduled checkpoint, and before the second + assert.isTrue(latestTime() > startTime + interval); + assert.isTrue(latestTime() <= startTime + (2 * interval)); + + // Add the Investor in to the whitelist + // Mint some tokens + await I_SecurityToken.mint(account_investor3, web3.utils.toWei('1', 'ether'), { from: token_owner }); + + assert.equal( + (await I_SecurityToken.balanceOf(account_investor3)).toNumber(), + web3.utils.toWei('1', 'ether') + ); + }); + + it("Should have new checkpoint created with correct balances", async() => { + let cp1 = await I_ScheduledCheckpoint.getSchedule("CP1"); + checkSchedule(cp1, "CP1", startTime, startTime + (2 * interval), interval, [1, 2], [startTime, startTime + interval], [1, 1]); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor3, 0)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor3, 1)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor3, 2)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 0)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 1)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 2)).toNumber(), web3.utils.toWei('1', 'ether')); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 0)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 1)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 2)).toNumber(), web3.utils.toWei('1', 'ether')); + }); + + it("Should have correct balances for investor 3 after new checkpoint", async() => { + // Jump time + await increaseTime(2 * interval); + // We should be after the first scheduled checkpoint, and before the second + assert.isTrue(latestTime() > startTime + (3 * interval)); + assert.isTrue(latestTime() <= startTime + (4 * interval)); + await I_SecurityToken.transfer(account_investor3, web3.utils.toWei('0.5', 'ether'), { from: account_investor1 }); + let cp1 = await I_ScheduledCheckpoint.getSchedule("CP1"); + checkSchedule(cp1, "CP1", startTime, startTime + (4 * interval), interval, [1, 2, 3], [startTime, startTime + interval, startTime + (2 * interval)], [1, 1, 2]); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor3, 0)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor3, 1)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor3, 2)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor3, 3)).toNumber(), web3.utils.toWei('1', 'ether')); + + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 0)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 1)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 2)).toNumber(), web3.utils.toWei('1', 'ether')); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 3)).toNumber(), web3.utils.toWei('1', 'ether')); + + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 0)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 1)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 2)).toNumber(), web3.utils.toWei('1', 'ether')); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 3)).toNumber(), web3.utils.toWei('1', 'ether')); + + }); + + it("Manually update checkpoints", async() => { + await increaseTime(interval); + await I_ScheduledCheckpoint.updateAll({from: token_owner}); + + let cp1 = await I_ScheduledCheckpoint.getSchedule("CP1"); + checkSchedule(cp1, "CP1", startTime, startTime + (5 * interval), interval, [1, 2, 3, 4], [startTime, startTime + interval, startTime + (2 * interval), startTime + (4 * interval)], [1, 1, 2, 1]); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor3, 0)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor3, 1)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor3, 2)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor3, 3)).toNumber(), web3.utils.toWei('1', 'ether')); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor3, 4)).toNumber(), web3.utils.toWei('1.5', 'ether')); + + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 0)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 1)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 2)).toNumber(), web3.utils.toWei('1', 'ether')); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 3)).toNumber(), web3.utils.toWei('1', 'ether')); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor2, 4)).toNumber(), web3.utils.toWei('1', 'ether')); + + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 0)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 1)).toNumber(), 0); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 2)).toNumber(), web3.utils.toWei('1', 'ether')); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 3)).toNumber(), web3.utils.toWei('1', 'ether')); + assert.equal((await I_SecurityToken.balanceOfAt(account_investor1, 4)).toNumber(), web3.utils.toWei('0.5', 'ether')); + + }); + + it("Should get the permission", async() => { + let perm = await I_ScheduledCheckpoint.getPermissions.call(); + assert.equal(perm.length, 0); + }); + + }); + +}); + +function checkSchedule(schedule, name, startTime, nextTime, interval, checkpoints, timestamps, periods) { + assert.equal(web3.utils.toAscii(schedule[0]).replace(/\u0000/g, ''), name); + assert.equal(schedule[1].toNumber(), startTime); + assert.equal(schedule[2].toNumber(), nextTime); + assert.equal(schedule[3].toNumber(), interval); + assert.equal(schedule[4].length, checkpoints.length); + for (let i = 0; i < checkpoints.length; i++) { + assert.equal(schedule[4][i].toNumber(), checkpoints[i]); + } + assert.equal(schedule[5].length, timestamps.length); + for (let i = 0; i < timestamps.length; i++) { + assert.equal(schedule[5][i].toNumber(), timestamps[i]); + } + assert.equal(schedule[6].length, periods.length); + for (let i = 0; i < periods.length; i++) { + assert.equal(schedule[6][i].toNumber(), periods[i]); + } +} From 18d770bb3bb119e8f33d22e886033e82b9d66143 Mon Sep 17 00:00:00 2001 From: Polymath Date: Mon, 12 Nov 2018 15:51:13 -0300 Subject: [PATCH 046/139] Whitelist refactor --- CLI/commands/OLD_whitelist.js | 302 ++++++++++++++++++++++++++++++++++ CLI/commands/whitelist.js | 266 ++++++++++++------------------ CLI/polymath-cli.js | 3 +- 3 files changed, 409 insertions(+), 162 deletions(-) create mode 100644 CLI/commands/OLD_whitelist.js diff --git a/CLI/commands/OLD_whitelist.js b/CLI/commands/OLD_whitelist.js new file mode 100644 index 000000000..5ef201195 --- /dev/null +++ b/CLI/commands/OLD_whitelist.js @@ -0,0 +1,302 @@ +var fs = require('fs'); +var csv = require('fast-csv'); +var BigNumber = require('bignumber.js'); +var common = require('./common/common_functions'); +var global = require('./common/global'); + +/////////////////////////////ARTIFACTS////////////////////////////////////////// +var contracts = require('./helpers/contract_addresses'); +var abis = require('./helpers/contract_abis'); + +////////////////////////////USER INPUTS////////////////////////////////////////// +let tokenSymbol = process.argv.slice(2)[0]; //token symbol +let BATCH_SIZE = process.argv.slice(2)[1]; //batch size +if (!BATCH_SIZE) BATCH_SIZE = 70; +let remoteNetwork = process.argv.slice(2)[2]; + +/////////////////////////GLOBAL VARS////////////////////////////////////////// + +//distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] +let distribData = new Array(); +//allocData is a temporary array that stores up to the batch size, +//then gets push into distribData, then gets set to 0 to start another batch +let allocData = new Array(); +//full file data is a single array that contains all arrays. i.e. if there are 200 entries we get [[200]] +let fullFileData = new Array(); +let badData = new Array(); + +const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); + +//////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// + +startScript(); + +async function startScript() { + if (remoteNetwork == 'undefined') remoteNetwork = undefined; + await global.initialize(remoteNetwork); + + try { + let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); + let securityTokenRegistryABI = abis.securityTokenRegistry(); + securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); + securityTokenRegistry.setProvider(web3.currentProvider); + + console.log("Processing investor CSV upload. Batch size is "+BATCH_SIZE+" accounts per transaction"); + readFile(); + } catch (err) { + console.log(err) + console.log('\x1b[31m%s\x1b[0m', "There was a problem getting the contracts. Make sure they are deployed to the selected network."); + return; + } +} + +///////////////////////////FUNCTION READING THE CSV FILE +function readFile() { + var stream = fs.createReadStream("./CLI/data/whitelist_data.csv"); + + let index = 0; + let batch = 0; + console.log(` + -------------------------------------------- + ----------- Parsing the csv file ----------- + -------------------------------------------- + `); + + var csvStream = csv() + .on("data", function (data) { + // console.log(data[1]) + // console.log(data[2]) + // console.log(data[3]) + let isAddress = web3.utils.isAddress(data[0]); + let sellValid = isValidDate(data[1]) + let buyValid = isValidDate(data[2]) + let kycExpiryDate = isValidDate(data[3]) + let canBuyFromSTO = (typeof JSON.parse(data[4].toLowerCase())) == "boolean" ? JSON.parse(data[4].toLowerCase()) : "not-valid"; + + if (isAddress && sellValid && buyValid && kycExpiryDate && (canBuyFromSTO != "not-valid") ) { + let userArray = new Array() + let checksummedAddress = web3.utils.toChecksumAddress(data[0]); + + userArray.push(checksummedAddress) + userArray.push(sellValid) + userArray.push(buyValid) + userArray.push(kycExpiryDate) + userArray.push(canBuyFromSTO) + // console.log(userArray) + allocData.push(userArray); + fullFileData.push(userArray); + index++; + if (index >= BATCH_SIZE) { + distribData.push(allocData); + // console.log("DIS", distribData); + allocData = []; + // console.log("ALLOC", allocData); + index = 0; + } + + } else { + let userArray = new Array() + //dont need this here, as if it is NOT an address this function will fail + //let checksummedAddress = web3.utils.toChecksumAddress(data[1]); + userArray.push(data[0]) + userArray.push(sellValid) + userArray.push(buyValid) + userArray.push(kycExpiryDate); + userArray.push(canBuyFromSTO); + badData.push(userArray); + fullFileData.push(userArray) + } + }) + .on("end", function () { + //Add last remainder batch + distribData.push(allocData); + allocData = []; + + setInvestors(); + }); + + stream.pipe(csvStream); +} + +////////////////////////MAIN FUNCTION COMMUNICATING TO BLOCKCHAIN +async function setInvestors() { + let tokenDeployed = false; + let tokenDeployedAddress; + // Let's check if token has already been deployed, if it has, skip to STO + await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { + if (result != "0x0000000000000000000000000000000000000000") { + console.log('\x1b[32m%s\x1b[0m', "Token deployed at address " + result + "."); + tokenDeployedAddress = result; + tokenDeployed = true; + } + }); + if (tokenDeployed) { + let securityTokenABI = abis.securityToken(); + securityToken = new web3.eth.Contract(securityTokenABI, tokenDeployedAddress); + } + let gmtModules = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); + let generalTransferManagerAddress = gmtModules[0]; + let generalTransferManagerABI = abis.generalTransferManager(); + let generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, generalTransferManagerAddress); + + console.log(` + ------------------------------------------------------- + ----- Sending buy/sell restrictions to blockchain ----- + ------------------------------------------------------- + `); + + //this for loop will do the batches, so it should run 75, 75, 50 with 200 + for (let i = 0; i < distribData.length; i++) { + try { + let investorArray = []; + let fromTimesArray = []; + let toTimesArray = []; + let expiryTimeArray = []; + let canBuyFromSTOArray = []; + + //splitting the user arrays to be organized by input + for (let j = 0; j < distribData[i].length; j++) { + investorArray.push(distribData[i][j][0]) + fromTimesArray.push(distribData[i][j][1]) + toTimesArray.push(distribData[i][j][2]) + expiryTimeArray.push(distribData[i][j][3]) + canBuyFromSTOArray.push(distribData[i][j][4]) + } + + //fromTimes is ability to sell coin FROM your account (2nd row in csv, 2nd parameter in modifyWhiteList() ) + //toTimes is ability to buy coins TOwards your account (3rd row in csv, 3rd parameter in modifyWhiteList() ) + //expiryTime is time at which KYC of investor get expired (4th row in csv, 4rd parameter in modifyWhiteList() ) + let modifyWhitelistMultiAction = generalTransferManager.methods.modifyWhitelistMulti(investorArray, fromTimesArray, toTimesArray, expiryTimeArray, canBuyFromSTOArray); + let r = await common.sendTransaction(modifyWhitelistMultiAction); + console.log(`Batch ${i} - Attempting to modifyWhitelist accounts:\n\n`, investorArray, "\n\n"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); + console.log("Whitelist transaxction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); + + } catch (err) { + console.log("ERROR:", err); + } + } + + console.log("Retrieving logs to determine investors have had their times uploaded correctly.\n\n") + + let totalInvestors = 0; + let updatedInvestors = 0; + + let investorData_Events = new Array(); + let investorObjectLookup = {}; + + let event_data = await generalTransferManager.getPastEvents('ModifyWhitelist', { + fromBlock: 0, + toBlock: 'latest' + }, function (error, events) { + //console.log(error); + }); + + for (var i = 0; i < event_data.length; i++) { + let combineArray = []; + + let investorAddress_Event = event_data[i].returnValues._investor; + let fromTime_Event = event_data[i].returnValues._fromTime + let toTime_Event = event_data[i].returnValues._toTime + let expiryTime_Event = event_data[i].returnValues._expiryTime + let canBuyFromSTO_Event = event_data[i].returnValues._canBuyFromSTO + let blockNumber = event_data[i].blockNumber + + combineArray.push(investorAddress_Event); + combineArray.push(fromTime_Event); + combineArray.push(toTime_Event); + combineArray.push(expiryTime_Event); + combineArray.push(canBuyFromSTO_Event); + combineArray.push(blockNumber) + + investorData_Events.push(combineArray) + + //we have already recorded it, so this is an update to our object + if (investorObjectLookup.hasOwnProperty(investorAddress_Event)) { + + //the block number form the event we are checking is bigger, so we gotta replace it + if (investorObjectLookup[investorAddress_Event].recordedBlockNumber < blockNumber) { + investorObjectLookup[investorAddress_Event] = { fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber }; + updatedInvestors += 1; + // investorAddress_Events.push(investorAddress_Event); not needed, because we start the obj with zero events + + } else { + //do nothing. so if we find an event, and it was an older block, its old, we dont care + } + //we have never recorded this address as an object key, so we need to add it to our list of investors updated by the csv + } else { + investorObjectLookup[investorAddress_Event] = { fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber }; + totalInvestors += 1; + // investorAddress_Events.push(investorAddress_Event); + } + } + let investorAddress_Events = Object.keys(investorObjectLookup) + + console.log(`******************** EVENT LOGS ANALYSIS COMPLETE ********************\n`); + console.log(`A total of ${totalInvestors} investors have been whitelisted total, all time.\n`); + console.log(`This script in total sent ${fullFileData.length - badData.length} new investors and updated investors to the blockchain.\n`); + console.log(`There were ${badData.length} bad entries that didnt get sent to the blockchain in the script.\n`); + + // console.log("LIST OF ALL INVESTOR DATA FROM EVENTS:", investorData_Events) + // console.log(fullFileData) + console.log("************************************************************************************************"); + console.log("OBJECT WITH EVERY USER AND THEIR UPDATED TIMES: \n\n", investorObjectLookup) + console.log("************************************************************************************************"); + console.log("LIST OF ALL INVESTORS WHITELISTED: \n\n", investorAddress_Events) + + let missingDistribs = []; + for (let l = 0; l < fullFileData.length; l++) { + if (!investorObjectLookup.hasOwnProperty(fullFileData[l][0])) { + missingDistribs.push(fullFileData[l]) + } + } + + if (missingDistribs.length > 0) { + console.log("************************************************************************************************"); + console.log("-- No LogModifyWhitelist event was found for the following data arrays. Please review them manually --") + console.log(missingDistribs) + // for (var i = 0; i < missingDistribs.length; i++) { + // console.log('\x1b[31m%s\x1b[0m', `No Transfer event was found for account ${missingDistribs[i]}`); + // } + console.log("************************************************************************************************"); + } else { + console.log("\n************************************************************************************************"); + console.log("All accounts passed through from the CSV were successfully whitelisted, because we were able to read them all from events") + console.log("************************************************************************************************"); + } + // console.log(`Run 'node scripts/verify_airdrop.js ${polyDistribution.address} > scripts/data/review.csv' to get a log of all the accounts that were distributed the airdrop tokens.`) +} + +//will be deleted once DATES are updated +function isValidDayInput(days) { + let today = Date.now() / 1000 + let isValid = !isNaN(days) + if (isValid) { + let addedSeconds = days * 86400 + + let unixTimestamp = today + addedSeconds + console.log("unxitimestapm :" , (unixTimestamp)) + + return unixTimestamp + } else { + return false + } +} + +function isValidDate(date) { + var matches = /^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/.exec(date); + if (matches == null) return false; + var d = matches[2]; + var m = matches[1] - 1; //not clear why this is -1, but it works after checking + var y = matches[3]; + var composedDate = new Date(y, m, d); + var timestampDate = composedDate.getTime() + + //note, some reason these timestamps are being recorded +4 hours UTC + if (composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y) { + return timestampDate / 1000 + } else { + return false + } +} diff --git a/CLI/commands/whitelist.js b/CLI/commands/whitelist.js index 5ef201195..d176903ee 100644 --- a/CLI/commands/whitelist.js +++ b/CLI/commands/whitelist.js @@ -1,143 +1,97 @@ +var common = require('./common/common_functions'); var fs = require('fs'); var csv = require('fast-csv'); -var BigNumber = require('bignumber.js'); -var common = require('./common/common_functions'); -var global = require('./common/global'); - -/////////////////////////////ARTIFACTS////////////////////////////////////////// var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); +var BigNumber = require('bignumber.js'); -////////////////////////////USER INPUTS////////////////////////////////////////// -let tokenSymbol = process.argv.slice(2)[0]; //token symbol -let BATCH_SIZE = process.argv.slice(2)[1]; //batch size -if (!BATCH_SIZE) BATCH_SIZE = 70; -let remoteNetwork = process.argv.slice(2)[2]; - -/////////////////////////GLOBAL VARS////////////////////////////////////////// - -//distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] let distribData = new Array(); -//allocData is a temporary array that stores up to the batch size, -//then gets push into distribData, then gets set to 0 to start another batch let allocData = new Array(); -//full file data is a single array that contains all arrays. i.e. if there are 200 entries we get [[200]] let fullFileData = new Array(); let badData = new Array(); +let BATCH_SIZE = 70; +let securityToken; +let generalTransferManager; -const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); +async function startScript(tokenSymbol, batchSize) { + if (batchSize) { + BATCH_SIZE = batchSize; + } -//////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// + common.logAsciiBull(); -startScript(); + let STAddress = await checkST(tokenSymbol); + securityToken = new web3.eth.Contract(abis.securityToken(), STAddress); + + await readCsv(); +}; -async function startScript() { - if (remoteNetwork == 'undefined') remoteNetwork = undefined; - await global.initialize(remoteNetwork); +async function checkST(tokenSymbol) { + let securityTokenRegistry = await STConnect(); + return await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { + if (result != "0x0000000000000000000000000000000000000000") { + return result + } else { + console.log("Token doesn't exist") + process.exit(0) + } + }); +} + +async function STConnect() { try { - let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); - let securityTokenRegistryABI = abis.securityTokenRegistry(); - securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); - securityTokenRegistry.setProvider(web3.currentProvider); - - console.log("Processing investor CSV upload. Batch size is "+BATCH_SIZE+" accounts per transaction"); - readFile(); + let STRegistryAddress = await contracts.securityTokenRegistry(); + let STRegistry = new web3.eth.Contract(abis.securityTokenRegistry(), STRegistryAddress); + return STRegistry; } catch (err) { - console.log(err) - console.log('\x1b[31m%s\x1b[0m', "There was a problem getting the contracts. Make sure they are deployed to the selected network."); - return; + console.log("There was a problem getting the contracts. Make sure they are deployed to the selected network."); + process.exit(0); } } -///////////////////////////FUNCTION READING THE CSV FILE -function readFile() { - var stream = fs.createReadStream("./CLI/data/whitelist_data.csv"); +async function readCsv() { + var CSV_STRING = fs.readFileSync("./CLI/data/whitelist_data.csv").toString(); + let i = 0; - let index = 0; - let batch = 0; - console.log(` - -------------------------------------------- - ----------- Parsing the csv file ----------- - -------------------------------------------- - `); + csv.fromString(CSV_STRING) + .on("data", (data) => { + let data_processed = whitelist_processing(data); + fullFileData.push(data_processed[1]); - var csvStream = csv() - .on("data", function (data) { - // console.log(data[1]) - // console.log(data[2]) - // console.log(data[3]) - let isAddress = web3.utils.isAddress(data[0]); - let sellValid = isValidDate(data[1]) - let buyValid = isValidDate(data[2]) - let kycExpiryDate = isValidDate(data[3]) - let canBuyFromSTO = (typeof JSON.parse(data[4].toLowerCase())) == "boolean" ? JSON.parse(data[4].toLowerCase()) : "not-valid"; - - if (isAddress && sellValid && buyValid && kycExpiryDate && (canBuyFromSTO != "not-valid") ) { - let userArray = new Array() - let checksummedAddress = web3.utils.toChecksumAddress(data[0]); - - userArray.push(checksummedAddress) - userArray.push(sellValid) - userArray.push(buyValid) - userArray.push(kycExpiryDate) - userArray.push(canBuyFromSTO) - // console.log(userArray) - allocData.push(userArray); - fullFileData.push(userArray); - index++; - if (index >= BATCH_SIZE) { + if (data_processed[0]) { + allocData.push(data_processed[1]); + i++; + if (i >= BATCH_SIZE) { distribData.push(allocData); - // console.log("DIS", distribData); allocData = []; - // console.log("ALLOC", allocData); - index = 0; + i = 0; } - } else { - let userArray = new Array() - //dont need this here, as if it is NOT an address this function will fail - //let checksummedAddress = web3.utils.toChecksumAddress(data[1]); - userArray.push(data[0]) - userArray.push(sellValid) - userArray.push(buyValid) - userArray.push(kycExpiryDate); - userArray.push(canBuyFromSTO); - badData.push(userArray); - fullFileData.push(userArray) + badData.push(data_processed[1]); } + }) - .on("end", function () { - //Add last remainder batch + .on("end", async () => { distribData.push(allocData); allocData = []; - setInvestors(); + await saveInBlockchain(); + await finalResults(); + return; }); - - stream.pipe(csvStream); } -////////////////////////MAIN FUNCTION COMMUNICATING TO BLOCKCHAIN -async function setInvestors() { - let tokenDeployed = false; - let tokenDeployedAddress; - // Let's check if token has already been deployed, if it has, skip to STO - await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { - if (result != "0x0000000000000000000000000000000000000000") { - console.log('\x1b[32m%s\x1b[0m', "Token deployed at address " + result + "."); - tokenDeployedAddress = result; - tokenDeployed = true; - } - }); - if (tokenDeployed) { - let securityTokenABI = abis.securityToken(); - securityToken = new web3.eth.Contract(securityTokenABI, tokenDeployedAddress); +async function saveInBlockchain() { + let gtmModules; + try { + gtmModules = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); + } catch (e) { + console.log("Please attach General Transfer module before launch this action.", e) + process.exit(0) } - let gmtModules = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); - let generalTransferManagerAddress = gmtModules[0]; - let generalTransferManagerABI = abis.generalTransferManager(); - let generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, generalTransferManagerAddress); + + generalTransferManager = new web3.eth.Contract(abis.generalTransferManager(), gtmModules[0]); console.log(` ------------------------------------------------------- @@ -145,16 +99,11 @@ async function setInvestors() { ------------------------------------------------------- `); - //this for loop will do the batches, so it should run 75, 75, 50 with 200 for (let i = 0; i < distribData.length; i++) { try { - let investorArray = []; - let fromTimesArray = []; - let toTimesArray = []; - let expiryTimeArray = []; - let canBuyFromSTOArray = []; + let investorArray = [], fromTimesArray = [], toTimesArray = [], expiryTimeArray = [], canBuyFromSTOArray = []; - //splitting the user arrays to be organized by input + // Splitting the user arrays to be organized by input for (let j = 0; j < distribData[i].length; j++) { investorArray.push(distribData[i][j][0]) fromTimesArray.push(distribData[i][j][1]) @@ -163,40 +112,33 @@ async function setInvestors() { canBuyFromSTOArray.push(distribData[i][j][4]) } - //fromTimes is ability to sell coin FROM your account (2nd row in csv, 2nd parameter in modifyWhiteList() ) - //toTimes is ability to buy coins TOwards your account (3rd row in csv, 3rd parameter in modifyWhiteList() ) - //expiryTime is time at which KYC of investor get expired (4th row in csv, 4rd parameter in modifyWhiteList() ) let modifyWhitelistMultiAction = generalTransferManager.methods.modifyWhitelistMulti(investorArray, fromTimesArray, toTimesArray, expiryTimeArray, canBuyFromSTOArray); - let r = await common.sendTransaction(modifyWhitelistMultiAction); + let tx = await common.sendTransaction(modifyWhitelistMultiAction); console.log(`Batch ${i} - Attempting to modifyWhitelist accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Whitelist transaxction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); + console.log("Whitelist transaxction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); } catch (err) { - console.log("ERROR:", err); + console.log("ERROR", err) + process.exit(0) } } - console.log("Retrieving logs to determine investors have had their times uploaded correctly.\n\n") + return; +} +async function finalResults() { let totalInvestors = 0; let updatedInvestors = 0; - - let investorData_Events = new Array(); let investorObjectLookup = {}; - - let event_data = await generalTransferManager.getPastEvents('ModifyWhitelist', { - fromBlock: 0, - toBlock: 'latest' - }, function (error, events) { - //console.log(error); - }); + let investorData_Events = new Array(); + let event_data = await generalTransferManager.getPastEvents('ModifyWhitelist', {fromBlock: 0, toBlock: 'latest'}, () => {}); for (var i = 0; i < event_data.length; i++) { let combineArray = []; - let investorAddress_Event = event_data[i].returnValues._investor; + let investorAddress_Event = event_data[i].returnValues._investor let fromTime_Event = event_data[i].returnValues._fromTime let toTime_Event = event_data[i].returnValues._toTime let expiryTime_Event = event_data[i].returnValues._expiryTime @@ -212,34 +154,25 @@ async function setInvestors() { investorData_Events.push(combineArray) - //we have already recorded it, so this is an update to our object + // We have already recorded it, so this is an update to our object if (investorObjectLookup.hasOwnProperty(investorAddress_Event)) { - - //the block number form the event we are checking is bigger, so we gotta replace it + // The block number form the event we are checking is bigger, so we gotta replace it if (investorObjectLookup[investorAddress_Event].recordedBlockNumber < blockNumber) { - investorObjectLookup[investorAddress_Event] = { fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber }; + investorObjectLookup[investorAddress_Event] = {fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber}; updatedInvestors += 1; - // investorAddress_Events.push(investorAddress_Event); not needed, because we start the obj with zero events - - } else { - //do nothing. so if we find an event, and it was an older block, its old, we dont care } - //we have never recorded this address as an object key, so we need to add it to our list of investors updated by the csv } else { - investorObjectLookup[investorAddress_Event] = { fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber }; + investorObjectLookup[investorAddress_Event] = {fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber}; totalInvestors += 1; - // investorAddress_Events.push(investorAddress_Event); } } + let investorAddress_Events = Object.keys(investorObjectLookup) console.log(`******************** EVENT LOGS ANALYSIS COMPLETE ********************\n`); console.log(`A total of ${totalInvestors} investors have been whitelisted total, all time.\n`); console.log(`This script in total sent ${fullFileData.length - badData.length} new investors and updated investors to the blockchain.\n`); console.log(`There were ${badData.length} bad entries that didnt get sent to the blockchain in the script.\n`); - - // console.log("LIST OF ALL INVESTOR DATA FROM EVENTS:", investorData_Events) - // console.log(fullFileData) console.log("************************************************************************************************"); console.log("OBJECT WITH EVERY USER AND THEIR UPDATED TIMES: \n\n", investorObjectLookup) console.log("************************************************************************************************"); @@ -256,31 +189,34 @@ async function setInvestors() { console.log("************************************************************************************************"); console.log("-- No LogModifyWhitelist event was found for the following data arrays. Please review them manually --") console.log(missingDistribs) - // for (var i = 0; i < missingDistribs.length; i++) { - // console.log('\x1b[31m%s\x1b[0m', `No Transfer event was found for account ${missingDistribs[i]}`); - // } console.log("************************************************************************************************"); } else { console.log("\n************************************************************************************************"); console.log("All accounts passed through from the CSV were successfully whitelisted, because we were able to read them all from events") console.log("************************************************************************************************"); } - // console.log(`Run 'node scripts/verify_airdrop.js ${polyDistribution.address} > scripts/data/review.csv' to get a log of all the accounts that were distributed the airdrop tokens.`) + } -//will be deleted once DATES are updated -function isValidDayInput(days) { - let today = Date.now() / 1000 - let isValid = !isNaN(days) - if (isValid) { - let addedSeconds = days * 86400 +function whitelist_processing(csv_line) { + let isAddress = web3.utils.isAddress(csv_line[0]); + let sellValid = isValidDate(csv_line[1]) + let buyValid = isValidDate(csv_line[2]) + let kycExpiryDate = isValidDate(csv_line[3]) + let canBuyFromSTO = (typeof JSON.parse(csv_line[4].toLowerCase())) == "boolean" ? JSON.parse(csv_line[4].toLowerCase()) : "not-valid"; - let unixTimestamp = today + addedSeconds - console.log("unxitimestapm :" , (unixTimestamp)) + if (isAddress && + sellValid && + buyValid && + kycExpiryDate && + (canBuyFromSTO != "not-valid")) { + + return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), sellValid, buyValid, kycExpiryDate, canBuyFromSTO)] - return unixTimestamp } else { - return false + + return [false, new Array(csv_line[0], sellValid, buyValid, kycExpiryDate, canBuyFromSTO)] + } } @@ -288,15 +224,23 @@ function isValidDate(date) { var matches = /^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/.exec(date); if (matches == null) return false; var d = matches[2]; - var m = matches[1] - 1; //not clear why this is -1, but it works after checking + var m = matches[1] - 1; var y = matches[3]; var composedDate = new Date(y, m, d); var timestampDate = composedDate.getTime() - //note, some reason these timestamps are being recorded +4 hours UTC - if (composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y) { + // For some reason these timestamps are being recorded +4 hours UTC + if (composedDate.getDate() == d && + composedDate.getMonth() == m && + composedDate.getFullYear() == y) { return timestampDate / 1000 } else { return false } } + +module.exports = { + executeApp: async (tokenSymbol, batchSize) => { + return startScript(tokenSymbol, batchSize); + } +} \ No newline at end of file diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index f802ab4c0..db0c02d9d 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -6,6 +6,7 @@ var investor_portal = require('./commands/investor_portal'); var module_manager = require('./commands/module_manager'); var st20generator = require('./commands/ST20Generator'); var transfer = require('./commands/transfer'); +var whitelist = require('./commands/whitelist'); var transfer_ownership = require('./commands/transfer_ownership'); var dividends_manager = require('./commands/dividends_manager'); var transfer_manager = require('./commands/transfer_manager'); @@ -101,7 +102,7 @@ program .description('Mass-update a whitelist of allowed/known investors') .action(async function(tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); - shell.exec(`${__dirname}/commands/scripts/script.sh Whitelist ${tokenSymbol} ${batchSize} ${program.remoteNode}`); + await whitelist.executeApp(tokenSymbol, batchSize); }); program From 34ef7e8c5476a626fe23fc7040089922a4860751 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Tue, 13 Nov 2018 10:59:15 +0530 Subject: [PATCH 047/139] Updated documentation --- CHANGELOG.md | 18 ++++++++++---- contracts/modules/STO/USDTieredSTO.sol | 33 +++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 869af0d8e..82d075303 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,26 @@ # Changelog All notable changes to this project will be documented in this file. -# v1.5.0 - Release Candidate +# v2.1.0 -[__1.5.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __15-08-18__ +[__2.1.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __13-09-18__ ## Added * Added `getSTODetails` to USDTSTO. * Added an Array of Tiers that will hold data about every tier in USDTSTO. * Added `buyWithETHRateLimited`, `buyWithPOLYRateLimited` and `buyWithUSDRateLimited` to USDTSTO. + +##Changed +* `getAllModulesAndPermsFromTypes()` does not take securityToken address as a parameter anymore. + +## Removed +* Individual mappings for tier data removed in UDSTSTO. + +# v1.5.0 - Release Candidate + +[__1.5.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __15-08-18__ + +## Added * Added `getInvestorsAt` which returns the investors (non-zero balances) at a particular checkpoint * Added `iterateInvestors` to allow an a subset of `investors` to be returned from the security token in case `investors` is large. * `ChangeModuleBudget` in SecurityToken now takes in the change in budget rather than absoulte budget. Added boolean paramter to decide increase/decrease. @@ -37,7 +49,6 @@ All notable changes to this project will be documented in this file. * Add new function `modifyTickerDetails()`, To modify the details of undeployed ticker. #230 ## Fixed -* `getAllModulesAndPermsFromTypes()` does not take securityToken address as a parameter anymore. * 0x0 and duplicate address in exclusions are no longer allowed in dividend modules. * All permissions are denied if no permission manager is active. * Generalize the STO varaible names and added them in `ISTO.sol` to use the common standard in all STOs. @@ -45,7 +56,6 @@ All notable changes to this project will be documented in this file. * Change the function name of `withdraPoly` to `withdrawERC20` and make the function generalize to extract tokens from the ST contract. parmeters are contract address and the value need to extract from the securityToken. ## Removed -* Individual mappings for tier data removed in UDSTSTO. * Removed investors list pruning * Remove `swarmHash` from the `registerTicker(), addCustomTicker(), generateSecurityToken(), addCustomSecurityToken()` functions of TickerRegistry.sol and SecurityTokenRegistry.sol. #230 * Remove `Log` prefix from all the event present in the ecosystem. diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index bd2df86c3..a210db45d 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -200,12 +200,21 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { _modifyLimits(_nonAccreditedLimitUSD, _minimumInvestmentUSD); } + /** + * @dev Modifies fund raise types + * @param _fundRaiseTypes Array of fund raise types to allow + */ function modifyFunding(FundRaiseType[] _fundRaiseTypes) external onlyOwner { /*solium-disable-next-line security/no-block-members*/ require(now < startTime, "STO already started"); _setFundRaiseType(_fundRaiseTypes); } + /** + * @dev modifies max non accredited invets limit and overall minimum investment limit + * @param _nonAccreditedLimitUSD max non accredited invets limit + * @param _minimumInvestmentUSD overall minimum investment limit + */ function modifyLimits( uint256 _nonAccreditedLimitUSD, uint256 _minimumInvestmentUSD @@ -215,6 +224,13 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { _modifyLimits(_nonAccreditedLimitUSD, _minimumInvestmentUSD); } + /** + * @dev modifiers STO tiers. All tiers must be passed, can not edit specific tiers. + * @param _ratePerTier Array of rates per tier + * @param _ratePerTierDiscountPoly Array of discounted poly rates per tier + * @param _tokensPerTierTotal Array of total tokens per tier + * @param _tokensPerTierDiscountPoly Array of discounted tokens per tier + */ function modifyTiers( uint256[] _ratePerTier, uint256[] _ratePerTierDiscountPoly, @@ -226,6 +242,11 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { _modifyTiers(_ratePerTier, _ratePerTierDiscountPoly, _tokensPerTierTotal, _tokensPerTierDiscountPoly); } + /** + * @dev Modifies STO start and end times + * @param _startTime start time of sto + * @param _endTime end time of sto + */ function modifyTimes( uint256 _startTime, uint256 _endTime @@ -233,6 +254,12 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { _modifyTimes(_startTime, _endTime); } + /** + * @dev Modifies addresses used as wallet, reserve wallet and usd token + * @param _wallet Address of wallet where funds are sent + * @param _reserveWallet Address of wallet where unsold tokens are sent + * @param _usdToken Address of usd token (DAI) + */ function modifyAddresses( address _wallet, address _reserveWallet, @@ -378,7 +405,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { buyWithETHRateLimited(msg.sender, 0); } - // For backwards compatibility + // Buy functions without rate restriction function buyWithETH(address _beneficiary) external payable { buyWithETHRateLimited(_beneficiary, 0); } @@ -620,6 +647,10 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { return (tiers[tiers.length - 1].mintedTotal == tiers[tiers.length - 1].tokenTotal); } + /** + * @dev returns current conversion rate of funds + * @param _fundRaiseType Fund raise type to get rate of + */ function getRate(FundRaiseType _fundRaiseType) public view returns (uint256) { if (_fundRaiseType == FundRaiseType.ETH) { return IOracle(_getOracle(bytes32("ETH"), bytes32("USD"))).getPrice(); From 937235bfaf92302fcdf3fcf80f6c23604f4025ec Mon Sep 17 00:00:00 2001 From: satyam Date: Tue, 13 Nov 2018 17:34:45 +0530 Subject: [PATCH 048/139] minor fix --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82d075303..f9ffcb644 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog All notable changes to this project will be documented in this file. -# v2.1.0 +# v2.1.0 - Release Candidate [__2.1.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __13-09-18__ @@ -16,7 +16,7 @@ All notable changes to this project will be documented in this file. ## Removed * Individual mappings for tier data removed in UDSTSTO. -# v1.5.0 - Release Candidate +# v1.5.0 [__1.5.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __15-08-18__ @@ -63,7 +63,7 @@ All notable changes to this project will be documented in this file. ====== -# v1.4.1 - Release Candidate +# v1.4.1 [__1.4.1__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __13-08-18__ @@ -87,7 +87,7 @@ All notable changes to this project will be documented in this file. * Fix #238: make beneficial investments optionally supported (default to not allowed) -# v1.4.0 - Release candidate +# v1.4.0 [__1.4.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __13-08-18__ From e2c426202542303a3026d04248218364aa3aea91 Mon Sep 17 00:00:00 2001 From: satyam Date: Tue, 13 Nov 2018 17:52:13 +0530 Subject: [PATCH 049/139] ignore the certificate --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 14c03d06b..cf13bd2e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ cache: matrix: fast_finish: true before_install: + - export GIT_SSL_NO_VERIFY=1 - echo -ne '\n' | sudo add-apt-repository ppa:ethereum/ethereum - sudo apt-get -y update - sudo apt-get -y install solc From 2c91dc14564b44719788fa5efcabf7537ee6d209 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Tue, 13 Nov 2018 17:55:57 +0530 Subject: [PATCH 050/139] Allow unauthenticated repos --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index cf13bd2e2..6ce84961a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,8 @@ cache: matrix: fast_finish: true before_install: - - export GIT_SSL_NO_VERIFY=1 - echo -ne '\n' | sudo add-apt-repository ppa:ethereum/ethereum - - sudo apt-get -y update + - sudo apt-get -y update --allow-unauthenticated - sudo apt-get -y install solc before_script: - truffle version From 261f2a85a1048bce441cdb904a73dfcfe9b0b9c0 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Tue, 13 Nov 2018 18:02:52 +0530 Subject: [PATCH 051/139] Removed travis before install --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6ce84961a..caddfc523 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,6 @@ cache: - node_modules matrix: fast_finish: true -before_install: - - echo -ne '\n' | sudo add-apt-repository ppa:ethereum/ethereum - - sudo apt-get -y update --allow-unauthenticated - - sudo apt-get -y install solc before_script: - truffle version - wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js From 018fee2d3137b48ea50a85805840cf03d4021e33 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Tue, 13 Nov 2018 18:49:03 +0530 Subject: [PATCH 052/139] Configuration by factory allowed only once --- contracts/modules/STO/USDTieredSTO.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index a210db45d..44569d469 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -192,6 +192,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { address _reserveWallet, address _usdToken ) public onlyFactory { + require(endTime == 0, "Already configured"); _modifyTimes(_startTime, _endTime); _modifyTiers(_ratePerTier, _ratePerTierDiscountPoly, _tokensPerTierTotal, _tokensPerTierDiscountPoly); // NB - _setFundRaiseType must come before modifyAddresses From 2ee91c488223302f62d4847c74cae1c8e6851f00 Mon Sep 17 00:00:00 2001 From: Polymath Date: Tue, 13 Nov 2018 10:23:12 -0300 Subject: [PATCH 053/139] Multi mint refactor --- CLI/commands/OLD_multi_mint.js | 280 ++++++++++++++++++++++++++++++++ CLI/commands/multi_mint.js | 281 +++++++++++++++------------------ CLI/polymath-cli.js | 3 +- 3 files changed, 410 insertions(+), 154 deletions(-) create mode 100644 CLI/commands/OLD_multi_mint.js diff --git a/CLI/commands/OLD_multi_mint.js b/CLI/commands/OLD_multi_mint.js new file mode 100644 index 000000000..d550fcd3e --- /dev/null +++ b/CLI/commands/OLD_multi_mint.js @@ -0,0 +1,280 @@ +var fs = require('fs'); +var csv = require('fast-csv'); +var BigNumber = require('bignumber.js'); +const chalk = require('chalk'); +var common = require('./common/common_functions'); +var global = require('./common/global'); + +/////////////////////////////ARTIFACTS////////////////////////////////////////// +var contracts = require('./helpers/contract_addresses'); +var abis = require('./helpers/contract_abis'); + +const STO_KEY = 3; + +let securityToken; + +////////////////////////////USER INPUTS////////////////////////////////////////// +let tokenSymbol = process.argv.slice(2)[0]; //token symbol +let BATCH_SIZE = process.argv.slice(2)[1]; //batch size +if (!BATCH_SIZE) BATCH_SIZE = 75; +let remoteNetwork = process.argv.slice(2)[2]; + +/////////////////////////GLOBAL VARS////////////////////////////////////////// + +//distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] +let distribData = new Array(); +//allocData is a temporary array that stores up to the batch size, +//then gets push into distribData, then gets set to 0 to start another batch +let allocData = new Array(); +//full file data is a single array that contains all arrays. i.e. if there are 200 entries we get [[200]] +let fullFileData = new Array(); +let badData = new Array(); + +//////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// + +startScript(); + +async function startScript() { + if (remoteNetwork == 'undefined') remoteNetwork = undefined; + await global.initialize(remoteNetwork); + + try { + let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); + let securityTokenRegistryABI = abis.securityTokenRegistry(); + securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); + securityTokenRegistry.setProvider(web3.currentProvider); + + console.log("Processing investor CSV upload. Batch size is "+BATCH_SIZE+" accounts per transaction"); + readFile(); + } catch (err) { + console.log(err) + console.log('\x1b[31m%s\x1b[0m', "There was a problem getting the contracts. Make sure they are deployed to the selected network."); + return; + } +} + +function readFile() { + var stream = fs.createReadStream("./CLI/data/multi_mint_data.csv"); + + let index = 0; + let batch = 0; + console.log(` + -------------------------------------------- + ----------- Parsing the csv file ----------- + -------------------------------------------- + `); + + var csvStream = csv() + .on("data", function (data) { + let isAddress = web3.utils.isAddress(data[0]); + let validToken = isvalidToken(data[1]); + + if (isAddress && validToken) { + let userArray = new Array() + let checksummedAddress = web3.utils.toChecksumAddress(data[0]); + + userArray.push(checksummedAddress) + userArray.push(validToken) + allocData.push(userArray); + fullFileData.push(userArray); + index++; + if (index >= 75) { + distribData.push(allocData); + allocData = []; + index = 0; + } + + } else { + let userArray = new Array() + //dont need this here, as if it is NOT an address this function will fail + //let checksummedAddress = web3.utils.toChecksumAddress(data[1]); + userArray.push(data[0]) + userArray.push(data[1]); + badData.push(userArray); + fullFileData.push(userArray) + } + }) + .on("end", function () { + //Add last remainder batch + distribData.push(allocData); + allocData = []; + + mint_tokens_for_affliliates(); + }); + + stream.pipe(csvStream); + } + + async function mint_tokens_for_affliliates() { + let tokenDeployed = false; + let tokenDeployedAddress; + // Let's check if token has already been deployed, if it has, skip to STO + await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { + if (result != "0x0000000000000000000000000000000000000000") { + console.log('\x1b[32m%s\x1b[0m', "Token deployed at address " + result + "."); + tokenDeployedAddress = result; + tokenDeployed = true; + } + }); + if (tokenDeployed) { + let securityTokenABI = abis.securityToken(); + securityToken = new web3.eth.Contract(securityTokenABI, tokenDeployedAddress); + } + let modules = await securityToken.methods.getModulesByType(STO_KEY).call(); + if (modules.length == 0) { + console.log("****************************************************************************************\n"); + console.log("*************" + chalk.red(" Minting of tokens is only allowed before the STO get attached ") + "************\n"); + console.log("****************************************************************************************\n"); + process.exit(0); + } + console.log(` + ------------------------------------------------------- + ------------ Mint the tokens to affiliates ------------ + ------------------------------------------------------- + `); + + let affiliatesFailedArray = []; + let affiliatesKYCInvalidArray = []; + //this for loop will do the batches, so it should run 75, 75, 50 with 200 + for (let i = 0; i < distribData.length; i++) { + try { + let affiliatesVerifiedArray = []; + let tokensVerifiedArray = []; + //splitting the user arrays to be organized by input + for (let j = 0; j < distribData[i].length; j++) { + let investorAccount = distribData[i][j][0]; + let tokenAmount = web3.utils.toWei((distribData[i][j][1]).toString(),"ether"); + let verifiedTransaction = await securityToken.methods.verifyTransfer("0x0000000000000000000000000000000000000000", investorAccount, tokenAmount, web3.utils.fromAscii('')).call(); + if (verifiedTransaction) { + affiliatesVerifiedArray.push(investorAccount); + tokensVerifiedArray.push(tokenAmount); + } else { + let gtmModule = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); + let generalTransferManagerABI = abis.generalTransferManager(); + let generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, gtmModule[0]); + let validKYC = (await generalTransferManager.methods.whitelist(Issuer.address).call()).expiryTime > Math.floor(Date.now()/1000); + if (validKYC) { + affiliatesFailedArray.push(investorAccount); + } else { + affiliatesKYCInvalidArray.push(investorAccount); + } + } + } + let mintMultiAction = securityToken.methods.mintMulti(affiliatesVerifiedArray, tokensVerifiedArray); + let r = await common.sendTransaction(mintMultiAction); + console.log(`Batch ${i} - Attempting to send the Minted tokens to affiliates accounts:\n\n`, affiliatesVerifiedArray, "\n\n"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); + console.log("Multi Mint transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); + + + } catch (err) { + console.log("ERROR:", err); + } + } + + console.log("Retrieving logs to determine investors have had their tokens correctly.\n\n") + + let totalInvestors = 0; + let updatedInvestors = 0; + + let investorData_Events = new Array(); + let investorObjectLookup = {}; + + let event_data = await securityToken.getPastEvents('Minted', { + fromBlock: 0, + toBlock: 'latest' + }, function (error, events) { + + }); + + for (var i = 0; i < event_data.length; i++) { + let combineArray = []; + + let investorAddress_Event = event_data[i].returnValues._to; + let amount_Event = event_data[i].returnValues._value; + let blockNumber = event_data[i].blockNumber + + combineArray.push(investorAddress_Event); + combineArray.push(amount_Event); + combineArray.push(blockNumber); + + investorData_Events.push(combineArray) + //we have already recorded it, so this is an update to our object + if (investorObjectLookup.hasOwnProperty(investorAddress_Event)) { + + //the block number form the event we are checking is bigger, so we gotta replace it + if (investorObjectLookup[investorAddress_Event].recordedBlockNumber < blockNumber) { + investorObjectLookup[investorAddress_Event] = { amount: amount_Event, recordedBlockNumber: blockNumber }; + updatedInvestors += 1; + // investorAddress_Events.push(investorAddress_Event); not needed, because we start the obj with zero events + + } else { + //do nothing. so if we find an event, and it was an older block, its old, we dont care + } + //we have never recorded this address as an object key, so we need to add it to our list of investors updated by the csv + } else { + investorObjectLookup[investorAddress_Event] = { amount: amount_Event, recordedBlockNumber: blockNumber }; + totalInvestors += 1; + // investorAddress_Events.push(investorAddress_Event); + } + } + let investorAddress_Events = Object.keys(investorObjectLookup) + + console.log(`******************** EVENT LOGS ANALYSIS COMPLETE ********************\n`); + console.log(`A total of ${totalInvestors} affiliated investors get the token\n`); + console.log(`This script in total sent ${fullFileData.length - badData.length - affiliatesFailedArray.length - affiliatesKYCInvalidArray.length} new investors and updated investors to the blockchain.\n`); + console.log(`There were ${badData.length} bad entries that didnt get sent to the blockchain in the script.\n`); + console.log(`There were ${affiliatesKYCInvalidArray.length} accounts with invalid KYC.\n`); + console.log(`There were ${affiliatesFailedArray.length} accounts that didn't get sent to the blockchain as they would fail.\n`); + + console.log("************************************************************************************************"); + console.log("OBJECT WITH EVERY USER AND THEIR MINTED TOKEN: \n\n", investorObjectLookup) + console.log("************************************************************************************************"); + console.log("LIST OF ALL INVESTORS WHO GOT THE MINTED TOKENS: \n\n", investorAddress_Events) + + let missingDistribs = []; + let failedVerificationDistribs = []; + let invalidKYCDistribs = []; + for (let l = 0; l < fullFileData.length; l++) { + if (affiliatesKYCInvalidArray.includes(fullFileData[l][0])) { + invalidKYCDistribs.push(fullFileData[l]); + } else if (affiliatesFailedArray.includes(fullFileData[l][0])) { + failedVerificationDistribs.push(fullFileData[l]); + } else if (!investorObjectLookup.hasOwnProperty(fullFileData[l][0])) { + missingDistribs.push(fullFileData[l]); + } + } + + if (invalidKYCDistribs.length > 0) { + console.log("**************************************************************************************************************************"); + console.log("The following data arrays have an invalid KYC. Please review if these accounts are whitelisted and their KYC is not expired\n"); + console.log(invalidKYCDistribs); + console.log("**************************************************************************************************************************"); + } + if (failedVerificationDistribs.length > 0) { + console.log("*********************************************************************************************************"); + console.log("-- The following data arrays failed at verifyTransfer. Please review if these accounts are whitelisted --\n"); + console.log(failedVerificationDistribs); + console.log("*********************************************************************************************************"); + } + if (missingDistribs.length > 0) { + console.log("******************************************************************************************"); + console.log("-- No Minted event was found for the following data arrays. Please review them manually --\n"); + console.log(missingDistribs); + console.log("******************************************************************************************"); + } + if (missingDistribs.length == 0 && failedVerificationDistribs.length == 0 && invalidKYCDistribs.length == 0) { + console.log("\n**************************************************************************************************************************"); + console.log("All accounts passed through from the CSV were successfully get the tokens, because we were able to read them all from events"); + console.log("****************************************************************************************************************************"); + } +} + +function isvalidToken(token) { + var tokenAmount = parseInt(token); + if((tokenAmount % 1 == 0)) { + return tokenAmount; + } + return false; +} diff --git a/CLI/commands/multi_mint.js b/CLI/commands/multi_mint.js index b138ef849..4e83c4190 100644 --- a/CLI/commands/multi_mint.js +++ b/CLI/commands/multi_mint.js @@ -1,157 +1,118 @@ +var common = require('./common/common_functions'); var fs = require('fs'); var csv = require('fast-csv'); -var BigNumber = require('bignumber.js'); -const chalk = require('chalk'); -var common = require('./common/common_functions'); -var global = require('./common/global'); - -/////////////////////////////ARTIFACTS////////////////////////////////////////// var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); +var BigNumber = require('bignumber.js'); -const STO_KEY = 3; - -let securityToken; - -////////////////////////////USER INPUTS////////////////////////////////////////// -let tokenSymbol = process.argv.slice(2)[0]; //token symbol -let BATCH_SIZE = process.argv.slice(2)[1]; //batch size -if (!BATCH_SIZE) BATCH_SIZE = 75; -let remoteNetwork = process.argv.slice(2)[2]; - -/////////////////////////GLOBAL VARS////////////////////////////////////////// - -//distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] let distribData = new Array(); -//allocData is a temporary array that stores up to the batch size, -//then gets push into distribData, then gets set to 0 to start another batch let allocData = new Array(); -//full file data is a single array that contains all arrays. i.e. if there are 200 entries we get [[200]] let fullFileData = new Array(); let badData = new Array(); +let BATCH_SIZE = 75; +let securityToken; +let affiliatesFailedArray = new Array(); +let affiliatesKYCInvalidArray = new Array(); -//////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// +async function startScript(tokenSymbol, batchSize) { + if (batchSize) { + BATCH_SIZE = batchSize; + } + + common.logAsciiBull(); -startScript(); + let STAddress = await checkST(tokenSymbol); + securityToken = new web3.eth.Contract(abis.securityToken(), STAddress); + + await readCsv(); +}; -async function startScript() { - if (remoteNetwork == 'undefined') remoteNetwork = undefined; - await global.initialize(remoteNetwork); +async function checkST(tokenSymbol) { + let securityTokenRegistry = await STConnect(); - try { - let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); - let securityTokenRegistryABI = abis.securityTokenRegistry(); - securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); - securityTokenRegistry.setProvider(web3.currentProvider); + return await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { + if (result != "0x0000000000000000000000000000000000000000") { + return result + } else { + console.log("Token doesn't exist") + process.exit(0) + } + }); +} - console.log("Processing investor CSV upload. Batch size is "+BATCH_SIZE+" accounts per transaction"); - readFile(); +async function STConnect() { + try { + let STRegistryAddress = await contracts.securityTokenRegistry(); + let STRegistry = new web3.eth.Contract(abis.securityTokenRegistry(), STRegistryAddress); + return STRegistry; } catch (err) { - console.log(err) - console.log('\x1b[31m%s\x1b[0m', "There was a problem getting the contracts. Make sure they are deployed to the selected network."); - return; + console.log("There was a problem getting the contracts. Make sure they are deployed to the selected network."); + process.exit(0); } } -function readFile() { - var stream = fs.createReadStream("./CLI/data/multi_mint_data.csv"); - - let index = 0; - let batch = 0; - console.log(` - -------------------------------------------- - ----------- Parsing the csv file ----------- - -------------------------------------------- - `); - - var csvStream = csv() - .on("data", function (data) { - let isAddress = web3.utils.isAddress(data[0]); - let validToken = isvalidToken(data[1]); - - if (isAddress && validToken) { - let userArray = new Array() - let checksummedAddress = web3.utils.toChecksumAddress(data[0]); - - userArray.push(checksummedAddress) - userArray.push(validToken) - allocData.push(userArray); - fullFileData.push(userArray); - index++; - if (index >= 75) { - distribData.push(allocData); - allocData = []; - index = 0; - } - - } else { - let userArray = new Array() - //dont need this here, as if it is NOT an address this function will fail - //let checksummedAddress = web3.utils.toChecksumAddress(data[1]); - userArray.push(data[0]) - userArray.push(data[1]); - badData.push(userArray); - fullFileData.push(userArray) +async function readCsv() { + var CSV_STRING = fs.readFileSync("./CLI/data/multi_mint_data.csv").toString(); + let i = 0; + + csv.fromString(CSV_STRING) + .on("data", (data) => { + let data_processed = multimint_processing(data); + fullFileData.push(data_processed[1]); + + if (data_processed[0]) { + allocData.push(data_processed[1]); + i++; + if (i >= BATCH_SIZE) { + distribData.push(allocData); + allocData = []; + i = 0; } - }) - .on("end", function () { - //Add last remainder batch - distribData.push(allocData); - allocData = []; + } else { + badData.push(data_processed[1]); + } + + }) + .on("end", async () => { + distribData.push(allocData); + allocData = []; - mint_tokens_for_affliliates(); - }); + await saveInBlockchain(); + await finalResults(); + return; + }); +} - stream.pipe(csvStream); +async function saveInBlockchain() { + + try { + await securityToken.methods.getModulesByType(3).call(); + } catch (e) { + console.log("Minting of tokens is only allowed before the STO get attached", e) + process.exit(0) } - async function mint_tokens_for_affliliates() { - let tokenDeployed = false; - let tokenDeployedAddress; - // Let's check if token has already been deployed, if it has, skip to STO - await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { - if (result != "0x0000000000000000000000000000000000000000") { - console.log('\x1b[32m%s\x1b[0m', "Token deployed at address " + result + "."); - tokenDeployedAddress = result; - tokenDeployed = true; - } - }); - if (tokenDeployed) { - let securityTokenABI = abis.securityToken(); - securityToken = new web3.eth.Contract(securityTokenABI, tokenDeployedAddress); - } - let modules = await securityToken.methods.getModulesByType(STO_KEY).call(); - if (modules.length > 0) { - console.log("****************************************************************************************\n"); - console.log("*************" + chalk.red(" Minting of tokens is only allowed before the STO get attached ") + "************\n"); - console.log("****************************************************************************************\n"); - process.exit(0); - } - console.log(` - ------------------------------------------------------- - ------------ Mint the tokens to affiliates ------------ - ------------------------------------------------------- - `); - - let affiliatesFailedArray = []; - let affiliatesKYCInvalidArray = []; - //this for loop will do the batches, so it should run 75, 75, 50 with 200 + console.log(` + ----------------------------------------- + ----- Mint the tokens to affiliates ----- + ----------------------------------------- + `); + for (let i = 0; i < distribData.length; i++) { try { - let affiliatesVerifiedArray = []; - let tokensVerifiedArray = []; - //splitting the user arrays to be organized by input + let affiliatesVerifiedArray = [], tokensVerifiedArray = []; + + // Splitting the user arrays to be organized by input for (let j = 0; j < distribData[i].length; j++) { let investorAccount = distribData[i][j][0]; - let tokenAmount = web3.utils.toWei((distribData[i][j][1]).toString(),"ether"); + let tokenAmount = web3.utils.toWei((distribData[i][j][1]).toString(), "ether"); let verifiedTransaction = await securityToken.methods.verifyTransfer("0x0000000000000000000000000000000000000000", investorAccount, tokenAmount, web3.utils.fromAscii('')).call(); if (verifiedTransaction) { affiliatesVerifiedArray.push(investorAccount); tokensVerifiedArray.push(tokenAmount); } else { let gtmModule = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); - let generalTransferManagerABI = abis.generalTransferManager(); - let generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, gtmModule[0]); + let generalTransferManager = new web3.eth.Contract(abis.generalTransferManager(), gtmModule[0]); let validKYC = (await generalTransferManager.methods.whitelist(Issuer.address).call()).expiryTime > Math.floor(Date.now()/1000); if (validKYC) { affiliatesFailedArray.push(investorAccount); @@ -160,65 +121,57 @@ function readFile() { } } } + let mintMultiAction = securityToken.methods.mintMulti(affiliatesVerifiedArray, tokensVerifiedArray); - let r = await common.sendTransaction(mintMultiAction); + let tx = await common.sendTransaction(mintMultiAction); console.log(`Batch ${i} - Attempting to send the Minted tokens to affiliates accounts:\n\n`, affiliatesVerifiedArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Multi Mint transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); + console.log("Multi Mint transaction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); - } catch (err) { - console.log("ERROR:", err); + console.log("ERROR", err) + process.exit(0) } } - console.log("Retrieving logs to determine investors have had their tokens correctly.\n\n") + return; +} +async function finalResults() { let totalInvestors = 0; let updatedInvestors = 0; - - let investorData_Events = new Array(); let investorObjectLookup = {}; + let investorData_Events = new Array(); - let event_data = await securityToken.getPastEvents('Minted', { - fromBlock: 0, - toBlock: 'latest' - }, function (error, events) { - - }); + let event_data = await securityToken.getPastEvents('Minted', {fromBlock: 0, toBlock: 'latest'}, () => {}); for (var i = 0; i < event_data.length; i++) { let combineArray = []; let investorAddress_Event = event_data[i].returnValues._to; let amount_Event = event_data[i].returnValues._value; - let blockNumber = event_data[i].blockNumber + let blockNumber = event_data[i].blockNumber; combineArray.push(investorAddress_Event); combineArray.push(amount_Event); combineArray.push(blockNumber); investorData_Events.push(combineArray) - //we have already recorded it, so this is an update to our object - if (investorObjectLookup.hasOwnProperty(investorAddress_Event)) { - //the block number form the event we are checking is bigger, so we gotta replace it + // We have already recorded it, so this is an update to our object + if (investorObjectLookup.hasOwnProperty(investorAddress_Event)) { + // The block number form the event we are checking is bigger, so we gotta replace it if (investorObjectLookup[investorAddress_Event].recordedBlockNumber < blockNumber) { - investorObjectLookup[investorAddress_Event] = { amount: amount_Event, recordedBlockNumber: blockNumber }; + investorObjectLookup[investorAddress_Event] = {amount: amount_Event, recordedBlockNumber: blockNumber}; updatedInvestors += 1; - // investorAddress_Events.push(investorAddress_Event); not needed, because we start the obj with zero events - - } else { - //do nothing. so if we find an event, and it was an older block, its old, we dont care } - //we have never recorded this address as an object key, so we need to add it to our list of investors updated by the csv } else { - investorObjectLookup[investorAddress_Event] = { amount: amount_Event, recordedBlockNumber: blockNumber }; + investorObjectLookup[investorAddress_Event] = {amount: amount_Event, recordedBlockNumber: blockNumber}; totalInvestors += 1; - // investorAddress_Events.push(investorAddress_Event); } } + let investorAddress_Events = Object.keys(investorObjectLookup) console.log(`******************** EVENT LOGS ANALYSIS COMPLETE ********************\n`); @@ -227,15 +180,12 @@ function readFile() { console.log(`There were ${badData.length} bad entries that didnt get sent to the blockchain in the script.\n`); console.log(`There were ${affiliatesKYCInvalidArray.length} accounts with invalid KYC.\n`); console.log(`There were ${affiliatesFailedArray.length} accounts that didn't get sent to the blockchain as they would fail.\n`); - console.log("************************************************************************************************"); console.log("OBJECT WITH EVERY USER AND THEIR MINTED TOKEN: \n\n", investorObjectLookup) console.log("************************************************************************************************"); console.log("LIST OF ALL INVESTORS WHO GOT THE MINTED TOKENS: \n\n", investorAddress_Events) - let missingDistribs = []; - let failedVerificationDistribs = []; - let invalidKYCDistribs = []; + let missingDistribs = [], failedVerificationDistribs = [], invalidKYCDistribs = []; for (let l = 0; l < fullFileData.length; l++) { if (affiliatesKYCInvalidArray.includes(fullFileData[l][0])) { invalidKYCDistribs.push(fullFileData[l]); @@ -264,17 +214,42 @@ function readFile() { console.log(missingDistribs); console.log("******************************************************************************************"); } - if (missingDistribs.length == 0 && failedVerificationDistribs.length == 0 && invalidKYCDistribs.length == 0) { + if (missingDistribs.length == 0 && + failedVerificationDistribs.length == 0 && + invalidKYCDistribs.length == 0) { console.log("\n**************************************************************************************************************************"); console.log("All accounts passed through from the CSV were successfully get the tokens, because we were able to read them all from events"); console.log("****************************************************************************************************************************"); } + +} + +function multimint_processing(csv_line) { + let isAddress = web3.utils.isAddress(csv_line[0]); + let validToken = isValidToken(csv_line[1]); + + if (isAddress && + validToken) { + + return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), validToken)] + + } else { + + return [false, new Array(csv_line[0], csv_line[1])] + + } } -function isvalidToken(token) { +function isValidToken(token) { var tokenAmount = parseInt(token); - if((tokenAmount % 1 == 0)) { + if ((tokenAmount % 1 == 0)) { return tokenAmount; } return false; } + +module.exports = { + executeApp: async (tokenSymbol, batchSize) => { + return startScript(tokenSymbol, batchSize); + } +} \ No newline at end of file diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index db0c02d9d..43ec73dd8 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -7,6 +7,7 @@ var module_manager = require('./commands/module_manager'); var st20generator = require('./commands/ST20Generator'); var transfer = require('./commands/transfer'); var whitelist = require('./commands/whitelist'); +var multimint = require('./commands/multi_mint'); var transfer_ownership = require('./commands/transfer_ownership'); var dividends_manager = require('./commands/dividends_manager'); var transfer_manager = require('./commands/transfer_manager'); @@ -75,7 +76,7 @@ program .description('Distribute tokens to previously whitelisted investors') .action(async function(tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); - shell.exec(`${__dirname}/commands/scripts/script.sh Multimint ${tokenSymbol} ${batchSize} ${program.remoteNode}`);; + await multimint.executeApp(tokenSymbol, batchSize); }); program From eb5079a2211eb9858c4adc1929fbcbf44a276283 Mon Sep 17 00:00:00 2001 From: Polymath Date: Tue, 13 Nov 2018 11:51:42 -0300 Subject: [PATCH 054/139] Accredit refactor --- CLI/commands/OLD_accredit.js | 149 +++++++++++++++++++++++++ CLI/commands/accredit.js | 210 ++++++++++++++++++----------------- CLI/commands/multi_mint.js | 8 +- CLI/polymath-cli.js | 3 +- 4 files changed, 268 insertions(+), 102 deletions(-) create mode 100644 CLI/commands/OLD_accredit.js diff --git a/CLI/commands/OLD_accredit.js b/CLI/commands/OLD_accredit.js new file mode 100644 index 000000000..a0aa306a2 --- /dev/null +++ b/CLI/commands/OLD_accredit.js @@ -0,0 +1,149 @@ +var fs = require('fs'); +var csv = require('fast-csv'); +var BigNumber = require('bignumber.js'); +var chalk = require('chalk'); +var common = require('./common/common_functions'); +var global = require('./common/global'); +var contracts = require('./helpers/contract_addresses'); +var abis = require('./helpers/contract_abis') + +/////////////////////////////ARTIFACTS////////////////////////////////////////// +let securityTokenRegistry; +let securityToken; +let usdTieredSTO; + +////////////////////////////USER INPUTS////////////////////////////////////////// +let tokenSymbol = process.argv.slice(2)[0]; //token symbol +let BATCH_SIZE = process.argv.slice(2)[1]; //batch size +if (!BATCH_SIZE) BATCH_SIZE = 75; +let remoteNetwork = process.argv.slice(2)[2]; + +/////////////////////////GLOBAL VARS////////////////////////////////////////// +//distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] +let distribData = new Array(); +//allocData is a temporary array that stores up to the batch size, +//then gets push into distribData, then gets set to 0 to start another batch +let allocData = new Array(); +//full file data is a single array that contains all arrays. i.e. if there are 200 entries we get [[200]] +let fullFileData = new Array(); +//baa data is an array that contains invalid entries +let badData = new Array(); + +//////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// +startScript(); + +async function startScript() { + if (remoteNetwork == 'undefined') remoteNetwork = undefined; + await global.initialize(remoteNetwork); + + try { + let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); + let securityTokenRegistryABI = abis.securityTokenRegistry(); + securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); + securityTokenRegistry.setProvider(web3.currentProvider); + console.log("Processing investor CSV upload. Batch size is " + BATCH_SIZE + " accounts per transaction"); + readFile(); + } catch (err) { + console.log(err) + console.log('\x1b[31m%s\x1b[0m', "There was a problem getting the contracts. Make sure they are deployed to the selected network."); + return; + } +} + +///////////////////////////FUNCTION READING THE CSV FILE +function readFile() { + var stream = fs.createReadStream("./CLI/data/accredited_data.csv"); + + let index = 0; + console.log(` + -------------------------------------------- + ----------- Parsing the csv file ----------- + -------------------------------------------- + `); + + var csvStream = csv() + .on("data", function (data) { + let isAddress = web3.utils.isAddress(data[0]); + let isAccredited = (typeof JSON.parse(data[1].toLowerCase())) == "boolean" ? JSON.parse(data[1].toLowerCase()) : "not-valid"; + + if (isAddress && (isAccredited != "not-valid") ) { + let userArray = new Array() + let checksummedAddress = web3.utils.toChecksumAddress(data[0]); + + userArray.push(checksummedAddress) + userArray.push(isAccredited) + + allocData.push(userArray); + fullFileData.push(userArray); + + index++; + if (index >= BATCH_SIZE) { + distribData.push(allocData); + allocData = []; + index = 0; + } + } else { + let userArray = new Array() + userArray.push(data[0]) + userArray.push(isAccredited); + + badData.push(userArray); + fullFileData.push(userArray) + } + }) + .on("end", function () { + //Add last remainder batch + distribData.push(allocData); + allocData = []; + + changeAccredited(); + }); + + stream.pipe(csvStream); +} + +// MAIN FUNCTION COMMUNICATING TO BLOCKCHAIN +async function changeAccredited() { + // Let's check if token has already been deployed, if it has, skip to STO + let tokenDeployedAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call(); + if (tokenDeployedAddress != "0x0000000000000000000000000000000000000000") { + let securityTokenABI = abis.securityToken(); + securityToken = new web3.eth.Contract(securityTokenABI, tokenDeployedAddress); + let result = await securityToken.methods.getModulesByName(web3.utils.toHex('USDTieredSTO')).call(); + if (result.length > 0) { + let usdTieredSTOABI = abis.usdTieredSTO(); + usdTieredSTO = new web3.eth.Contract(usdTieredSTOABI, result[0]); + console.log(` +------------------------------------------------------- +----- Sending accreditation changes to blockchain ----- +------------------------------------------------------- + `); + //this for loop will do the batches, so it should run 75, 75, 50 with 200 + for (let i = 0; i < distribData.length; i++) { + try { + let investorArray = []; + let isAccreditedArray = []; + + //splitting the user arrays to be organized by input + for (let j = 0; j < distribData[i].length; j++) { + investorArray.push(distribData[i][j][0]) + isAccreditedArray.push(distribData[i][j][1]) + } + + let changeAccreditedAction = usdTieredSTO.methods.changeAccredited(investorArray, isAccreditedArray); + let r = await common.sendTransaction(changeAccreditedAction); + console.log(`Batch ${i} - Attempting to change accredited accounts:\n\n`, investorArray, "\n\n"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); + console.log("Change accredited transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); + } catch (err) { + console.log("ERROR:", err); + } + } + } else { + console.log(chalk.red(`There is no USDTieredSTO module attached to the ${tokenSymbol.toUpperCase()} Token. No further actions can be taken.`)); + } + } else { + console.log(chalk.red(`Token symbol provided is not a registered Security Token.`)); + } +} diff --git a/CLI/commands/accredit.js b/CLI/commands/accredit.js index a0aa306a2..079e1040c 100644 --- a/CLI/commands/accredit.js +++ b/CLI/commands/accredit.js @@ -1,149 +1,159 @@ +var common = require('./common/common_functions'); var fs = require('fs'); var csv = require('fast-csv'); -var BigNumber = require('bignumber.js'); -var chalk = require('chalk'); -var common = require('./common/common_functions'); -var global = require('./common/global'); var contracts = require('./helpers/contract_addresses'); -var abis = require('./helpers/contract_abis') - -/////////////////////////////ARTIFACTS////////////////////////////////////////// -let securityTokenRegistry; -let securityToken; -let usdTieredSTO; - -////////////////////////////USER INPUTS////////////////////////////////////////// -let tokenSymbol = process.argv.slice(2)[0]; //token symbol -let BATCH_SIZE = process.argv.slice(2)[1]; //batch size -if (!BATCH_SIZE) BATCH_SIZE = 75; -let remoteNetwork = process.argv.slice(2)[2]; +var abis = require('./helpers/contract_abis'); +var BigNumber = require('bignumber.js'); -/////////////////////////GLOBAL VARS////////////////////////////////////////// -//distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] let distribData = new Array(); -//allocData is a temporary array that stores up to the batch size, -//then gets push into distribData, then gets set to 0 to start another batch let allocData = new Array(); -//full file data is a single array that contains all arrays. i.e. if there are 200 entries we get [[200]] let fullFileData = new Array(); -//baa data is an array that contains invalid entries let badData = new Array(); -//////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// -startScript(); +let BATCH_SIZE = 70; +let securityToken; + +async function startScript(tokenSymbol, batchSize) { + if (batchSize) { + BATCH_SIZE = batchSize; + } + + common.logAsciiBull(); + + let STAddress = await checkST(tokenSymbol); + securityToken = new web3.eth.Contract(abis.securityToken(), STAddress); + + await readCsv(); +}; -async function startScript() { - if (remoteNetwork == 'undefined') remoteNetwork = undefined; - await global.initialize(remoteNetwork); +async function checkST(tokenSymbol) { + let securityTokenRegistry = await STConnect(); + return await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { + if (result != "0x0000000000000000000000000000000000000000") { + return result + } else { + console.log("Token doesn't exist") + process.exit(0) + } + }); +} + +async function STConnect() { try { - let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); - let securityTokenRegistryABI = abis.securityTokenRegistry(); - securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); - securityTokenRegistry.setProvider(web3.currentProvider); - console.log("Processing investor CSV upload. Batch size is " + BATCH_SIZE + " accounts per transaction"); - readFile(); + let STRegistryAddress = await contracts.securityTokenRegistry(); + let STRegistry = new web3.eth.Contract(abis.securityTokenRegistry(), STRegistryAddress); + return STRegistry; } catch (err) { - console.log(err) - console.log('\x1b[31m%s\x1b[0m', "There was a problem getting the contracts. Make sure they are deployed to the selected network."); - return; + console.log("There was a problem getting the contracts. Make sure they are deployed to the selected network."); + process.exit(0); } } -///////////////////////////FUNCTION READING THE CSV FILE -function readFile() { - var stream = fs.createReadStream("./CLI/data/accredited_data.csv"); - - let index = 0; - console.log(` - -------------------------------------------- - ----------- Parsing the csv file ----------- - -------------------------------------------- - `); +async function readCsv() { + var CSV_STRING = fs.readFileSync("./CLI/data/accredited_data.csv").toString(); + let i = 0; - var csvStream = csv() - .on("data", function (data) { - let isAddress = web3.utils.isAddress(data[0]); - let isAccredited = (typeof JSON.parse(data[1].toLowerCase())) == "boolean" ? JSON.parse(data[1].toLowerCase()) : "not-valid"; + csv.fromString(CSV_STRING) + .on("data", (data) => { + let data_processed = accredit_processing(data); + fullFileData.push(data_processed[1]); - if (isAddress && (isAccredited != "not-valid") ) { - let userArray = new Array() - let checksummedAddress = web3.utils.toChecksumAddress(data[0]); - - userArray.push(checksummedAddress) - userArray.push(isAccredited) - - allocData.push(userArray); - fullFileData.push(userArray); - - index++; - if (index >= BATCH_SIZE) { + if (data_processed[0]) { + allocData.push(data_processed[1]); + i++; + if (i >= BATCH_SIZE) { distribData.push(allocData); allocData = []; - index = 0; + i = 0; } } else { - let userArray = new Array() - userArray.push(data[0]) - userArray.push(isAccredited); - - badData.push(userArray); - fullFileData.push(userArray) + badData.push(data_processed[1]); } + }) - .on("end", function () { - //Add last remainder batch + .on("end", async () => { distribData.push(allocData); allocData = []; - changeAccredited(); + await saveInBlockchain(); + return; }); - - stream.pipe(csvStream); } -// MAIN FUNCTION COMMUNICATING TO BLOCKCHAIN -async function changeAccredited() { - // Let's check if token has already been deployed, if it has, skip to STO - let tokenDeployedAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call(); - if (tokenDeployedAddress != "0x0000000000000000000000000000000000000000") { - let securityTokenABI = abis.securityToken(); - securityToken = new web3.eth.Contract(securityTokenABI, tokenDeployedAddress); - let result = await securityToken.methods.getModulesByName(web3.utils.toHex('USDTieredSTO')).call(); - if (result.length > 0) { - let usdTieredSTOABI = abis.usdTieredSTO(); - usdTieredSTO = new web3.eth.Contract(usdTieredSTOABI, result[0]); - console.log(` -------------------------------------------------------- ------ Sending accreditation changes to blockchain ----- -------------------------------------------------------- - `); - //this for loop will do the batches, so it should run 75, 75, 50 with 200 +async function saveInBlockchain() { + let gtmModules; + try { + gtmModules = await securityToken.methods.getModulesByName(web3.utils.toHex('USDTieredSTO')).call(); + } catch (e) { + console.log("Please attach USDTieredSTO module before launch this action.", e) + process.exit(0) + } + + if (!gtmModules.length) { + console.log("Please attach USDTieredSTO module before launch this action.") + process.exit(0) + } + + let usdTieredSTO = new web3.eth.Contract(abis.usdTieredSTO(), gtmModules[0]); + + console.log(` + -------------------------------------------------------- + ----- Sending accreditation changes to blockchain ----- + -------------------------------------------------------- + `); + + for (let i = 0; i < distribData.length; i++) { + try { + + // Splitting the user arrays to be organized by input for (let i = 0; i < distribData.length; i++) { try { - let investorArray = []; - let isAccreditedArray = []; + let investorArray = [], isAccreditedArray = []; - //splitting the user arrays to be organized by input for (let j = 0; j < distribData[i].length; j++) { investorArray.push(distribData[i][j][0]) isAccreditedArray.push(distribData[i][j][1]) } let changeAccreditedAction = usdTieredSTO.methods.changeAccredited(investorArray, isAccreditedArray); - let r = await common.sendTransaction(changeAccreditedAction); + let tx = await common.sendTransaction(changeAccreditedAction); console.log(`Batch ${i} - Attempting to change accredited accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Change accredited transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); + console.log("Change accredited transaction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); } catch (err) { console.log("ERROR:", err); } } - } else { - console.log(chalk.red(`There is no USDTieredSTO module attached to the ${tokenSymbol.toUpperCase()} Token. No further actions can be taken.`)); - } + + } catch (err) { + console.log("ERROR", err) + process.exit(0) + } + } + + return; +} + +function accredit_processing(csv_line) { + let isAddress = web3.utils.isAddress(csv_line[0]); + let isAccredited = (typeof JSON.parse(csv_line[1].toLowerCase())) == "boolean" ? JSON.parse(csv_line[1].toLowerCase()) : "not-valid"; + + if (isAddress && + (isAccredited != "not-valid")) { + + return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), isAccredited)] + } else { - console.log(chalk.red(`Token symbol provided is not a registered Security Token.`)); + + return [false, new Array(csv_line[0], isAccredited)] + } } + +module.exports = { + executeApp: async (tokenSymbol, batchSize) => { + return startScript(tokenSymbol, batchSize); + } +} \ No newline at end of file diff --git a/CLI/commands/multi_mint.js b/CLI/commands/multi_mint.js index 4e83c4190..723c2a34c 100644 --- a/CLI/commands/multi_mint.js +++ b/CLI/commands/multi_mint.js @@ -84,14 +84,20 @@ async function readCsv() { } async function saveInBlockchain() { + let gtmModules; try { - await securityToken.methods.getModulesByType(3).call(); + gtmModules = await securityToken.methods.getModulesByType(3).call(); } catch (e) { console.log("Minting of tokens is only allowed before the STO get attached", e) process.exit(0) } + if (!gtmModules.length) { + console.log("Minting of tokens is only allowed before the STO get attached") + process.exit(0) + } + console.log(` ----------------------------------------- ----- Mint the tokens to affiliates ----- diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 43ec73dd8..6d496cd00 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -8,6 +8,7 @@ var st20generator = require('./commands/ST20Generator'); var transfer = require('./commands/transfer'); var whitelist = require('./commands/whitelist'); var multimint = require('./commands/multi_mint'); +var accredit = require('./commands/accredit'); var transfer_ownership = require('./commands/transfer_ownership'); var dividends_manager = require('./commands/dividends_manager'); var transfer_manager = require('./commands/transfer_manager'); @@ -139,7 +140,7 @@ program .description('Runs accredit') .action(async function(tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); - shell.exec(`${__dirname}/commands/scripts/script.sh Accredit ${tokenSymbol} ${batchSize} ${program.remoteNode}`);; + await accredit.executeApp(tokenSymbol, batchSize); }); program From ae711879e667d7080c4d1619b4adc749face8d13 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Tue, 13 Nov 2018 14:05:11 -0300 Subject: [PATCH 055/139] token_manager command --- CLI/commands/helpers/contract_abis.js | 10 + CLI/commands/module_manager.js | 445 ------------------- CLI/commands/token_manager.js | 600 ++++++++++++++++++++++++++ CLI/polymath-cli.js | 10 +- 4 files changed, 615 insertions(+), 450 deletions(-) delete mode 100644 CLI/commands/module_manager.js create mode 100644 CLI/commands/token_manager.js diff --git a/CLI/commands/helpers/contract_abis.js b/CLI/commands/helpers/contract_abis.js index b6c58cc38..ba8ce2007 100644 --- a/CLI/commands/helpers/contract_abis.js +++ b/CLI/commands/helpers/contract_abis.js @@ -15,6 +15,8 @@ let erc20DividendCheckpointABI; let etherDividendCheckpointABI; let moduleInterfaceABI; let ownableABI; +let iSTOABI; +let iTransferManagerABI; let moduleFactoryABI; try { @@ -35,6 +37,8 @@ try { etherDividendCheckpointABI = JSON.parse(require('fs').readFileSync('./build/contracts/EtherDividendCheckpoint.json').toString()).abi; moduleInterfaceABI = JSON.parse(require('fs').readFileSync('./build/contracts/IModule.json').toString()).abi; ownableABI = JSON.parse(require('fs').readFileSync('./build/contracts/Ownable.json').toString()).abi; + iSTOABI = JSON.parse(require('fs').readFileSync('./build/contracts/ISTO.json').toString()).abi + iTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/ITransferManager.json').toString()).abi moduleFactoryABI = JSON.parse(require('fs').readFileSync('./build/contracts/ModuleFactory.json').toString()).abi; } catch (err) { console.log('\x1b[31m%s\x1b[0m',"Couldn't find contracts' artifacts. Make sure you ran truffle compile first"); @@ -93,6 +97,12 @@ module.exports = { ownable: function () { return ownableABI; }, + ISTO: function () { + return iSTOABI; + }, + ITransferManager: function () { + return iTransferManagerABI; + }, moduleFactory: function () { return moduleFactoryABI; } diff --git a/CLI/commands/module_manager.js b/CLI/commands/module_manager.js deleted file mode 100644 index 53f2a863a..000000000 --- a/CLI/commands/module_manager.js +++ /dev/null @@ -1,445 +0,0 @@ -// Libraries for terminal prompts -var readlineSync = require('readline-sync'); -var chalk = require('chalk'); -var common = require('./common/common_functions'); - -// Load contract artifacts -var contracts = require('./helpers/contract_addresses'); -var abis = require('./helpers/contract_abis'); - -let securityTokenRegistry; -let securityToken; -let polyToken; - -// Init token info -let STSymbol; -let STAddress; -let STDetails; -let validSymbol = false; - -// Init Module Info -let pmModules; -let tmModules; -let stoModules; -let cpModules; -let numPM; -let numTM; -let numSTO; -let numCP; - -async function setup() { - try { - let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); - let securityTokenRegistryABI = abis.securityTokenRegistry(); - securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); - securityTokenRegistry.setProvider(web3.currentProvider); - - let polytokenAddress = await contracts.polyToken(); - let polytokenABI = abis.polyToken(); - polyToken = new web3.eth.Contract(polytokenABI, polytokenAddress); - polyToken.setProvider(web3.currentProvider); - }catch(err){ - console.log(err); - console.log(chalk.red(`There was a problem getting the contracts. Make sure they are deployed to the selected network.`)); - process.exit(0); - } -} - -// Start function -async function executeApp() { - - common.logAsciiBull(); - console.log(chalk.yellow(`******************************************`)); - console.log(chalk.yellow(`Welcome to the Command-Line Module Manager`)); - console.log(chalk.yellow(`******************************************`)); - - await setup(); - await showUserInfo(Issuer.address); - - while (!validSymbol) { - await getSecurityToken(); - } -}; - -// get token contract based on input symbol -async function getSecurityToken() { - STSymbol = readlineSync.question(chalk.yellow(`\nEnter the symbol of the registered security token you issued: `)); - STAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(STSymbol).call(); - if (STAddress == "0x0000000000000000000000000000000000000000") { - console.log(chalk.red(`\nToken symbol provided is not a registered Security Token. Please enter another symbol.`)); - return; - } - STDetails = await securityTokenRegistry.methods.getSecurityTokenData(STAddress).call(); - if (STDetails[1] != Issuer.address) { - console.log(chalk.red(`\nYou did not issue the Security Token associated with the symbol provided. Please enter another symbol.`)); - return; - } - validSymbol = true; - let securityTokenABI = abis.securityToken(); - securityToken = new web3.eth.Contract(securityTokenABI, STAddress); - - await displayModules(); - -} - -// display module status -async function displayModules() { - - await showUserInfo(Issuer.address); - - // Security Token details - let displayTokenSymbol = await securityToken.methods.symbol().call(); - let displayTokenSupply = await securityToken.methods.totalSupply().call(); - let displayUserTokens = await securityToken.methods.balanceOf(Issuer.address).call(); - - console.log(` - ************** Security Token Information *************** - - Address: ${STAddress} - - Token symbol: ${displayTokenSymbol.toUpperCase()} - - Total supply: ${web3.utils.fromWei(displayTokenSupply)} ${displayTokenSymbol.toUpperCase()} - - User balance: ${web3.utils.fromWei(displayUserTokens)} ${displayTokenSymbol.toUpperCase()} - `); - - // Module Details - pmModules = await iterateModules(1); - tmModules = await iterateModules(2); - stoModules = await iterateModules(3); - cpModules = await iterateModules(4); - - // Module Counts - numPM = pmModules.length; - numTM = tmModules.length; - numSTO = stoModules.length; - numCP = cpModules.length; - - console.log(` - ****************** Module Information ******************* - - Permission Manager: ${(numPM > 0) ? numPM : 'None'} - - Transfer Manager: ${(numTM > 0) ? numTM : 'None'} - - STO: ${(numSTO > 0) ? numSTO : 'None'} - - Checkpoint: ${(numCP > 0) ? numCP : 'None'} - `); - - if (numPM) { - console.log(chalk.green(`\n Permission Manager Modules:`)); - for (i=0;i m.type == gbl.constants.MODULES_TYPES.PERMISSION); + let tmModules = allModules.filter(m => m.type == gbl.constants.MODULES_TYPES.TRANSFER); + let stoModules = allModules.filter(m => m.type == gbl.constants.MODULES_TYPES.STO); + let cpModules = allModules.filter(m => m.type == gbl.constants.MODULES_TYPES.DIVIDENDS); + let burnModules = allModules.filter(m => m.type == gbl.constants.MODULES_TYPES.BURN); + + // Module Counts + let numPM = pmModules.length; + let numTM = tmModules.length; + let numSTO = stoModules.length; + let numCP = cpModules.length; + let numBURN = burnModules.length; + + console.log(` +******************* Module Information ******************** +- Permission Manager: ${(numPM > 0) ? numPM : 'None'} +- Transfer Manager: ${(numTM > 0) ? numTM : 'None'} +- STO: ${(numSTO > 0) ? numSTO : 'None'} +- Checkpoint: ${(numCP > 0) ? numCP : 'None'} +- Burn: ${(numBURN > 0) ? numBURN : 'None'} + `); + + if (numPM) { + console.log(`Permission Manager Modules:`); + pmModules.map(m => console.log(`- ${m.name} is ${(m.archived) ? chalk.yellow('archived') : 'unarchived'} at ${m.address}`)); + } + + if (numTM) { + console.log(`Transfer Manager Modules:`); + tmModules.map(m => console.log(`- ${m.name} is ${(m.archived) ? chalk.yellow('archived') : 'unarchived'} at ${m.address}`)); + } + + if (numSTO) { + console.log(`STO Modules:`); + stoModules.map(m => console.log(`- ${m.name} is ${(m.archived) ? chalk.yellow('archived') : 'unarchived'} at ${m.address}`)); + } + + if (numCP) { + console.log(`Checkpoint Modules:`); + cpModules.map(m => console.log(`- ${m.name} is ${(m.archived) ? chalk.yellow('archived') : 'unarchived'} at ${m.address}`)); + } + + if (numBURN) { + console.log(` Burn Modules:`); + burnModules.map(m => console.log(`- ${m.name} is ${(m.archived) ? chalk.yellow('archived') : 'unarchived'} at ${m.address}`)); + } +} + +async function selectAction() { + let options = ['Update token details'/*, 'Change granularity'*/]; + + let transferFrozen = await securityToken.methods.transfersFrozen().call(); + if (transferFrozen) { + options.push('Unfreeze transfers'); + } else { + options.push('Freeze transfers'); + } + + let isMintingFrozen = await securityToken.methods.mintingFrozen().call(); + if (!isMintingFrozen) { + let isFreezeMintingAllowed = await featureRegistry.methods.getFeatureStatus('freezeMintingAllowed').call(); + if (isFreezeMintingAllowed) { + options.push('Freeze minting permanently'); + } + } + + options.push('Create a checkpoint', 'List investors') + + let currentCheckpointId = await securityToken.methods.currentCheckpointId().call(); + if (currentCheckpointId > 0) { + options.push('List investors at checkpoint') + } + + if (!isMintingFrozen) { + options.push('Mint tokens'); + } + + options.push('Manage modules', 'Withdraw tokens from contract'); + + let index = readlineSync.keyInSelect(options, 'What do you want to do?', {cancel: 'Exit'}); + let selected = index == -1 ? 'Exit' : options[index]; + console.log('Selected:', selected); + switch (selected) { + case 'Update token details': + let updatedDetails = readlineSync.question('Enter new off-chain details of the token (i.e. Dropbox folder url): '); + await updateTokenDetails(updatedDetails); + break; + case 'Change granularity': + //let granularity = readlineSync.questionInt('Enter ') + //await changeGranularity(); + break; + case 'Freeze transfers': + await freezeTransfers(); + break; + case 'Unfreeze transfers': + await unfreezeTransfers(); + break; + case 'Freeze minting permanently': + await freezeMinting(); + break; + case 'Create a checkpoint': + await createCheckpoint(); + break; + case 'List investors': + await listInvestors(); + break; + case 'List investors at checkpoint': + let checkpointId = readlineSync.questionInt('Enter the id of the checkpoint: ', { + limit: function (input) { + return input > 0 && input <= currentCheckpointId; + }, + limitMessage: `Must be greater than 0 and less than ${currentCheckpointId}` + }); + await listInvestorsAtCheckpoint(checkpointId); + break; + case 'Mint tokens': + await mintTokens(); + break; + case 'Manage modules': + await listModuleOptions(); + break; + case 'Withdraw tokens from contract': + let tokenAddress = readlineSync.question(`Enter the ERC20 token address (POLY ${polyToken.options.address}): `, { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address", + defaultInput: polyToken.options.address + }); + let value = readlineSync.questionFloat('Enter the value to withdraw: ', { + limit: function (input) { + return input > 0; + }, + limitMessage: "Must be a greater than 0" + }); + await withdrawFromContract(tokenAddress, web3.utils.toWei(new web3.utils.BN(value))); + break; + case 'Exit': + process.exit(); + break; + } +} + +// Token actions +async function updateTokenDetails(updatedDetails) { + let updateTokenDetailsAction = securityToken.methods.updateTokenDetails(updatedDetails); + await common.sendTransaction(updateTokenDetailsAction); + console.log(chalk.green(`Token details have been updated successfully!`)); +} + +async function freezeTransfers() { + let freezeTransfersAction = securityToken.methods.freezeTransfers(); + await common.sendTransaction(freezeTransfersAction); + console.log(chalk.green(`Transfers have been frozen successfully!`)); +} + +async function unfreezeTransfers() { + let unfreezeTransfersAction = securityToken.methods.unfreezeTransfers(); + await common.sendTransaction(unfreezeTransfersAction); + console.log(chalk.green(`Transfers have been unfrozen successfully!`)); +} + +async function freezeMinting() { + let freezeMintingAction = securityToken.methods.freezeMinting(); + await common.sendTransaction(freezeMintingAction); + console.log(chalk.green(`Minting has been frozen successfully!.`)); +} + +async function createCheckpoint() { + let createCheckpointAction = securityToken.methods.createCheckpoint(); + let receipt = await common.sendTransaction(createCheckpointAction); + let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'CheckpointCreated'); + console.log(chalk.green(`Checkpoint ${event._checkpointId} has been created successfully!`)); +} + +async function listInvestors() { + let investors = await securityToken.methods.getInvestors().call(); + console.log(); + if (investors.length > 0) { + console.log('***** List of investors *****'); + investors.map(i => console.log(i)); + } else { + console.log(chalk.yellow('There are no investors yet')); + } +} + +async function listInvestorsAtCheckpoint(checkpointId) { + let investors = await securityToken.methods.getInvestorsAt(checkpointId).call(); + console.log(); + if (investors.length > 0) { + console.log(`*** List of investors at checkpoint ${checkpointId} ***`); + investors.map(i => console.log(i)); + } else { + console.log(chalk.yellow(`There are no investors at checkpoint ${checkpointId}`)); + } + +} + +async function mintTokens() { + let options = ['Modify whitelist', 'Mint tokens to a single address', `Modify whitelist and mint tokens using data from 'whitelist_data.csv' and 'multi_mint_data.csv'`]; + let index = readlineSync.keyInSelect(options, 'What do you want to do?', {cancel: 'Return'}); + let selected = index == -1 ? 'Return' : options[index]; + console.log('Selected:', selected); + switch (selected) { + case 'Modify whitelist': + let investor = readlineSync.question('Enter the address to whitelist: ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let fromTime = readlineSync.questionInt('Enter the time (Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens: '); + let toTime = readlineSync.questionInt('Enter the time (Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others: '); + let expiryTime = readlineSync.questionInt('Enter the time till investors KYC will be validated (after that investor need to do re-KYC): '); + let canBuyFromSTO = readlineSync.keyInYNStrict('Is the investor a restricted investor?'); + await modifyWhitelist(investor, fromTime, toTime, expiryTime, canBuyFromSTO); + break; + case 'Mint tokens to a single address': + console.log(chalk.yellow(`Investor should be previously whitelisted.`)); + let receiver = readlineSync.question(`Enter the address to receive the tokens: `); + let amount = readlineSync.question(`Enter the amount of tokens to mint: `); + await mintToSingleAddress(receiver, amount); + break; + case `Modify whitelist and mint tokens using data from 'whitelist_data.csv' and 'multi_mint_data.csv'`: + await multi_mint_tokens(); + break; + } +} + +/// Mint actions +async function modifyWhitelist(investor, fromTime, toTime, expiryTime, canBuyFromSTO) { + let gmtModules = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); + let generalTransferManagerAddress = gmtModules[0]; + let generalTransferManagerABI = abis.generalTransferManager(); + let generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, generalTransferManagerAddress); + + let modifyWhitelistAction = generalTransferManager.methods.modifyWhitelist(investor, fromTime, toTime, expiryTime, canBuyFromSTO); + let modifyWhitelistReceipt = await common.sendTransaction(modifyWhitelistAction); + let modifyWhitelistEvent = common.getEventFromLogs(generalTransferManager._jsonInterface, modifyWhitelistReceipt.logs, 'ModifyWhitelist'); + console.log(chalk.green(`${modifyWhitelistEvent._investor} has been whitelisted sucessfully!`)); +} + +async function mintToSingleAddress(_investor, _amount) { + try { + let mintAction = securityToken.methods.mint(_investor, web3.utils.toWei(_amount)); + let receipt = await common.sendTransaction(mintAction); + let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'Minted'); + console.log(chalk.green(`${web3.utils.fromWei(event._value)} tokens have been minted to ${event._to} successfully.`)); + } + catch (e) { + console.log(e); + console.log(chalk.red(`Minting was not successful - Please make sure beneficiary address has been whitelisted`)); + } +} + +async function multi_mint_tokens() { + let tokenSymbol = await securityToken.methods.symbol().call(); + + shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${remoteNetwork}`); + console.log(chalk.green(`\nCongratulations! All the affiliates get succssfully whitelisted, Now its time to Mint the tokens\n`)); + console.log(chalk.red(`WARNING: `) + `Please make sure all the addresses that get whitelisted are only eligible to hold or get Security token\n`); + + shell.exec(`${__dirname}/scripts//script.sh Multimint ${tokenSymbol} 75 ${remoteNetwork}`); + console.log(chalk.green(`\nCongratulations! Tokens get successfully Minted and transferred to token holders`)); +} +/// + +async function withdrawFromContract(erc20address, value) { + let withdrawAction = securityToken.methods.withdrawERC20(erc20address, value); + await common.sendTransaction(withdrawAction); + console.log(chalk.green(`Withdrawn has been successful!.`)); +} +/// + +async function listModuleOptions() { + let options = ['Add a module'] + + let unpausedModules = allModules.filter(m => m.paused == false); + if (unpausedModules.length > 0) { + options.push('Pause a module'); + } + + let pausedModules = allModules.filter(m => m.paused == true); + if (pausedModules.length > 0) { + options.push('Unpause a module'); + } + + let unarchivedModules = allModules.filter(m => !m.archived); + if (unarchivedModules.length > 0) { + options.push('Archive a module'); + } + + let archivedModules = allModules.filter(m => m.archived); + if (archivedModules.length > 0) { + options.push('Unarchive a module'); + } + + if (allModules.length > 0) { + options.push('Remove a module', 'Change module budget'); + } + + let index = readlineSync.keyInSelect(options, chalk.yellow('What do you want to do?'), {cancel: 'Return'}); + let selected = index == -1 ? 'Exit' : options[index]; + console.log('Selected:', selected); + switch (selected) { + case 'Add a module': + await addModule(); + break; + case 'Pause a module': + await pauseModule(unpausedModules); + break; + case 'Unpause a module': + await unpauseModule(pausedModules); + break; + case 'Archive a module': + await archiveModule(unarchivedModules); + break; + case 'Unarchive a module': + await unarchiveModule(archivedModules); + break; + case 'Remove a module': + await removeModule(allModules); + break; + case 'Change module budget': + await changeBudget(allModules); + break; + } +} + +// Modules a actions +async function addModule() { + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************`)); +} + +async function pauseModule(modules) { + let options = modules.map(m => `${m.name} (${m.address})`); + let index = readlineSync.keyInSelect(options, 'Which module whould you like to pause?'); + if (index != -1) { + console.log("\nSelected: ",options[index]); + let moduleABI; + if (modules[index].type == gbl.constants.MODULES_TYPES.STO) { + moduleABI = abis.ISTO(); + } else if (modules[index].type == gbl.constants.MODULES_TYPES.STO) { + moduleABI = abis.ITransferManager(); + } else { + console.log(chalk.red(`Only STO and TM modules can be paused/unpaused`)); + process.exit(0); + } + let pausableModule = new web3.eth.Contract(moduleABI, modules[index].address); + let pauseAction = pausableModule.methods.pause(); + await common.sendTransaction(pauseAction); + console.log(chalk.green(`${modules[index].name} has been paused successfully!`)); + } +} + +async function unpauseModule(modules) { + let options = modules.map(m => `${m.name} (${m.address})`); + let index = readlineSync.keyInSelect(options, 'Which module whould you like to pause?'); + if (index != -1) { + console.log("\nSelected: ",options[index]); + let moduleABI; + if (modules[index].type == gbl.constants.MODULES_TYPES.STO) { + moduleABI = abis.ISTO(); + } else if (modules[index].type == gbl.constants.MODULES_TYPES.STO) { + moduleABI = abis.ITransferManager(); + } else { + console.log(chalk.red(`Only STO and TM modules can be paused/unpaused`)); + process.exit(0); + } + let pausableModule = new web3.eth.Contract(moduleABI, modules[index].address); + let unpauseAction = pausableModule.methods.unpause(); + await common.sendTransaction(unpauseAction); + console.log(chalk.green(`${modules[index].name} has been unpaused successfully!`)); + } +} + +async function archiveModule(modules) { + let options = modules.map(m => `${m.name} (${m.address})`); + let index = readlineSync.keyInSelect(options, 'Which module would you like to archive?'); + if (index != -1) { + console.log("\nSelected: ",options[index]); + let archiveModuleAction = securityToken.methods.archiveModule(modules[index].address); + await common.sendTransaction(archiveModuleAction, {factor: 2}); + console.log(chalk.green(`${modules[index].name} has been archived successfully!`)); + } +} + +async function unarchiveModule(modules) { + let options = modules.map(m => `${m.name} (${m.address})`); + let index = readlineSync.keyInSelect(options, 'Which module whould you like to unarchive?'); + if (index != -1) { + console.log("\nSelected: ",options[index]); + let unarchiveModuleAction = securityToken.methods.unarchiveModule(modules[index].address); + await common.sendTransaction(unarchiveModuleAction, {factor: 2}); + console.log(chalk.green(`${modules[index].name} has been unarchived successfully!`)); + } +} + +async function removeModule(modules) { + let options = modules.map(m => `${m.name} (${m.address})`); + let index = readlineSync.keyInSelect(options, 'Which module whould you like to remove?'); + if (index != -1) { + console.log("\nSelected: ",options[index]); + let removeModuleAction = securityToken.methods.removeModule(modules[index].address); + await common.sendTransaction(removeModuleAction, {factor: 2}); + console.log(chalk.green(`${modules[index].name} has been removed successfully!`)); + } +} + +async function changeBudget() { + let options = modules.map(m => `${m.name} (${m.address})`); + let index = readlineSync.keyInSelect(options, 'Which module whould you like to remove?'); + if (index != -1) { + console.log("\nSelected: ",options[index]); + let increase = 0 == readlineSync.keyInSelect(['Increase', 'Decrease'], `Do you want to increase or decrease budget?`, {cancel: false}); + let amount = readlineSync.question(`Enter the amount of POLY to change in allowance`); + let changeModuleBudgetAction = securityToken.methods.changeModuleBudget(modules[index].address, web3.utils.toWei(amount), increase); + await common.sendTransaction(changeModuleBudgetAction); + console.log(chalk.green(`Module budget has been changed successfully!`)); + } +} + +// Helpers +async function showUserInfo(_user) { + console.log(` +******************** User Information ********************* +- Address: ${_user} +- POLY balance: ${web3.utils.fromWei(await polyToken.methods.balanceOf(_user).call())} +- ETH balance: ${web3.utils.fromWei(await web3.eth.getBalance(_user))} + `); +} + +async function getAllModules() { + function ModuleInfo(_moduleType, _name, _address, _factoryAddress, _archived, _paused) { + this.name = _name; + this.type = _moduleType; + this.address = _address; + this.factoryAddress = _factoryAddress; + this.archived = _archived; + this.paused = _paused; + } + + let modules = []; + + // Iterate over all module types + for (let type = 1; type <= 5; type++) { + let allModules = await securityToken.methods.getModulesByType(type).call(); + + // Iterate over all modules of each type + for (let i = 0; i < allModules.length; i++) { + try { + let details = await securityToken.methods.getModule(allModules[i]).call(); + let nameTemp = web3.utils.hexToUtf8(details[0]); + let pausedTemp = null; + if (type == gbl.constants.MODULES_TYPES.STO || type == gbl.constants.MODULES_TYPES.TRANSFER) { + let abiTemp = JSON.parse(require('fs').readFileSync(`./build/contracts/${nameTemp}.json`).toString()).abi; + let contractTemp = new web3.eth.Contract(abiTemp, details[1]); + pausedTemp = await contractTemp.methods.paused().call(); + } + modules.push(new ModuleInfo(type, nameTemp, details[1], details[2], details[3], pausedTemp)); + } catch(error) { + console.log(error); + console.log(chalk.red(` + ************************* + Unable to iterate over module type - unexpected error + *************************`)); + } + } + } + + return modules; +} + +module.exports = { + executeApp: async function() { + return executeApp(); + } +} diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 4de51588e..c21c9abad 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -3,7 +3,7 @@ const shell = require('shelljs'); var faucet = require('./commands/faucet'); var investor_portal = require('./commands/investor_portal'); -var module_manager = require('./commands/module_manager'); +var token_manager = require('./commands/token_manager'); var st20generator = require('./commands/ST20Generator'); var transfer = require('./commands/transfer'); var transfer_ownership = require('./commands/transfer_ownership'); @@ -55,12 +55,12 @@ program }); program - .command('module_manager') - .alias('mm') - .description('View modules attached to a token and their status') + .command('token_manager') + .alias('stm') + .description('Manage your Security Tokens, mint tokens, add modules and change config') .action(async function() { await gbl.initialize(program.remoteNode); - await module_manager.executeApp(); + await token_manager.executeApp(); }); program From 508abe1bb64f2263839940fa54146400aae1fa78 Mon Sep 17 00:00:00 2001 From: Polymath Date: Tue, 13 Nov 2018 16:14:24 -0300 Subject: [PATCH 056/139] Non accredited limit refactor + delete old files and packages dependencies --- CLI/commands/OLD_accredit.js | 149 ----------- CLI/commands/OLD_multi_mint.js | 280 --------------------- CLI/commands/OLD_whitelist.js | 302 ----------------------- CLI/commands/changeNonAccreditedLimit.js | 212 ++++++++-------- CLI/commands/scripts/script.sh | 19 -- CLI/polymath-cli.js | 4 +- package.json | 1 - 7 files changed, 113 insertions(+), 854 deletions(-) delete mode 100644 CLI/commands/OLD_accredit.js delete mode 100644 CLI/commands/OLD_multi_mint.js delete mode 100644 CLI/commands/OLD_whitelist.js delete mode 100755 CLI/commands/scripts/script.sh diff --git a/CLI/commands/OLD_accredit.js b/CLI/commands/OLD_accredit.js deleted file mode 100644 index a0aa306a2..000000000 --- a/CLI/commands/OLD_accredit.js +++ /dev/null @@ -1,149 +0,0 @@ -var fs = require('fs'); -var csv = require('fast-csv'); -var BigNumber = require('bignumber.js'); -var chalk = require('chalk'); -var common = require('./common/common_functions'); -var global = require('./common/global'); -var contracts = require('./helpers/contract_addresses'); -var abis = require('./helpers/contract_abis') - -/////////////////////////////ARTIFACTS////////////////////////////////////////// -let securityTokenRegistry; -let securityToken; -let usdTieredSTO; - -////////////////////////////USER INPUTS////////////////////////////////////////// -let tokenSymbol = process.argv.slice(2)[0]; //token symbol -let BATCH_SIZE = process.argv.slice(2)[1]; //batch size -if (!BATCH_SIZE) BATCH_SIZE = 75; -let remoteNetwork = process.argv.slice(2)[2]; - -/////////////////////////GLOBAL VARS////////////////////////////////////////// -//distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] -let distribData = new Array(); -//allocData is a temporary array that stores up to the batch size, -//then gets push into distribData, then gets set to 0 to start another batch -let allocData = new Array(); -//full file data is a single array that contains all arrays. i.e. if there are 200 entries we get [[200]] -let fullFileData = new Array(); -//baa data is an array that contains invalid entries -let badData = new Array(); - -//////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// -startScript(); - -async function startScript() { - if (remoteNetwork == 'undefined') remoteNetwork = undefined; - await global.initialize(remoteNetwork); - - try { - let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); - let securityTokenRegistryABI = abis.securityTokenRegistry(); - securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); - securityTokenRegistry.setProvider(web3.currentProvider); - console.log("Processing investor CSV upload. Batch size is " + BATCH_SIZE + " accounts per transaction"); - readFile(); - } catch (err) { - console.log(err) - console.log('\x1b[31m%s\x1b[0m', "There was a problem getting the contracts. Make sure they are deployed to the selected network."); - return; - } -} - -///////////////////////////FUNCTION READING THE CSV FILE -function readFile() { - var stream = fs.createReadStream("./CLI/data/accredited_data.csv"); - - let index = 0; - console.log(` - -------------------------------------------- - ----------- Parsing the csv file ----------- - -------------------------------------------- - `); - - var csvStream = csv() - .on("data", function (data) { - let isAddress = web3.utils.isAddress(data[0]); - let isAccredited = (typeof JSON.parse(data[1].toLowerCase())) == "boolean" ? JSON.parse(data[1].toLowerCase()) : "not-valid"; - - if (isAddress && (isAccredited != "not-valid") ) { - let userArray = new Array() - let checksummedAddress = web3.utils.toChecksumAddress(data[0]); - - userArray.push(checksummedAddress) - userArray.push(isAccredited) - - allocData.push(userArray); - fullFileData.push(userArray); - - index++; - if (index >= BATCH_SIZE) { - distribData.push(allocData); - allocData = []; - index = 0; - } - } else { - let userArray = new Array() - userArray.push(data[0]) - userArray.push(isAccredited); - - badData.push(userArray); - fullFileData.push(userArray) - } - }) - .on("end", function () { - //Add last remainder batch - distribData.push(allocData); - allocData = []; - - changeAccredited(); - }); - - stream.pipe(csvStream); -} - -// MAIN FUNCTION COMMUNICATING TO BLOCKCHAIN -async function changeAccredited() { - // Let's check if token has already been deployed, if it has, skip to STO - let tokenDeployedAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call(); - if (tokenDeployedAddress != "0x0000000000000000000000000000000000000000") { - let securityTokenABI = abis.securityToken(); - securityToken = new web3.eth.Contract(securityTokenABI, tokenDeployedAddress); - let result = await securityToken.methods.getModulesByName(web3.utils.toHex('USDTieredSTO')).call(); - if (result.length > 0) { - let usdTieredSTOABI = abis.usdTieredSTO(); - usdTieredSTO = new web3.eth.Contract(usdTieredSTOABI, result[0]); - console.log(` -------------------------------------------------------- ------ Sending accreditation changes to blockchain ----- -------------------------------------------------------- - `); - //this for loop will do the batches, so it should run 75, 75, 50 with 200 - for (let i = 0; i < distribData.length; i++) { - try { - let investorArray = []; - let isAccreditedArray = []; - - //splitting the user arrays to be organized by input - for (let j = 0; j < distribData[i].length; j++) { - investorArray.push(distribData[i][j][0]) - isAccreditedArray.push(distribData[i][j][1]) - } - - let changeAccreditedAction = usdTieredSTO.methods.changeAccredited(investorArray, isAccreditedArray); - let r = await common.sendTransaction(changeAccreditedAction); - console.log(`Batch ${i} - Attempting to change accredited accounts:\n\n`, investorArray, "\n\n"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Change accredited transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); - } catch (err) { - console.log("ERROR:", err); - } - } - } else { - console.log(chalk.red(`There is no USDTieredSTO module attached to the ${tokenSymbol.toUpperCase()} Token. No further actions can be taken.`)); - } - } else { - console.log(chalk.red(`Token symbol provided is not a registered Security Token.`)); - } -} diff --git a/CLI/commands/OLD_multi_mint.js b/CLI/commands/OLD_multi_mint.js deleted file mode 100644 index d550fcd3e..000000000 --- a/CLI/commands/OLD_multi_mint.js +++ /dev/null @@ -1,280 +0,0 @@ -var fs = require('fs'); -var csv = require('fast-csv'); -var BigNumber = require('bignumber.js'); -const chalk = require('chalk'); -var common = require('./common/common_functions'); -var global = require('./common/global'); - -/////////////////////////////ARTIFACTS////////////////////////////////////////// -var contracts = require('./helpers/contract_addresses'); -var abis = require('./helpers/contract_abis'); - -const STO_KEY = 3; - -let securityToken; - -////////////////////////////USER INPUTS////////////////////////////////////////// -let tokenSymbol = process.argv.slice(2)[0]; //token symbol -let BATCH_SIZE = process.argv.slice(2)[1]; //batch size -if (!BATCH_SIZE) BATCH_SIZE = 75; -let remoteNetwork = process.argv.slice(2)[2]; - -/////////////////////////GLOBAL VARS////////////////////////////////////////// - -//distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] -let distribData = new Array(); -//allocData is a temporary array that stores up to the batch size, -//then gets push into distribData, then gets set to 0 to start another batch -let allocData = new Array(); -//full file data is a single array that contains all arrays. i.e. if there are 200 entries we get [[200]] -let fullFileData = new Array(); -let badData = new Array(); - -//////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// - -startScript(); - -async function startScript() { - if (remoteNetwork == 'undefined') remoteNetwork = undefined; - await global.initialize(remoteNetwork); - - try { - let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); - let securityTokenRegistryABI = abis.securityTokenRegistry(); - securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); - securityTokenRegistry.setProvider(web3.currentProvider); - - console.log("Processing investor CSV upload. Batch size is "+BATCH_SIZE+" accounts per transaction"); - readFile(); - } catch (err) { - console.log(err) - console.log('\x1b[31m%s\x1b[0m', "There was a problem getting the contracts. Make sure they are deployed to the selected network."); - return; - } -} - -function readFile() { - var stream = fs.createReadStream("./CLI/data/multi_mint_data.csv"); - - let index = 0; - let batch = 0; - console.log(` - -------------------------------------------- - ----------- Parsing the csv file ----------- - -------------------------------------------- - `); - - var csvStream = csv() - .on("data", function (data) { - let isAddress = web3.utils.isAddress(data[0]); - let validToken = isvalidToken(data[1]); - - if (isAddress && validToken) { - let userArray = new Array() - let checksummedAddress = web3.utils.toChecksumAddress(data[0]); - - userArray.push(checksummedAddress) - userArray.push(validToken) - allocData.push(userArray); - fullFileData.push(userArray); - index++; - if (index >= 75) { - distribData.push(allocData); - allocData = []; - index = 0; - } - - } else { - let userArray = new Array() - //dont need this here, as if it is NOT an address this function will fail - //let checksummedAddress = web3.utils.toChecksumAddress(data[1]); - userArray.push(data[0]) - userArray.push(data[1]); - badData.push(userArray); - fullFileData.push(userArray) - } - }) - .on("end", function () { - //Add last remainder batch - distribData.push(allocData); - allocData = []; - - mint_tokens_for_affliliates(); - }); - - stream.pipe(csvStream); - } - - async function mint_tokens_for_affliliates() { - let tokenDeployed = false; - let tokenDeployedAddress; - // Let's check if token has already been deployed, if it has, skip to STO - await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { - if (result != "0x0000000000000000000000000000000000000000") { - console.log('\x1b[32m%s\x1b[0m', "Token deployed at address " + result + "."); - tokenDeployedAddress = result; - tokenDeployed = true; - } - }); - if (tokenDeployed) { - let securityTokenABI = abis.securityToken(); - securityToken = new web3.eth.Contract(securityTokenABI, tokenDeployedAddress); - } - let modules = await securityToken.methods.getModulesByType(STO_KEY).call(); - if (modules.length == 0) { - console.log("****************************************************************************************\n"); - console.log("*************" + chalk.red(" Minting of tokens is only allowed before the STO get attached ") + "************\n"); - console.log("****************************************************************************************\n"); - process.exit(0); - } - console.log(` - ------------------------------------------------------- - ------------ Mint the tokens to affiliates ------------ - ------------------------------------------------------- - `); - - let affiliatesFailedArray = []; - let affiliatesKYCInvalidArray = []; - //this for loop will do the batches, so it should run 75, 75, 50 with 200 - for (let i = 0; i < distribData.length; i++) { - try { - let affiliatesVerifiedArray = []; - let tokensVerifiedArray = []; - //splitting the user arrays to be organized by input - for (let j = 0; j < distribData[i].length; j++) { - let investorAccount = distribData[i][j][0]; - let tokenAmount = web3.utils.toWei((distribData[i][j][1]).toString(),"ether"); - let verifiedTransaction = await securityToken.methods.verifyTransfer("0x0000000000000000000000000000000000000000", investorAccount, tokenAmount, web3.utils.fromAscii('')).call(); - if (verifiedTransaction) { - affiliatesVerifiedArray.push(investorAccount); - tokensVerifiedArray.push(tokenAmount); - } else { - let gtmModule = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); - let generalTransferManagerABI = abis.generalTransferManager(); - let generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, gtmModule[0]); - let validKYC = (await generalTransferManager.methods.whitelist(Issuer.address).call()).expiryTime > Math.floor(Date.now()/1000); - if (validKYC) { - affiliatesFailedArray.push(investorAccount); - } else { - affiliatesKYCInvalidArray.push(investorAccount); - } - } - } - let mintMultiAction = securityToken.methods.mintMulti(affiliatesVerifiedArray, tokensVerifiedArray); - let r = await common.sendTransaction(mintMultiAction); - console.log(`Batch ${i} - Attempting to send the Minted tokens to affiliates accounts:\n\n`, affiliatesVerifiedArray, "\n\n"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Multi Mint transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); - - - } catch (err) { - console.log("ERROR:", err); - } - } - - console.log("Retrieving logs to determine investors have had their tokens correctly.\n\n") - - let totalInvestors = 0; - let updatedInvestors = 0; - - let investorData_Events = new Array(); - let investorObjectLookup = {}; - - let event_data = await securityToken.getPastEvents('Minted', { - fromBlock: 0, - toBlock: 'latest' - }, function (error, events) { - - }); - - for (var i = 0; i < event_data.length; i++) { - let combineArray = []; - - let investorAddress_Event = event_data[i].returnValues._to; - let amount_Event = event_data[i].returnValues._value; - let blockNumber = event_data[i].blockNumber - - combineArray.push(investorAddress_Event); - combineArray.push(amount_Event); - combineArray.push(blockNumber); - - investorData_Events.push(combineArray) - //we have already recorded it, so this is an update to our object - if (investorObjectLookup.hasOwnProperty(investorAddress_Event)) { - - //the block number form the event we are checking is bigger, so we gotta replace it - if (investorObjectLookup[investorAddress_Event].recordedBlockNumber < blockNumber) { - investorObjectLookup[investorAddress_Event] = { amount: amount_Event, recordedBlockNumber: blockNumber }; - updatedInvestors += 1; - // investorAddress_Events.push(investorAddress_Event); not needed, because we start the obj with zero events - - } else { - //do nothing. so if we find an event, and it was an older block, its old, we dont care - } - //we have never recorded this address as an object key, so we need to add it to our list of investors updated by the csv - } else { - investorObjectLookup[investorAddress_Event] = { amount: amount_Event, recordedBlockNumber: blockNumber }; - totalInvestors += 1; - // investorAddress_Events.push(investorAddress_Event); - } - } - let investorAddress_Events = Object.keys(investorObjectLookup) - - console.log(`******************** EVENT LOGS ANALYSIS COMPLETE ********************\n`); - console.log(`A total of ${totalInvestors} affiliated investors get the token\n`); - console.log(`This script in total sent ${fullFileData.length - badData.length - affiliatesFailedArray.length - affiliatesKYCInvalidArray.length} new investors and updated investors to the blockchain.\n`); - console.log(`There were ${badData.length} bad entries that didnt get sent to the blockchain in the script.\n`); - console.log(`There were ${affiliatesKYCInvalidArray.length} accounts with invalid KYC.\n`); - console.log(`There were ${affiliatesFailedArray.length} accounts that didn't get sent to the blockchain as they would fail.\n`); - - console.log("************************************************************************************************"); - console.log("OBJECT WITH EVERY USER AND THEIR MINTED TOKEN: \n\n", investorObjectLookup) - console.log("************************************************************************************************"); - console.log("LIST OF ALL INVESTORS WHO GOT THE MINTED TOKENS: \n\n", investorAddress_Events) - - let missingDistribs = []; - let failedVerificationDistribs = []; - let invalidKYCDistribs = []; - for (let l = 0; l < fullFileData.length; l++) { - if (affiliatesKYCInvalidArray.includes(fullFileData[l][0])) { - invalidKYCDistribs.push(fullFileData[l]); - } else if (affiliatesFailedArray.includes(fullFileData[l][0])) { - failedVerificationDistribs.push(fullFileData[l]); - } else if (!investorObjectLookup.hasOwnProperty(fullFileData[l][0])) { - missingDistribs.push(fullFileData[l]); - } - } - - if (invalidKYCDistribs.length > 0) { - console.log("**************************************************************************************************************************"); - console.log("The following data arrays have an invalid KYC. Please review if these accounts are whitelisted and their KYC is not expired\n"); - console.log(invalidKYCDistribs); - console.log("**************************************************************************************************************************"); - } - if (failedVerificationDistribs.length > 0) { - console.log("*********************************************************************************************************"); - console.log("-- The following data arrays failed at verifyTransfer. Please review if these accounts are whitelisted --\n"); - console.log(failedVerificationDistribs); - console.log("*********************************************************************************************************"); - } - if (missingDistribs.length > 0) { - console.log("******************************************************************************************"); - console.log("-- No Minted event was found for the following data arrays. Please review them manually --\n"); - console.log(missingDistribs); - console.log("******************************************************************************************"); - } - if (missingDistribs.length == 0 && failedVerificationDistribs.length == 0 && invalidKYCDistribs.length == 0) { - console.log("\n**************************************************************************************************************************"); - console.log("All accounts passed through from the CSV were successfully get the tokens, because we were able to read them all from events"); - console.log("****************************************************************************************************************************"); - } -} - -function isvalidToken(token) { - var tokenAmount = parseInt(token); - if((tokenAmount % 1 == 0)) { - return tokenAmount; - } - return false; -} diff --git a/CLI/commands/OLD_whitelist.js b/CLI/commands/OLD_whitelist.js deleted file mode 100644 index 5ef201195..000000000 --- a/CLI/commands/OLD_whitelist.js +++ /dev/null @@ -1,302 +0,0 @@ -var fs = require('fs'); -var csv = require('fast-csv'); -var BigNumber = require('bignumber.js'); -var common = require('./common/common_functions'); -var global = require('./common/global'); - -/////////////////////////////ARTIFACTS////////////////////////////////////////// -var contracts = require('./helpers/contract_addresses'); -var abis = require('./helpers/contract_abis'); - -////////////////////////////USER INPUTS////////////////////////////////////////// -let tokenSymbol = process.argv.slice(2)[0]; //token symbol -let BATCH_SIZE = process.argv.slice(2)[1]; //batch size -if (!BATCH_SIZE) BATCH_SIZE = 70; -let remoteNetwork = process.argv.slice(2)[2]; - -/////////////////////////GLOBAL VARS////////////////////////////////////////// - -//distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] -let distribData = new Array(); -//allocData is a temporary array that stores up to the batch size, -//then gets push into distribData, then gets set to 0 to start another batch -let allocData = new Array(); -//full file data is a single array that contains all arrays. i.e. if there are 200 entries we get [[200]] -let fullFileData = new Array(); -let badData = new Array(); - -const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); - -//////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// - -startScript(); - -async function startScript() { - if (remoteNetwork == 'undefined') remoteNetwork = undefined; - await global.initialize(remoteNetwork); - - try { - let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); - let securityTokenRegistryABI = abis.securityTokenRegistry(); - securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); - securityTokenRegistry.setProvider(web3.currentProvider); - - console.log("Processing investor CSV upload. Batch size is "+BATCH_SIZE+" accounts per transaction"); - readFile(); - } catch (err) { - console.log(err) - console.log('\x1b[31m%s\x1b[0m', "There was a problem getting the contracts. Make sure they are deployed to the selected network."); - return; - } -} - -///////////////////////////FUNCTION READING THE CSV FILE -function readFile() { - var stream = fs.createReadStream("./CLI/data/whitelist_data.csv"); - - let index = 0; - let batch = 0; - console.log(` - -------------------------------------------- - ----------- Parsing the csv file ----------- - -------------------------------------------- - `); - - var csvStream = csv() - .on("data", function (data) { - // console.log(data[1]) - // console.log(data[2]) - // console.log(data[3]) - let isAddress = web3.utils.isAddress(data[0]); - let sellValid = isValidDate(data[1]) - let buyValid = isValidDate(data[2]) - let kycExpiryDate = isValidDate(data[3]) - let canBuyFromSTO = (typeof JSON.parse(data[4].toLowerCase())) == "boolean" ? JSON.parse(data[4].toLowerCase()) : "not-valid"; - - if (isAddress && sellValid && buyValid && kycExpiryDate && (canBuyFromSTO != "not-valid") ) { - let userArray = new Array() - let checksummedAddress = web3.utils.toChecksumAddress(data[0]); - - userArray.push(checksummedAddress) - userArray.push(sellValid) - userArray.push(buyValid) - userArray.push(kycExpiryDate) - userArray.push(canBuyFromSTO) - // console.log(userArray) - allocData.push(userArray); - fullFileData.push(userArray); - index++; - if (index >= BATCH_SIZE) { - distribData.push(allocData); - // console.log("DIS", distribData); - allocData = []; - // console.log("ALLOC", allocData); - index = 0; - } - - } else { - let userArray = new Array() - //dont need this here, as if it is NOT an address this function will fail - //let checksummedAddress = web3.utils.toChecksumAddress(data[1]); - userArray.push(data[0]) - userArray.push(sellValid) - userArray.push(buyValid) - userArray.push(kycExpiryDate); - userArray.push(canBuyFromSTO); - badData.push(userArray); - fullFileData.push(userArray) - } - }) - .on("end", function () { - //Add last remainder batch - distribData.push(allocData); - allocData = []; - - setInvestors(); - }); - - stream.pipe(csvStream); -} - -////////////////////////MAIN FUNCTION COMMUNICATING TO BLOCKCHAIN -async function setInvestors() { - let tokenDeployed = false; - let tokenDeployedAddress; - // Let's check if token has already been deployed, if it has, skip to STO - await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { - if (result != "0x0000000000000000000000000000000000000000") { - console.log('\x1b[32m%s\x1b[0m', "Token deployed at address " + result + "."); - tokenDeployedAddress = result; - tokenDeployed = true; - } - }); - if (tokenDeployed) { - let securityTokenABI = abis.securityToken(); - securityToken = new web3.eth.Contract(securityTokenABI, tokenDeployedAddress); - } - let gmtModules = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); - let generalTransferManagerAddress = gmtModules[0]; - let generalTransferManagerABI = abis.generalTransferManager(); - let generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, generalTransferManagerAddress); - - console.log(` - ------------------------------------------------------- - ----- Sending buy/sell restrictions to blockchain ----- - ------------------------------------------------------- - `); - - //this for loop will do the batches, so it should run 75, 75, 50 with 200 - for (let i = 0; i < distribData.length; i++) { - try { - let investorArray = []; - let fromTimesArray = []; - let toTimesArray = []; - let expiryTimeArray = []; - let canBuyFromSTOArray = []; - - //splitting the user arrays to be organized by input - for (let j = 0; j < distribData[i].length; j++) { - investorArray.push(distribData[i][j][0]) - fromTimesArray.push(distribData[i][j][1]) - toTimesArray.push(distribData[i][j][2]) - expiryTimeArray.push(distribData[i][j][3]) - canBuyFromSTOArray.push(distribData[i][j][4]) - } - - //fromTimes is ability to sell coin FROM your account (2nd row in csv, 2nd parameter in modifyWhiteList() ) - //toTimes is ability to buy coins TOwards your account (3rd row in csv, 3rd parameter in modifyWhiteList() ) - //expiryTime is time at which KYC of investor get expired (4th row in csv, 4rd parameter in modifyWhiteList() ) - let modifyWhitelistMultiAction = generalTransferManager.methods.modifyWhitelistMulti(investorArray, fromTimesArray, toTimesArray, expiryTimeArray, canBuyFromSTOArray); - let r = await common.sendTransaction(modifyWhitelistMultiAction); - console.log(`Batch ${i} - Attempting to modifyWhitelist accounts:\n\n`, investorArray, "\n\n"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Whitelist transaxction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); - - } catch (err) { - console.log("ERROR:", err); - } - } - - console.log("Retrieving logs to determine investors have had their times uploaded correctly.\n\n") - - let totalInvestors = 0; - let updatedInvestors = 0; - - let investorData_Events = new Array(); - let investorObjectLookup = {}; - - let event_data = await generalTransferManager.getPastEvents('ModifyWhitelist', { - fromBlock: 0, - toBlock: 'latest' - }, function (error, events) { - //console.log(error); - }); - - for (var i = 0; i < event_data.length; i++) { - let combineArray = []; - - let investorAddress_Event = event_data[i].returnValues._investor; - let fromTime_Event = event_data[i].returnValues._fromTime - let toTime_Event = event_data[i].returnValues._toTime - let expiryTime_Event = event_data[i].returnValues._expiryTime - let canBuyFromSTO_Event = event_data[i].returnValues._canBuyFromSTO - let blockNumber = event_data[i].blockNumber - - combineArray.push(investorAddress_Event); - combineArray.push(fromTime_Event); - combineArray.push(toTime_Event); - combineArray.push(expiryTime_Event); - combineArray.push(canBuyFromSTO_Event); - combineArray.push(blockNumber) - - investorData_Events.push(combineArray) - - //we have already recorded it, so this is an update to our object - if (investorObjectLookup.hasOwnProperty(investorAddress_Event)) { - - //the block number form the event we are checking is bigger, so we gotta replace it - if (investorObjectLookup[investorAddress_Event].recordedBlockNumber < blockNumber) { - investorObjectLookup[investorAddress_Event] = { fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber }; - updatedInvestors += 1; - // investorAddress_Events.push(investorAddress_Event); not needed, because we start the obj with zero events - - } else { - //do nothing. so if we find an event, and it was an older block, its old, we dont care - } - //we have never recorded this address as an object key, so we need to add it to our list of investors updated by the csv - } else { - investorObjectLookup[investorAddress_Event] = { fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber }; - totalInvestors += 1; - // investorAddress_Events.push(investorAddress_Event); - } - } - let investorAddress_Events = Object.keys(investorObjectLookup) - - console.log(`******************** EVENT LOGS ANALYSIS COMPLETE ********************\n`); - console.log(`A total of ${totalInvestors} investors have been whitelisted total, all time.\n`); - console.log(`This script in total sent ${fullFileData.length - badData.length} new investors and updated investors to the blockchain.\n`); - console.log(`There were ${badData.length} bad entries that didnt get sent to the blockchain in the script.\n`); - - // console.log("LIST OF ALL INVESTOR DATA FROM EVENTS:", investorData_Events) - // console.log(fullFileData) - console.log("************************************************************************************************"); - console.log("OBJECT WITH EVERY USER AND THEIR UPDATED TIMES: \n\n", investorObjectLookup) - console.log("************************************************************************************************"); - console.log("LIST OF ALL INVESTORS WHITELISTED: \n\n", investorAddress_Events) - - let missingDistribs = []; - for (let l = 0; l < fullFileData.length; l++) { - if (!investorObjectLookup.hasOwnProperty(fullFileData[l][0])) { - missingDistribs.push(fullFileData[l]) - } - } - - if (missingDistribs.length > 0) { - console.log("************************************************************************************************"); - console.log("-- No LogModifyWhitelist event was found for the following data arrays. Please review them manually --") - console.log(missingDistribs) - // for (var i = 0; i < missingDistribs.length; i++) { - // console.log('\x1b[31m%s\x1b[0m', `No Transfer event was found for account ${missingDistribs[i]}`); - // } - console.log("************************************************************************************************"); - } else { - console.log("\n************************************************************************************************"); - console.log("All accounts passed through from the CSV were successfully whitelisted, because we were able to read them all from events") - console.log("************************************************************************************************"); - } - // console.log(`Run 'node scripts/verify_airdrop.js ${polyDistribution.address} > scripts/data/review.csv' to get a log of all the accounts that were distributed the airdrop tokens.`) -} - -//will be deleted once DATES are updated -function isValidDayInput(days) { - let today = Date.now() / 1000 - let isValid = !isNaN(days) - if (isValid) { - let addedSeconds = days * 86400 - - let unixTimestamp = today + addedSeconds - console.log("unxitimestapm :" , (unixTimestamp)) - - return unixTimestamp - } else { - return false - } -} - -function isValidDate(date) { - var matches = /^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/.exec(date); - if (matches == null) return false; - var d = matches[2]; - var m = matches[1] - 1; //not clear why this is -1, but it works after checking - var y = matches[3]; - var composedDate = new Date(y, m, d); - var timestampDate = composedDate.getTime() - - //note, some reason these timestamps are being recorded +4 hours UTC - if (composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y) { - return timestampDate / 1000 - } else { - return false - } -} diff --git a/CLI/commands/changeNonAccreditedLimit.js b/CLI/commands/changeNonAccreditedLimit.js index b4d5e3c6b..da3589f3d 100644 --- a/CLI/commands/changeNonAccreditedLimit.js +++ b/CLI/commands/changeNonAccreditedLimit.js @@ -1,149 +1,159 @@ +var common = require('./common/common_functions'); var fs = require('fs'); var csv = require('fast-csv'); -var BigNumber = require('bignumber.js'); -var chalk = require('chalk'); -var common = require('./common/common_functions'); -var global = require('./common/global'); var contracts = require('./helpers/contract_addresses'); -var abis = require('./helpers/contract_abis') - -/////////////////////////////ARTIFACTS////////////////////////////////////////// -let securityTokenRegistry; -let securityToken; -let usdTieredSTO; - -////////////////////////////USER INPUTS////////////////////////////////////////// -let tokenSymbol = process.argv.slice(2)[0]; //token symbol -let BATCH_SIZE = process.argv.slice(2)[1]; //batch size -if (!BATCH_SIZE) BATCH_SIZE = 75; -let remoteNetwork = process.argv.slice(2)[2]; +var abis = require('./helpers/contract_abis'); +var BigNumber = require('bignumber.js'); -/////////////////////////GLOBAL VARS////////////////////////////////////////// -//distribData is an array of batches. i.e. if there are 200 entries, with batch sizes of 75, we get [[75],[75],[50]] let distribData = new Array(); -//allocData is a temporary array that stores up to the batch size, -//then gets push into distribData, then gets set to 0 to start another batch let allocData = new Array(); -//full file data is a single array that contains all arrays. i.e. if there are 200 entries we get [[200]] let fullFileData = new Array(); -//baa data is an array that contains invalid entries let badData = new Array(); -//////////////////////////////////////////ENTRY INTO SCRIPT////////////////////////////////////////// -startScript(); +let BATCH_SIZE = 70; +let securityToken; + +async function startScript(tokenSymbol, batchSize) { + if (batchSize) { + BATCH_SIZE = batchSize; + } + + common.logAsciiBull(); + + let STAddress = await checkST(tokenSymbol); + securityToken = new web3.eth.Contract(abis.securityToken(), STAddress); + + await readCsv(); +}; -async function startScript() { - if (remoteNetwork == 'undefined') remoteNetwork = undefined; - await global.initialize(remoteNetwork); +async function checkST(tokenSymbol) { + let securityTokenRegistry = await STConnect(); + return await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { + if (result != "0x0000000000000000000000000000000000000000") { + return result + } else { + console.log("Token doesn't exist") + process.exit(0) + } + }); +} + +async function STConnect() { try { - let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); - let securityTokenRegistryABI = abis.securityTokenRegistry(); - securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); - securityTokenRegistry.setProvider(web3.currentProvider); - console.log("Processing investor CSV upload. Batch size is " + BATCH_SIZE + " accounts per transaction"); - readFile(); + let STRegistryAddress = await contracts.securityTokenRegistry(); + let STRegistry = new web3.eth.Contract(abis.securityTokenRegistry(), STRegistryAddress); + return STRegistry; } catch (err) { - console.log(err) - console.log('\x1b[31m%s\x1b[0m', "There was a problem getting the contracts. Make sure they are deployed to the selected network."); - return; + console.log("There was a problem getting the contracts. Make sure they are deployed to the selected network."); + process.exit(0); } } -///////////////////////////FUNCTION READING THE CSV FILE -function readFile() { - var stream = fs.createReadStream("./CLI/data/nonAccreditedLimits_data.csv"); - - let index = 0; - console.log(` - -------------------------------------------- - ----------- Parsing the csv file ----------- - -------------------------------------------- - `); - - var csvStream = csv() - .on("data", function (data) { - let isAddress = web3.utils.isAddress(data[0]); - let isNumber = !isNaN(data[1]); - - if (isAddress && isNumber) { - let userArray = new Array(); - let checksummedAddress = web3.utils.toChecksumAddress(data[0]); +async function readCsv() { + var CSV_STRING = fs.readFileSync("./CLI/data/nonAccreditedLimits_data.csv").toString(); + let i = 0; - userArray.push(checksummedAddress); - userArray.push(data[1]); + csv.fromString(CSV_STRING) + .on("data", (data) => { + let data_processed = nonAccredited_processing(data); + fullFileData.push(data_processed[1]); - allocData.push(userArray); - fullFileData.push(userArray); - - index++; - if (index >= BATCH_SIZE) { + if (data_processed[0]) { + allocData.push(data_processed[1]); + i++; + if (i >= BATCH_SIZE) { distribData.push(allocData); allocData = []; - index = 0; + i = 0; } } else { - let userArray = new Array() - userArray.push(data[0]); - userArray.push(data[1]); - - badData.push(userArray); - fullFileData.push(userArray) + badData.push(data_processed[1]); } + }) - .on("end", function () { - //Add last remainder batch + .on("end", async () => { distribData.push(allocData); allocData = []; - changeNonAccreditedLimit(); + await saveInBlockchain(); + return; }); - - stream.pipe(csvStream); } -// MAIN FUNCTION COMMUNICATING TO BLOCKCHAIN -async function changeNonAccreditedLimit() { - // Let's check if token has already been deployed, if it has, skip to STO - let tokenDeployedAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call(); - if (tokenDeployedAddress != "0x0000000000000000000000000000000000000000") { - let securityTokenABI = abis.securityToken(); - securityToken = new web3.eth.Contract(securityTokenABI, tokenDeployedAddress); - let result = await securityToken.methods.getModulesByName(web3.utils.toHex('USDTieredSTO')).call(); - if (result.length > 0) { - let usdTieredSTOABI = abis.usdTieredSTO(); - usdTieredSTO = new web3.eth.Contract(usdTieredSTOABI, result[0]); - console.log(` --------------------------------------------------------------- ------ Sending non accredited limit changes to blockchain ----- --------------------------------------------------------------- - `); - //this for loop will do the batches, so it should run 75, 75, 50 with 200 +async function saveInBlockchain() { + let gtmModules; + try { + gtmModules = await securityToken.methods.getModulesByName(web3.utils.toHex('USDTieredSTO')).call(); + } catch (e) { + console.log("Please attach USDTieredSTO module before launch this action.", e) + process.exit(0) + } + + if (!gtmModules.length) { + console.log("Please attach USDTieredSTO module before launch this action.") + process.exit(0) + } + + let usdTieredSTO = new web3.eth.Contract(abis.usdTieredSTO(), gtmModules[0]); + + console.log(` + -------------------------------------------------------------- + ----- Sending non accredited limit changes to blockchain ----- + -------------------------------------------------------------- + `); + + for (let i = 0; i < distribData.length; i++) { + try { + + // Splitting the user arrays to be organized by input for (let i = 0; i < distribData.length; i++) { try { - let investorArray = []; - let limitArray = []; + let investorArray = [], limitArray = []; - //splitting the user arrays to be organized by input for (let j = 0; j < distribData[i].length; j++) { investorArray.push(distribData[i][j][0]); limitArray.push(web3.utils.toWei(distribData[i][j][1].toString())); } - + let changeNonAccreditedLimitAction = usdTieredSTO.methods.changeNonAccreditedLimit(investorArray, limitArray); - let r = await common.sendTransaction(changeNonAccreditedLimitAction); + let tx = await common.sendTransaction(changeNonAccreditedLimitAction); console.log(`Batch ${i} - Attempting to change non accredited limits to accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Change accredited transaction was successful.", r.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(r.gasUsed * defaultGasPrice).toString()), "Ether"); + console.log("Change accredited transaction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString()), "Ether"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); + } catch (err) { console.log("ERROR:", err); } } - } else { - console.log(chalk.red(`There is no STO module attached to the ${tokenSymbol.toUpperCase()} Token. No further actions can be taken.`)); - } + + } catch (err) { + console.log("ERROR", err) + process.exit(0) + } + } + + return; +} + +function nonAccredited_processing(csv_line) { + let isAddress = web3.utils.isAddress(csv_line[0]); + let isNumber = !isNaN(csv_line[1]); + + if (isAddress && isNumber) { + + return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), csv_line[1])] + } else { - console.log(chalk.red(`Token symbol provided is not a registered Security Token.`)); + + return [false, new Array(csv_line[0], csv_line[1])] + } } + +module.exports = { + executeApp: async (tokenSymbol, batchSize) => { + return startScript(tokenSymbol, batchSize); + } +} \ No newline at end of file diff --git a/CLI/commands/scripts/script.sh b/CLI/commands/scripts/script.sh deleted file mode 100755 index 2ee363a8f..000000000 --- a/CLI/commands/scripts/script.sh +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/bash - -if [ $1 = "Whitelist" ]; -then -echo "Running the $1 script"; -node $PWD/CLI/commands/whitelist.js $2 $3 $4 -elif [ $1 = "Multimint" ]; -then -echo "Running the $1 script"; -node $PWD/CLI/commands/multi_mint.js $2 $3 $4 -elif [ $1 = "Accredit" ]; -then -echo "Running the $1 script"; -node $PWD/CLI/commands/accredit.js $2 $3 $4 -elif [ $1 = "NonAccreditedLimit" ]; -then -echo "Running the $1 script"; -node $PWD/CLI/commands/changeNonAccreditedLimit.js $2 $3 $4 -fi diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 6d496cd00..25831ab9d 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -1,6 +1,5 @@ #!/usr/bin/env node -const shell = require('shelljs'); var faucet = require('./commands/faucet'); var investor_portal = require('./commands/investor_portal'); var module_manager = require('./commands/module_manager'); @@ -9,6 +8,7 @@ var transfer = require('./commands/transfer'); var whitelist = require('./commands/whitelist'); var multimint = require('./commands/multi_mint'); var accredit = require('./commands/accredit'); +var changeNonAccreditedLimit = require('./commands/changeNonAccreditedLimit'); var transfer_ownership = require('./commands/transfer_ownership'); var dividends_manager = require('./commands/dividends_manager'); var transfer_manager = require('./commands/transfer_manager'); @@ -149,7 +149,7 @@ program .description('Runs changeNonAccreditedLimit') .action(async function(tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); - shell.exec(`${__dirname}/commands/scripts/script.sh NonAccreditedLimit ${tokenSymbol} ${batchSize} ${program.remoteNode}`);; + await changeNonAccreditedLimit.executeApp(tokenSymbol, batchSize); }); program diff --git a/package.json b/package.json index b350b4ac6..5f8594e10 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,6 @@ "readline-sync": "^1.4.9", "request": "^2.88.0", "request-promise": "^4.2.2", - "shelljs": "^0.8.2", "solc": "^0.4.24", "truffle-contract": "^3.0.4", "truffle-hdwallet-provider-privkey": "^0.1.0", From dd6c292be2b53333055dfd9ba834a8266b3922f8 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Wed, 14 Nov 2018 12:00:03 -0300 Subject: [PATCH 057/139] sto_manager command --- CLI/commands/sto_manager.js | 927 ++++++++++++++++++++++++++++++++++++ CLI/polymath-cli.js | 10 + 2 files changed, 937 insertions(+) create mode 100644 CLI/commands/sto_manager.js diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js new file mode 100644 index 000000000..871e6d37b --- /dev/null +++ b/CLI/commands/sto_manager.js @@ -0,0 +1,927 @@ +var readlineSync = require('readline-sync'); +var BigNumber = require('bignumber.js'); +var chalk = require('chalk'); +const shell = require('shelljs'); +var contracts = require('./helpers/contract_addresses'); +var abis = require('./helpers/contract_abis'); +var common = require('./common/common_functions'); +var gbl = require('./common/global'); + +/////////////////// +// Crowdsale params +let tokenSymbol; + +//////////////////////// +// Artifacts +let securityTokenRegistry; +let polyToken; +let usdToken; +let securityToken; + +async function executeApp() { + common.logAsciiBull(); + console.log("********************************************"); + console.log("Welcome to the Command-Line ST-20 Generator."); + console.log("********************************************"); + console.log("The following script will create a new ST-20 according to the parameters you enter."); + console.log("Issuer Account: " + Issuer.address + "\n"); + + await setup(); + + securityToken = await selectToken(); + while (true) { + await start_explorer(); + } +}; + +async function setup(){ + try { + let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); + let securityTokenRegistryABI = abis.securityTokenRegistry(); + securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); + securityTokenRegistry.setProvider(web3.currentProvider); + + let polytokenAddress = await contracts.polyToken(); + let polytokenABI = abis.polyToken(); + polyToken = new web3.eth.Contract(polytokenABI, polytokenAddress); + polyToken.setProvider(web3.currentProvider); + + //TODO: Use proper DAI token here + let usdTokenAddress = await contracts.usdToken(); + usdToken = new web3.eth.Contract(polytokenABI, usdTokenAddress); + usdToken.setProvider(web3.currentProvider); + } catch (err) { + console.log(err) + console.log('\x1b[31m%s\x1b[0m',"There was a problem getting the contracts. Make sure they are deployed to the selected network."); + process.exit(0); + } +} + +async function selectToken() { + let stAddress; + let userTokens = await securityTokenRegistry.methods.getTokensByOwner(Issuer.address).call(); + if (userTokens.length == 0) { + console.log(chalk.red(`You have not issued any Security Token yet!`)); + process.exit(0); + } else if (userTokens.length == 1) { + let tokenData = await securityTokenRegistry.methods.getSecurityTokenData(userTokens[0]).call(); + console.log(chalk.yellow(`You have only one token. ${tokenData[0]} will be selected automatically.`)); + stAddress = userTokens[0]; + } else { + let options = await Promise.all(userTokens.map(async function (t) { + let tokenData = await securityTokenRegistry.methods.getSecurityTokenData(t).call(); + return `${tokenData[0]} + Deployed at ${t}`; + })); + + let index = readlineSync.keyInSelect(options, 'Select a token:', {cancel: 'Exit'}); + if (index == -1) { + process.exit(0); + } else { + stAddress = userTokens[index]; + } + } + + let securityTokenABI = abis.securityToken(); + let securityToken = new web3.eth.Contract(securityTokenABI, stAddress); + + return securityToken; +} + +async function start_explorer() { + console.log(); + console.log(chalk.blue('STO Manager - Main Menu')); + + // Show non-archived attached STO modules + console.log(); + let stoModules = await getAllModulesByType(gbl.constants.MODULES_TYPES.STO); + let nonArchivedModules = stoModules.filter(m => !m.archived); + if (nonArchivedModules.length > 0) { + console.log(`STO modules attached:`); + nonArchivedModules.map(m => console.log(`- ${m.name} at ${m.address}`)) + } else { + console.log(`There are no STO modules attached`); + } + + let options = []; + if (nonArchivedModules.length > 0) { + options.push('Show existing STO information', 'Modify existing STO'); + } + options.push('Add new STO module'); + + let index = readlineSync.keyInSelect(options, 'What do you want to do?', {cancel: 'Exit'}); + let optionSelected = index != -1 ? options[index] : 'Exit'; + console.log('Selected:', optionSelected, '\n'); + switch (optionSelected) { + case 'Show existing STO information': + let stoToShow = selectExistingSTO(nonArchivedModules, true); + await showSTO(stoToShow.name, stoToShow.module); + break; + case 'Modify existing STO': + let stoToModify = selectExistingSTO(nonArchivedModules); + await modifySTO(stoToModify.name, stoToModify.module); + break; + case 'Add new STO module': + await addSTOModule(); + break; + case 'Exit': + process.exit(0); + } +} + +function selectExistingSTO(stoModules, showPaused) { + let filteredModules = stoModules; + if (!showPaused) { + filteredModules = stoModules.filter(m => !m.paused); + } + let options = filteredModules.map(m => `${m.name} at ${m.address}`); + let index = readlineSync.keyInSelect(options, 'Select a module: ', {cancel: false}); + console.log('Selected:', options[index], '\n'); + let selectedName = filteredModules[index].name; + let stoABI; + switch (selectedName) { + case 'CappedSTO': + stoABI = abis.cappedSTO(); + break; + case 'USDTieredSTO': + stoABI = abis.usdTieredSTO(); + break; + } + + let stoModule = new web3.eth.Contract(stoABI, filteredModules[index].address); + return {name: selectedName, module: stoModule}; +} + +async function showSTO(selectedSTO, currentSTO) { + switch (selectedSTO) { + case 'CappedSTO': + await cappedSTO_status(currentSTO); + break; + case 'USDTieredSTO': + await usdTieredSTO_status(currentSTO); + break; + } +} + +async function modifySTO(selectedSTO, currentSTO) { + switch (selectedSTO) { + case 'CappedSTO': + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************`)); + break; + case 'USDTieredSTO': + await usdTieredSTO_configure(currentSTO); + break; + } +} + +async function addSTOModule() { + console.log(chalk.blue('Launch STO - Configuration')); + + let options = ['CappedSTO', 'USDTieredSTO']; + let index = readlineSync.keyInSelect(options, 'What type of STO do you want?', { cancel: 'Return' }); + let optionSelected = index != -1 ? options[index] : 'Return'; + console.log('Selected:', optionSelected, '\n'); + switch (optionSelected) { + case 'CappedSTO': + let cappedSTO = await cappedSTO_launch(); + await cappedSTO_status(cappedSTO); + break; + case 'USDTieredSTO': + let usdTieredSTO = await usdTieredSTO_launch(); + await usdTieredSTO_status(usdTieredSTO); + break; + } +} + +//////////////// +// Capped STO // +//////////////// +async function cappedSTO_launch() { + console.log(chalk.blue('Launch STO - Capped STO in No. of Tokens')); + + let cappedSTOFactoryABI = abis.cappedSTOFactory(); + let cappedSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, gbl.constants.MODULES_TYPES.STO, "CappedSTO"); + let cappedSTOFactory = new web3.eth.Contract(cappedSTOFactoryABI, cappedSTOFactoryAddress); + cappedSTOFactory.setProvider(web3.currentProvider); + let stoFee = await cappedSTOFactory.methods.getSetupCost().call(); + + let contractBalance = await polyToken.methods.balanceOf(securityToken._address).call(); + if (parseInt(contractBalance) < parseInt(stoFee)) { + let transferAmount = parseInt(stoFee) - parseInt(contractBalance); + let ownerBalance = await polyToken.methods.balanceOf(Issuer.address).call(); + if (parseInt(ownerBalance) < transferAmount) { + console.log(chalk.red(`\n**************************************************************************************************************************************************`)); + console.log(chalk.red(`Not enough balance to pay the CappedSTO fee, Requires ${(new BigNumber(transferAmount).dividedBy(new BigNumber(10).pow(18))).toNumber()} POLY but have ${(new BigNumber(ownerBalance).dividedBy(new BigNumber(10).pow(18))).toNumber()} POLY. Access POLY faucet to get the POLY to complete this txn`)); + console.log(chalk.red(`**************************************************************************************************************************************************\n`)); + return; + } else { + let transferAction = polyToken.methods.transfer(securityToken._address, new BigNumber(transferAmount)); + let receipt = await common.sendTransaction(transferAction, {factor: 2}); + let event = common.getEventFromLogs(polyToken._jsonInterface, receipt.logs, 'Transfer'); + console.log(`Number of POLY sent: ${web3.utils.fromWei(new web3.utils.BN(event._value))}`) + } + } + + let cap = readlineSync.question('How many tokens do you plan to sell on the STO? (500.000): '); + if (cap == "") cap = '500000'; + + let oneMinuteFromNow = BigNumber((Math.floor(Date.now() / 1000) + 60)); + let startTime = readlineSync.question('Enter the start time for the STO (Unix Epoch time)\n(1 minutes from now = ' + oneMinuteFromNow + ' ): '); + if (startTime == "") startTime = oneMinuteFromNow; + + let oneMonthFromNow = BigNumber((Math.floor(Date.now()/1000)+ (30 * 24 * 60 * 60))); + let endTime = readlineSync.question('Enter the end time for the STO (Unix Epoch time)\n(1 month from now = ' + oneMonthFromNow + ' ): '); + if (endTime == "") endTime = oneMonthFromNow; + + let wallet = readlineSync.question('Enter the address that will receive the funds from the STO (' + Issuer.address + '): '); + if (wallet == "") wallet = Issuer.address; + + let raiseType = readlineSync.question('Enter' + chalk.green(` P `) + 'for POLY raise or leave empty for Ether raise (E): '); + if (raiseType.toUpperCase() == 'P' ) { + raiseType = [1]; + } else { + raiseType = [0]; + } + + let rate = readlineSync.question(`Enter the rate (1 ${(raiseType == 1 ? 'POLY' : 'ETH')} = X ${tokenSymbol}) for the STO (1000): `); + if (rate == "") rate = 1000; + + let bytesSTO = web3.eth.abi.encodeFunctionCall( { + name: 'configure', + type: 'function', + inputs: [ + { + type: 'uint256', + name: '_startTime' + },{ + type: 'uint256', + name: '_endTime' + },{ + type: 'uint256', + name: '_cap' + },{ + type: 'uint256', + name: '_rate' + },{ + type: 'uint8[]', + name: '_fundRaiseTypes' + },{ + type: 'address', + name: '_fundsReceiver' + } + ] + }, [startTime, endTime, web3.utils.toWei(cap), rate, raiseType, wallet]); + + let addModuleAction = securityToken.methods.addModule(cappedSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); + let receipt = await common.sendTransaction(addModuleAction); + let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); + console.log(`STO deployed at address: ${event._module}`); + + let cappedSTOABI = abis.cappedSTO(); + let cappedSTO = new web3.eth.Contract(cappedSTOABI, event._module); + cappedSTO.setProvider(web3.currentProvider); + + return cappedSTO; +} + +async function cappedSTO_status(currentSTO) { + let displayStartTime = await currentSTO.methods.startTime().call(); + let displayEndTime = await currentSTO.methods.endTime().call(); + let displayRate = await currentSTO.methods.rate().call(); + let displayCap = await currentSTO.methods.cap().call(); + let displayWallet = await currentSTO.methods.wallet().call(); + let displayRaiseType; + let displayFundsRaised; + let displayWalletBalance; + let raiseType = await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.ETH).call(); + if (raiseType) { + displayRaiseType = 'ETH'; + displayFundsRaised = await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES.ETH).call(); + displayWalletBalance = web3.utils.fromWei(await web3.eth.getBalance(displayWallet)); + } else { + displayRaiseType = 'POLY'; + displayFundsRaised = await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES.POLY).call(); + displayWalletBalance = web3.utils.fromWei(await getBalance(displayWallet, 'POLY')); + } + let displayTokensSold = await currentSTO.methods.totalTokensSold().call(); + let displayInvestorCount = await currentSTO.methods.investorCount().call(); + let displayTokenSymbol = await securityToken.methods.symbol().call(); + + let formattedCap = BigNumber(web3.utils.fromWei(displayCap)); + let formattedSold = BigNumber(web3.utils.fromWei(displayTokensSold)); + + let now = Math.floor(Date.now()/1000); + let timeTitle; + let timeRemaining; + + if (now < displayStartTime) { + timeTitle = "STO starts in: "; + timeRemaining = displayStartTime - now; + } else { + timeTitle = "Time remaining:"; + timeRemaining = displayEndTime - now; + } + + timeRemaining = common.convertToDaysRemaining(timeRemaining); + + console.log(` + *************** STO Information *************** + - Address: ${currentSTO.options.address} + - Raise Cap: ${web3.utils.fromWei(displayCap)} ${displayTokenSymbol.toUpperCase()} + - Start Time: ${new Date(displayStartTime * 1000)} + - End Time: ${new Date(displayEndTime * 1000)} + - Raise Type: ${displayRaiseType} + - Rate: 1 ${displayRaiseType} = ${displayRate} ${displayTokenSymbol.toUpperCase()} + - Wallet: ${displayWallet} + - Wallet Balance: ${displayWalletBalance} ${displayRaiseType} + ----------------------------------------------- + - ${timeTitle} ${timeRemaining} + - Funds raised: ${web3.utils.fromWei(displayFundsRaised)} ${displayRaiseType} + - Tokens sold: ${web3.utils.fromWei(displayTokensSold)} ${displayTokenSymbol.toUpperCase()} + - Tokens remaining: ${formattedCap.minus(formattedSold).toNumber()} ${displayTokenSymbol.toUpperCase()} + - Investor count: ${displayInvestorCount} + `); + + console.log(chalk.green(`\n${(web3.utils.fromWei(await getBalance(Issuer.address, 'POLY')))} POLY balance remaining at issuer address ${Issuer.address}`)); +} + +//////////////////// +// USD Tiered STO // +//////////////////// +function fundingConfigUSDTieredSTO() { + let funding = {}; + + let selectedFunding = readlineSync.question('Enter' + chalk.green(` P `) + 'for POLY raise,' + chalk.green(` D `) + 'for DAI raise,' + chalk.green(` E `) + 'for Ether raise or any combination of them (i.e.'+ chalk.green(` PED `) + 'for all): ').toUpperCase(); + + funding.raiseType = []; + if (selectedFunding.includes('E')) { + funding.raiseType.push(gbl.constants.FUND_RAISE_TYPES.ETH); + } + if (selectedFunding.includes('P')) { + funding.raiseType.push(gbl.constants.FUND_RAISE_TYPES.POLY); + } + if (selectedFunding.includes('D')) { + funding.raiseType.push(gbl.constants.FUND_RAISE_TYPES.DAI); + } + if (funding.raiseType.length == 0) { + funding.raiseType = [gbl.constants.FUND_RAISE_TYPES.ETH, gbl.constants.FUND_RAISE_TYPES.POLY, gbl.constants.FUND_RAISE_TYPES.DAI]; + } + + return funding; +} + +function addressesConfigUSDTieredSTO(usdTokenRaise) { + let addresses = {}; + + addresses.wallet = readlineSync.question('Enter the address that will receive the funds from the STO (' + Issuer.address + '): ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address", + defaultInput: Issuer.address + }); + if (addresses.wallet == "") addresses.wallet = Issuer.address; + + addresses.reserveWallet = readlineSync.question('Enter the address that will receive remaining tokens in the case the cap is not met (' + Issuer.address + '): ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address", + defaultInput: Issuer.address + }); + if (addresses.reserveWallet == "") addresses.reserveWallet = Issuer.address; + + if (usdTokenRaise) { + addresses.usdToken = readlineSync.question('Enter the address of the USD Token or stable coin (' + usdToken.options.address + '): ', { + limit: function(input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address", + defaultInput: usdToken.options.address + }); + if (addresses.usdToken == "") addresses.usdToken = usdToken.options.address; + } else { + addresses.usdToken = '0x0000000000000000000000000000000000000000'; + } + + return addresses; +} + +function tiersConfigUSDTieredSTO(polyRaise) { + let tiers = {}; + + let defaultTiers = 3; + tiers.tiers = readlineSync.questionInt(`Enter the number of tiers for the STO? (${defaultTiers}): `, { + limit: function(input) { + return input > 0; + }, + limitMessage: 'Must be greater than zero', + defaultInput: defaultTiers + }); + + let defaultTokensPerTier = [190000000, 100000000, 200000000]; + let defaultRatePerTier = ['0.05', '0.10', '0.15']; + let defaultTokensPerTierDiscountPoly = [90000000, 50000000, 100000000]; + let defaultRatePerTierDiscountPoly = ['0.025', '0.05', '0.075']; + tiers.tokensPerTier = []; + tiers.ratePerTier = []; + tiers.tokensPerTierDiscountPoly = []; + tiers.ratePerTierDiscountPoly = []; + for (let i = 0; i < tiers.tiers; i++) { + tiers.tokensPerTier[i] = web3.utils.toWei(readlineSync.question(`How many tokens do you plan to sell on tier No. ${i+1}? (${defaultTokensPerTier[i]}): `, { + limit: function(input) { + return parseFloat(input) > 0; + }, + limitMessage: 'Must be greater than zero', + defaultInput: defaultTokensPerTier[i] + })); + + tiers.ratePerTier[i] = web3.utils.toWei(readlineSync.question(`What is the USD per token rate for tier No. ${i+1}? (${defaultRatePerTier[i]}): `, { + limit: function(input) { + return parseFloat(input) > 0; + }, + limitMessage: 'Must be greater than zero', + defaultInput: defaultRatePerTier[i] + })); + + if (polyRaise && readlineSync.keyInYNStrict(`Do you plan to have a discounted rate for POLY investments for tier No. ${i+1}? `)) { + tiers.tokensPerTierDiscountPoly[i] = web3.utils.toWei(readlineSync.question(`How many of those tokens do you plan to sell at discounted rate on tier No. ${i+1}? (${defaultTokensPerTierDiscountPoly[i]}): `, { + limit: function(input) { + return new BigNumber(web3.utils.toWei(input)).lte(tiers.tokensPerTier[i]) + }, + limitMessage: 'Must be less than the No. of tokens of the tier', + defaultInput: defaultTokensPerTierDiscountPoly[i] + })); + + tiers.ratePerTierDiscountPoly[i] = web3.utils.toWei(readlineSync.question(`What is the discounted rate for tier No. ${i+1}? (${defaultRatePerTierDiscountPoly[i]}): `, { + limit: function(input) { + return new BigNumber(web3.utils.toWei(input)).lte(tiers.ratePerTier[i]) + }, + limitMessage: 'Must be less than the rate of the tier', + defaultInput: defaultRatePerTierDiscountPoly[i] + })); + } else { + tiers.tokensPerTierDiscountPoly[i] = 0; + tiers.ratePerTierDiscountPoly[i] = 0; + } + } + + return tiers; +} + +function timesConfigUSDTieredSTO() { + let times = {}; + + let oneMinuteFromNow = Math.floor(Date.now() / 1000) + 60; + times.startTime = readlineSync.questionInt('Enter the start time for the STO (Unix Epoch time)\n(1 minutes from now = ' + oneMinuteFromNow + ' ): ', { + limit: function(input) { + return input > Math.floor(Date.now() / 1000); + }, + limitMessage: "Must be a future time", + defaultInput: oneMinuteFromNow + }); + if (times.startTime == "") times.startTime = oneMinuteFromNow; + + let oneMonthFromNow = Math.floor(Date.now() / 1000) + (30 * 24 * 60 * 60); + times.endTime = readlineSync.questionInt('Enter the end time for the STO (Unix Epoch time)\n(1 month from now = ' + oneMonthFromNow + ' ): ', { + limit: function(input) { + return input > times.startTime; + }, + limitMessage: "Must be greater than Start Time", + defaultInput: oneMonthFromNow + }); + if (times.endTime == "") times.endTime = oneMonthFromNow; + + return times; +} + +function limitsConfigUSDTieredSTO() { + let limits = {}; + + let defaultMinimumInvestment = 5; + limits.minimumInvestmentUSD = web3.utils.toWei(readlineSync.question(`What is the minimum investment in USD? (${defaultMinimumInvestment}): `, { + limit: function(input) { + return parseInt(input) > 0; + }, + limitMessage: "Must be greater than zero", + defaultInput: defaultMinimumInvestment + })); + + let nonAccreditedLimit = 2500; + limits.nonAccreditedLimitUSD = web3.utils.toWei(readlineSync.question(`What is the default limit for non accredited investors in USD? (${nonAccreditedLimit}): `, { + limit: function(input) { + return new BigNumber(web3.utils.toWei(input)).gte(limits.minimumInvestmentUSD); + }, + limitMessage: "Must be greater than minimum investment", + defaultInput: nonAccreditedLimit + })); + + return limits; +} + +async function usdTieredSTO_launch() { + console.log(chalk.blue('Launch STO - USD pegged tiered STO')); + + let usdTieredSTOFactoryABI = abis.usdTieredSTOFactory(); + let usdTieredSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, gbl.constants.MODULES_TYPES.STO, 'USDTieredSTO'); + let usdTieredSTOFactory = new web3.eth.Contract(usdTieredSTOFactoryABI, usdTieredSTOFactoryAddress); + usdTieredSTOFactory.setProvider(web3.currentProvider); + let stoFee = await usdTieredSTOFactory.methods.getSetupCost().call(); + + let contractBalance = await polyToken.methods.balanceOf(securityToken._address).call(); + if (new web3.utils.BN(contractBalance).lt(new web3.utils.BN(stoFee))) { + let transferAmount = (new web3.utils.BN(stoFee)).sub(new web3.utils.BN(contractBalance)); + let ownerBalance = new web3.utils.BN(await polyToken.methods.balanceOf(Issuer.address).call()); + if (ownerBalance.lt(transferAmount)) { + console.log(chalk.red(`\n**************************************************************************************************************************************************`)); + console.log(chalk.red(`Not enough balance to pay the USDTieredSTO fee, Requires ${web3.utils.fromWei(transferAmount)} POLY but have ${web3.utils.fromWei(ownerBalance)} POLY. Access POLY faucet to get the POLY to complete this txn`)); + console.log(chalk.red(`**************************************************************************************************************************************************\n`)); + return; + } else { + let transferAction = polyToken.methods.transfer(securityToken._address, transferAmount); + let receipt = await common.sendTransaction(transferAction, {factor: 2}); + let event = common.getEventFromLogs(polyToken._jsonInterface, receipt.logs, 'Transfer'); + console.log(`Number of POLY sent: ${web3.utils.fromWei(new web3.utils.BN(event._value))}`) + } + } + + let funding = fundingConfigUSDTieredSTO(); + let addresses = addressesConfigUSDTieredSTO(funding.raiseType.includes(gbl.constants.FUND_RAISE_TYPES.DAI)); + let tiers = tiersConfigUSDTieredSTO(funding.raiseType.includes(gbl.constants.FUND_RAISE_TYPES.POLY)); + let limits = limitsConfigUSDTieredSTO(); + let times = timesConfigUSDTieredSTO(); + let bytesSTO = web3.eth.abi.encodeFunctionCall( { + name: 'configure', + type: 'function', + inputs: [ + { + type: 'uint256', + name: '_startTime' + },{ + type: 'uint256', + name: '_endTime' + },{ + type: 'uint256[]', + name: '_ratePerTier' + },{ + type: 'uint256[]', + name: '_ratePerTierDiscountPoly' + },{ + type: 'uint256[]', + name: '_tokensPerTier' + },{ + type: 'uint256[]', + name: '_tokensPerTierDiscountPoly' + },{ + type: 'uint256', + name: '_nonAccreditedLimitUSD' + },{ + type: 'uint256', + name: '_minimumInvestmentUSD' + },{ + type: 'uint8[]', + name: '_fundRaiseTypes' + },{ + type: 'address', + name: '_wallet' + },{ + type: 'address', + name: '_reserveWallet' + },{ + type: 'address', + name: '_usdToken' + } + ] + }, [times.startTime, + times.endTime, + tiers.ratePerTier, + tiers.ratePerTierDiscountPoly, + tiers.tokensPerTier, + tiers.tokensPerTierDiscountPoly, + limits.nonAccreditedLimitUSD, + limits.minimumInvestmentUSD, + funding.raiseType, + addresses.wallet, + addresses.reserveWallet, + addresses.usdToken + ]); + + let addModuleAction = securityToken.methods.addModule(usdTieredSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); + let receipt = await common.sendTransaction(addModuleAction); + let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); + console.log(`STO deployed at address: ${event._module}`); + + let usdTieredSTOABI = abis.usdTieredSTO(); + let usdTieredSTO = new web3.eth.Contract(usdTieredSTOABI, event._module); + usdTieredSTO.setProvider(web3.currentProvider); + + return usdTieredSTO; +} + +async function usdTieredSTO_status(currentSTO) { + let displayStartTime = await currentSTO.methods.startTime().call(); + let displayEndTime = await currentSTO.methods.endTime().call(); + let displayCurrentTier = parseInt(await currentSTO.methods.currentTier().call()) + 1; + let displayNonAccreditedLimitUSD = web3.utils.fromWei(await currentSTO.methods.nonAccreditedLimitUSD().call()); + let displayMinimumInvestmentUSD = web3.utils.fromWei(await currentSTO.methods.minimumInvestmentUSD().call()); + let displayWallet = await currentSTO.methods.wallet().call(); + let displayReserveWallet = await currentSTO.methods.reserveWallet().call(); + let displayTokensSold = web3.utils.fromWei(await currentSTO.methods.getTokensSold().call()); + let displayInvestorCount = await currentSTO.methods.investorCount().call(); + let displayIsFinalized = await currentSTO.methods.isFinalized().call() ? "YES" : "NO"; + let displayTokenSymbol = await securityToken.methods.symbol().call(); + + let tiersLength = await currentSTO.methods.getNumberOfTiers().call();; + + let raiseTypes = []; + for (const fundType in gbl.constants.FUND_RAISE_TYPES) { + if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES[fundType]).call()) { + raiseTypes.push(fundType); + } + } + + let displayTiers = ""; + let displayMintedPerTier = ""; + for (let t = 0; t < tiersLength; t++) { + let ratePerTier = await currentSTO.methods.ratePerTier(t).call(); + let tokensPerTierTotal = await currentSTO.methods.tokensPerTierTotal(t).call(); + let mintedPerTierTotal = await currentSTO.methods.mintedPerTierTotal(t).call(); + + let displayMintedPerTierPerType = ""; + let displayDiscountTokens = ""; + for (const type of raiseTypes) { + let displayDiscountMinted = ""; + if (type == 'POLY') { + let tokensPerTierDiscountPoly = await currentSTO.methods.tokensPerTierDiscountPoly(t).call(); + if (tokensPerTierDiscountPoly > 0) { + let ratePerTierDiscountPoly = await currentSTO.methods.ratePerTierDiscountPoly(t).call(); + let mintedPerTierDiscountPoly = await currentSTO.methods.mintedPerTierDiscountPoly(t).call(); + displayDiscountTokens = ` + Tokens at discounted rate: ${web3.utils.fromWei(tokensPerTierDiscountPoly)} ${displayTokenSymbol} + Discounted rate: ${web3.utils.fromWei(ratePerTierDiscountPoly, 'ether')} USD per Token`; + + displayDiscountMinted = `(${web3.utils.fromWei(mintedPerTierDiscountPoly)} ${displayTokenSymbol} at discounted rate)`; + } + } + + let mintedPerTier = await currentSTO.methods.mintedPerTier(gbl.constants.FUND_RAISE_TYPES[type], t).call(); + displayMintedPerTierPerType += ` + Sold for ${type}:\t\t ${web3.utils.fromWei(mintedPerTier)} ${displayTokenSymbol} ${displayDiscountMinted}`; + } + + displayTiers += ` + - Tier ${t+1}: + Tokens: ${web3.utils.fromWei(tokensPerTierTotal)} ${displayTokenSymbol} + Rate: ${web3.utils.fromWei(ratePerTier)} USD per Token` + + displayDiscountTokens; + + displayMintedPerTier += ` + - Tokens minted in Tier ${t+1}: ${web3.utils.fromWei(mintedPerTierTotal)} ${displayTokenSymbol}` + + displayMintedPerTierPerType; + } + + let displayFundsRaisedUSD = web3.utils.fromWei(await currentSTO.methods.fundsRaisedUSD().call()); + + let displayWalletBalancePerType = ''; + let displayReserveWalletBalancePerType = ''; + let displayFundsRaisedPerType = ''; + let displayTokensSoldPerType = ''; + for (const type of raiseTypes) { + let balance = await getBalance(displayWallet, type); + let walletBalance = web3.utils.fromWei(balance); + let walletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(gbl.constants.FUND_RAISE_TYPES[type], balance).call()); + displayWalletBalancePerType += ` + Balance ${type}:\t\t ${walletBalance} ${type} (${walletBalanceUSD} USD)`; + + balance = await getBalance(displayReserveWallet, type); + let reserveWalletBalance = web3.utils.fromWei(balance); + let reserveWalletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(gbl.constants.FUND_RAISE_TYPES[type], balance).call()); + displayReserveWalletBalancePerType += ` + Balance ${type}:\t\t ${reserveWalletBalance} ${type} (${reserveWalletBalanceUSD} USD)`; + + let fundsRaised = web3.utils.fromWei(await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES[type]).call()); + displayFundsRaisedPerType += ` + ${type}:\t\t\t ${fundsRaised} ${type}`; + + //Only show sold for if more than one raise type are allowed + if (raiseTypes.length > 1) { + let tokensSoldPerType = web3.utils.fromWei(await currentSTO.methods.getTokensSoldFor(gbl.constants.FUND_RAISE_TYPES[type]).call()); + displayTokensSoldPerType += ` + Sold for ${type}:\t\t ${tokensSoldPerType} ${displayTokenSymbol}`; + } + } + + let displayRaiseType = raiseTypes.join(' - '); + + let now = Math.floor(Date.now()/1000); + let timeTitle; + let timeRemaining; + if (now < displayStartTime) { + timeTitle = "STO starts in: "; + timeRemaining = displayStartTime - now; + } else { + timeTitle = "Time remaining:"; + timeRemaining = displayEndTime - now; + } + + timeRemaining = common.convertToDaysRemaining(timeRemaining); + + console.log(` + *********************** STO Information *********************** + - Address: ${currentSTO.options.address} + - Start Time: ${new Date(displayStartTime * 1000)} + - End Time: ${new Date(displayEndTime * 1000)} + - Raise Type: ${displayRaiseType} + - Tiers: ${tiersLength}` + + displayTiers + ` + - Minimum Investment: ${displayMinimumInvestmentUSD} USD + - Non Accredited Limit: ${displayNonAccreditedLimitUSD} USD + - Wallet: ${displayWallet}` + + displayWalletBalancePerType + ` + - Reserve Wallet: ${displayReserveWallet}` + + displayReserveWalletBalancePerType + ` + + --------------------------------------------------------------- + - ${timeTitle} ${timeRemaining} + - Is Finalized: ${displayIsFinalized} + - Tokens Sold: ${displayTokensSold} ${displayTokenSymbol}` + + displayTokensSoldPerType + ` + - Current Tier: ${displayCurrentTier}` + + displayMintedPerTier + ` + - Investor count: ${displayInvestorCount} + - Funds Raised` + + displayFundsRaisedPerType + ` + USD: ${displayFundsRaisedUSD} USD + `); + + console.log(chalk.green(`\n${(web3.utils.fromWei(await getBalance(Issuer.address, 'POLY')))} POLY balance remaining at issuer address ${Issuer.address}`)); +} + +async function usdTieredSTO_configure(currentSTO) { + console.log(chalk.blue('STO Configuration - USD Tiered STO')); + + let isFinalized = await currentSTO.methods.isFinalized().call(); + if (isFinalized) { + console.log(chalk.red(`STO is finalized`)); + } else { + let options = []; + options.push('Finalize STO', + 'Change accredited account', 'Change accredited in batch', + 'Change non accredited limit for an account', 'Change non accredited limits in batch'); + + // If STO is not started, you can modify configuration + let now = Math.floor(Date.now() / 1000); + let startTime = await currentSTO.methods.startTime().call.call(); + if (now < startTime) { + options.push('Modify times configuration', 'Modify tiers configuration', 'Modify addresses configuration', + 'Modify limits configuration', 'Modify funding configuration'); + } + + let index = readlineSync.keyInSelect(options, 'What do you want to do?'); + switch (index) { + case 0: + let reserveWallet = await currentSTO.methods.reserveWallet().call(); + let isVerified = await securityToken.methods.verifyTransfer('0x0000000000000000000000000000000000000000', reserveWallet, 0, web3.utils.fromAscii("")).call(); + if (isVerified) { + if (readlineSync.keyInYNStrict()) { + let finalizeAction = currentSTO.methods.finalize(); + await common.sendTransaction(finalizeAction); + } + } else { + console.log(chalk.red(`Reserve wallet (${reserveWallet}) is not able to receive remaining tokens. Check if this address is whitelisted.`)); + } + break; + case 1: + let investor = readlineSync.question('Enter the address to change accreditation: '); + let isAccredited = readlineSync.keyInYNStrict(`Is ${investor} accredited?`); + let investors = [investor]; + let accredited = [isAccredited]; + let changeAccreditedAction = currentSTO.methods.changeAccredited(investors, accredited); + // 2 GAS? + await common.sendTransaction(changeAccreditedAction); + break; + case 2: + shell.exec(`${__dirname}/scripts/script.sh Accredit ${tokenSymbol} 75 ${remoteNetwork}`); + break; + case 3: + let account = readlineSync.question('Enter the address to change non accredited limit: '); + let limit = readlineSync.question(`Enter the limit in USD: `); + let accounts = [account]; + let limits = [web3.utils.toWei(limit)]; + let changeNonAccreditedLimitAction = currentSTO.methods.changeNonAccreditedLimit(accounts, limits); + // 2 GAS? + await common.sendTransaction(changeNonAccreditedLimitAction); + break; + case 4: + shell.exec(`${__dirname}/scripts/script.sh NonAccreditedLimit ${tokenSymbol} 75 ${remoteNetwork}`); + break; + case 5: + await modfifyTimes(currentSTO); + await usdTieredSTO_status(currentSTO); + break; + case 6: + await modfifyTiers(currentSTO); + await usdTieredSTO_status(currentSTO); + break; + case 7: + await modfifyAddresses(currentSTO); + await usdTieredSTO_status(currentSTO); + break; + case 8: + await modfifyLimits(currentSTO); + await usdTieredSTO_status(currentSTO); + break; + case 9: + await modfifyFunding(currentSTO); + await usdTieredSTO_status(currentSTO); + break; + } + } +} + +async function modfifyTimes(currentSTO) { + let times = timesConfigUSDTieredSTO(); + let modifyTimesAction = currentSTO.methods.modifyTimes(times.startTime, times.endTime); + await common.sendTransaction(modifyTimesAction); +} + +async function modfifyLimits(currentSTO) { + let limits = limitsConfigUSDTieredSTO(); + let modifyLimitsAction = currentSTO.methods.modifyLimits(limits.nonAccreditedLimitUSD, limits.minimumInvestmentUSD); + await common.sendTransaction(modifyLimitsAction); +} + +async function modfifyFunding(currentSTO) { + let funding = fundingConfigUSDTieredSTO(); + let modifyFundingAction = currentSTO.methods.modifyFunding(funding.raiseType); + await common.sendTransaction(modifyFundingAction); +} + +async function modfifyAddresses(currentSTO) { + let addresses = addressesConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.DAI).call()); + let modifyAddressesAction = currentSTO.methods.modifyAddresses(addresses.wallet, addresses.reserveWallet, addresses.usdToken); + await common.sendTransaction(modifyAddressesAction); +} + +async function modfifyTiers(currentSTO) { + let tiers = tiersConfigUSDTieredSTO(await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.POLY).call()); + let modifyTiersAction = currentSTO.methods.modifyTiers( + tiers.ratePerTier, + tiers.ratePerTierDiscountPoly, + tiers.tokensPerTier, + tiers.tokensPerTierDiscountPoly, + ); + await common.sendTransaction(modifyTiersAction); +} + +////////////////////// +// HELPER FUNCTIONS // +////////////////////// +async function getBalance(from, type) { + switch (type) { + case 'ETH': + return await web3.eth.getBalance(from); + case 'POLY': + return await polyToken.methods.balanceOf(from).call(); + case 'DAI': + return await usdToken.methods.balanceOf(from).call(); + } +} + +async function getAllModulesByType(type) { + function ModuleInfo(_moduleType, _name, _address, _factoryAddress, _archived, _paused) { + this.name = _name; + this.type = _moduleType; + this.address = _address; + this.factoryAddress = _factoryAddress; + this.archived = _archived; + this.paused = _paused; + } + + let modules = []; + + let allModules = await securityToken.methods.getModulesByType(type).call(); + + for (let i = 0; i < allModules.length; i++) { + let details = await securityToken.methods.getModule(allModules[i]).call(); + let nameTemp = web3.utils.hexToUtf8(details[0]); + let pausedTemp = null; + if (type == gbl.constants.MODULES_TYPES.STO || type == gbl.constants.MODULES_TYPES.TRANSFER) { + let abiTemp = JSON.parse(require('fs').readFileSync(`./build/contracts/${nameTemp}.json`).toString()).abi; + let contractTemp = new web3.eth.Contract(abiTemp, details[1]); + pausedTemp = await contractTemp.methods.paused().call(); + } + modules.push(new ModuleInfo(type, nameTemp, details[1], details[2], details[3], pausedTemp)); + } + + return modules; +} + +module.exports = { + executeApp: async function() { + return executeApp(); + } +} \ No newline at end of file diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index c21c9abad..f90ac529a 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -5,6 +5,7 @@ var faucet = require('./commands/faucet'); var investor_portal = require('./commands/investor_portal'); var token_manager = require('./commands/token_manager'); var st20generator = require('./commands/ST20Generator'); +var sto_manager = require('./commands/sto_manager'); var transfer = require('./commands/transfer'); var transfer_ownership = require('./commands/transfer_ownership'); var dividends_manager = require('./commands/dividends_manager'); @@ -36,6 +37,15 @@ program await st20generator.executeApp(cmd.ticker, cmd.transferOwnership, cmd.tokenName, cmd.details, cmd.divisible); }); +program + .command('sto_manager') + .alias('sto') + .description('Wizard-like script that will guide technical users in the creation of an STO') + .action(async function() { + await gbl.initialize(program.remoteNode); + await sto_manager.executeApp(); + }); + program .command('faucet [beneficiary] [amount]') .alias('f') From ebda32a9840d1353ca8f765bc6837a7374bcf4fa Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 14 Nov 2018 21:42:33 +0530 Subject: [PATCH 058/139] bug fix --- contracts/modules/STO/USDTieredSTO.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index 44569d469..d5b7fde2c 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -252,6 +252,8 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 _startTime, uint256 _endTime ) external onlyOwner { + /*solium-disable-next-line security/no-block-members*/ + require(now < startTime, "STO already started"); _modifyTimes(_startTime, _endTime); } From 7cb5b540b8bb832d06de375350add834a60ca67a Mon Sep 17 00:00:00 2001 From: Polymath Date: Thu, 15 Nov 2018 05:42:20 -0300 Subject: [PATCH 059/139] CSV sync & ST20generator fix --- CLI/commands/ST20Generator.js | 14 ++--- CLI/commands/accredit.js | 49 ++++++++--------- CLI/commands/changeNonAccreditedLimit.js | 49 ++++++++--------- CLI/commands/common/common_functions.js | 3 +- CLI/commands/common/csv_sync.js | 39 ++++++++++++++ CLI/commands/multi_mint.js | 68 ++++++++++-------------- CLI/commands/whitelist.js | 52 +++++++++--------- package.json | 1 - 8 files changed, 145 insertions(+), 130 deletions(-) create mode 100644 CLI/commands/common/csv_sync.js diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index a7dabe7d7..457788e49 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -2,11 +2,14 @@ var readlineSync = require('readline-sync'); var BigNumber = require('bignumber.js'); var moment = require('moment'); var chalk = require('chalk'); -const shell = require('shelljs'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); var common = require('./common/common_functions'); var gbl = require('./common/global'); +var whitelist = require('./whitelist'); +var multi_mint = require('./multi_mint'); +var accredit = require('./accredit'); +var changeNonAccreditedLimit = require('./changeNonAccreditedLimit'); let securityTokenRegistryAddress; @@ -241,12 +244,11 @@ async function step_Wallet_Issuance(){ } async function multi_mint_tokens() { - //await whitelist.startWhitelisting(tokenSymbol); - shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${remoteNetwork}`); + await whitelist.executeApp(tokenSymbol, 75); console.log(chalk.green(`\nCongrats! All the affiliates get succssfully whitelisted, Now its time to Mint the tokens\n`)); console.log(chalk.red(`WARNING: `) + `Please make sure all the addresses that get whitelisted are only eligible to hold or get Security token\n`); - shell.exec(`${__dirname}/scripts//script.sh Multimint ${tokenSymbol} 75 ${remoteNetwork}`); + await multi_mint.executeApp(tokenSymbol, 75); console.log(chalk.green(`\nHurray!! Tokens get successfully Minted and transferred to token holders`)); } @@ -1003,7 +1005,7 @@ async function usdTieredSTO_configure() { await common.sendTransaction(changeAccreditedAction); break; case 2: - shell.exec(`${__dirname}/scripts/script.sh Accredit ${tokenSymbol} 75 ${remoteNetwork}`); + await accredit.executeApp(tokenSymbol, 75); break; case 3: let account = readlineSync.question('Enter the address to change non accredited limit: '); @@ -1015,7 +1017,7 @@ async function usdTieredSTO_configure() { await common.sendTransaction(changeNonAccreditedLimitAction); break; case 4: - shell.exec(`${__dirname}/scripts/script.sh NonAccreditedLimit ${tokenSymbol} 75 ${remoteNetwork}`); + await changeNonAccreditedLimit.executeApp(tokenSymbol, 75); break; case 5: await modfifyTimes(); diff --git a/CLI/commands/accredit.js b/CLI/commands/accredit.js index 079e1040c..dd2c5d3af 100644 --- a/CLI/commands/accredit.js +++ b/CLI/commands/accredit.js @@ -1,6 +1,5 @@ var common = require('./common/common_functions'); -var fs = require('fs'); -var csv = require('fast-csv'); +var csv = require('./common/csv_sync'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); var BigNumber = require('bignumber.js'); @@ -18,7 +17,7 @@ async function startScript(tokenSymbol, batchSize) { BATCH_SIZE = batchSize; } - common.logAsciiBull(); + //common.logAsciiBull(); let STAddress = await checkST(tokenSymbol); securityToken = new web3.eth.Contract(abis.securityToken(), STAddress); @@ -51,34 +50,30 @@ async function STConnect() { } async function readCsv() { - var CSV_STRING = fs.readFileSync("./CLI/data/accredited_data.csv").toString(); + var CSV_STRING = csv('./CLI/data/accredited_data.csv'); let i = 0; - csv.fromString(CSV_STRING) - .on("data", (data) => { - let data_processed = accredit_processing(data); - fullFileData.push(data_processed[1]); - - if (data_processed[0]) { - allocData.push(data_processed[1]); - i++; - if (i >= BATCH_SIZE) { - distribData.push(allocData); - allocData = []; - i = 0; - } - } else { - badData.push(data_processed[1]); + CSV_STRING.forEach(line => { + let data_processed = accredit_processing(line); + fullFileData.push(data_processed[1]); + + if (data_processed[0]) { + allocData.push(data_processed[1]); + i++; + if (i >= BATCH_SIZE) { + distribData.push(allocData); + allocData = []; + i = 0; } + } else { + badData.push(data_processed[1]); + } + }); - }) - .on("end", async () => { - distribData.push(allocData); - allocData = []; + distribData.push(allocData); + allocData = []; - await saveInBlockchain(); - return; - }); + await saveInBlockchain(); } async function saveInBlockchain() { @@ -116,7 +111,7 @@ async function saveInBlockchain() { isAccreditedArray.push(distribData[i][j][1]) } - let changeAccreditedAction = usdTieredSTO.methods.changeAccredited(investorArray, isAccreditedArray); + let changeAccreditedAction = await usdTieredSTO.methods.changeAccredited(investorArray, isAccreditedArray); let tx = await common.sendTransaction(changeAccreditedAction); console.log(`Batch ${i} - Attempting to change accredited accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); diff --git a/CLI/commands/changeNonAccreditedLimit.js b/CLI/commands/changeNonAccreditedLimit.js index da3589f3d..35ae68b57 100644 --- a/CLI/commands/changeNonAccreditedLimit.js +++ b/CLI/commands/changeNonAccreditedLimit.js @@ -1,6 +1,5 @@ var common = require('./common/common_functions'); -var fs = require('fs'); -var csv = require('fast-csv'); +var csv = require('./common/csv_sync'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); var BigNumber = require('bignumber.js'); @@ -18,7 +17,7 @@ async function startScript(tokenSymbol, batchSize) { BATCH_SIZE = batchSize; } - common.logAsciiBull(); + //common.logAsciiBull(); let STAddress = await checkST(tokenSymbol); securityToken = new web3.eth.Contract(abis.securityToken(), STAddress); @@ -51,34 +50,30 @@ async function STConnect() { } async function readCsv() { - var CSV_STRING = fs.readFileSync("./CLI/data/nonAccreditedLimits_data.csv").toString(); + var CSV_STRING = csv('./CLI/data/nonAccreditedLimits_data.csv'); let i = 0; - csv.fromString(CSV_STRING) - .on("data", (data) => { - let data_processed = nonAccredited_processing(data); - fullFileData.push(data_processed[1]); - - if (data_processed[0]) { - allocData.push(data_processed[1]); - i++; - if (i >= BATCH_SIZE) { - distribData.push(allocData); - allocData = []; - i = 0; - } - } else { - badData.push(data_processed[1]); + CSV_STRING.forEach(line => { + let data_processed = nonAccredited_processing(line); + fullFileData.push(data_processed[1]); + + if (data_processed[0]) { + allocData.push(data_processed[1]); + i++; + if (i >= BATCH_SIZE) { + distribData.push(allocData); + allocData = []; + i = 0; } + } else { + badData.push(data_processed[1]); + } + }); - }) - .on("end", async () => { - distribData.push(allocData); - allocData = []; + distribData.push(allocData); + allocData = []; - await saveInBlockchain(); - return; - }); + await saveInBlockchain(); } async function saveInBlockchain() { @@ -116,7 +111,7 @@ async function saveInBlockchain() { limitArray.push(web3.utils.toWei(distribData[i][j][1].toString())); } - let changeNonAccreditedLimitAction = usdTieredSTO.methods.changeNonAccreditedLimit(investorArray, limitArray); + let changeNonAccreditedLimitAction = await usdTieredSTO.methods.changeNonAccreditedLimit(investorArray, limitArray); let tx = await common.sendTransaction(changeNonAccreditedLimitAction); console.log(`Batch ${i} - Attempting to change non accredited limits to accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); diff --git a/CLI/commands/common/common_functions.js b/CLI/commands/common/common_functions.js index 123e158cb..700d6b4eb 100644 --- a/CLI/commands/common/common_functions.js +++ b/CLI/commands/common/common_functions.js @@ -50,7 +50,7 @@ async function checkPermissions(action) { //NOTE this is a condition to verify if the transaction comes from a module or not. if (contractRegistry.methods.hasOwnProperty('factory')) { let moduleAddress = await contractRegistry.methods.factory().call(); - let moduleRegistry = await connect(abis.moduleFactory(), moduleAddress) + let moduleRegistry = await connect(abis.moduleFactory(), moduleAddress); let parentModule = await moduleRegistry.methods.getName().call(); let result = await checkPermission(web3.utils.hexToUtf8(parentModule), action._method.name, contractRegistry); if (!result) { @@ -58,6 +58,7 @@ async function checkPermissions(action) { process.exit(0); } } + return } module.exports = { diff --git a/CLI/commands/common/csv_sync.js b/CLI/commands/common/csv_sync.js new file mode 100644 index 000000000..6955a2445 --- /dev/null +++ b/CLI/commands/common/csv_sync.js @@ -0,0 +1,39 @@ +var fs = require('fs'); + +function load(filename, options) { + var content = fs.readFileSync(filename, 'utf-8'); + var lines = content.split('\n'); + var splitToColumns = options && check.fn(options.getColumns) ? options.getColumns : getColumns; + var results = []; + + lines.forEach(function (line, index) { + if (!line) { + return; + } + + var obj = []; + var values = stripQuotes(splitToColumns(line, index)); + + values.forEach(function (value) { + obj.push(value) + }); + + results.push(obj); + }); + + return results; +} + +function getColumns(line) { + var columns = line.split(','); + return columns; +} + +function stripQuotes(words) { + return words.map(function (word) { + word = word.trim(); + return word.replace(/"/g, ''); + }); +} + +module.exports = load; diff --git a/CLI/commands/multi_mint.js b/CLI/commands/multi_mint.js index 723c2a34c..b1f041115 100644 --- a/CLI/commands/multi_mint.js +++ b/CLI/commands/multi_mint.js @@ -1,6 +1,5 @@ var common = require('./common/common_functions'); -var fs = require('fs'); -var csv = require('fast-csv'); +var csv = require('./common/csv_sync'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); var BigNumber = require('bignumber.js'); @@ -19,7 +18,7 @@ async function startScript(tokenSymbol, batchSize) { BATCH_SIZE = batchSize; } - common.logAsciiBull(); + //common.logAsciiBull(); let STAddress = await checkST(tokenSymbol); securityToken = new web3.eth.Contract(abis.securityToken(), STAddress); @@ -52,50 +51,39 @@ async function STConnect() { } async function readCsv() { - var CSV_STRING = fs.readFileSync("./CLI/data/multi_mint_data.csv").toString(); + var CSV_STRING = csv('./CLI/data/multi_mint_data.csv'); let i = 0; - csv.fromString(CSV_STRING) - .on("data", (data) => { - let data_processed = multimint_processing(data); - fullFileData.push(data_processed[1]); - - if (data_processed[0]) { - allocData.push(data_processed[1]); - i++; - if (i >= BATCH_SIZE) { - distribData.push(allocData); - allocData = []; - i = 0; - } - } else { - badData.push(data_processed[1]); + CSV_STRING.forEach(line => { + let data_processed = multimint_processing(line); + fullFileData.push(data_processed[1]); + + if (data_processed[0]) { + allocData.push(data_processed[1]); + i++; + if (i >= BATCH_SIZE) { + distribData.push(allocData); + allocData = []; + i = 0; } + } else { + badData.push(data_processed[1]); + } + }); - }) - .on("end", async () => { - distribData.push(allocData); - allocData = []; + distribData.push(allocData); + allocData = []; - await saveInBlockchain(); - await finalResults(); - return; - }); + await saveInBlockchain(); + await finalResults(); } async function saveInBlockchain() { - let gtmModules; - - try { - gtmModules = await securityToken.methods.getModulesByType(3).call(); - } catch (e) { - console.log("Minting of tokens is only allowed before the STO get attached", e) - process.exit(0) - } - - if (!gtmModules.length) { - console.log("Minting of tokens is only allowed before the STO get attached") - process.exit(0) + let gtmModules = await securityToken.methods.getModulesByType(3).call(); + + if (gtmModules.length > 0) { + console.log("Minting of tokens is only allowed before the STO get attached"); + process.exit(0); } console.log(` @@ -128,7 +116,7 @@ async function saveInBlockchain() { } } - let mintMultiAction = securityToken.methods.mintMulti(affiliatesVerifiedArray, tokensVerifiedArray); + let mintMultiAction = await securityToken.methods.mintMulti(affiliatesVerifiedArray, tokensVerifiedArray); let tx = await common.sendTransaction(mintMultiAction); console.log(`Batch ${i} - Attempting to send the Minted tokens to affiliates accounts:\n\n`, affiliatesVerifiedArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); diff --git a/CLI/commands/whitelist.js b/CLI/commands/whitelist.js index d176903ee..2cd108030 100644 --- a/CLI/commands/whitelist.js +++ b/CLI/commands/whitelist.js @@ -1,6 +1,5 @@ var common = require('./common/common_functions'); -var fs = require('fs'); -var csv = require('fast-csv'); +var csv = require('./common/csv_sync'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); var BigNumber = require('bignumber.js'); @@ -18,7 +17,7 @@ async function startScript(tokenSymbol, batchSize) { BATCH_SIZE = batchSize; } - common.logAsciiBull(); + //common.logAsciiBull(); let STAddress = await checkST(tokenSymbol); securityToken = new web3.eth.Contract(abis.securityToken(), STAddress); @@ -51,35 +50,32 @@ async function STConnect() { } async function readCsv() { - var CSV_STRING = fs.readFileSync("./CLI/data/whitelist_data.csv").toString(); + var CSV_STRING = csv('./CLI/data/whitelist_data.csv'); let i = 0; - csv.fromString(CSV_STRING) - .on("data", (data) => { - let data_processed = whitelist_processing(data); - fullFileData.push(data_processed[1]); - - if (data_processed[0]) { - allocData.push(data_processed[1]); - i++; - if (i >= BATCH_SIZE) { - distribData.push(allocData); - allocData = []; - i = 0; - } - } else { - badData.push(data_processed[1]); + CSV_STRING.forEach(line => { + let data_processed = whitelist_processing(line); + fullFileData.push(data_processed[1]); + + if (data_processed[0]) { + allocData.push(data_processed[1]); + i++; + if (i >= BATCH_SIZE) { + distribData.push(allocData); + allocData = []; + i = 0; } + } else { + badData.push(data_processed[1]); + } + }); + + distribData.push(allocData); + allocData = []; - }) - .on("end", async () => { - distribData.push(allocData); - allocData = []; + await saveInBlockchain(); + await finalResults(); - await saveInBlockchain(); - await finalResults(); - return; - }); } async function saveInBlockchain() { @@ -112,7 +108,7 @@ async function saveInBlockchain() { canBuyFromSTOArray.push(distribData[i][j][4]) } - let modifyWhitelistMultiAction = generalTransferManager.methods.modifyWhitelistMulti(investorArray, fromTimesArray, toTimesArray, expiryTimeArray, canBuyFromSTOArray); + let modifyWhitelistMultiAction = await generalTransferManager.methods.modifyWhitelistMulti(investorArray, fromTimesArray, toTimesArray, expiryTimeArray, canBuyFromSTOArray); let tx = await common.sendTransaction(modifyWhitelistMultiAction); console.log(`Batch ${i} - Attempting to modifyWhitelist accounts:\n\n`, investorArray, "\n\n"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); diff --git a/package.json b/package.json index 5f8594e10..ef2d76c38 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,6 @@ "eslint-plugin-standard": "^3.0.1", "ethereum-bridge": "^0.6.1", "ethereumjs-abi": "^0.6.5", - "fast-csv": "^2.4.1", "ganache-cli": "^6.1.8", "prettier": "^1.14.3", "sol-merger": "^0.1.2", From be15824823701d8a4626c47ff4f91098df8d16d6 Mon Sep 17 00:00:00 2001 From: Adam Dossa Date: Thu, 15 Nov 2018 16:12:10 +0000 Subject: [PATCH 060/139] Add getTokensSoldByTier --- contracts/modules/STO/USDTieredSTO.sol | 35 ++++++++++++++++++-------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index d5b7fde2c..e5e7bb3aa 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -22,7 +22,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 rate; // How many token units a buyer gets per USD in this tier (multiplied by 10**18) when investing in POLY up to tokensDiscountPoly - uint256 rateDiscountPoly; + uint256 rateDiscountPoly; // How many tokens are available in this tier (relative to totalSupply) uint256 tokenTotal; @@ -202,7 +202,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { } /** - * @dev Modifies fund raise types + * @dev Modifies fund raise types * @param _fundRaiseTypes Array of fund raise types to allow */ function modifyFunding(FundRaiseType[] _fundRaiseTypes) external onlyOwner { @@ -291,7 +291,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { require(_tokensPerTierTotal.length > 0, "No tiers provided"); require(_ratePerTier.length == _tokensPerTierTotal.length && _ratePerTierDiscountPoly.length == _tokensPerTierTotal.length && - _tokensPerTierDiscountPoly.length == _tokensPerTierTotal.length, + _tokensPerTierDiscountPoly.length == _tokensPerTierTotal.length, "Tier data length mismatch" ); delete tiers; @@ -408,7 +408,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { buyWithETHRateLimited(msg.sender, 0); } - // Buy functions without rate restriction + // Buy functions without rate restriction function buyWithETH(address _beneficiary) external payable { buyWithETHRateLimited(_beneficiary, 0); } @@ -448,7 +448,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { * @param _minTokens Minumum number of tokens to buy or else revert */ function buyWithPOLYRateLimited(address _beneficiary, uint256 _investedPOLY, uint256 _minTokens) public validPOLY { - _buyWithTokens(_beneficiary, _investedPOLY, FundRaiseType.POLY, _minTokens); + _buyWithTokens(_beneficiary, _investedPOLY, FundRaiseType.POLY, _minTokens); } /** @@ -529,7 +529,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { if (!gotoNextTier) break; } - + } // Modify storage @@ -544,7 +544,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { spentValue = 0; } else { //_rate is actually OriginalUSD. Reusing variable to prevent stackoverflow - spentValue = DecimalMath.mul(DecimalMath.div(spentUSD, _rate), _investmentValue); + spentValue = DecimalMath.mul(DecimalMath.div(spentUSD, _rate), _investmentValue); } // Return calculated amounts @@ -556,7 +556,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 _tier, uint256 _investedUSD, FundRaiseType _fundRaiseType - ) + ) internal returns(uint256 spentUSD, bool gotoNextTier) { @@ -712,7 +712,8 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { } /** - * @notice Return the total no. of tokens sold for ETH + * @notice Return the total no. of tokens sold for the given fund raise type + * param _fundRaiseType The fund raising currency (e.g. ETH, POLY, DAI) to calculate sold tokens for * @return uint256 Total number of tokens sold for ETH */ function getTokensSoldFor(FundRaiseType _fundRaiseType) public view returns (uint256) { @@ -723,6 +724,20 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { return tokensSold; } + /** + * @notice Return the total no. of tokens sold in a given tier + * param _tier The tier to calculate sold tokens for + * @return uint256 Total number of tokens sold in the tier + */ + function getTokensSoldByTier(uint256 _tier) public view returns (uint256) { + require(_tier < tiers.length, "Incorrect tier"); + uint256 tokensSold; + tokensSold = tokensSold.add(tiers[_tier].minted[uint8(FundRaiseType.ETH)]); + tokensSold = tokensSold.add(tiers[_tier].minted[uint8(FundRaiseType.POLY)]); + tokensSold = tokensSold.add(tiers[_tier].minted[uint8(FundRaiseType.DAI)]); + return tokensSold; + } + /** * @notice Return the total no. of tiers * @return uint256 Total number of tiers @@ -748,7 +763,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { * @return Array Rate at which tokens are sold at different tiers * @return Amount of funds raised * @return Number of individual investors this STO have. - * @return Amount of tokens sold. + * @return Amount of tokens sold. * @return Array of bools to show if funding is allowed in ETH, POLY, DAI respectively */ function getSTODetails() public view returns(uint256, uint256, uint256, uint256[], uint256[], uint256, uint256, uint256, bool[]) { From 12864712d7c0dd78456cc5f70ae51b41b975cf21 Mon Sep 17 00:00:00 2001 From: Polymath Date: Thu, 15 Nov 2018 17:09:22 -0300 Subject: [PATCH 061/139] Improvements over mint tokens (parseFloat for divisible tokens) --- CLI/commands/multi_mint.js | 16 +++++++++++----- CLI/data/multi_mint_data.csv | 6 +++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CLI/commands/multi_mint.js b/CLI/commands/multi_mint.js index b1f041115..684be6bac 100644 --- a/CLI/commands/multi_mint.js +++ b/CLI/commands/multi_mint.js @@ -12,6 +12,7 @@ let BATCH_SIZE = 75; let securityToken; let affiliatesFailedArray = new Array(); let affiliatesKYCInvalidArray = new Array(); +let tokenDivisible; async function startScript(tokenSymbol, batchSize) { if (batchSize) { @@ -22,6 +23,7 @@ async function startScript(tokenSymbol, batchSize) { let STAddress = await checkST(tokenSymbol); securityToken = new web3.eth.Contract(abis.securityToken(), STAddress); + tokenDivisible = await securityToken.methods.granularity().call() == 1; await readCsv(); }; @@ -80,7 +82,7 @@ async function readCsv() { async function saveInBlockchain() { let gtmModules = await securityToken.methods.getModulesByType(3).call(); - + if (gtmModules.length > 0) { console.log("Minting of tokens is only allowed before the STO get attached"); process.exit(0); @@ -235,11 +237,15 @@ function multimint_processing(csv_line) { } function isValidToken(token) { - var tokenAmount = parseInt(token); - if ((tokenAmount % 1 == 0)) { - return tokenAmount; + var tokenAmount = parseFloat(token); + if (tokenDivisible) { + return tokenAmount + } else { + if ((tokenAmount % 1 == 0)) { + return tokenAmount; + } + return false } - return false; } module.exports = { diff --git a/CLI/data/multi_mint_data.csv b/CLI/data/multi_mint_data.csv index 0b157b164..8b27f06b0 100644 --- a/CLI/data/multi_mint_data.csv +++ b/CLI/data/multi_mint_data.csv @@ -1,8 +1,8 @@ -0xee7ae74d964f2be7d72c1b187b38e2ed3615d4d1,1000 +0xee7ae74d964f2be7d72c1b187b38e2ed3615d4d1,123.4 0x2f0fd672bf222413cc69dc1f4f1d7e93ad1763a1,1000 -0xac297053173b02b02a737d47f7b4a718e5b170ef,1000 +0xac297053173b02b02a737d47f7b4a718e5b170ef,234.5 0x49fc0b78238dab644698a90fa351b4c749e123d2,1000 -0x10223927009b8add0960359dd90d1449415b7ca9,1000 +0x10223927009b8add0960359dd90d1449415b7ca9,345.6 0x3c65cfe3de848cf38e9d76e9c3e57a2f1140b399,1000 0xabf60de3265b3017db7a1be66fc8b364ec1dbb98,1000 0xb841fe5a89da1bbef2d0805fbd7ffcbbb2fca5e3,1000 From 8a91610be7b69ae3d0865c57aec5e42994f23445 Mon Sep 17 00:00:00 2001 From: Adam Dossa Date: Fri, 16 Nov 2018 09:42:44 +0000 Subject: [PATCH 062/139] Update changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9ffcb644..e5293b1fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. * Added `getSTODetails` to USDTSTO. * Added an Array of Tiers that will hold data about every tier in USDTSTO. * Added `buyWithETHRateLimited`, `buyWithPOLYRateLimited` and `buyWithUSDRateLimited` to USDTSTO. +* Added `getTokensSoldByTier` to return sold (not minted during finalisation) tokens in each tier. ##Changed * `getAllModulesAndPermsFromTypes()` does not take securityToken address as a parameter anymore. @@ -63,7 +64,7 @@ All notable changes to this project will be documented in this file. ====== -# v1.4.1 +# v1.4.1 [__1.4.1__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __13-08-18__ @@ -87,7 +88,7 @@ All notable changes to this project will be documented in this file. * Fix #238: make beneficial investments optionally supported (default to not allowed) -# v1.4.0 +# v1.4.0 [__1.4.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __13-08-18__ From 53fcaac757b44ab19207bd773a1ef3f5a69b007d Mon Sep 17 00:00:00 2001 From: Adam Dossa Date: Fri, 16 Nov 2018 09:43:05 +0000 Subject: [PATCH 063/139] Typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5293b1fc..a99b5f767 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ All notable changes to this project will be documented in this file. * Added `getSTODetails` to USDTSTO. * Added an Array of Tiers that will hold data about every tier in USDTSTO. * Added `buyWithETHRateLimited`, `buyWithPOLYRateLimited` and `buyWithUSDRateLimited` to USDTSTO. -* Added `getTokensSoldByTier` to return sold (not minted during finalisation) tokens in each tier. +* Added `getTokensSoldByTier` to return sold (not minted during finalisation) tokens in each tier to USDTSTO. ##Changed * `getAllModulesAndPermsFromTypes()` does not take securityToken address as a parameter anymore. From 4974b1362204e73088828fe4f864940a3625eee6 Mon Sep 17 00:00:00 2001 From: Polymath Date: Mon, 19 Nov 2018 11:40:14 -0300 Subject: [PATCH 064/139] Final CSV refactor --- CLI/commands/accredit.js | 90 +++------------ CLI/commands/changeNonAccreditedLimit.js | 90 +++------------ CLI/commands/common/csv_shared.js | 82 ++++++++++++++ CLI/commands/multi_mint.js | 114 +++++-------------- CLI/commands/whitelist.js | 138 +++++++---------------- 5 files changed, 179 insertions(+), 335 deletions(-) create mode 100644 CLI/commands/common/csv_shared.js diff --git a/CLI/commands/accredit.js b/CLI/commands/accredit.js index dd2c5d3af..cc550af2e 100644 --- a/CLI/commands/accredit.js +++ b/CLI/commands/accredit.js @@ -1,81 +1,37 @@ var common = require('./common/common_functions'); -var csv = require('./common/csv_sync'); -var contracts = require('./helpers/contract_addresses'); +var csv_shared = require('./common/csv_shared'); var abis = require('./helpers/contract_abis'); var BigNumber = require('bignumber.js'); let distribData = new Array(); -let allocData = new Array(); let fullFileData = new Array(); let badData = new Array(); -let BATCH_SIZE = 70; let securityToken; async function startScript(tokenSymbol, batchSize) { - if (batchSize) { - BATCH_SIZE = batchSize; - } - - //common.logAsciiBull(); + securityToken = await csv_shared.start(tokenSymbol, batchSize); - let STAddress = await checkST(tokenSymbol); - securityToken = new web3.eth.Contract(abis.securityToken(), STAddress); + let result_processing = await csv_shared.read('./CLI/data/accredited_data.csv', accredit_processing); + distribData = result_processing.distribData; + fullFileData = result_processing.fullFileData; + badData = result_processing.badData; - await readCsv(); + await saveInBlockchain(); }; -async function checkST(tokenSymbol) { - let securityTokenRegistry = await STConnect(); - - return await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { - if (result != "0x0000000000000000000000000000000000000000") { - return result - } else { - console.log("Token doesn't exist") - process.exit(0) - } - }); -} +function accredit_processing(csv_line) { + let isAddress = web3.utils.isAddress(csv_line[0]); + let isAccredited = (typeof JSON.parse(csv_line[1].toLowerCase())) == "boolean" ? JSON.parse(csv_line[1].toLowerCase()) : "not-valid"; -async function STConnect() { - try { - let STRegistryAddress = await contracts.securityTokenRegistry(); - let STRegistry = new web3.eth.Contract(abis.securityTokenRegistry(), STRegistryAddress); - return STRegistry; - } catch (err) { - console.log("There was a problem getting the contracts. Make sure they are deployed to the selected network."); - process.exit(0); + if (isAddress && + (isAccredited != "not-valid")) { + return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), isAccredited)] + } else { + return [false, new Array(csv_line[0], isAccredited)] } } -async function readCsv() { - var CSV_STRING = csv('./CLI/data/accredited_data.csv'); - let i = 0; - - CSV_STRING.forEach(line => { - let data_processed = accredit_processing(line); - fullFileData.push(data_processed[1]); - - if (data_processed[0]) { - allocData.push(data_processed[1]); - i++; - if (i >= BATCH_SIZE) { - distribData.push(allocData); - allocData = []; - i = 0; - } - } else { - badData.push(data_processed[1]); - } - }); - - distribData.push(allocData); - allocData = []; - - await saveInBlockchain(); -} - async function saveInBlockchain() { let gtmModules; try { @@ -131,22 +87,6 @@ async function saveInBlockchain() { return; } -function accredit_processing(csv_line) { - let isAddress = web3.utils.isAddress(csv_line[0]); - let isAccredited = (typeof JSON.parse(csv_line[1].toLowerCase())) == "boolean" ? JSON.parse(csv_line[1].toLowerCase()) : "not-valid"; - - if (isAddress && - (isAccredited != "not-valid")) { - - return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), isAccredited)] - - } else { - - return [false, new Array(csv_line[0], isAccredited)] - - } -} - module.exports = { executeApp: async (tokenSymbol, batchSize) => { return startScript(tokenSymbol, batchSize); diff --git a/CLI/commands/changeNonAccreditedLimit.js b/CLI/commands/changeNonAccreditedLimit.js index 35ae68b57..029f2fc70 100644 --- a/CLI/commands/changeNonAccreditedLimit.js +++ b/CLI/commands/changeNonAccreditedLimit.js @@ -1,79 +1,34 @@ var common = require('./common/common_functions'); -var csv = require('./common/csv_sync'); -var contracts = require('./helpers/contract_addresses'); +var csv_shared = require('./common/csv_shared'); var abis = require('./helpers/contract_abis'); var BigNumber = require('bignumber.js'); let distribData = new Array(); -let allocData = new Array(); let fullFileData = new Array(); let badData = new Array(); -let BATCH_SIZE = 70; let securityToken; async function startScript(tokenSymbol, batchSize) { - if (batchSize) { - BATCH_SIZE = batchSize; - } - - //common.logAsciiBull(); + securityToken = await csv_shared.start(tokenSymbol, batchSize); - let STAddress = await checkST(tokenSymbol); - securityToken = new web3.eth.Contract(abis.securityToken(), STAddress); + let result_processing = await csv_shared.read('./CLI/data/nonAccreditedLimits_data.csv', nonAccredited_processing); + distribData = result_processing.distribData; + fullFileData = result_processing.fullFileData; + badData = result_processing.badData; - await readCsv(); -}; - -async function checkST(tokenSymbol) { - let securityTokenRegistry = await STConnect(); - - return await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { - if (result != "0x0000000000000000000000000000000000000000") { - return result - } else { - console.log("Token doesn't exist") - process.exit(0) - } - }); -} - -async function STConnect() { - try { - let STRegistryAddress = await contracts.securityTokenRegistry(); - let STRegistry = new web3.eth.Contract(abis.securityTokenRegistry(), STRegistryAddress); - return STRegistry; - } catch (err) { - console.log("There was a problem getting the contracts. Make sure they are deployed to the selected network."); - process.exit(0); - } + await saveInBlockchain(); } -async function readCsv() { - var CSV_STRING = csv('./CLI/data/nonAccreditedLimits_data.csv'); - let i = 0; - - CSV_STRING.forEach(line => { - let data_processed = nonAccredited_processing(line); - fullFileData.push(data_processed[1]); - - if (data_processed[0]) { - allocData.push(data_processed[1]); - i++; - if (i >= BATCH_SIZE) { - distribData.push(allocData); - allocData = []; - i = 0; - } - } else { - badData.push(data_processed[1]); - } - }); - - distribData.push(allocData); - allocData = []; +function nonAccredited_processing(csv_line) { + let isAddress = web3.utils.isAddress(csv_line[0]); + let isNumber = !isNaN(csv_line[1]); - await saveInBlockchain(); + if (isAddress && isNumber) { + return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), csv_line[1])] + } else { + return [false, new Array(csv_line[0], csv_line[1])] + } } async function saveInBlockchain() { @@ -132,21 +87,6 @@ async function saveInBlockchain() { return; } -function nonAccredited_processing(csv_line) { - let isAddress = web3.utils.isAddress(csv_line[0]); - let isNumber = !isNaN(csv_line[1]); - - if (isAddress && isNumber) { - - return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), csv_line[1])] - - } else { - - return [false, new Array(csv_line[0], csv_line[1])] - - } -} - module.exports = { executeApp: async (tokenSymbol, batchSize) => { return startScript(tokenSymbol, batchSize); diff --git a/CLI/commands/common/csv_shared.js b/CLI/commands/common/csv_shared.js new file mode 100644 index 000000000..471db13d1 --- /dev/null +++ b/CLI/commands/common/csv_shared.js @@ -0,0 +1,82 @@ +var contracts = require('../helpers/contract_addresses'); +var abis = require('../helpers/contract_abis'); +var csv = require('./csv_sync'); + +let BATCH_SIZE = 70; + +async function startScript(tokenSymbol, batchSize) { + if (batchSize) { + BATCH_SIZE = batchSize; + } + let STAddress = await checkST(tokenSymbol); + return new web3.eth.Contract(abis.securityToken(), STAddress); +}; + +async function checkST(tokenSymbol) { + let securityTokenRegistry = await STConnect(); + + return await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { + if (result != "0x0000000000000000000000000000000000000000") { + return result + } else { + console.log("Token doesn't exist") + process.exit(0) + } + }); +} + +async function STConnect() { + try { + let STRegistryAddress = await contracts.securityTokenRegistry(); + let STRegistry = new web3.eth.Contract(abis.securityTokenRegistry(), STRegistryAddress); + return STRegistry; + } catch (err) { + console.log("There was a problem getting the contracts. Make sure they are deployed to the selected network."); + process.exit(0); + } +} + +async function readScript(file, processing) { + let allocData = new Array(); + let distribData = new Array(); + let fullFileData = new Array(); + let badData = new Array(); + let i = 0; + + var CSV_STRING = csv(file); + + CSV_STRING.forEach(line => { + let data_processed = processing(line); + fullFileData.push(data_processed[1]); + + if (data_processed[0]) { + allocData.push(data_processed[1]); + i++; + if (i >= BATCH_SIZE) { + distribData.push(allocData); + allocData = []; + i = 0; + } + } else { + badData.push(data_processed[1]); + } + }); + + distribData.push(allocData); + allocData = []; + + return { + distribData: distribData, + fullFileData: fullFileData, + badData: badData + } +} + +module.exports = { + start: async (tokenSymbol, batchSize) => { + return await startScript(tokenSymbol, batchSize); + }, + read: async (file, processing) => { + return await readScript(file, processing); + } +} \ No newline at end of file diff --git a/CLI/commands/multi_mint.js b/CLI/commands/multi_mint.js index 684be6bac..3147b2754 100644 --- a/CLI/commands/multi_mint.js +++ b/CLI/commands/multi_mint.js @@ -1,83 +1,53 @@ var common = require('./common/common_functions'); -var csv = require('./common/csv_sync'); -var contracts = require('./helpers/contract_addresses'); +var csv_shared = require('./common/csv_shared'); var abis = require('./helpers/contract_abis'); var BigNumber = require('bignumber.js'); let distribData = new Array(); -let allocData = new Array(); let fullFileData = new Array(); let badData = new Array(); -let BATCH_SIZE = 75; -let securityToken; let affiliatesFailedArray = new Array(); let affiliatesKYCInvalidArray = new Array(); + +let securityToken; let tokenDivisible; async function startScript(tokenSymbol, batchSize) { - if (batchSize) { - BATCH_SIZE = batchSize; - } + securityToken = await csv_shared.start(tokenSymbol, batchSize); - //common.logAsciiBull(); + let result_processing = await csv_shared.read('./CLI/data/multi_mint_data.csv', multimint_processing); + distribData = result_processing.distribData; + fullFileData = result_processing.fullFileData; + badData = result_processing.badData; - let STAddress = await checkST(tokenSymbol); - securityToken = new web3.eth.Contract(abis.securityToken(), STAddress); tokenDivisible = await securityToken.methods.granularity().call() == 1; - await readCsv(); -}; - -async function checkST(tokenSymbol) { - let securityTokenRegistry = await STConnect(); - - return await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { - if (result != "0x0000000000000000000000000000000000000000") { - return result - } else { - console.log("Token doesn't exist") - process.exit(0) - } - }); + await saveInBlockchain(); + await finalResults(); } -async function STConnect() { - try { - let STRegistryAddress = await contracts.securityTokenRegistry(); - let STRegistry = new web3.eth.Contract(abis.securityTokenRegistry(), STRegistryAddress); - return STRegistry; - } catch (err) { - console.log("There was a problem getting the contracts. Make sure they are deployed to the selected network."); - process.exit(0); +function multimint_processing(csv_line) { + let isAddress = web3.utils.isAddress(csv_line[0]); + let validToken = isValidToken(csv_line[1]); + + if (isAddress && + validToken) { + return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), validToken)] + } else { + return [false, new Array(csv_line[0], csv_line[1])] } } -async function readCsv() { - var CSV_STRING = csv('./CLI/data/multi_mint_data.csv'); - let i = 0; - - CSV_STRING.forEach(line => { - let data_processed = multimint_processing(line); - fullFileData.push(data_processed[1]); - - if (data_processed[0]) { - allocData.push(data_processed[1]); - i++; - if (i >= BATCH_SIZE) { - distribData.push(allocData); - allocData = []; - i = 0; - } - } else { - badData.push(data_processed[1]); +function isValidToken(token) { + var tokenAmount = parseFloat(token); + if (tokenDivisible) { + return tokenAmount + } else { + if ((tokenAmount % 1 == 0)) { + return tokenAmount; } - }); - - distribData.push(allocData); - allocData = []; - - await saveInBlockchain(); - await finalResults(); + return false + } } async function saveInBlockchain() { @@ -220,34 +190,6 @@ async function finalResults() { } -function multimint_processing(csv_line) { - let isAddress = web3.utils.isAddress(csv_line[0]); - let validToken = isValidToken(csv_line[1]); - - if (isAddress && - validToken) { - - return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), validToken)] - - } else { - - return [false, new Array(csv_line[0], csv_line[1])] - - } -} - -function isValidToken(token) { - var tokenAmount = parseFloat(token); - if (tokenDivisible) { - return tokenAmount - } else { - if ((tokenAmount % 1 == 0)) { - return tokenAmount; - } - return false - } -} - module.exports = { executeApp: async (tokenSymbol, batchSize) => { return startScript(tokenSymbol, batchSize); diff --git a/CLI/commands/whitelist.js b/CLI/commands/whitelist.js index 2cd108030..7a5767611 100644 --- a/CLI/commands/whitelist.js +++ b/CLI/commands/whitelist.js @@ -1,81 +1,62 @@ var common = require('./common/common_functions'); -var csv = require('./common/csv_sync'); -var contracts = require('./helpers/contract_addresses'); +var csv_shared = require('./common/csv_shared'); var abis = require('./helpers/contract_abis'); var BigNumber = require('bignumber.js'); let distribData = new Array(); -let allocData = new Array(); let fullFileData = new Array(); let badData = new Array(); -let BATCH_SIZE = 70; + let securityToken; let generalTransferManager; async function startScript(tokenSymbol, batchSize) { - if (batchSize) { - BATCH_SIZE = batchSize; - } + securityToken = await csv_shared.start(tokenSymbol, batchSize); - //common.logAsciiBull(); + let result_processing = await csv_shared.read('./CLI/data/whitelist_data.csv', whitelist_processing); + distribData = result_processing.distribData; + fullFileData = result_processing.fullFileData; + badData = result_processing.badData; - let STAddress = await checkST(tokenSymbol); - securityToken = new web3.eth.Contract(abis.securityToken(), STAddress); - - await readCsv(); + await saveInBlockchain(); + await finalResults(); }; -async function checkST(tokenSymbol) { - let securityTokenRegistry = await STConnect(); - - return await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { - if (result != "0x0000000000000000000000000000000000000000") { - return result - } else { - console.log("Token doesn't exist") - process.exit(0) - } - }); -} +function whitelist_processing(csv_line) { + let isAddress = web3.utils.isAddress(csv_line[0]); + let sellValid = isValidDate(csv_line[1]) + let buyValid = isValidDate(csv_line[2]) + let kycExpiryDate = isValidDate(csv_line[3]) + let canBuyFromSTO = (typeof JSON.parse(csv_line[4].toLowerCase())) == "boolean" ? JSON.parse(csv_line[4].toLowerCase()) : "not-valid"; -async function STConnect() { - try { - let STRegistryAddress = await contracts.securityTokenRegistry(); - let STRegistry = new web3.eth.Contract(abis.securityTokenRegistry(), STRegistryAddress); - return STRegistry; - } catch (err) { - console.log("There was a problem getting the contracts. Make sure they are deployed to the selected network."); - process.exit(0); + if (isAddress && + sellValid && + buyValid && + kycExpiryDate && + (canBuyFromSTO != "not-valid")) { + return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), sellValid, buyValid, kycExpiryDate, canBuyFromSTO)] + } else { + return [false, new Array(csv_line[0], sellValid, buyValid, kycExpiryDate, canBuyFromSTO)] } } -async function readCsv() { - var CSV_STRING = csv('./CLI/data/whitelist_data.csv'); - let i = 0; - - CSV_STRING.forEach(line => { - let data_processed = whitelist_processing(line); - fullFileData.push(data_processed[1]); - - if (data_processed[0]) { - allocData.push(data_processed[1]); - i++; - if (i >= BATCH_SIZE) { - distribData.push(allocData); - allocData = []; - i = 0; - } - } else { - badData.push(data_processed[1]); - } - }); - - distribData.push(allocData); - allocData = []; - - await saveInBlockchain(); - await finalResults(); +function isValidDate(date) { + var matches = /^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/.exec(date); + if (matches == null) return false; + var d = matches[2]; + var m = matches[1] - 1; + var y = matches[3]; + var composedDate = new Date(y, m, d); + var timestampDate = composedDate.getTime() + // For some reason these timestamps are being recorded +4 hours UTC + if (composedDate.getDate() == d && + composedDate.getMonth() == m && + composedDate.getFullYear() == y) { + return timestampDate / 1000 + } else { + return false + } } async function saveInBlockchain() { @@ -194,47 +175,6 @@ async function finalResults() { } -function whitelist_processing(csv_line) { - let isAddress = web3.utils.isAddress(csv_line[0]); - let sellValid = isValidDate(csv_line[1]) - let buyValid = isValidDate(csv_line[2]) - let kycExpiryDate = isValidDate(csv_line[3]) - let canBuyFromSTO = (typeof JSON.parse(csv_line[4].toLowerCase())) == "boolean" ? JSON.parse(csv_line[4].toLowerCase()) : "not-valid"; - - if (isAddress && - sellValid && - buyValid && - kycExpiryDate && - (canBuyFromSTO != "not-valid")) { - - return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), sellValid, buyValid, kycExpiryDate, canBuyFromSTO)] - - } else { - - return [false, new Array(csv_line[0], sellValid, buyValid, kycExpiryDate, canBuyFromSTO)] - - } -} - -function isValidDate(date) { - var matches = /^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/.exec(date); - if (matches == null) return false; - var d = matches[2]; - var m = matches[1] - 1; - var y = matches[3]; - var composedDate = new Date(y, m, d); - var timestampDate = composedDate.getTime() - - // For some reason these timestamps are being recorded +4 hours UTC - if (composedDate.getDate() == d && - composedDate.getMonth() == m && - composedDate.getFullYear() == y) { - return timestampDate / 1000 - } else { - return false - } -} - module.exports = { executeApp: async (tokenSymbol, batchSize) => { return startScript(tokenSymbol, batchSize); From afb4baee9b5e1a4f5b8b7902e0e8c3f2f2f55ed4 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 21 Nov 2018 10:46:03 +0530 Subject: [PATCH 065/139] Added helper view functions --- contracts/modules/STO/USDTieredSTO.sol | 164 ++++++++++++++++++++----- 1 file changed, 130 insertions(+), 34 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index e5e7bb3aa..d20b98884 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -491,45 +491,25 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { internal nonReentrant whenNotPaused - returns(uint256, uint256) + returns(uint256 spentUSD, uint256 spentValue) { - if (!allowBeneficialInvestments) { - require(_beneficiary == msg.sender, "Beneficiary != funder"); - } - - require(isOpen(), "STO not open"); - require(_investmentValue > 0, "No funds were sent"); - uint256 investedUSD = DecimalMath.mul(_rate, _investmentValue); - _rate = investedUSD; // Reusing variable to prevent stackoverflow - // Check for minimum investment - require(investedUSD.add(investorInvestedUSD[_beneficiary]) >= minimumInvestmentUSD, "Total investment < minimumInvestmentUSD"); + investedUSD = _buyTokensChecks(_beneficiary, _investmentValue, investedUSD); - // Check for non-accredited cap - if (!accredited[_beneficiary]) { - uint256 investorLimitUSD = (nonAccreditedLimitUSDOverride[_beneficiary] == 0) ? nonAccreditedLimitUSD : nonAccreditedLimitUSDOverride[_beneficiary]; - require(investorInvestedUSD[_beneficiary] < investorLimitUSD, "Over Non-accredited investor limit"); - if (investedUSD.add(investorInvestedUSD[_beneficiary]) > investorLimitUSD) - investedUSD = investorLimitUSD.sub(investorInvestedUSD[_beneficiary]); - } - uint256 spentUSD; - uint256 spentValue; - // Iterate over each tier and process payment for (uint256 i = currentTier; i < tiers.length; i++) { bool gotoNextTier; + uint256 tempSpentUSD; // Update current tier if needed if (currentTier != i) currentTier = i; // If there are tokens remaining, process investment if (tiers[i].mintedTotal < tiers[i].tokenTotal) { - //spentValue used as temp variable here to prevent stackoverflow - (spentValue, gotoNextTier) = _calculateTier(_beneficiary, i, investedUSD.sub(spentUSD), _fundRaiseType); - spentUSD = spentUSD.add(spentValue); + (tempSpentUSD, gotoNextTier) = _calculateTier(_beneficiary, i, investedUSD.sub(spentUSD), _fundRaiseType); + spentUSD = spentUSD.add(tempSpentUSD); // If all funds have been spent, exit the loop if (!gotoNextTier) break; } - } // Modify storage @@ -540,15 +520,74 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { fundsRaisedUSD = fundsRaisedUSD.add(spentUSD); } - if (spentUSD == 0) { - spentValue = 0; - } else { - //_rate is actually OriginalUSD. Reusing variable to prevent stackoverflow - spentValue = DecimalMath.mul(DecimalMath.div(spentUSD, _rate), _investmentValue); + spentValue = DecimalMath.mul(DecimalMath.div(spentUSD, investedUSD), _investmentValue); + } + + /** + * @notice Getter function for buyer to calculate how many tokens will they get + * @param _beneficiary Address where security tokens are to be sent + * @param _investmentValue Amount of POLY, ETH or DAI invested + * @param _fundRaiseType Fund raise type (POLY, ETH, DAI) + */ + function buyTokensView( + address _beneficiary, + uint256 _investmentValue, + FundRaiseType _fundRaiseType + ) + public + view + returns(uint256 spentUSD, uint256 spentValue, uint256 tokensMinted) + { + require(_fundRaiseType == FundRaiseType.POLY || _fundRaiseType == FundRaiseType.DAI, "Invalid raise type"); + uint256 rate = getRate(_fundRaiseType); + uint256 investedUSD = DecimalMath.mul(rate, _investmentValue); + investedUSD = _buyTokensChecks(_beneficiary, _investmentValue, investedUSD); + + // Iterate over each tier and process payment + for (uint256 i = currentTier; i < tiers.length; i++) { + bool gotoNextTier; + uint256 tempSpentUSD; + uint256 tempTokensMinted; + // If there are tokens remaining, process investment + if (tiers[i].mintedTotal < tiers[i].tokenTotal) { + (tempSpentUSD, gotoNextTier, tempTokensMinted) = _calculateTierView(i, investedUSD.sub(spentUSD), _fundRaiseType); + spentUSD = spentUSD.add(tempSpentUSD); + tokensMinted = tokensMinted.add(tempTokensMinted); + // If all funds have been spent, exit the loop + if (!gotoNextTier) + break; + } + } + + spentValue = DecimalMath.mul(DecimalMath.div(spentUSD, investedUSD), _investmentValue); + } + + function _buyTokensChecks( + address _beneficiary, + uint256 _investmentValue, + uint256 investedUSD + ) + internal + view + returns(uint256 netInvestedUSD) + { + if (!allowBeneficialInvestments) { + require(_beneficiary == msg.sender, "Beneficiary != funder"); } - // Return calculated amounts - return (spentUSD, spentValue); + require(isOpen(), "STO not open"); + require(_investmentValue > 0, "No funds were sent"); + + // Check for minimum investment + require(investedUSD.add(investorInvestedUSD[_beneficiary]) >= minimumInvestmentUSD, "Total investment < minimumInvestmentUSD"); + netInvestedUSD = investedUSD; + // Check for non-accredited cap + if (!accredited[_beneficiary]) { + uint256 investorLimitUSD = (nonAccreditedLimitUSDOverride[_beneficiary] == 0) ? nonAccreditedLimitUSD : nonAccreditedLimitUSDOverride[_beneficiary]; + require(investorInvestedUSD[_beneficiary] < investorLimitUSD, "Over Non-accredited investor limit"); + if (investedUSD.add(investorInvestedUSD[_beneficiary]) > investorLimitUSD) + netInvestedUSD = investorLimitUSD.sub(investorInvestedUSD[_beneficiary]); + } } function _calculateTier( @@ -587,6 +626,37 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { } } + function _calculateTierView( + uint256 _tier, + uint256 _investedUSD, + FundRaiseType _fundRaiseType + ) + internal + view + returns(uint256 spentUSD, bool gotoNextTier, uint256 tokensMinted) + { + // First purchase any discounted tokens if POLY investment + uint256 tierSpentUSD; + uint256 tierPurchasedTokens; + Tier storage tierData = tiers[_tier]; + // Check whether there are any remaining discounted tokens + if ((_fundRaiseType == FundRaiseType.POLY) && (tierData.tokensDiscountPoly > tierData.mintedDiscountPoly)) { + uint256 discountRemaining = tierData.tokensDiscountPoly.sub(tierData.mintedDiscountPoly); + uint256 totalRemaining = tierData.tokenTotal.sub(tierData.mintedTotal); + if (totalRemaining < discountRemaining) + (spentUSD, tokensMinted, gotoNextTier) = _purchaseTierAmount(tierData.rateDiscountPoly, totalRemaining, _investedUSD); + else + (spentUSD, tokensMinted, gotoNextTier) = _purchaseTierAmount(tierData.rateDiscountPoly, discountRemaining, _investedUSD); + _investedUSD = _investedUSD.sub(spentUSD); + } + // Now, if there is any remaining USD to be invested, purchase at non-discounted rate + if ((_investedUSD > 0) && (tierData.tokenTotal.sub(tierData.mintedTotal.add(tokensMinted)) > 0)) { + (tierSpentUSD, tierPurchasedTokens, gotoNextTier) = _purchaseTierAmount(tierData.rate, tierData.tokenTotal.sub(tierData.mintedTotal), _investedUSD); + spentUSD = spentUSD.add(tierSpentUSD); + tokensMinted = tokensMinted.add(tierPurchasedTokens); + } + } + function _purchaseTier( address _beneficiary, uint256 _tierPrice, @@ -596,6 +666,20 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { ) internal returns(uint256 spentUSD, uint256 purchasedTokens, bool gotoNextTier) + { + (spentUSD, purchasedTokens, gotoNextTier) = _purchaseTierAmount(_tierPrice, _tierRemaining, _investedUSD); + require(ISecurityToken(securityToken).mint(_beneficiary, purchasedTokens), "Error in minting"); + emit TokenPurchase(msg.sender, _beneficiary, purchasedTokens, spentUSD, _tierPrice, _tier); + } + + function _purchaseTierAmount( + uint256 _tierPrice, + uint256 _tierRemaining, + uint256 _investedUSD + ) + internal + view + returns(uint256 spentUSD, uint256 purchasedTokens, bool gotoNextTier) { uint256 maximumTokens = DecimalMath.div(_investedUSD, _tierPrice); uint256 granularity = ISecurityToken(securityToken).granularity(); @@ -613,8 +697,6 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { spentUSD = DecimalMath.mul(maximumTokens, _tierPrice); purchasedTokens = maximumTokens; } - require(ISecurityToken(securityToken).mint(_beneficiary, purchasedTokens), "Error in minting"); - emit TokenPurchase(msg.sender, _beneficiary, purchasedTokens, spentUSD, _tierPrice, _tier); } ///////////// @@ -724,6 +806,20 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { return tokensSold; } + /** + * @notice Return array of minted tokens in each fund raise type for given tier + * param _tier The tier to return minted tokens for + * @return uint256[] array of minted tokens in each fund raise type + */ + function getTokensMintedByTier(uint256 _tier) public view returns (uint256[]) { + require(_tier < tiers.length, "Invalid tier"); + uint256[] memory tokensMinted = new uint256[](3); + tokensMinted[0] = tiers[_tier].minted[uint8(FundRaiseType.ETH)]; + tokensMinted[1] = tiers[_tier].minted[uint8(FundRaiseType.POLY)]; + tokensMinted[2] = tiers[_tier].minted[uint8(FundRaiseType.DAI)]; + return tokensMinted; + } + /** * @notice Return the total no. of tokens sold in a given tier * param _tier The tier to calculate sold tokens for From 1f992cb9c8b523cdd679578b322e5a88fe467742 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 21 Nov 2018 10:46:37 +0530 Subject: [PATCH 066/139] Updated gitignore --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1693ab75c..395634f11 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,7 @@ package-lock.json bridge.log .node-xml* .solcover.js.bk -allFiredEvents \ No newline at end of file +allFiredEvents +extract/ +extract.py +extract.zip \ No newline at end of file From efcde8aefa89961d871d5b6e069139dd5fcaa4e3 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 21 Nov 2018 10:53:18 +0530 Subject: [PATCH 067/139] Bug fix --- contracts/modules/STO/USDTieredSTO.sol | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index d20b98884..9ddeb4c8b 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -493,8 +493,8 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { whenNotPaused returns(uint256 spentUSD, uint256 spentValue) { - uint256 investedUSD = DecimalMath.mul(_rate, _investmentValue); - investedUSD = _buyTokensChecks(_beneficiary, _investmentValue, investedUSD); + uint256 originalUSD = DecimalMath.mul(_rate, _investmentValue); + uint256 allowedUSD = _buyTokensChecks(_beneficiary, _investmentValue, originalUSD); for (uint256 i = currentTier; i < tiers.length; i++) { bool gotoNextTier; @@ -504,7 +504,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { currentTier = i; // If there are tokens remaining, process investment if (tiers[i].mintedTotal < tiers[i].tokenTotal) { - (tempSpentUSD, gotoNextTier) = _calculateTier(_beneficiary, i, investedUSD.sub(spentUSD), _fundRaiseType); + (tempSpentUSD, gotoNextTier) = _calculateTier(_beneficiary, i, allowedUSD.sub(spentUSD), _fundRaiseType); spentUSD = spentUSD.add(tempSpentUSD); // If all funds have been spent, exit the loop if (!gotoNextTier) @@ -520,7 +520,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { fundsRaisedUSD = fundsRaisedUSD.add(spentUSD); } - spentValue = DecimalMath.mul(DecimalMath.div(spentUSD, investedUSD), _investmentValue); + spentValue = DecimalMath.mul(DecimalMath.div(spentUSD, originalUSD), _investmentValue); } /** @@ -540,8 +540,8 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { { require(_fundRaiseType == FundRaiseType.POLY || _fundRaiseType == FundRaiseType.DAI, "Invalid raise type"); uint256 rate = getRate(_fundRaiseType); - uint256 investedUSD = DecimalMath.mul(rate, _investmentValue); - investedUSD = _buyTokensChecks(_beneficiary, _investmentValue, investedUSD); + uint256 originalUSD = DecimalMath.mul(rate, _investmentValue); + uint256 allowedUSD = _buyTokensChecks(_beneficiary, _investmentValue, originalUSD); // Iterate over each tier and process payment for (uint256 i = currentTier; i < tiers.length; i++) { @@ -550,7 +550,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { uint256 tempTokensMinted; // If there are tokens remaining, process investment if (tiers[i].mintedTotal < tiers[i].tokenTotal) { - (tempSpentUSD, gotoNextTier, tempTokensMinted) = _calculateTierView(i, investedUSD.sub(spentUSD), _fundRaiseType); + (tempSpentUSD, gotoNextTier, tempTokensMinted) = _calculateTierView(i, allowedUSD.sub(spentUSD), _fundRaiseType); spentUSD = spentUSD.add(tempSpentUSD); tokensMinted = tokensMinted.add(tempTokensMinted); // If all funds have been spent, exit the loop @@ -559,7 +559,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { } } - spentValue = DecimalMath.mul(DecimalMath.div(spentUSD, investedUSD), _investmentValue); + spentValue = DecimalMath.mul(DecimalMath.div(spentUSD, originalUSD), _investmentValue); } function _buyTokensChecks( From b6221ac14ff05460c3eb9d7f3ccfd64a9e9bb64d Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 21 Nov 2018 10:58:44 +0530 Subject: [PATCH 068/139] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a99b5f767..1c2ec5fdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. [__2.1.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __13-09-18__ ## Added +* Added `buyTokensView` and `getTokensMintedByTier` to USDTSTO. * Added `getSTODetails` to USDTSTO. * Added an Array of Tiers that will hold data about every tier in USDTSTO. * Added `buyWithETHRateLimited`, `buyWithPOLYRateLimited` and `buyWithUSDRateLimited` to USDTSTO. From e16a4671380f8fdf9d028eddff1892c6484cbd08 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 21 Nov 2018 11:57:09 +0530 Subject: [PATCH 069/139] Added test cases --- contracts/modules/STO/USDTieredSTO.sol | 8 ++++---- test/p_usd_tiered_sto.js | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index 9ddeb4c8b..1c424cba0 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -493,6 +493,10 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { whenNotPaused returns(uint256 spentUSD, uint256 spentValue) { + if (!allowBeneficialInvestments) { + require(_beneficiary == msg.sender, "Beneficiary != funder"); + } + uint256 originalUSD = DecimalMath.mul(_rate, _investmentValue); uint256 allowedUSD = _buyTokensChecks(_beneficiary, _investmentValue, originalUSD); @@ -571,10 +575,6 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { view returns(uint256 netInvestedUSD) { - if (!allowBeneficialInvestments) { - require(_beneficiary == msg.sender, "Beneficiary != funder"); - } - require(isOpen(), "STO not open"); require(_investmentValue > 0, "No funds were sent"); diff --git a/test/p_usd_tiered_sto.js b/test/p_usd_tiered_sto.js index 86a2eded4..604eb1aaf 100644 --- a/test/p_usd_tiered_sto.js +++ b/test/p_usd_tiered_sto.js @@ -3790,6 +3790,8 @@ contract("USDTieredSTO", accounts => { let init_WalletETHBal = BigNumber(await web3.eth.getBalance(WALLET)); let init_WalletPOLYBal = await I_PolyToken.balanceOf(WALLET); + let tokensToMint = (await I_USDTieredSTO_Array[stoId].buyTokensView(ACCREDITED1, investment_POLY,POLY))[2]; + // Buy With POLY let tx2 = await I_USDTieredSTO_Array[stoId].buyWithPOLY(ACCREDITED1, investment_POLY, { from: ACCREDITED1, @@ -3818,6 +3820,11 @@ contract("USDTieredSTO", accounts => { .toNumber(), "Token Supply not changed as expected" ); + assert.equal( + tokensToMint.toNumber(), + investment_Tokens.sub(refund_Tokens).toNumber(), + "View function returned incorrect data" + ); assert.equal( final_InvestorTokenBal.toNumber(), init_InvestorTokenBal @@ -4475,6 +4482,18 @@ contract("USDTieredSTO", accounts => { "fundsRaisedUSD not changed as expected" ); }); + + it("should return minted tokens in a tier", async () => { + let totalMinted = (await I_USDTieredSTO_Array[0].getTokensSoldByTier.call(0)).toNumber(); + let individualMinted = await I_USDTieredSTO_Array[0].getTokensMintedByTier.call(0); + assert.equal(totalMinted, individualMinted[0].add(individualMinted[1]).add(individualMinted[2]).toNumber()); + }); + + it("should return correct tokens sold in token details", async () => { + let tokensSold = (await I_USDTieredSTO_Array[0].getTokensSold.call()).toNumber(); + let tokenDetails = await I_USDTieredSTO_Array[0].getSTODetails.call(); + assert.equal(tokensSold, tokenDetails[7].toNumber()); + }); }); describe("convertToUSD", async () => { From 7ab089a07522d62709e68ff4e8a68d1800aa9cda Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 21 Nov 2018 20:24:15 +0530 Subject: [PATCH 070/139] Minor fix --- contracts/modules/STO/USDTieredSTO.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index 1c424cba0..464cb7948 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -542,7 +542,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { view returns(uint256 spentUSD, uint256 spentValue, uint256 tokensMinted) { - require(_fundRaiseType == FundRaiseType.POLY || _fundRaiseType == FundRaiseType.DAI, "Invalid raise type"); + require(_fundRaiseType == FundRaiseType.POLY || _fundRaiseType == FundRaiseType.DAI || _fundRaiseType == FundRaiseType.ETH, "Invalid raise type"); uint256 rate = getRate(_fundRaiseType); uint256 originalUSD = DecimalMath.mul(rate, _investmentValue); uint256 allowedUSD = _buyTokensChecks(_beneficiary, _investmentValue, originalUSD); From e5c9aac805f464365e17f539b0f19c8485b4f584 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Wed, 21 Nov 2018 12:11:35 -0300 Subject: [PATCH 071/139] CLI changes for new USDTieredSTO changes --- CLI/commands/ST20Generator.js | 26 +++++++++++----------- CLI/commands/investor_portal.js | 39 ++++++++++++++++++++------------- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index a7dabe7d7..43ea37306 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -843,28 +843,28 @@ async function usdTieredSTO_status() { let displayTiers = ""; let displayMintedPerTier = ""; for (let t = 0; t < tiersLength; t++) { - let ratePerTier = await currentSTO.methods.ratePerTier(t).call(); - let tokensPerTierTotal = await currentSTO.methods.tokensPerTierTotal(t).call(); - let mintedPerTierTotal = await currentSTO.methods.mintedPerTierTotal(t).call(); - + let tier = await currentSTO.methods.tiers(t).call(); + let ratePerTier = tier.rate; + let tokensPerTierTotal = tier.tokenTotal; + let mintedPerTierTotal = tier.mintedTotal; + let mintedPerTierPerRaiseType = await currentSTO.methods.getTokensMintedByTier(t).call(); + let displayMintedPerTierPerType = ""; let displayDiscountTokens = ""; for (const type of raiseTypes) { let displayDiscountMinted = ""; - if (type == 'POLY') { - let tokensPerTierDiscountPoly = await currentSTO.methods.tokensPerTierDiscountPoly(t).call(); - if (tokensPerTierDiscountPoly > 0) { - let ratePerTierDiscountPoly = await currentSTO.methods.ratePerTierDiscountPoly(t).call(); - let mintedPerTierDiscountPoly = await currentSTO.methods.mintedPerTierDiscountPoly(t).call(); - displayDiscountTokens = ` + let tokensPerTierDiscountPoly = tier.tokensDiscountPoly; + if (tokensPerTierDiscountPoly > 0) { + let ratePerTierDiscountPoly = tier.rateDiscountPoly; + let mintedPerTierDiscountPoly = tier.mintedDiscountPoly; + displayDiscountTokens = ` Tokens at discounted rate: ${web3.utils.fromWei(tokensPerTierDiscountPoly)} ${displayTokenSymbol} Discounted rate: ${web3.utils.fromWei(ratePerTierDiscountPoly, 'ether')} USD per Token`; - displayDiscountMinted = `(${web3.utils.fromWei(mintedPerTierDiscountPoly)} ${displayTokenSymbol} at discounted rate)`; - } + displayDiscountMinted = `(${web3.utils.fromWei(mintedPerTierDiscountPoly)} ${displayTokenSymbol} at discounted rate)`; } - let mintedPerTier = await currentSTO.methods.mintedPerTier(gbl.constants.FUND_RAISE_TYPES[type], t).call(); + let mintedPerTier = mintedPerTierPerRaiseType[gbl.constants.FUND_RAISE_TYPES[type]]; displayMintedPerTierPerType += ` Sold for ${type}:\t\t ${web3.utils.fromWei(mintedPerTier)} ${displayTokenSymbol} ${displayDiscountMinted}`; } diff --git a/CLI/commands/investor_portal.js b/CLI/commands/investor_portal.js index 276f8bda3..46be05a7b 100644 --- a/CLI/commands/investor_portal.js +++ b/CLI/commands/investor_portal.js @@ -290,28 +290,29 @@ async function showUSDTieredSTOInfo() { let displayTiers = ""; let displayMintedPerTier = ""; for (let t = 0; t < tiersLength; t++) { - let ratePerTier = await currentSTO.methods.ratePerTier(t).call(); - let tokensPerTierTotal = await currentSTO.methods.tokensPerTierTotal(t).call(); - let mintedPerTierTotal = await currentSTO.methods.mintedPerTierTotal(t).call(); + let tier = await currentSTO.methods.tiers(t).call(); + let ratePerTier = tier.rate; + let tokensPerTierTotal = tier.tokenTotal; + let mintedPerTierTotal = tier.mintedTotal; + let mintedPerTierPerRaiseType = await currentSTO.methods.getTokensMintedByTier(t).call(); let displayMintedPerTierPerType = ""; let displayDiscountTokens = ""; for (const type of raiseTypes) { let displayDiscountMinted = ""; - if (type == 'POLY') { - let tokensPerTierDiscountPoly = await currentSTO.methods.tokensPerTierDiscountPoly(t).call(); - if (tokensPerTierDiscountPoly > 0) { - let ratePerTierDiscountPoly = await currentSTO.methods.ratePerTierDiscountPoly(t).call(); - let mintedPerTierDiscountPoly = await currentSTO.methods.mintedPerTierDiscountPoly(t).call(); - displayDiscountTokens = ` + let tokensPerTierDiscountPoly = tier.tokensDiscountPoly; + if (tokensPerTierDiscountPoly > 0) { + let ratePerTierDiscountPoly = tier.rateDiscountPoly; + let mintedPerTierDiscountPoly = tier.mintedDiscountPoly; + displayDiscountTokens = ` Tokens at discounted rate: ${web3.utils.fromWei(tokensPerTierDiscountPoly)} ${displayTokenSymbol} Discounted rate: ${web3.utils.fromWei(ratePerTierDiscountPoly, 'ether')} USD per Token`; - displayDiscountMinted = `(${web3.utils.fromWei(mintedPerTierDiscountPoly)} ${displayTokenSymbol} at discounted rate)`; - } + displayDiscountMinted = `(${web3.utils.fromWei(mintedPerTierDiscountPoly)} ${displayTokenSymbol} at discounted rate)`; } + - let mintedPerTier = await currentSTO.methods.mintedPerTier(gbl.constants.FUND_RAISE_TYPES[type], t).call(); + let mintedPerTier = mintedPerTierPerRaiseType[gbl.constants.FUND_RAISE_TYPES[type]]; displayMintedPerTierPerType += ` Sold for ${type}:\t\t ${web3.utils.fromWei(mintedPerTier)} ${displayTokenSymbol} ${displayDiscountMinted}`; } @@ -481,6 +482,14 @@ async function investUsdTieredSTO(currency, amount) { let costWei = web3.utils.toWei(cost.toString()); + let tokensToBuy = await currentSTO.methods.buyTokensView(User.address, costWei, gbl.constants.FUND_RAISE_TYPES[raiseType]).call(); + let minTokenToBuy = tokensToBuy.tokensMinted; + console.log(chalk.yellow(`You are going to spent ${web3.utils.fromWei(tokensToBuy.spentValue)} ${raiseType} (${web3.utils.fromWei(tokensToBuy.spentUSD)} USD) to buy ${web3.utils.fromWei(minTokenToBuy)} ${STSymbol} approx.`)); + console.log(chalk.yellow(`Due to ${raiseType} price changes and network delays, it is possible that the final amount of purchased tokens is lower.`)); + if (typeof amount !== 'undefined' || !readlineSync.keyInYNStrict(`Do you want the transaction to fail if this happens?`)) { + minTokenToBuy = 0; + } + if (raiseType == 'POLY') { let userBalance = await polyBalance(User.address); if (parseInt(userBalance) >= parseInt(cost)) { @@ -489,7 +498,7 @@ async function investUsdTieredSTO(currency, amount) { let approveAction = polyToken.methods.approve(STOAddress, costWei); await common.sendTransaction(approveAction, {from: User}); } - let actionBuyWithPoly = currentSTO.methods.buyWithPOLY(User.address, costWei); + let actionBuyWithPoly = currentSTO.methods.buyWithPOLYRateLimited(User.address, costWei, minTokenToBuy); let receipt = await common.sendTransaction(actionBuyWithPoly, {from: User, factor: 2}); logTokensPurchasedUSDTieredSTO(receipt); } else { @@ -505,7 +514,7 @@ async function investUsdTieredSTO(currency, amount) { let approveAction = usdToken.methods.approve(STOAddress, costWei); await common.sendTransaction(approveAction, {from: User}); } - let actionBuyWithUSD = currentSTO.methods.buyWithUSD(User.address, costWei); + let actionBuyWithUSD = currentSTO.methods.buyWithUSDRateLimited(User.address, costWei, minTokenToBuy); let receipt = await common.sendTransaction(actionBuyWithUSD, {from: User, factor: 1.5}); logTokensPurchasedUSDTieredSTO(receipt); } else { @@ -514,7 +523,7 @@ async function investUsdTieredSTO(currency, amount) { process.exit(); } } else { - let actionBuyWithETH = currentSTO.methods.buyWithETH(User.address); + let actionBuyWithETH = currentSTO.methods.buyWithETHRateLimited(User.address, minTokenToBuy); let receipt = await common.sendTransaction(actionBuyWithETH, {from: User, value: costWei}); logTokensPurchasedUSDTieredSTO(receipt); } From a4b7e6c309cf98dcf24cf7adbdba5b06c5e62e1a Mon Sep 17 00:00:00 2001 From: FOBCrypto <42175565+FOBCrypto@users.noreply.github.com> Date: Thu, 22 Nov 2018 16:36:05 +0530 Subject: [PATCH 072/139] Typo fix Co-Authored-By: maxsam4 --- CLI/commands/investor_portal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLI/commands/investor_portal.js b/CLI/commands/investor_portal.js index 46be05a7b..1ced21ce0 100644 --- a/CLI/commands/investor_portal.js +++ b/CLI/commands/investor_portal.js @@ -484,7 +484,7 @@ async function investUsdTieredSTO(currency, amount) { let tokensToBuy = await currentSTO.methods.buyTokensView(User.address, costWei, gbl.constants.FUND_RAISE_TYPES[raiseType]).call(); let minTokenToBuy = tokensToBuy.tokensMinted; - console.log(chalk.yellow(`You are going to spent ${web3.utils.fromWei(tokensToBuy.spentValue)} ${raiseType} (${web3.utils.fromWei(tokensToBuy.spentUSD)} USD) to buy ${web3.utils.fromWei(minTokenToBuy)} ${STSymbol} approx.`)); + console.log(chalk.yellow(`You are going to spend ${web3.utils.fromWei(tokensToBuy.spentValue)} ${raiseType} (${web3.utils.fromWei(tokensToBuy.spentUSD)} USD) to buy ${web3.utils.fromWei(minTokenToBuy)} ${STSymbol} approx.`)); console.log(chalk.yellow(`Due to ${raiseType} price changes and network delays, it is possible that the final amount of purchased tokens is lower.`)); if (typeof amount !== 'undefined' || !readlineSync.keyInYNStrict(`Do you want the transaction to fail if this happens?`)) { minTokenToBuy = 0; From 631d2b107eb85fc7535d210ae4809942528a6525 Mon Sep 17 00:00:00 2001 From: Adam Dossa Date: Thu, 22 Nov 2018 11:38:47 +0000 Subject: [PATCH 073/139] Allow 0x transfers for MATM --- .../modules/ManualApprovalTransferManager.sol | 169 ++++++++++++++++++ test/j_manual_approval_transfer_manager.js | 47 ++--- 2 files changed, 188 insertions(+), 28 deletions(-) create mode 100644 contracts/modules/ManualApprovalTransferManager.sol diff --git a/contracts/modules/ManualApprovalTransferManager.sol b/contracts/modules/ManualApprovalTransferManager.sol new file mode 100644 index 000000000..d95241e9a --- /dev/null +++ b/contracts/modules/ManualApprovalTransferManager.sol @@ -0,0 +1,169 @@ +pragma solidity ^0.4.24; + +import "./ITransferManager.sol"; +import "openzeppelin-solidity/contracts/math/SafeMath.sol"; + +/** + * @title Transfer Manager module for manually approving or blocking transactions between accounts + */ +contract ManualApprovalTransferManager is ITransferManager { + using SafeMath for uint256; + + //Address from which issuances come + address public issuanceAddress = address(0); + + //Address which can sign whitelist changes + address public signingAddress = address(0); + + bytes32 public constant TRANSFER_APPROVAL = "TRANSFER_APPROVAL"; + + //Manual approval is an allowance (that has been approved) with an expiry time + struct ManualApproval { + uint256 allowance; + uint256 expiryTime; + } + + //Manual blocking allows you to specify a list of blocked address pairs with an associated expiry time for the block + struct ManualBlocking { + uint256 expiryTime; + } + + //Store mappings of address => address with ManualApprovals + mapping (address => mapping (address => ManualApproval)) public manualApprovals; + + //Store mappings of address => address with ManualBlockings + mapping (address => mapping (address => ManualBlocking)) public manualBlockings; + + event AddManualApproval( + address indexed _from, + address indexed _to, + uint256 _allowance, + uint256 _expiryTime, + address indexed _addedBy + ); + + event AddManualBlocking( + address indexed _from, + address indexed _to, + uint256 _expiryTime, + address indexed _addedBy + ); + + event RevokeManualApproval( + address indexed _from, + address indexed _to, + address indexed _addedBy + ); + + event RevokeManualBlocking( + address indexed _from, + address indexed _to, + address indexed _addedBy + ); + + /** + * @notice Constructor + * @param _securityToken Address of the security token + * @param _polyAddress Address of the polytoken + */ + constructor (address _securityToken, address _polyAddress) + public + Module(_securityToken, _polyAddress) + { + } + + /** + * @notice This function returns the signature of configure function + */ + function getInitFunction() public pure returns (bytes4) { + return bytes4(0); + } + + /** @notice Used to verify the transfer transaction and allow a manually approved transqaction to bypass other restrictions + * @param _from Address of the sender + * @param _to Address of the receiver + * @param _amount The amount of tokens to transfer + * @param _isTransfer Whether or not this is an actual transfer or just a test to see if the tokens would be transferrable + */ + function verifyTransfer(address _from, address _to, uint256 _amount, bytes /* _data */, bool _isTransfer) public returns(Result) { + // function must only be called by the associated security token if _isTransfer == true + require(_isTransfer == false || msg.sender == securityToken, "Sender is not the owner"); + // manual blocking takes precidence over manual approval + if (!paused) { + /*solium-disable-next-line security/no-block-members*/ + if (manualBlockings[_from][_to].expiryTime >= now) { + return Result.INVALID; + } + /*solium-disable-next-line security/no-block-members*/ + if ((manualApprovals[_from][_to].expiryTime >= now) && (manualApprovals[_from][_to].allowance >= _amount)) { + if (_isTransfer) { + manualApprovals[_from][_to].allowance = manualApprovals[_from][_to].allowance.sub(_amount); + } + return Result.VALID; + } + } + return Result.NA; + } + + /** + * @notice Adds a pair of addresses to manual approvals + * @param _from is the address from which transfers are approved + * @param _to is the address to which transfers are approved + * @param _allowance is the approved amount of tokens + * @param _expiryTime is the time until which the transfer is allowed + */ + function addManualApproval(address _from, address _to, uint256 _allowance, uint256 _expiryTime) public withPerm(TRANSFER_APPROVAL) { + require(_to != address(0), "Invalid to address"); + /*solium-disable-next-line security/no-block-members*/ + require(_expiryTime > now, "Invalid expiry time"); + require(manualApprovals[_from][_to].allowance == 0, "Approval already exists"); + manualApprovals[_from][_to] = ManualApproval(_allowance, _expiryTime); + emit AddManualApproval(_from, _to, _allowance, _expiryTime, msg.sender); + } + + /** + * @notice Adds a pair of addresses to manual blockings + * @param _from is the address from which transfers are blocked + * @param _to is the address to which transfers are blocked + * @param _expiryTime is the time until which the transfer is blocked + */ + function addManualBlocking(address _from, address _to, uint256 _expiryTime) public withPerm(TRANSFER_APPROVAL) { + require(_to != address(0), "Invalid to address"); + /*solium-disable-next-line security/no-block-members*/ + require(_expiryTime > now, "Invalid expiry time"); + require(manualBlockings[_from][_to].expiryTime == 0, "Blocking already exists"); + manualBlockings[_from][_to] = ManualBlocking(_expiryTime); + emit AddManualBlocking(_from, _to, _expiryTime, msg.sender); + } + + /** + * @notice Removes a pairs of addresses from manual approvals + * @param _from is the address from which transfers are approved + * @param _to is the address to which transfers are approved + */ + function revokeManualApproval(address _from, address _to) public withPerm(TRANSFER_APPROVAL) { + require(_to != address(0), "Invalid to address"); + delete manualApprovals[_from][_to]; + emit RevokeManualApproval(_from, _to, msg.sender); + } + + /** + * @notice Removes a pairs of addresses from manual approvals + * @param _from is the address from which transfers are approved + * @param _to is the address to which transfers are approved + */ + function revokeManualBlocking(address _from, address _to) public withPerm(TRANSFER_APPROVAL) { + require(_to != address(0), "Invalid to address"); + delete manualBlockings[_from][_to]; + emit RevokeManualBlocking(_from, _to, msg.sender); + } + + /** + * @notice Returns the permissions flag that are associated with ManualApproval transfer manager + */ + function getPermissions() public view returns(bytes32[]) { + bytes32[] memory allPermissions = new bytes32[](1); + allPermissions[0] = TRANSFER_APPROVAL; + return allPermissions; + } +} diff --git a/test/j_manual_approval_transfer_manager.js b/test/j_manual_approval_transfer_manager.js index 709991b92..0461f287a 100644 --- a/test/j_manual_approval_transfer_manager.js +++ b/test/j_manual_approval_transfer_manager.js @@ -321,18 +321,6 @@ contract("ManualApprovalTransferManager", accounts => { assert.equal((await I_SecurityToken.balanceOf(account_investor1)).toNumber(), web3.utils.toWei("5", "ether")); }); - it("Should fail to add a manual approval because invalid _from address", async () => { - await catchRevert( - I_ManualApprovalTransferManager.addManualApproval( - "", - account_investor4, - web3.utils.toWei("2", "ether"), - latestTime() + duration.days(1), - { from: token_owner } - ) - ); - }); - it("Should fail to add a manual approval because invalid _to address", async () => { await catchRevert( I_ManualApprovalTransferManager.addManualApproval( @@ -367,6 +355,16 @@ contract("ManualApprovalTransferManager", accounts => { ); }); + it("Add a manual approval for a 5th investor from issuance", async () => { + await I_ManualApprovalTransferManager.addManualApproval( + "", + account_investor5, + web3.utils.toWei("2", "ether"), + latestTime() + duration.days(1), + { from: token_owner } + ); + }); + it("Should fail to add a manual approval because allowance is laready exists", async () => { await catchRevert( I_ManualApprovalTransferManager.addManualApproval( @@ -379,10 +377,6 @@ contract("ManualApprovalTransferManager", accounts => { ); }); - it("Should fail to revoke manual approval because invalid _from address", async () => { - await catchRevert(I_ManualApprovalTransferManager.revokeManualApproval("", account_investor4, { from: token_owner })); - }); - it("Should fail to revoke manual approval because invalid _to address", async () => { await catchRevert(I_ManualApprovalTransferManager.revokeManualApproval(account_investor1, "", { from: token_owner })); }); @@ -409,6 +403,15 @@ contract("ManualApprovalTransferManager", accounts => { assert.equal((await I_SecurityToken.balanceOf(account_investor4)).toNumber(), web3.utils.toWei("1", "ether")); }); + it("Approval fails with wrong from to address", async () => { + await catchRevert(I_SecurityToken.transfer(account_investor5, web3.utils.toWei("1", "ether"), { from: account_investor1 })); + }); + + it("Use 100% of issuance approval", async () => { + await I_SecurityToken.mint(account_investor5, web3.utils.toWei("2", "ether"), { from: token_owner }); + assert.equal((await I_SecurityToken.balanceOf(account_investor5)).toNumber(), web3.utils.toWei("2", "ether")); + }); + it("Check verifyTransfer without actually transferring", async () => { let verified = await I_SecurityToken.verifyTransfer.call( account_investor1, @@ -439,14 +442,6 @@ contract("ManualApprovalTransferManager", accounts => { await I_SecurityToken.transfer(account_investor2, web3.utils.toWei("1", "ether"), { from: account_investor1 }); }); - it("Should fail to add a manual block because invalid _from address", async () => { - await catchRevert( - I_ManualApprovalTransferManager.addManualBlocking("", account_investor2, latestTime() + duration.days(1), { - from: token_owner - }) - ); - }); - it("Should fail to add a manual block because invalid _to address", async () => { await catchRevert( I_ManualApprovalTransferManager.addManualBlocking(account_investor1, "", latestTime() + duration.days(1), { @@ -477,10 +472,6 @@ contract("ManualApprovalTransferManager", accounts => { await catchRevert(I_SecurityToken.transfer(account_investor2, web3.utils.toWei("1", "ether"), { from: account_investor1 })); }); - it("Should fail to revoke manual block because invalid _from address", async () => { - await catchRevert(I_ManualApprovalTransferManager.revokeManualBlocking("0x0", account_investor2, { from: token_owner })); - }); - it("Should fail to revoke manual block because invalid _to address", async () => { await catchRevert(I_ManualApprovalTransferManager.revokeManualBlocking(account_investor1, "0x0", { from: token_owner })); }); From 115c3cb807a4bc87cf8a8905d2ad685b9881e574 Mon Sep 17 00:00:00 2001 From: Adam Dossa Date: Thu, 22 Nov 2018 11:55:03 +0000 Subject: [PATCH 074/139] Fix typo --- .../modules/ManualApprovalTransferManager.sol | 169 ------------------ .../ManualApprovalTransferManager.sol | 4 - 2 files changed, 173 deletions(-) delete mode 100644 contracts/modules/ManualApprovalTransferManager.sol diff --git a/contracts/modules/ManualApprovalTransferManager.sol b/contracts/modules/ManualApprovalTransferManager.sol deleted file mode 100644 index d95241e9a..000000000 --- a/contracts/modules/ManualApprovalTransferManager.sol +++ /dev/null @@ -1,169 +0,0 @@ -pragma solidity ^0.4.24; - -import "./ITransferManager.sol"; -import "openzeppelin-solidity/contracts/math/SafeMath.sol"; - -/** - * @title Transfer Manager module for manually approving or blocking transactions between accounts - */ -contract ManualApprovalTransferManager is ITransferManager { - using SafeMath for uint256; - - //Address from which issuances come - address public issuanceAddress = address(0); - - //Address which can sign whitelist changes - address public signingAddress = address(0); - - bytes32 public constant TRANSFER_APPROVAL = "TRANSFER_APPROVAL"; - - //Manual approval is an allowance (that has been approved) with an expiry time - struct ManualApproval { - uint256 allowance; - uint256 expiryTime; - } - - //Manual blocking allows you to specify a list of blocked address pairs with an associated expiry time for the block - struct ManualBlocking { - uint256 expiryTime; - } - - //Store mappings of address => address with ManualApprovals - mapping (address => mapping (address => ManualApproval)) public manualApprovals; - - //Store mappings of address => address with ManualBlockings - mapping (address => mapping (address => ManualBlocking)) public manualBlockings; - - event AddManualApproval( - address indexed _from, - address indexed _to, - uint256 _allowance, - uint256 _expiryTime, - address indexed _addedBy - ); - - event AddManualBlocking( - address indexed _from, - address indexed _to, - uint256 _expiryTime, - address indexed _addedBy - ); - - event RevokeManualApproval( - address indexed _from, - address indexed _to, - address indexed _addedBy - ); - - event RevokeManualBlocking( - address indexed _from, - address indexed _to, - address indexed _addedBy - ); - - /** - * @notice Constructor - * @param _securityToken Address of the security token - * @param _polyAddress Address of the polytoken - */ - constructor (address _securityToken, address _polyAddress) - public - Module(_securityToken, _polyAddress) - { - } - - /** - * @notice This function returns the signature of configure function - */ - function getInitFunction() public pure returns (bytes4) { - return bytes4(0); - } - - /** @notice Used to verify the transfer transaction and allow a manually approved transqaction to bypass other restrictions - * @param _from Address of the sender - * @param _to Address of the receiver - * @param _amount The amount of tokens to transfer - * @param _isTransfer Whether or not this is an actual transfer or just a test to see if the tokens would be transferrable - */ - function verifyTransfer(address _from, address _to, uint256 _amount, bytes /* _data */, bool _isTransfer) public returns(Result) { - // function must only be called by the associated security token if _isTransfer == true - require(_isTransfer == false || msg.sender == securityToken, "Sender is not the owner"); - // manual blocking takes precidence over manual approval - if (!paused) { - /*solium-disable-next-line security/no-block-members*/ - if (manualBlockings[_from][_to].expiryTime >= now) { - return Result.INVALID; - } - /*solium-disable-next-line security/no-block-members*/ - if ((manualApprovals[_from][_to].expiryTime >= now) && (manualApprovals[_from][_to].allowance >= _amount)) { - if (_isTransfer) { - manualApprovals[_from][_to].allowance = manualApprovals[_from][_to].allowance.sub(_amount); - } - return Result.VALID; - } - } - return Result.NA; - } - - /** - * @notice Adds a pair of addresses to manual approvals - * @param _from is the address from which transfers are approved - * @param _to is the address to which transfers are approved - * @param _allowance is the approved amount of tokens - * @param _expiryTime is the time until which the transfer is allowed - */ - function addManualApproval(address _from, address _to, uint256 _allowance, uint256 _expiryTime) public withPerm(TRANSFER_APPROVAL) { - require(_to != address(0), "Invalid to address"); - /*solium-disable-next-line security/no-block-members*/ - require(_expiryTime > now, "Invalid expiry time"); - require(manualApprovals[_from][_to].allowance == 0, "Approval already exists"); - manualApprovals[_from][_to] = ManualApproval(_allowance, _expiryTime); - emit AddManualApproval(_from, _to, _allowance, _expiryTime, msg.sender); - } - - /** - * @notice Adds a pair of addresses to manual blockings - * @param _from is the address from which transfers are blocked - * @param _to is the address to which transfers are blocked - * @param _expiryTime is the time until which the transfer is blocked - */ - function addManualBlocking(address _from, address _to, uint256 _expiryTime) public withPerm(TRANSFER_APPROVAL) { - require(_to != address(0), "Invalid to address"); - /*solium-disable-next-line security/no-block-members*/ - require(_expiryTime > now, "Invalid expiry time"); - require(manualBlockings[_from][_to].expiryTime == 0, "Blocking already exists"); - manualBlockings[_from][_to] = ManualBlocking(_expiryTime); - emit AddManualBlocking(_from, _to, _expiryTime, msg.sender); - } - - /** - * @notice Removes a pairs of addresses from manual approvals - * @param _from is the address from which transfers are approved - * @param _to is the address to which transfers are approved - */ - function revokeManualApproval(address _from, address _to) public withPerm(TRANSFER_APPROVAL) { - require(_to != address(0), "Invalid to address"); - delete manualApprovals[_from][_to]; - emit RevokeManualApproval(_from, _to, msg.sender); - } - - /** - * @notice Removes a pairs of addresses from manual approvals - * @param _from is the address from which transfers are approved - * @param _to is the address to which transfers are approved - */ - function revokeManualBlocking(address _from, address _to) public withPerm(TRANSFER_APPROVAL) { - require(_to != address(0), "Invalid to address"); - delete manualBlockings[_from][_to]; - emit RevokeManualBlocking(_from, _to, msg.sender); - } - - /** - * @notice Returns the permissions flag that are associated with ManualApproval transfer manager - */ - function getPermissions() public view returns(bytes32[]) { - bytes32[] memory allPermissions = new bytes32[](1); - allPermissions[0] = TRANSFER_APPROVAL; - return allPermissions; - } -} diff --git a/contracts/modules/TransferManager/ManualApprovalTransferManager.sol b/contracts/modules/TransferManager/ManualApprovalTransferManager.sol index fd888680a..d95241e9a 100644 --- a/contracts/modules/TransferManager/ManualApprovalTransferManager.sol +++ b/contracts/modules/TransferManager/ManualApprovalTransferManager.sol @@ -113,7 +113,6 @@ contract ManualApprovalTransferManager is ITransferManager { * @param _expiryTime is the time until which the transfer is allowed */ function addManualApproval(address _from, address _to, uint256 _allowance, uint256 _expiryTime) public withPerm(TRANSFER_APPROVAL) { - require(_from != address(0), "Invalid from address"); require(_to != address(0), "Invalid to address"); /*solium-disable-next-line security/no-block-members*/ require(_expiryTime > now, "Invalid expiry time"); @@ -129,7 +128,6 @@ contract ManualApprovalTransferManager is ITransferManager { * @param _expiryTime is the time until which the transfer is blocked */ function addManualBlocking(address _from, address _to, uint256 _expiryTime) public withPerm(TRANSFER_APPROVAL) { - require(_from != address(0), "Invalid from address"); require(_to != address(0), "Invalid to address"); /*solium-disable-next-line security/no-block-members*/ require(_expiryTime > now, "Invalid expiry time"); @@ -144,7 +142,6 @@ contract ManualApprovalTransferManager is ITransferManager { * @param _to is the address to which transfers are approved */ function revokeManualApproval(address _from, address _to) public withPerm(TRANSFER_APPROVAL) { - require(_from != address(0), "Invalid from address"); require(_to != address(0), "Invalid to address"); delete manualApprovals[_from][_to]; emit RevokeManualApproval(_from, _to, msg.sender); @@ -156,7 +153,6 @@ contract ManualApprovalTransferManager is ITransferManager { * @param _to is the address to which transfers are approved */ function revokeManualBlocking(address _from, address _to) public withPerm(TRANSFER_APPROVAL) { - require(_from != address(0), "Invalid from address"); require(_to != address(0), "Invalid to address"); delete manualBlockings[_from][_to]; emit RevokeManualBlocking(_from, _to, msg.sender); From 3dca9fec5afddcb8de17e353ed6cda650ba6bc20 Mon Sep 17 00:00:00 2001 From: shuffledex Date: Thu, 22 Nov 2018 09:36:16 -0300 Subject: [PATCH 075/139] Add support to remote nodes --- CLI/commands/common/global.js | 23 +++++++++++++++++------ CLI/polymath-cli.js | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CLI/commands/common/global.js b/CLI/commands/common/global.js index e1fb648e2..525030aea 100644 --- a/CLI/commands/common/global.js +++ b/CLI/commands/common/global.js @@ -24,18 +24,29 @@ function getGasPrice (networkId) { return gasPrice; } +function providerValidator(url) { + var expression = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g; + var regex = new RegExp(expression); + return url.match(regex); +} + +async function httpProvider(url, file) { + web3 = new Web3(new Web3.providers.HttpProvider(url)); + Issuer = await web3.eth.accounts.privateKeyToAccount("0x" + require('fs').readFileSync(file).toString()); +} + module.exports = { initialize: async function(network) { remoteNetwork = network; if (typeof web3 === 'undefined' || typeof Issuer === 'undefined' || typeof defaultGasPrice === 'undefined') { if (typeof remoteNetwork !== 'undefined') { - web3 = new Web3(new Web3.providers.HttpProvider(`https://${remoteNetwork}.infura.io/`)); - let privKey = require('fs').readFileSync('./privKey').toString(); - Issuer = await web3.eth.accounts.privateKeyToAccount("0x" + privKey); + if (!providerValidator(remoteNetwork)) { + console.log("Invalid remote node") + process.exit(0) + } + await httpProvider(remoteNetwork, './privKey'); } else { - web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); - let privKeyLocal = require('fs').readFileSync('./privKeyLocal').toString() - Issuer = await web3.eth.accounts.privateKeyToAccount("0x" + privKeyLocal); + await httpProvider("http://localhost:8545", './privKeyLocal'); } defaultGasPrice = getGasPrice(await web3.eth.net.getId()); } diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 25831ab9d..f2248b25a 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -23,7 +23,7 @@ const fs = require('fs'); program .version('0.0.1') .description('CLI for Polymath-core') - .option('-r, --remote-node ', 'Use Infura to connect to a remote node on selected network'); + .option('-r, --remote-node ', 'Connect to a remote node'); program .command('st20generator') From 3796d24a2fd435e0e75e3ddfd103e92b6266fc0e Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Thu, 22 Nov 2018 11:52:26 -0300 Subject: [PATCH 076/139] sto_manager improvements --- CLI/commands/sto_manager.js | 325 +++++++++++++++++-------------- CLI/data/capped_sto_data.yml | 49 ++--- CLI/data/usd_tiered_sto_data.yml | 76 +++----- CLI/polymath-cli.js | 11 +- 4 files changed, 233 insertions(+), 228 deletions(-) diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index 871e6d37b..159ace91b 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -19,18 +19,45 @@ let usdToken; let securityToken; async function executeApp() { - common.logAsciiBull(); - console.log("********************************************"); - console.log("Welcome to the Command-Line ST-20 Generator."); - console.log("********************************************"); - console.log("The following script will create a new ST-20 according to the parameters you enter."); - console.log("Issuer Account: " + Issuer.address + "\n"); - - await setup(); + let exit = false; + while (!exit) { + console.log('\n', chalk.blue('STO Manager - Main Menu'), '\n'); + + // Show non-archived attached STO modules + let stoModules = await getAllModulesByType(gbl.constants.MODULES_TYPES.STO); + let nonArchivedModules = stoModules.filter(m => !m.archived); + if (nonArchivedModules.length > 0) { + console.log(`STO modules attached:`); + nonArchivedModules.map(m => console.log(`- ${m.name} at ${m.address}`)) + } else { + console.log(`There are no STO modules attached`); + } - securityToken = await selectToken(); - while (true) { - await start_explorer(); + let options = []; + if (nonArchivedModules.length > 0) { + options.push('Show existing STO information', 'Modify existing STO'); + } + options.push('Add new STO module'); + + let index = readlineSync.keyInSelect(options, 'What do you want to do?', {cancel: 'Exit'}); + let optionSelected = index != -1 ? options[index] : 'Exit'; + console.log('Selected:', optionSelected, '\n'); + switch (optionSelected) { + case 'Show existing STO information': + let stoToShow = selectExistingSTO(nonArchivedModules, true); + await showSTO(stoToShow.name, stoToShow.module); + break; + case 'Modify existing STO': + let stoToModify = selectExistingSTO(nonArchivedModules); + await modifySTO(stoToModify.name, stoToModify.module); + break; + case 'Add new STO module': + await addSTOModule(); + break; + case 'Exit': + exit = true; + break; + } } }; @@ -58,75 +85,33 @@ async function setup(){ } async function selectToken() { - let stAddress; + let result = null; + let userTokens = await securityTokenRegistry.methods.getTokensByOwner(Issuer.address).call(); if (userTokens.length == 0) { console.log(chalk.red(`You have not issued any Security Token yet!`)); - process.exit(0); } else if (userTokens.length == 1) { let tokenData = await securityTokenRegistry.methods.getSecurityTokenData(userTokens[0]).call(); console.log(chalk.yellow(`You have only one token. ${tokenData[0]} will be selected automatically.`)); - stAddress = userTokens[0]; + result = tokenData[0]; } else { - let options = await Promise.all(userTokens.map(async function (t) { + let tokenDataArray = await Promise.all(userTokens.map(async function (t) { let tokenData = await securityTokenRegistry.methods.getSecurityTokenData(t).call(); - return `${tokenData[0]} - Deployed at ${t}`; + return {tokenData: tokenData, address: t}; })); + let options = tokenDataArray.map(function (t) { + return `${t.tokenData[0]} - Deployed at ${t.address}`; + }); let index = readlineSync.keyInSelect(options, 'Select a token:', {cancel: 'Exit'}); - if (index == -1) { - process.exit(0); + if (index != -1) { + result = tokenDataArray[index][0]; } else { - stAddress = userTokens[index]; + process.exit(); } } - - let securityTokenABI = abis.securityToken(); - let securityToken = new web3.eth.Contract(securityTokenABI, stAddress); - return securityToken; -} - -async function start_explorer() { - console.log(); - console.log(chalk.blue('STO Manager - Main Menu')); - - // Show non-archived attached STO modules - console.log(); - let stoModules = await getAllModulesByType(gbl.constants.MODULES_TYPES.STO); - let nonArchivedModules = stoModules.filter(m => !m.archived); - if (nonArchivedModules.length > 0) { - console.log(`STO modules attached:`); - nonArchivedModules.map(m => console.log(`- ${m.name} at ${m.address}`)) - } else { - console.log(`There are no STO modules attached`); - } - - let options = []; - if (nonArchivedModules.length > 0) { - options.push('Show existing STO information', 'Modify existing STO'); - } - options.push('Add new STO module'); - - let index = readlineSync.keyInSelect(options, 'What do you want to do?', {cancel: 'Exit'}); - let optionSelected = index != -1 ? options[index] : 'Exit'; - console.log('Selected:', optionSelected, '\n'); - switch (optionSelected) { - case 'Show existing STO information': - let stoToShow = selectExistingSTO(nonArchivedModules, true); - await showSTO(stoToShow.name, stoToShow.module); - break; - case 'Modify existing STO': - let stoToModify = selectExistingSTO(nonArchivedModules); - await modifySTO(stoToModify.name, stoToModify.module); - break; - case 'Add new STO module': - await addSTOModule(); - break; - case 'Exit': - process.exit(0); - } + return result; } function selectExistingSTO(stoModules, showPaused) { @@ -177,20 +162,25 @@ async function modifySTO(selectedSTO, currentSTO) { } } -async function addSTOModule() { +async function addSTOModule(stoConfig) { console.log(chalk.blue('Launch STO - Configuration')); - let options = ['CappedSTO', 'USDTieredSTO']; - let index = readlineSync.keyInSelect(options, 'What type of STO do you want?', { cancel: 'Return' }); - let optionSelected = index != -1 ? options[index] : 'Return'; + let optionSelected; + if (typeof stoConfig === 'undefined') { + let options = ['CappedSTO', 'USDTieredSTO']; + let index = readlineSync.keyInSelect(options, 'What type of STO do you want?', { cancel: 'Return' }); + optionSelected = index != -1 ? options[index] : 'Return'; + } else { + optionSelected = stoConfig.type; + } console.log('Selected:', optionSelected, '\n'); switch (optionSelected) { case 'CappedSTO': - let cappedSTO = await cappedSTO_launch(); + let cappedSTO = await cappedSTO_launch(stoConfig); await cappedSTO_status(cappedSTO); break; case 'USDTieredSTO': - let usdTieredSTO = await usdTieredSTO_launch(); + let usdTieredSTO = await usdTieredSTO_launch(stoConfig); await usdTieredSTO_status(usdTieredSTO); break; } @@ -199,7 +189,7 @@ async function addSTOModule() { //////////////// // Capped STO // //////////////// -async function cappedSTO_launch() { +async function cappedSTO_launch(stoConfig) { console.log(chalk.blue('Launch STO - Capped STO in No. of Tokens')); let cappedSTOFactoryABI = abis.cappedSTOFactory(); @@ -225,29 +215,37 @@ async function cappedSTO_launch() { } } - let cap = readlineSync.question('How many tokens do you plan to sell on the STO? (500.000): '); - if (cap == "") cap = '500000'; - let oneMinuteFromNow = BigNumber((Math.floor(Date.now() / 1000) + 60)); - let startTime = readlineSync.question('Enter the start time for the STO (Unix Epoch time)\n(1 minutes from now = ' + oneMinuteFromNow + ' ): '); - if (startTime == "") startTime = oneMinuteFromNow; - let oneMonthFromNow = BigNumber((Math.floor(Date.now()/1000)+ (30 * 24 * 60 * 60))); - let endTime = readlineSync.question('Enter the end time for the STO (Unix Epoch time)\n(1 month from now = ' + oneMonthFromNow + ' ): '); - if (endTime == "") endTime = oneMonthFromNow; - let wallet = readlineSync.question('Enter the address that will receive the funds from the STO (' + Issuer.address + '): '); - if (wallet == "") wallet = Issuer.address; + let cappedSTOconfig = {}; + let useConfigFile = typeof stoConfig !== 'undefined'; + if (!useConfigFile) { + cappedSTOconfig.cap = readlineSync.question('How many tokens do you plan to sell on the STO? (500.000): '); + if (cappedSTOconfig.cap == "") cappedSTOconfig.cap = 500000; + + cappedSTOconfig.raiseType = readlineSync.question('Enter' + chalk.green(` P `) + 'for POLY raise or leave empty for Ether raise (E): '); + if (cappedSTOconfig.raiseType.toUpperCase() == 'P' ) { + cappedSTOconfig.raiseType = [1]; + } else { + cappedSTOconfig.raiseType = [0]; + } + + cappedSTOconfig.rate = readlineSync.question(`Enter the rate (1 ${(cappedSTOconfig.raiseType == 1 ? 'POLY' : 'ETH')} = X ${tokenSymbol}) for the STO (1000): `); + if (cappedSTOconfig.rate == "") cappedSTOconfig.rate = 1000; - let raiseType = readlineSync.question('Enter' + chalk.green(` P `) + 'for POLY raise or leave empty for Ether raise (E): '); - if (raiseType.toUpperCase() == 'P' ) { - raiseType = [1]; + cappedSTOconfig.wallet = readlineSync.question('Enter the address that will receive the funds from the STO (' + Issuer.address + '): '); + if (cappedSTOconfig.wallet == "") cappedSTOconfig.wallet = Issuer.address; + + cappedSTOconfig.startTime = readlineSync.question('Enter the start time for the STO (Unix Epoch time)\n(1 minutes from now = ' + oneMinuteFromNow + ' ): '); + + cappedSTOconfig.endTime = readlineSync.question('Enter the end time for the STO (Unix Epoch time)\n(1 month from now = ' + oneMonthFromNow + ' ): '); } else { - raiseType = [0]; + cappedSTOconfig = stoConfig; } - let rate = readlineSync.question(`Enter the rate (1 ${(raiseType == 1 ? 'POLY' : 'ETH')} = X ${tokenSymbol}) for the STO (1000): `); - if (rate == "") rate = 1000; + if (cappedSTOconfig.startTime == "") cappedSTOconfig.startTime = oneMinuteFromNow; + if (cappedSTOconfig.endTime == "") cappedSTOconfig.endTime = oneMonthFromNow; let bytesSTO = web3.eth.abi.encodeFunctionCall( { name: 'configure', @@ -273,7 +271,7 @@ async function cappedSTO_launch() { name: '_fundsReceiver' } ] - }, [startTime, endTime, web3.utils.toWei(cap), rate, raiseType, wallet]); + }, [cappedSTOconfig.startTime, cappedSTOconfig.endTime, web3.utils.toWei(cappedSTOconfig.cap.toString()), cappedSTOconfig.rate, cappedSTOconfig.raiseType, cappedSTOconfig.wallet]); let addModuleAction = securityToken.methods.addModule(cappedSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); let receipt = await common.sendTransaction(addModuleAction); @@ -431,38 +429,38 @@ function tiersConfigUSDTieredSTO(polyRaise) { tiers.tokensPerTierDiscountPoly = []; tiers.ratePerTierDiscountPoly = []; for (let i = 0; i < tiers.tiers; i++) { - tiers.tokensPerTier[i] = web3.utils.toWei(readlineSync.question(`How many tokens do you plan to sell on tier No. ${i+1}? (${defaultTokensPerTier[i]}): `, { + tiers.tokensPerTier[i] = readlineSync.question(`How many tokens do you plan to sell on tier No. ${i+1}? (${defaultTokensPerTier[i]}): `, { limit: function(input) { return parseFloat(input) > 0; }, limitMessage: 'Must be greater than zero', defaultInput: defaultTokensPerTier[i] - })); + }); - tiers.ratePerTier[i] = web3.utils.toWei(readlineSync.question(`What is the USD per token rate for tier No. ${i+1}? (${defaultRatePerTier[i]}): `, { + tiers.ratePerTier[i] = readlineSync.question(`What is the USD per token rate for tier No. ${i+1}? (${defaultRatePerTier[i]}): `, { limit: function(input) { return parseFloat(input) > 0; }, limitMessage: 'Must be greater than zero', defaultInput: defaultRatePerTier[i] - })); + }); if (polyRaise && readlineSync.keyInYNStrict(`Do you plan to have a discounted rate for POLY investments for tier No. ${i+1}? `)) { - tiers.tokensPerTierDiscountPoly[i] = web3.utils.toWei(readlineSync.question(`How many of those tokens do you plan to sell at discounted rate on tier No. ${i+1}? (${defaultTokensPerTierDiscountPoly[i]}): `, { + tiers.tokensPerTierDiscountPoly[i] = readlineSync.question(`How many of those tokens do you plan to sell at discounted rate on tier No. ${i+1}? (${defaultTokensPerTierDiscountPoly[i]}): `, { limit: function(input) { - return new BigNumber(web3.utils.toWei(input)).lte(tiers.tokensPerTier[i]) + return parseFloat(input) < parseFloat(tiers.tokensPerTier[i]); }, limitMessage: 'Must be less than the No. of tokens of the tier', defaultInput: defaultTokensPerTierDiscountPoly[i] - })); + }); - tiers.ratePerTierDiscountPoly[i] = web3.utils.toWei(readlineSync.question(`What is the discounted rate for tier No. ${i+1}? (${defaultRatePerTierDiscountPoly[i]}): `, { + tiers.ratePerTierDiscountPoly[i] = readlineSync.question(`What is the discounted rate for tier No. ${i+1}? (${defaultRatePerTierDiscountPoly[i]}): `, { limit: function(input) { - return new BigNumber(web3.utils.toWei(input)).lte(tiers.ratePerTier[i]) + return parseFloat(input) < parseFloat(tiers.ratePerTier[i]); }, limitMessage: 'Must be less than the rate of the tier', defaultInput: defaultRatePerTierDiscountPoly[i] - })); + }); } else { tiers.tokensPerTierDiscountPoly[i] = 0; tiers.ratePerTierDiscountPoly[i] = 0; @@ -472,57 +470,65 @@ function tiersConfigUSDTieredSTO(polyRaise) { return tiers; } -function timesConfigUSDTieredSTO() { - let times = {}; - - let oneMinuteFromNow = Math.floor(Date.now() / 1000) + 60; - times.startTime = readlineSync.questionInt('Enter the start time for the STO (Unix Epoch time)\n(1 minutes from now = ' + oneMinuteFromNow + ' ): ', { - limit: function(input) { - return input > Math.floor(Date.now() / 1000); - }, - limitMessage: "Must be a future time", - defaultInput: oneMinuteFromNow - }); - if (times.startTime == "") times.startTime = oneMinuteFromNow; - - let oneMonthFromNow = Math.floor(Date.now() / 1000) + (30 * 24 * 60 * 60); - times.endTime = readlineSync.questionInt('Enter the end time for the STO (Unix Epoch time)\n(1 month from now = ' + oneMonthFromNow + ' ): ', { - limit: function(input) { - return input > times.startTime; - }, - limitMessage: "Must be greater than Start Time", - defaultInput: oneMonthFromNow - }); - if (times.endTime == "") times.endTime = oneMonthFromNow; - - return times; -} - function limitsConfigUSDTieredSTO() { let limits = {}; let defaultMinimumInvestment = 5; - limits.minimumInvestmentUSD = web3.utils.toWei(readlineSync.question(`What is the minimum investment in USD? (${defaultMinimumInvestment}): `, { + limits.minimumInvestmentUSD = readlineSync.question(`What is the minimum investment in USD? (${defaultMinimumInvestment}): `, { limit: function(input) { return parseInt(input) > 0; }, limitMessage: "Must be greater than zero", defaultInput: defaultMinimumInvestment - })); + }); let nonAccreditedLimit = 2500; - limits.nonAccreditedLimitUSD = web3.utils.toWei(readlineSync.question(`What is the default limit for non accredited investors in USD? (${nonAccreditedLimit}): `, { + limits.nonAccreditedLimitUSD = readlineSync.question(`What is the default limit for non accredited investors in USD? (${nonAccreditedLimit}): `, { limit: function(input) { - return new BigNumber(web3.utils.toWei(input)).gte(limits.minimumInvestmentUSD); + return parseFloat(input) >= parseFloat(limits.minimumInvestmentUSD); }, limitMessage: "Must be greater than minimum investment", defaultInput: nonAccreditedLimit - })); + }); return limits; } -async function usdTieredSTO_launch() { +function timesConfigUSDTieredSTO(stoConfig) { + let times = {}; + + let oneMinuteFromNow = Math.floor(Date.now() / 1000) + 60; + if (typeof stoConfig === 'undefined') { + times.startTime = readlineSync.questionInt('Enter the start time for the STO (Unix Epoch time)\n(1 minutes from now = ' + oneMinuteFromNow + ' ): ', { + limit: function(input) { + return input > Math.floor(Date.now() / 1000); + }, + limitMessage: "Must be a future time", + defaultInput: oneMinuteFromNow + }); + } else { + times.startTime = stoConfig.times.startTime; + } + if (times.startTime == "") times.startTime = oneMinuteFromNow; + + let oneMonthFromNow = Math.floor(Date.now() / 1000) + (30 * 24 * 60 * 60); + if (typeof stoConfig === 'undefined') { + times.endTime = readlineSync.questionInt('Enter the end time for the STO (Unix Epoch time)\n(1 month from now = ' + oneMonthFromNow + ' ): ', { + limit: function(input) { + return input > times.startTime; + }, + limitMessage: "Must be greater than Start Time", + defaultInput: oneMonthFromNow + }); + } else { + times.endTime = stoConfig.times.startTime; + } + if (times.endTime == "") times.endTime = oneMonthFromNow; + + return times; +} + +async function usdTieredSTO_launch(stoConfig) { console.log(chalk.blue('Launch STO - USD pegged tiered STO')); let usdTieredSTOFactoryABI = abis.usdTieredSTOFactory(); @@ -548,11 +554,12 @@ async function usdTieredSTO_launch() { } } - let funding = fundingConfigUSDTieredSTO(); - let addresses = addressesConfigUSDTieredSTO(funding.raiseType.includes(gbl.constants.FUND_RAISE_TYPES.DAI)); - let tiers = tiersConfigUSDTieredSTO(funding.raiseType.includes(gbl.constants.FUND_RAISE_TYPES.POLY)); - let limits = limitsConfigUSDTieredSTO(); - let times = timesConfigUSDTieredSTO(); + let useConfigFile = typeof stoConfig !== 'undefined'; + let funding = useConfigFile ? stoConfig.funding : fundingConfigUSDTieredSTO(); + let addresses = useConfigFile ? stoConfig.addresses : addressesConfigUSDTieredSTO(funding.raiseType.includes(gbl.constants.FUND_RAISE_TYPES.DAI)); + let tiers = useConfigFile ? stoConfig.tiers : tiersConfigUSDTieredSTO(funding.raiseType.includes(gbl.constants.FUND_RAISE_TYPES.POLY)); + let limits = useConfigFile ? stoConfig.limits : limitsConfigUSDTieredSTO(); + let times = timesConfigUSDTieredSTO(stoConfig); let bytesSTO = web3.eth.abi.encodeFunctionCall( { name: 'configure', type: 'function', @@ -597,12 +604,12 @@ async function usdTieredSTO_launch() { ] }, [times.startTime, times.endTime, - tiers.ratePerTier, - tiers.ratePerTierDiscountPoly, - tiers.tokensPerTier, - tiers.tokensPerTierDiscountPoly, - limits.nonAccreditedLimitUSD, - limits.minimumInvestmentUSD, + tiers.ratePerTier.map(r => web3.utils.toWei(r.toString())), + tiers.ratePerTierDiscountPoly.map(rd => web3.utils.toWei(rd.toString())), + tiers.tokensPerTier.map(t => web3.utils.toWei(t.toString())), + tiers.tokensPerTierDiscountPoly.map(td => web3.utils.toWei(td.toString())), + web3.utils.toWei(limits.nonAccreditedLimitUSD.toString()), + web3.utils.toWei(limits.minimumInvestmentUSD.toString()), funding.raiseType, addresses.wallet, addresses.reserveWallet, @@ -920,8 +927,40 @@ async function getAllModulesByType(type) { return modules; } +async function initialize(_tokenSymbol) { + welcome(); + await setup(); + if (typeof _tokenSymbol === 'undefined') { + tokenSymbol = await selectToken(); + } else { + tokenSymbol = _tokenSymbol; + } + let securityTokenAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call(); + if (securityTokenAddress == '0x0000000000000000000000000000000000000000') { + console.log(chalk.red(`Selected Security Token ${tokenSymbol} does not exist.`)); + process.exit(0); + } + let securityTokenABI = abis.securityToken(); + securityToken = new web3.eth.Contract(securityTokenABI, securityTokenAddress); + securityToken.setProvider(web3.currentProvider); +} + +function welcome() { + common.logAsciiBull(); + console.log("****************************************"); + console.log("Welcome to the Command-Line STO Manager."); + console.log("****************************************"); + console.log("The following script will allow you to manage STOs modules."); + console.log("Issuer Account: " + Issuer.address + "\n"); +} + module.exports = { - executeApp: async function() { + executeApp: async function(_tokenSymbol) { + await initialize(_tokenSymbol); return executeApp(); + }, + addSTOModule: async function(_tokenSymbol, stoConfig) { + await initialize(_tokenSymbol); + return addSTOModule(stoConfig) } } \ No newline at end of file diff --git a/CLI/data/capped_sto_data.yml b/CLI/data/capped_sto_data.yml index 6be0c0f66..41653c9ff 100644 --- a/CLI/data/capped_sto_data.yml +++ b/CLI/data/capped_sto_data.yml @@ -1,35 +1,14 @@ -securityToken: - # symbol -> security token symbol - symbol: CAP - # name -> security token name - name: CAP Token - # divisible -> true for divisible token, false for non-divisible - divisible: true - -initialMint: - # multimint -> whitelist and mint tokens to a list of affiliates (true) or only to a single wallet (false) - multimint: true - # singleMint -> Only valid if multimint = false - singleMint: - # wallet -> address that will be whitelisted - wallet: '' - # allowedToBuy -> true to allow wallet to buy tokens from the STO - allowedToBuy: true - # tokenAmount -> tokens minted to wallet - tokenAmount: 500000 - -sto: - # type -> 0 for cappedSTO, 1 for USDTieredSTO, 2 for select STO later - type: 0 - # cap -> - cap: 500000 - # startTime -> start time for the STO (Unix Epoch time) - startTime: '' - # endTime -> end time for the STO (Unix Epoch time) - endTime: '' - # wallet -> address that will receive the funds from the STO - wallet: '' - # raiseType -> 0 for ETH, 1 for POLY - raiseType: 0 - # rate -> rate for the STO - rate: 1000 \ No newline at end of file +# type -> 'CappedSTO' for cappedSTO, 'USDTieredSTO' for USDTieredSTO +type: 'CappedSTO' +# cap -> Maximum No. of tokens for sale. +cap: 1000000 +# startTime -> Unix timestamp at which offering get started. '' for CLI default (one minute from now) +startTime: '' +# endTime -> Unix timestamp at which offering get ended. '' for CLI default (one month from now) +endTime: '' +# wallet -> Ethereum account address to hold the funds +wallet: '0x0a519b4b6501f92e8f516230b97aca83257b0c01' +# raiseType -> Type of currency used to collect the funds. [0] for ETH, [1] for POLY +raiseType: [0] +# rate -> Token units a buyer gets per unit of selected raise type. +rate: 1000 \ No newline at end of file diff --git a/CLI/data/usd_tiered_sto_data.yml b/CLI/data/usd_tiered_sto_data.yml index 305167bd7..29655c5bf 100644 --- a/CLI/data/usd_tiered_sto_data.yml +++ b/CLI/data/usd_tiered_sto_data.yml @@ -1,57 +1,37 @@ -securityToken: - # symbol -> security token symbol - symbol: TIE - # name -> security token name - name: TIEred Token - # divisible -> true for divisible token, false for non-divisible - divisible: true +# type -> 'CappedSTO' for cappedSTO, 'USDTieredSTO' for USDTieredSTO +type: 'USDTieredSTO' -initialMint: - # multimint -> whitelist and mint tokens to a list of affiliates (true) or only to a single wallet (false) - multimint: true - # singleMint -> Only valid if multimint = false - singleMint: - # wallet -> address that will be whitelisted - wallet: '' - # allowedToBuy -> true to allow wallet to buy tokens from the STO - allowedToBuy: true - # tokenAmount -> tokens minted to wallet - tokenAmount: 500000 - -sto: - # type -> 0 for cappedSTO, 1 for USDTieredSTO, 2 for select STO later - type: 1 - - # fundings - # fundigType -> P for POLY, E for ETH, B for both - fundingType: B +funding: + # fundigType -> Types of currency used to collect the funds, 0 for ETH, 1 for POLY, 2 for DAI, any combination of them for more than one (i.e. [0, 1, 2] for all of them) + raiseType: [0, 1] - # addresses - # wallet -> address that will receive the funds from the STO - wallet: '' - # reserveWallet -> address that will receive remaining tokens in the case the cap is not met - reserveWallet: '' +addresses: + # wallet -> Ethereum account address to hold the funds. + wallet: '0x0a519b4b6501f92e8f516230b97aca83257b0c01' + # reserveWallet -> Ethereum account address to receive unsold tokens. + reserveWallet: '0x0a519b4b6501f92e8f516230b97aca83257b0c01' + # usdToken -> Contract address of the stable coin. + usdToken: '0x0000000000000000000000000000000000000000' + - # tiers - # numberOfTiers -> total of tiers for the STO - numberOfTiers: 3 - # tokensPerTiers -> total tokens for each tier - tokensPerTiers: !!seq [ 190000000, 100000000, 200000000 ] - # ratePerTiers -> rate for each tier (in USD) - ratePerTiers: !!seq [ 0.05, 0.10, 0.15 ] - # discountedTokensPerTiers -> tokens for discounted rate for POLY investments (relative to tokensPerTier). 0 for no discounted tokens - discountedTokensPerTiers: !!seq [ 0, 0, 100000000 ] - # discountedRatePerTiers -> discounted rate for POLY investments for each tier. 0 for no discounted rate - discountedRatePerTiers: !!seq [ 0, 0, 0.075 ] +tiers: + # tokensPerTiers -> Total tokens for each tier + tokensPerTier: !!seq [ 190000000, 100000000, 200000000 ] + # ratePerTiers -> Rate for each tier (in USD) + ratePerTier: !!seq [ 0.05, 0.10, 0.15 ] + # discountedTokensPerTiers -> Tokens for discounted rate for POLY investments. 0 for no discounted tokens + tokensPerTierDiscountPoly: !!seq [ 0, 0, 100000000 ] + # discountedRatePerTiers -> Discounted rate for POLY investments for each tier. 0 for no discounted rate + ratePerTierDiscountPoly: !!seq [ 0, 0, 0.075 ] - # limits - # minimumInvestmentUSD -> minimum investment (in USD) +limits: + # minimumInvestmentUSD -> Minimun investment in USD. minimumInvestmentUSD: 5 - # nonAccreditedLimitUSD -> limit for non accredited insvestors (in USD) + # nonAccreditedLimitUSD -> Limit in USD for non-accredited investors nonAccreditedLimitUSD: 10000 - #times - # startTime -> start time for the STO (Unix Epoch time) +times: + # startTime -> Unix timestamp at which offering get started. '' for CLI default (one minute from now) startTime: '' - # endTime -> end time for the STO (Unix Epoch time) + # endTime -> Unix timestamp at which offering get ended. '' for CLI default (one month from now) endTime: '' \ No newline at end of file diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index f90ac529a..e28e4c987 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -39,11 +39,18 @@ program program .command('sto_manager') + .option('-t, --securityToken ', 'Selects a ST to manage modules') + .option('-l, --launch ', 'Uses configuration file to configure and launch a STO') .alias('sto') .description('Wizard-like script that will guide technical users in the creation of an STO') - .action(async function() { + .action(async function(cmd) { await gbl.initialize(program.remoteNode); - await sto_manager.executeApp(); + if (cmd.launch) { + let config = yaml.safeLoad(fs.readFileSync(`${__dirname}/${cmd.launch}`, 'utf8')); + await sto_manager.addSTOModule(cmd.securityToken, config) + } else { + await sto_manager.executeApp(cmd.securityToken); + } }); program From e732ed9e5c3ada2f6af6cab69a3bd047cf07828c Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Thu, 22 Nov 2018 12:25:44 -0300 Subject: [PATCH 077/139] Minor improvements --- CLI/commands/sto_manager.js | 80 +++++++++++++++---------------------- 1 file changed, 33 insertions(+), 47 deletions(-) diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index 159ace91b..ae3ba6ea7 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -1,5 +1,4 @@ var readlineSync = require('readline-sync'); -var BigNumber = require('bignumber.js'); var chalk = require('chalk'); const shell = require('shelljs'); var contracts = require('./helpers/contract_addresses'); @@ -196,27 +195,27 @@ async function cappedSTO_launch(stoConfig) { let cappedSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, gbl.constants.MODULES_TYPES.STO, "CappedSTO"); let cappedSTOFactory = new web3.eth.Contract(cappedSTOFactoryABI, cappedSTOFactoryAddress); cappedSTOFactory.setProvider(web3.currentProvider); - let stoFee = await cappedSTOFactory.methods.getSetupCost().call(); + let stoFee = new web3.utils.BN(await cappedSTOFactory.methods.getSetupCost().call()); - let contractBalance = await polyToken.methods.balanceOf(securityToken._address).call(); - if (parseInt(contractBalance) < parseInt(stoFee)) { - let transferAmount = parseInt(stoFee) - parseInt(contractBalance); - let ownerBalance = await polyToken.methods.balanceOf(Issuer.address).call(); - if (parseInt(ownerBalance) < transferAmount) { + let contractBalance = new web3.utils.BN(await polyToken.methods.balanceOf(securityToken._address).call()); + if (contractBalance.lt(stoFee)) { + let transferAmount = stoFee.sub(contractBalance); + let ownerBalance = new web3.utils.BN(await polyToken.methods.balanceOf(Issuer.address).call()); + if (ownerBalance.lt(transferAmount)) { console.log(chalk.red(`\n**************************************************************************************************************************************************`)); - console.log(chalk.red(`Not enough balance to pay the CappedSTO fee, Requires ${(new BigNumber(transferAmount).dividedBy(new BigNumber(10).pow(18))).toNumber()} POLY but have ${(new BigNumber(ownerBalance).dividedBy(new BigNumber(10).pow(18))).toNumber()} POLY. Access POLY faucet to get the POLY to complete this txn`)); + console.log(chalk.red(`Not enough balance to pay the CappedSTO fee, Requires ${web3.utils.fromWei(transferAmount)} POLY but have ${web3.utils.fromWei(ownerBalance)} POLY. Access POLY faucet to get the POLY to complete this txn`)); console.log(chalk.red(`**************************************************************************************************************************************************\n`)); return; } else { - let transferAction = polyToken.methods.transfer(securityToken._address, new BigNumber(transferAmount)); + let transferAction = polyToken.methods.transfer(securityToken._address, transferAmount); let receipt = await common.sendTransaction(transferAction, {factor: 2}); let event = common.getEventFromLogs(polyToken._jsonInterface, receipt.logs, 'Transfer'); console.log(`Number of POLY sent: ${web3.utils.fromWei(new web3.utils.BN(event._value))}`) } } - let oneMinuteFromNow = BigNumber((Math.floor(Date.now() / 1000) + 60)); - let oneMonthFromNow = BigNumber((Math.floor(Date.now()/1000)+ (30 * 24 * 60 * 60))); + let oneMinuteFromNow = new web3.utils.BN((Math.floor(Date.now() / 1000) + 60)); + let oneMonthFromNow = new web3.utils.BN((Math.floor(Date.now()/1000)+ (30 * 24 * 60 * 60))); let cappedSTOconfig = {}; let useConfigFile = typeof stoConfig !== 'undefined'; @@ -226,12 +225,12 @@ async function cappedSTO_launch(stoConfig) { cappedSTOconfig.raiseType = readlineSync.question('Enter' + chalk.green(` P `) + 'for POLY raise or leave empty for Ether raise (E): '); if (cappedSTOconfig.raiseType.toUpperCase() == 'P' ) { - cappedSTOconfig.raiseType = [1]; + cappedSTOconfig.raiseType = [gbl.constants.FUND_RAISE_TYPES.POLY]; } else { - cappedSTOconfig.raiseType = [0]; + cappedSTOconfig.raiseType = [gbl.constants.FUND_RAISE_TYPES.ETH]; } - cappedSTOconfig.rate = readlineSync.question(`Enter the rate (1 ${(cappedSTOconfig.raiseType == 1 ? 'POLY' : 'ETH')} = X ${tokenSymbol}) for the STO (1000): `); + cappedSTOconfig.rate = readlineSync.question(`Enter the rate (1 ${cappedSTOconfig.raiseType == gbl.constants.FUND_RAISE_TYPES.POLY ? 'POLY' : 'ETH'} = X ${tokenSymbol}) for the STO (1000): `); if (cappedSTOconfig.rate == "") cappedSTOconfig.rate = 1000; cappedSTOconfig.wallet = readlineSync.question('Enter the address that will receive the funds from the STO (' + Issuer.address + '): '); @@ -273,7 +272,7 @@ async function cappedSTO_launch(stoConfig) { ] }, [cappedSTOconfig.startTime, cappedSTOconfig.endTime, web3.utils.toWei(cappedSTOconfig.cap.toString()), cappedSTOconfig.rate, cappedSTOconfig.raiseType, cappedSTOconfig.wallet]); - let addModuleAction = securityToken.methods.addModule(cappedSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); + let addModuleAction = securityToken.methods.addModule(cappedSTOFactoryAddress, bytesSTO, stoFee, 0); let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`STO deployed at address: ${event._module}`); @@ -289,28 +288,15 @@ async function cappedSTO_status(currentSTO) { let displayStartTime = await currentSTO.methods.startTime().call(); let displayEndTime = await currentSTO.methods.endTime().call(); let displayRate = await currentSTO.methods.rate().call(); - let displayCap = await currentSTO.methods.cap().call(); + let displayCap = new web3.utils.BN(await currentSTO.methods.cap().call()); let displayWallet = await currentSTO.methods.wallet().call(); - let displayRaiseType; - let displayFundsRaised; - let displayWalletBalance; - let raiseType = await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.ETH).call(); - if (raiseType) { - displayRaiseType = 'ETH'; - displayFundsRaised = await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES.ETH).call(); - displayWalletBalance = web3.utils.fromWei(await web3.eth.getBalance(displayWallet)); - } else { - displayRaiseType = 'POLY'; - displayFundsRaised = await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES.POLY).call(); - displayWalletBalance = web3.utils.fromWei(await getBalance(displayWallet, 'POLY')); - } - let displayTokensSold = await currentSTO.methods.totalTokensSold().call(); + let displayRaiseType = await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.ETH).call() ? 'ETH' : 'POLY'; + let displayFundsRaised = await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES[displayRaiseType]).call(); + let displayWalletBalance = web3.utils.fromWei(await getBalance(displayWallet, gbl.constants.FUND_RAISE_TYPES[displayRaiseType])); + let displayTokensSold = new web3.utils.BN(await currentSTO.methods.totalTokensSold().call()); let displayInvestorCount = await currentSTO.methods.investorCount().call(); let displayTokenSymbol = await securityToken.methods.symbol().call(); - let formattedCap = BigNumber(web3.utils.fromWei(displayCap)); - let formattedSold = BigNumber(web3.utils.fromWei(displayTokensSold)); - let now = Math.floor(Date.now()/1000); let timeTitle; let timeRemaining; @@ -339,11 +325,11 @@ async function cappedSTO_status(currentSTO) { - ${timeTitle} ${timeRemaining} - Funds raised: ${web3.utils.fromWei(displayFundsRaised)} ${displayRaiseType} - Tokens sold: ${web3.utils.fromWei(displayTokensSold)} ${displayTokenSymbol.toUpperCase()} - - Tokens remaining: ${formattedCap.minus(formattedSold).toNumber()} ${displayTokenSymbol.toUpperCase()} + - Tokens remaining: ${web3.utils.fromWei(displayCap.sub(displayTokensSold))} ${displayTokenSymbol.toUpperCase()} - Investor count: ${displayInvestorCount} `); - console.log(chalk.green(`\n${(web3.utils.fromWei(await getBalance(Issuer.address, 'POLY')))} POLY balance remaining at issuer address ${Issuer.address}`)); + console.log(chalk.green(`\n${(web3.utils.fromWei(await getBalance(Issuer.address, gbl.constants.FUND_RAISE_TYPES.POLY)))} POLY balance remaining at issuer address ${Issuer.address}`)); } //////////////////// @@ -476,7 +462,7 @@ function limitsConfigUSDTieredSTO() { let defaultMinimumInvestment = 5; limits.minimumInvestmentUSD = readlineSync.question(`What is the minimum investment in USD? (${defaultMinimumInvestment}): `, { limit: function(input) { - return parseInt(input) > 0; + return parseFloat(input) > 0; }, limitMessage: "Must be greater than zero", defaultInput: defaultMinimumInvestment @@ -535,11 +521,11 @@ async function usdTieredSTO_launch(stoConfig) { let usdTieredSTOFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, gbl.constants.MODULES_TYPES.STO, 'USDTieredSTO'); let usdTieredSTOFactory = new web3.eth.Contract(usdTieredSTOFactoryABI, usdTieredSTOFactoryAddress); usdTieredSTOFactory.setProvider(web3.currentProvider); - let stoFee = await usdTieredSTOFactory.methods.getSetupCost().call(); + let stoFee = new web3.utils.BN(await usdTieredSTOFactory.methods.getSetupCost().call()); - let contractBalance = await polyToken.methods.balanceOf(securityToken._address).call(); - if (new web3.utils.BN(contractBalance).lt(new web3.utils.BN(stoFee))) { - let transferAmount = (new web3.utils.BN(stoFee)).sub(new web3.utils.BN(contractBalance)); + let contractBalance = new web3.utils.BN(await polyToken.methods.balanceOf(securityToken._address).call()); + if (contractBalance.lt(stoFee)) { + let transferAmount = stoFee.sub(contractBalance); let ownerBalance = new web3.utils.BN(await polyToken.methods.balanceOf(Issuer.address).call()); if (ownerBalance.lt(transferAmount)) { console.log(chalk.red(`\n**************************************************************************************************************************************************`)); @@ -616,7 +602,7 @@ async function usdTieredSTO_launch(stoConfig) { addresses.usdToken ]); - let addModuleAction = securityToken.methods.addModule(usdTieredSTOFactoryAddress, bytesSTO, new BigNumber(stoFee).times(new BigNumber(10).pow(18)), 0); + let addModuleAction = securityToken.methods.addModule(usdTieredSTOFactoryAddress, bytesSTO, stoFee, 0); let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`STO deployed at address: ${event._module}`); @@ -697,13 +683,13 @@ async function usdTieredSTO_status(currentSTO) { let displayFundsRaisedPerType = ''; let displayTokensSoldPerType = ''; for (const type of raiseTypes) { - let balance = await getBalance(displayWallet, type); + let balance = await getBalance(displayWallet, gbl.constants.FUND_RAISE_TYPES[type]); let walletBalance = web3.utils.fromWei(balance); let walletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(gbl.constants.FUND_RAISE_TYPES[type], balance).call()); displayWalletBalancePerType += ` Balance ${type}:\t\t ${walletBalance} ${type} (${walletBalanceUSD} USD)`; - balance = await getBalance(displayReserveWallet, type); + balance = await getBalance(displayReserveWallet, gbl.constants.FUND_RAISE_TYPES[type]); let reserveWalletBalance = web3.utils.fromWei(balance); let reserveWalletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(gbl.constants.FUND_RAISE_TYPES[type], balance).call()); displayReserveWalletBalancePerType += ` @@ -764,7 +750,7 @@ async function usdTieredSTO_status(currentSTO) { USD: ${displayFundsRaisedUSD} USD `); - console.log(chalk.green(`\n${(web3.utils.fromWei(await getBalance(Issuer.address, 'POLY')))} POLY balance remaining at issuer address ${Issuer.address}`)); + console.log(chalk.green(`\n${(web3.utils.fromWei(await getBalance(Issuer.address, gbl.constants.FUND_RAISE_TYPES.POLY)))} POLY balance remaining at issuer address ${Issuer.address}`)); } async function usdTieredSTO_configure(currentSTO) { @@ -889,11 +875,11 @@ async function modfifyTiers(currentSTO) { ////////////////////// async function getBalance(from, type) { switch (type) { - case 'ETH': + case gbl.constants.FUND_RAISE_TYPES.ETH: return await web3.eth.getBalance(from); - case 'POLY': + case gbl.constants.FUND_RAISE_TYPES.POLY: return await polyToken.methods.balanceOf(from).call(); - case 'DAI': + case gbl.constants.FUND_RAISE_TYPES.DAI: return await usdToken.methods.balanceOf(from).call(); } } From a6cd7049de0e20adcef639bc0487a678bb1b0908 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Thu, 22 Nov 2018 12:33:17 -0300 Subject: [PATCH 078/139] Get configure function from ABI --- CLI/commands/sto_manager.js | 109 +++++++++--------------------------- 1 file changed, 27 insertions(+), 82 deletions(-) diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index ae3ba6ea7..076401968 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -246,38 +246,22 @@ async function cappedSTO_launch(stoConfig) { if (cappedSTOconfig.startTime == "") cappedSTOconfig.startTime = oneMinuteFromNow; if (cappedSTOconfig.endTime == "") cappedSTOconfig.endTime = oneMonthFromNow; - let bytesSTO = web3.eth.abi.encodeFunctionCall( { - name: 'configure', - type: 'function', - inputs: [ - { - type: 'uint256', - name: '_startTime' - },{ - type: 'uint256', - name: '_endTime' - },{ - type: 'uint256', - name: '_cap' - },{ - type: 'uint256', - name: '_rate' - },{ - type: 'uint8[]', - name: '_fundRaiseTypes' - },{ - type: 'address', - name: '_fundsReceiver' - } - ] - }, [cappedSTOconfig.startTime, cappedSTOconfig.endTime, web3.utils.toWei(cappedSTOconfig.cap.toString()), cappedSTOconfig.rate, cappedSTOconfig.raiseType, cappedSTOconfig.wallet]); + let cappedSTOABI = abis.cappedSTO(); + let configureFunction = cappedSTOABI.find(o => o.name === 'configure' && o.type === 'function'); + let bytesSTO = web3.eth.abi.encodeFunctionCall( configureFunction, + [ cappedSTOconfig.startTime, + cappedSTOconfig.endTime, + web3.utils.toWei(cappedSTOconfig.cap.toString()), + cappedSTOconfig.rate, + cappedSTOconfig.raiseType, + cappedSTOconfig.wallet ] + ); let addModuleAction = securityToken.methods.addModule(cappedSTOFactoryAddress, bytesSTO, stoFee, 0); let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`STO deployed at address: ${event._module}`); - let cappedSTOABI = abis.cappedSTO(); let cappedSTO = new web3.eth.Contract(cappedSTOABI, event._module); cappedSTO.setProvider(web3.currentProvider); @@ -546,68 +530,29 @@ async function usdTieredSTO_launch(stoConfig) { let tiers = useConfigFile ? stoConfig.tiers : tiersConfigUSDTieredSTO(funding.raiseType.includes(gbl.constants.FUND_RAISE_TYPES.POLY)); let limits = useConfigFile ? stoConfig.limits : limitsConfigUSDTieredSTO(); let times = timesConfigUSDTieredSTO(stoConfig); - let bytesSTO = web3.eth.abi.encodeFunctionCall( { - name: 'configure', - type: 'function', - inputs: [ - { - type: 'uint256', - name: '_startTime' - },{ - type: 'uint256', - name: '_endTime' - },{ - type: 'uint256[]', - name: '_ratePerTier' - },{ - type: 'uint256[]', - name: '_ratePerTierDiscountPoly' - },{ - type: 'uint256[]', - name: '_tokensPerTier' - },{ - type: 'uint256[]', - name: '_tokensPerTierDiscountPoly' - },{ - type: 'uint256', - name: '_nonAccreditedLimitUSD' - },{ - type: 'uint256', - name: '_minimumInvestmentUSD' - },{ - type: 'uint8[]', - name: '_fundRaiseTypes' - },{ - type: 'address', - name: '_wallet' - },{ - type: 'address', - name: '_reserveWallet' - },{ - type: 'address', - name: '_usdToken' - } - ] - }, [times.startTime, - times.endTime, - tiers.ratePerTier.map(r => web3.utils.toWei(r.toString())), - tiers.ratePerTierDiscountPoly.map(rd => web3.utils.toWei(rd.toString())), - tiers.tokensPerTier.map(t => web3.utils.toWei(t.toString())), - tiers.tokensPerTierDiscountPoly.map(td => web3.utils.toWei(td.toString())), - web3.utils.toWei(limits.nonAccreditedLimitUSD.toString()), - web3.utils.toWei(limits.minimumInvestmentUSD.toString()), - funding.raiseType, - addresses.wallet, - addresses.reserveWallet, - addresses.usdToken - ]); + + let usdTieredSTOABI = abis.usdTieredSTO(); + let configureFunction = usdTieredSTOABI.find(o => o.name === 'configure' && o.type === 'function'); + let bytesSTO = web3.eth.abi.encodeFunctionCall( configureFunction, + [ times.startTime, + times.endTime, + tiers.ratePerTier.map(r => web3.utils.toWei(r.toString())), + tiers.ratePerTierDiscountPoly.map(rd => web3.utils.toWei(rd.toString())), + tiers.tokensPerTier.map(t => web3.utils.toWei(t.toString())), + tiers.tokensPerTierDiscountPoly.map(td => web3.utils.toWei(td.toString())), + web3.utils.toWei(limits.nonAccreditedLimitUSD.toString()), + web3.utils.toWei(limits.minimumInvestmentUSD.toString()), + funding.raiseType, + addresses.wallet, + addresses.reserveWallet, + addresses.usdToken ] + ); let addModuleAction = securityToken.methods.addModule(usdTieredSTOFactoryAddress, bytesSTO, stoFee, 0); let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`STO deployed at address: ${event._module}`); - let usdTieredSTOABI = abis.usdTieredSTO(); let usdTieredSTO = new web3.eth.Contract(usdTieredSTOABI, event._module); usdTieredSTO.setProvider(web3.currentProvider); From e0b29883cf394e799c96c9c2e95da03f5a694589 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Thu, 22 Nov 2018 15:29:31 -0300 Subject: [PATCH 079/139] Flow changes --- CLI/commands/ST20Generator.js | 16 ++-- CLI/commands/sto_manager.js | 105 ++++++++++++----------- CLI/commands/token_manager.js | 156 ++++++++++++++++++++++------------ CLI/polymath-cli.js | 7 +- 4 files changed, 165 insertions(+), 119 deletions(-) diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index 556baf8eb..727c112b4 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -1,10 +1,11 @@ -var readlineSync = require('readline-sync'); -var BigNumber = require('bignumber.js'); -var moment = require('moment'); -var chalk = require('chalk'); -var contracts = require('./helpers/contract_addresses'); -var abis = require('./helpers/contract_abis'); -var common = require('./common/common_functions'); +const readlineSync = require('readline-sync'); +const BigNumber = require('bignumber.js'); +const moment = require('moment'); +const chalk = require('chalk'); +const tokenManager = require('./token_manager'); +const contracts = require('./helpers/contract_addresses'); +const abis = require('./helpers/contract_abis'); +const common = require('./common/common_functions'); //////////////////////// let securityTokenRegistryAddress; @@ -31,6 +32,7 @@ async function executeApp(_ticker, _transferOwnership, _name, _details, _divisib await step_transfer_ticker_ownership(_transferOwnership); await step_token_deploy(_name, _details, _divisible); } + await tokenManager.executeApp(tokenSymbol); } catch (err) { console.log(err); return; diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index 257a223bc..8943ec5d4 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -61,59 +61,6 @@ async function executeApp() { } }; -async function setup(){ - try { - let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); - let securityTokenRegistryABI = abis.securityTokenRegistry(); - securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); - securityTokenRegistry.setProvider(web3.currentProvider); - - let polytokenAddress = await contracts.polyToken(); - let polytokenABI = abis.polyToken(); - polyToken = new web3.eth.Contract(polytokenABI, polytokenAddress); - polyToken.setProvider(web3.currentProvider); - - //TODO: Use proper DAI token here - let usdTokenAddress = await contracts.usdToken(); - usdToken = new web3.eth.Contract(polytokenABI, usdTokenAddress); - usdToken.setProvider(web3.currentProvider); - } catch (err) { - console.log(err) - console.log('\x1b[31m%s\x1b[0m',"There was a problem getting the contracts. Make sure they are deployed to the selected network."); - process.exit(0); - } -} - -async function selectToken() { - let result = null; - - let userTokens = await securityTokenRegistry.methods.getTokensByOwner(Issuer.address).call(); - if (userTokens.length == 0) { - console.log(chalk.red(`You have not issued any Security Token yet!`)); - } else if (userTokens.length == 1) { - let tokenData = await securityTokenRegistry.methods.getSecurityTokenData(userTokens[0]).call(); - console.log(chalk.yellow(`You have only one token. ${tokenData[0]} will be selected automatically.`)); - result = tokenData[0]; - } else { - let tokenDataArray = await Promise.all(userTokens.map(async function (t) { - let tokenData = await securityTokenRegistry.methods.getSecurityTokenData(t).call(); - return {tokenData: tokenData, address: t}; - })); - let options = tokenDataArray.map(function (t) { - return `${t.tokenData[0]} - Deployed at ${t.address}`; - }); - - let index = readlineSync.keyInSelect(options, 'Select a token:', {cancel: 'Exit'}); - if (index != -1) { - result = tokenDataArray[index][0]; - } else { - process.exit(); - } - } - - return result; -} - function selectExistingSTO(stoModules, showPaused) { let filteredModules = stoModules; if (!showPaused) { @@ -886,6 +833,58 @@ function welcome() { console.log("Issuer Account: " + Issuer.address + "\n"); } +async function setup(){ + try { + let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); + let securityTokenRegistryABI = abis.securityTokenRegistry(); + securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); + securityTokenRegistry.setProvider(web3.currentProvider); + + let polytokenAddress = await contracts.polyToken(); + let polytokenABI = abis.polyToken(); + polyToken = new web3.eth.Contract(polytokenABI, polytokenAddress); + polyToken.setProvider(web3.currentProvider); + + //TODO: Use proper DAI token here + let usdTokenAddress = await contracts.usdToken(); + usdToken = new web3.eth.Contract(polytokenABI, usdTokenAddress); + usdToken.setProvider(web3.currentProvider); + } catch (err) { + console.log(err) + console.log('\x1b[31m%s\x1b[0m',"There was a problem getting the contracts. Make sure they are deployed to the selected network."); + process.exit(0); + } +} + +async function selectToken() { + let result = null; + + let userTokens = await securityTokenRegistry.methods.getTokensByOwner(Issuer.address).call(); + let tokenDataArray = await Promise.all(userTokens.map(async function (t) { + let tokenData = await securityTokenRegistry.methods.getSecurityTokenData(t).call(); + return {symbol: tokenData[0], address: t}; + })); + let options = tokenDataArray.map(function (t) { + return `${t.symbol} - Deployed at ${t.address}`; + }); + options.push('Enter token symbol manually'); + + let index = readlineSync.keyInSelect(options, 'Select a token:', {cancel: 'Exit'}); + switch (options[index]) { + case 'Enter token symbol manually': + result = readlineSync.question('Enter the token symbol: '); + break; + case 'Exit': + process.exit(); + break; + default: + result = tokenDataArray[index].symbol; + break; + } + + return result; +} + module.exports = { executeApp: async function(_tokenSymbol) { await initialize(_tokenSymbol); diff --git a/CLI/commands/token_manager.js b/CLI/commands/token_manager.js index 5c9d7fd6c..47361cb12 100644 --- a/CLI/commands/token_manager.js +++ b/CLI/commands/token_manager.js @@ -1,8 +1,9 @@ // Libraries for terminal prompts const readlineSync = require('readline-sync'); const chalk = require('chalk'); -var whitelist = require('./whitelist'); -var multimint = require('./multi_mint'); +const whitelist = require('./whitelist'); +const multimint = require('./multi_mint'); +const stoManager = require('./sto_manager'); const common = require('./common/common_functions'); const gbl = require('./common/global'); @@ -16,6 +17,7 @@ let featureRegistry; let securityToken; let allModules; +let tokenSymbol async function setup() { try { @@ -42,54 +44,14 @@ async function setup() { // Start function async function executeApp() { - common.logAsciiBull(); - console.log(`*****************************************`); - console.log(`Welcome to the Command-Line Token Manager`); - console.log(`*****************************************`); - console.log("The following script will allow you to manage your ST-20 tokens"); - console.log("Issuer Account: " + Issuer.address + "\n"); - - await setup(); - await showUserInfo(Issuer.address); - - securityToken = await selectToken(); - while (securityToken) { - allModules = await getAllModules(); - await displayTokenData(); - await displayModules(); - await selectAction(); - } -}; - -async function selectToken() { - let stAddress; - let userTokens = await securityTokenRegistry.methods.getTokensByOwner(Issuer.address).call(); - if (userTokens.length == 0) { - console.log(chalk.red(`You have not issued any Security Token yet!`)); - process.exit(0); - } else if (userTokens.length == 1) { - console.log(chalk.yellow(`You have only one token. It will be selected automatically.`)); - stAddress = userTokens[0]; - } else { - let options = await Promise.all(userTokens.map(async function (t) { - let tokenData = await securityTokenRegistry.methods.getSecurityTokenData(t).call(); - return `${tokenData[0]} - Deployed at ${t}`; - })); - - let index = readlineSync.keyInSelect(options, 'Select a token:', {cancel: 'Exit'}); - if (index == -1) { - process.exit(0); - } else { - stAddress = userTokens[index]; - } + await showUserInfo(Issuer.address); + while (securityToken) { + allModules = await getAllModules(); + await displayTokenData(); + await displayModules(); + await selectAction(); } - - let securityTokenABI = abis.securityToken(); - let securityToken = new web3.eth.Contract(securityTokenABI, stAddress); - - return securityToken; -} +}; async function displayTokenData() { let displayTokenSymbol = await securityToken.methods.symbol().call(); @@ -374,8 +336,6 @@ async function mintToSingleAddress(_investor, _amount) { } async function multi_mint_tokens() { - let tokenSymbol = await securityToken.methods.symbol().call(); - await whitelist.executeApp(tokenSymbol, 75); console.log(chalk.green(`\nCongratulations! All the affiliates get succssfully whitelisted, Now its time to Mint the tokens\n`)); console.log(chalk.red(`WARNING: `) + `Please make sure all the addresses that get whitelisted are only eligible to hold or get Security token\n`); @@ -449,17 +409,44 @@ async function listModuleOptions() { // Modules a actions async function addModule() { - console.log(chalk.red(` + let options = ['Permission Manager', 'Transfer Manager', 'Security Token Offering', 'Dividends', 'Burn']; + let index = readlineSync.keyInSelect(options, 'What type of module whould you like to add?', {cancel: 'Return'}); + switch (options[index]) { + case 'Permission Manager': + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************`)); + break; + case 'Transfer Manager': + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************`)); + break; + case 'Security Token Offering': + await stoManager.addSTOModule(tokenSymbol) + break; + case 'Dividends': + console.log(chalk.red(` ********************************* This option is not yet available. *********************************`)); + break; + case 'Burn': + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************`)); + break; + } } async function pauseModule(modules) { let options = modules.map(m => `${m.name} (${m.address})`); let index = readlineSync.keyInSelect(options, 'Which module whould you like to pause?'); if (index != -1) { - console.log("\nSelected: ",options[index]); + console.log("\nSelected:",options[index]); let moduleABI; if (modules[index].type == gbl.constants.MODULES_TYPES.STO) { moduleABI = abis.ISTO(); @@ -594,8 +581,65 @@ async function getAllModules() { return modules; } +async function initialize(_tokenSymbol) { + welcome(); + await setup(); + if (typeof _tokenSymbol === 'undefined') { + tokenSymbol = await selectToken(); + } else { + tokenSymbol = _tokenSymbol; + } + let securityTokenAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call(); + if (securityTokenAddress == '0x0000000000000000000000000000000000000000') { + console.log(chalk.red(`Selected Security Token ${tokenSymbol} does not exist.`)); + process.exit(0); + } + let securityTokenABI = abis.securityToken(); + securityToken = new web3.eth.Contract(securityTokenABI, securityTokenAddress); + securityToken.setProvider(web3.currentProvider); +} + +function welcome() { + common.logAsciiBull(); + console.log(`*****************************************`); + console.log(`Welcome to the Command-Line Token Manager`); + console.log(`*****************************************`); + console.log("The following script will allow you to manage your ST-20 tokens"); + console.log("Issuer Account: " + Issuer.address + "\n"); +} + +async function selectToken() { + let result = null; + + let userTokens = await securityTokenRegistry.methods.getTokensByOwner(Issuer.address).call(); + let tokenDataArray = await Promise.all(userTokens.map(async function (t) { + let tokenData = await securityTokenRegistry.methods.getSecurityTokenData(t).call(); + return {symbol: tokenData[0], address: t}; + })); + let options = tokenDataArray.map(function (t) { + return `${t.symbol} - Deployed at ${t.address}`; + }); + options.push('Enter token symbol manually'); + + let index = readlineSync.keyInSelect(options, 'Select a token:', {cancel: 'Exit'}); + switch (options[index]) { + case 'Enter token symbol manually': + result = readlineSync.question('Enter the token symbol: '); + break; + case 'Exit': + process.exit(); + break; + default: + result = tokenDataArray[index].symbol; + break; + } + + return result; +} + module.exports = { - executeApp: async function() { - return executeApp(); - } + executeApp: async function(_tokenSymbol) { + await initialize(_tokenSymbol) + return executeApp(); + } } diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index cbe38921b..c15d62c41 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -42,9 +42,9 @@ program program .command('sto_manager') + .alias('sto') .option('-t, --securityToken ', 'Selects a ST to manage modules') .option('-l, --launch ', 'Uses configuration file to configure and launch a STO') - .alias('sto') .description('Wizard-like script that will guide technical users in the creation of an STO') .action(async function(cmd) { await gbl.initialize(program.remoteNode); @@ -77,10 +77,11 @@ program program .command('token_manager') .alias('stm') + .option('-t, --securityToken ', 'Selects a ST to manage') .description('Manage your Security Tokens, mint tokens, add modules and change config') - .action(async function() { + .action(async function(cmd) { await gbl.initialize(program.remoteNode); - await token_manager.executeApp(); + await token_manager.executeApp(cmd.securityToken); }); program From 752a5e67a2bf8ea069e894f076c5dbc299b893b7 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 23 Nov 2018 19:59:10 +0530 Subject: [PATCH 080/139] Skip emiting event when no tokens purchased --- contracts/modules/STO/USDTieredSTO.sol | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index 464cb7948..92a3157df 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -618,7 +618,10 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { tierData.mintedTotal = tierData.mintedTotal.add(tierPurchasedTokens); } // Now, if there is any remaining USD to be invested, purchase at non-discounted rate - if ((investedUSD > 0) && (tierData.tokenTotal.sub(tierData.mintedTotal) > 0)) { + if (investedUSD > 0 && + tierData.tokenTotal.sub(tierData.mintedTotal) > 0 && + tierData.tokensDiscountPoly == tierData.mintedDiscountPoly + ) { (tierSpentUSD, tierPurchasedTokens, gotoNextTier) = _purchaseTier(_beneficiary, tierData.rate, tierData.tokenTotal.sub(tierData.mintedTotal), investedUSD, _tier); spentUSD = spentUSD.add(tierSpentUSD); tierData.minted[uint8(_fundRaiseType)] = tierData.minted[uint8(_fundRaiseType)].add(tierPurchasedTokens); @@ -650,7 +653,10 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { _investedUSD = _investedUSD.sub(spentUSD); } // Now, if there is any remaining USD to be invested, purchase at non-discounted rate - if ((_investedUSD > 0) && (tierData.tokenTotal.sub(tierData.mintedTotal.add(tokensMinted)) > 0)) { + if (_investedUSD > 0 && + tierData.tokenTotal.sub(tierData.mintedTotal.add(tokensMinted)) > 0 && + tierData.tokensDiscountPoly == tierData.mintedDiscountPoly + ) { (tierSpentUSD, tierPurchasedTokens, gotoNextTier) = _purchaseTierAmount(tierData.rate, tierData.tokenTotal.sub(tierData.mintedTotal), _investedUSD); spentUSD = spentUSD.add(tierSpentUSD); tokensMinted = tokensMinted.add(tierPurchasedTokens); @@ -668,8 +674,10 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { returns(uint256 spentUSD, uint256 purchasedTokens, bool gotoNextTier) { (spentUSD, purchasedTokens, gotoNextTier) = _purchaseTierAmount(_tierPrice, _tierRemaining, _investedUSD); - require(ISecurityToken(securityToken).mint(_beneficiary, purchasedTokens), "Error in minting"); - emit TokenPurchase(msg.sender, _beneficiary, purchasedTokens, spentUSD, _tierPrice, _tier); + if (purchasedTokens > 0) { + require(ISecurityToken(securityToken).mint(_beneficiary, purchasedTokens), "Error in minting"); + emit TokenPurchase(msg.sender, _beneficiary, purchasedTokens, spentUSD, _tierPrice, _tier); + } } function _purchaseTierAmount( From 401156bbee0d036f9dd40da2309b3a9b0a1771c4 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 23 Nov 2018 20:05:26 +0530 Subject: [PATCH 081/139] typo fix --- contracts/modules/STO/USDTieredSTO.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/modules/STO/USDTieredSTO.sol b/contracts/modules/STO/USDTieredSTO.sol index 92a3157df..baba70472 100644 --- a/contracts/modules/STO/USDTieredSTO.sol +++ b/contracts/modules/STO/USDTieredSTO.sol @@ -620,7 +620,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { // Now, if there is any remaining USD to be invested, purchase at non-discounted rate if (investedUSD > 0 && tierData.tokenTotal.sub(tierData.mintedTotal) > 0 && - tierData.tokensDiscountPoly == tierData.mintedDiscountPoly + (_fundRaiseType != FundRaiseType.POLY || tierData.tokensDiscountPoly <= tierData.mintedDiscountPoly) ) { (tierSpentUSD, tierPurchasedTokens, gotoNextTier) = _purchaseTier(_beneficiary, tierData.rate, tierData.tokenTotal.sub(tierData.mintedTotal), investedUSD, _tier); spentUSD = spentUSD.add(tierSpentUSD); @@ -655,7 +655,7 @@ contract USDTieredSTO is ISTO, ReentrancyGuard { // Now, if there is any remaining USD to be invested, purchase at non-discounted rate if (_investedUSD > 0 && tierData.tokenTotal.sub(tierData.mintedTotal.add(tokensMinted)) > 0 && - tierData.tokensDiscountPoly == tierData.mintedDiscountPoly + (_fundRaiseType != FundRaiseType.POLY || tierData.tokensDiscountPoly <= tierData.mintedDiscountPoly) ) { (tierSpentUSD, tierPurchasedTokens, gotoNextTier) = _purchaseTierAmount(tierData.rate, tierData.tokenTotal.sub(tierData.mintedTotal), _investedUSD); spentUSD = spentUSD.add(tierSpentUSD); From b40a44989a77b2c702d230a5a37eaaa50bfd5547 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Fri, 23 Nov 2018 16:23:11 -0300 Subject: [PATCH 082/139] dev-2.1.0 changes --- CLI/commands/transfer_manager.js | 46 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index c2b299d93..2103304c2 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -117,7 +117,7 @@ async function start_explorer() { let isTranferVerified = await securityToken.methods.verifyTransfer(Issuer.address, transferTo, web3.utils.toWei(transferAmount), web3.utils.fromAscii("")).call(); if (isTranferVerified) { let transferAction = securityToken.methods.transfer(transferTo, web3.utils.toWei(transferAmount)); - let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice); + let receipt = await common.sendTransaction(transferAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'Transfer'); console.log(chalk.green(`${event.from} transferred ${web3.utils.fromWei(event.value)} ${tokenSymbol} to ${event.to} successfully!`)); console.log(`Balance of ${Issuer.address} after transfer: ${web3.utils.fromWei(await securityToken.methods.balanceOf(Issuer.address).call())} ${tokenSymbol}`); @@ -157,7 +157,7 @@ async function forcedTransfers() { case 'Disable controller': if (readlineSync.keyInYNStrict()) { let disableControllerAction = securityToken.methods.disableController(); - await common.sendTransaction(Issuer, disableControllerAction, defaultGasPrice); + await common.sendTransaction(disableControllerAction); console.log(chalk.green(`Forced transfers have been disabled permanently`)); } break; @@ -171,7 +171,7 @@ async function forcedTransfers() { }); let rollerAction = securityToken.methods.setController(controllerAddress); - let setControllerReceipt = await common.sendTransaction(Issuer, setControllerAction, defaultGasPrice); + let setControllerReceipt = await common.sendTransaction(setControllerAction); let setControllerEvent = common.getEventFromLogs(securityToken._jsonInterface, setControllerReceipt.logs, 'SetController'); console.log(chalk.green(`New controller is ${setControllerEvent._newController}`)); break; @@ -201,7 +201,7 @@ async function forcedTransfers() { let data = readlineSync.question('Enter the data to indicate validation: '); let log = readlineSync.question('Enter the data attached to the transfer by controller to emit in event: '); let forceTransferAction = securityToken.methods.forceTransfer(from, to, web3.utils.toWei(amount), web3.utils.asciiToHex(data), web3.utils.asciiToHex(log)); - let forceTransferReceipt = await common.sendTransaction(Issuer, forceTransferAction, defaultGasPrice, 0, 1.5); + let forceTransferReceipt = await common.sendTransaction(forceTransferAction, { factor: 1.5 }); let forceTransferEvent = common.getEventFromLogs(securityToken._jsonInterface, forceTransferReceipt.logs, 'ForceTransfer'); console.log(chalk.green(` ${forceTransferEvent._controller} has successfully forced a transfer of ${web3.utils.fromWei(forceTransferEvent._value)} ${tokenSymbol} from ${forceTransferEvent._from} to ${forceTransferEvent._to} @@ -345,7 +345,7 @@ async function addTransferManagerModule() { } let selectedTMFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.TRANSFER, options[index]); let addModuleAction = securityToken.methods.addModule(selectedTMFactoryAddress, bytes, 0, 0); - let receipt = await common.sendTransaction(Issuer, addModuleAction, defaultGasPrice); + let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); console.log(`Module deployed at address: ${event._module}`); } @@ -410,7 +410,7 @@ async function generalTransferManager() { let expiryTime = readlineSync.questionInt('Enter the time till investors KYC will be validated (after that investor need to do re-KYC): '); let canBuyFromSTO = readlineSync.keyInYNStrict('Is the investor a restricted investor?'); let modifyWhitelistAction = currentTransferManager.methods.modifyWhitelist(investor, fromTime, toTime, expiryTime, canBuyFromSTO); - let modifyWhitelistReceipt = await common.sendTransaction(Issuer, modifyWhitelistAction, defaultGasPrice); + let modifyWhitelistReceipt = await common.sendTransaction(modifyWhitelistAction); let modifyWhitelistEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, modifyWhitelistReceipt.logs, 'ModifyWhitelist'); console.log(chalk.green(`${modifyWhitelistEvent._investor} has been whitelisted sucessfully!`)); break; @@ -449,7 +449,7 @@ async function generalTransferManager() { limitMessage: "Must be a valid address" }); let changeIssuanceAddressAction = currentTransferManager.methods.changeIssuanceAddress(issuanceAddress); - let changeIssuanceAddressReceipt = await common.sendTransaction(Issuer, changeIssuanceAddressAction, defaultGasPrice); + let changeIssuanceAddressReceipt = await common.sendTransaction(changeIssuanceAddressAction); let changeIssuanceAddressEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeIssuanceAddressReceipt.logs, 'ChangeIssuanceAddress'); console.log(chalk.green(`${changeIssuanceAddressEvent._issuanceAddress} is the new address for the issuance!`)); break; @@ -461,14 +461,14 @@ async function generalTransferManager() { limitMessage: "Must be a valid address" }); let changeSigningAddressAction = currentTransferManager.methods.changeSigningAddress(signingAddress); - let changeSigningAddressReceipt = await common.sendTransaction(Issuer, changeSigningAddressAction, defaultGasPrice); + let changeSigningAddressReceipt = await common.sendTransaction(changeSigningAddressAction); let changeSigningAddressEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeSigningAddressReceipt.logs, 'ChangeSigningAddress'); console.log(chalk.green(`${changeSigningAddressEvent._signingAddress} is the new address for the signing!`)); break; case 'Allow all transfers': case 'Disallow all transfers': let changeAllowAllTransfersAction = currentTransferManager.methods.changeAllowAllTransfers(!displayAllowAllTransfers); - let changeAllowAllTransfersReceipt = await common.sendTransaction(Issuer, changeAllowAllTransfersAction, defaultGasPrice); + let changeAllowAllTransfersReceipt = await common.sendTransaction(changeAllowAllTransfersAction); let changeAllowAllTransfersEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeAllowAllTransfersReceipt.logs, 'AllowAllTransfers'); if (changeAllowAllTransfersEvent._allowAllTransfers) { console.log(chalk.green(`All transfers are allowed!`)); @@ -479,7 +479,7 @@ async function generalTransferManager() { case 'Allow all whitelist transfers': case 'Disallow all whitelist transfers': let changeAllowAllWhitelistTransfersAction = currentTransferManager.methods.changeAllowAllWhitelistTransfers(!displayAllowAllWhitelistTransfers); - let changeAllowAllWhitelistTransfersReceipt = await common.sendTransaction(Issuer, changeAllowAllWhitelistTransfersAction, defaultGasPrice); + let changeAllowAllWhitelistTransfersReceipt = await common.sendTransaction(changeAllowAllWhitelistTransfersAction); let changeAllowAllWhitelistTransfersEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeAllowAllWhitelistTransfersReceipt.logs, 'AllowAllWhitelistTransfers'); if (changeAllowAllWhitelistTransfersEvent._allowAllWhitelistTransfers) { console.log(chalk.green(`Time locks from whitelist are ignored for transfers!`)); @@ -490,7 +490,7 @@ async function generalTransferManager() { case 'Allow all whitelist issuances': case 'Disallow all whitelist issuances': let changeAllowAllWhitelistIssuancesAction = currentTransferManager.methods.changeAllowAllWhitelistIssuances(!displayAllowAllWhitelistIssuances); - let changeAllowAllWhitelistIssuancesReceipt = await common.sendTransaction(Issuer, changeAllowAllWhitelistIssuancesAction, defaultGasPrice); + let changeAllowAllWhitelistIssuancesReceipt = await common.sendTransaction(changeAllowAllWhitelistIssuancesAction); let changeAllowAllWhitelistIssuancesEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeAllowAllWhitelistIssuancesReceipt.logs, 'AllowAllWhitelistIssuances'); if (changeAllowAllWhitelistIssuancesEvent._allowAllWhitelistIssuances) { console.log(chalk.green(`Time locks from whitelist are ignored for issuances!`)); @@ -501,7 +501,7 @@ async function generalTransferManager() { case 'Allow all burn transfers': case 'Disallow all burn transfers': let changeAllowAllBurnTransfersAction = currentTransferManager.methods.changeAllowAllBurnTransfers(!displayAllowAllBurnTransfers); - let changeAllowAllBurnTransfersReceipt = await common.sendTransaction(Issuer, changeAllowAllBurnTransfersAction, defaultGasPrice); + let changeAllowAllBurnTransfersReceipt = await common.sendTransaction(changeAllowAllBurnTransfersAction); let changeAllowAllBurnTransfersEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeAllowAllBurnTransfersReceipt.logs, 'AllowAllBurnTransfers'); if (changeAllowAllBurnTransfersEvent._allowAllWhitelistTransfers) { console.log(chalk.green(`To burn tokens is allowed!`)); @@ -553,7 +553,7 @@ async function singleTradeVolumeRestrictionTM() { case 'Allow primary issuance': case 'Disallow primary issuance': let disallowPrimaryIssuanceAction = currentTransferManager.methods.setAllowPrimaryIssuance(!displayAllowPrimaryIssuance); - await common.sendTransaction(Issuer, disallowPrimaryIssuanceAction, defaultGasPrice); + await common.sendTransaction(disallowPrimaryIssuanceAction); break; case 'Add exempted wallet': let walletToExempt = readlineSync.question('Enter the wallet to exempt: ', { @@ -563,7 +563,7 @@ async function singleTradeVolumeRestrictionTM() { limitMessage: "Must be a valid address" }); let addExemptWalletAction = currentTransferManager.methods.addExemptWallet(walletToExempt); - let addExemptWalletReceipt = await common.sendTransaction(Issuer, addExemptWalletAction, defaultGasPrice); + let addExemptWalletReceipt = await common.sendTransaction(addExemptWalletAction); let addExemptWalletEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, addExemptWalletReceipt.logs, 'ExemptWalletAdded'); console.log(chalk.green(`${addExemptWalletEvent._wallet} has been exempted sucessfully!`)); break; @@ -575,7 +575,7 @@ async function singleTradeVolumeRestrictionTM() { limitMessage: "Must be a valid address" }); let removeExemptWalletAction = currentTransferManager.methods.removeExemptWallet(exemptedWallet); - let removeExemptWalletReceipt = await common.sendTransaction(Issuer, removeExemptWalletAction, defaultGasPrice); + let removeExemptWalletReceipt = await common.sendTransaction(removeExemptWalletAction); let removeExemptWalletEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, removeExemptWalletReceipt.logs, 'ExemptWalletRemoved'); console.log(chalk.green(`${removeExemptWalletEvent._wallet} has been removed from exempt wallets sucessfully!`)); break; @@ -587,7 +587,7 @@ async function singleTradeVolumeRestrictionTM() { limitMessage: "Must be greater than zero" })); let changeTransferLimitToTokensAction = currentTransferManager.methods.changeTransferLimitToTokens(newDefaultLimitInTokens); - let changeTransferLimitToTokensReceipt = await common.sendTransaction(Issuer, changeTransferLimitToTokensAction, defaultGasPrice); + let changeTransferLimitToTokensReceipt = await common.sendTransaction(changeTransferLimitToTokensAction); let changeTransferLimitToTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeTransferLimitToTokensReceipt.logs, 'GlobalTransferLimitInTokensSet'); console.log(chalk.green(`Transfer limit has been set to tokens sucessfully!`)); console.log(chalk.green(`The default transfer limit is ${web3.utils.fromWei(changeTransferLimitToTokensEvent._amount)} ${tokenSymbol}`)); @@ -600,7 +600,7 @@ async function singleTradeVolumeRestrictionTM() { limitMessage: "Must be greater than 0 and less than 100" })); let changeTransferLimitToPercentageAction = currentTransferManager.methods.changeTransferLimitToPercentage(newDefaultLimitInPercentage); - let changeTransferLimitToPercentageReceipt = await common.sendTransaction(Issuer, changeTransferLimitToPercentageAction, defaultGasPrice); + let changeTransferLimitToPercentageReceipt = await common.sendTransaction(changeTransferLimitToPercentageAction); let changeTransferLimitToPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeTransferLimitToPercentageReceipt.logs, 'GlobalTransferLimitInPercentageSet'); console.log(chalk.green(`Transfer limit has been set to tokens sucessfully!`)); console.log(chalk.green(`The default transfer limit is ${fromWeiPercentage(changeTransferLimitToPercentageEvent._percentage)} %`)); @@ -613,7 +613,7 @@ async function singleTradeVolumeRestrictionTM() { limitMessage: "Must be greater than 0 and less than 100" })); let changeGlobalLimitInPercentageAction = currentTransferManager.methods.changeGlobalLimitInPercentage(defaultLimitInPercentage); - let changeGlobalLimitInPercentageReceipt = await common.sendTransaction(Issuer, changeGlobalLimitInPercentageAction, defaultGasPrice); + let changeGlobalLimitInPercentageReceipt = await common.sendTransaction(changeGlobalLimitInPercentageAction); let changeGlobalLimitInPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeGlobalLimitInPercentageReceipt.logs, 'GlobalTransferLimitInPercentageSet'); console.log(chalk.green(`The default transfer limit is ${fromWeiPercentage(changeGlobalLimitInPercentageEvent._percentage)} %`)); break; @@ -625,7 +625,7 @@ async function singleTradeVolumeRestrictionTM() { limitMessage: "Must be greater than zero" })); let changeGlobalLimitInTokensAction = currentTransferManager.methods.changeGlobalLimitInTokens(defaultLimitInTokens); - let changeGlobalLimitInTokensReceipt = await common.sendTransaction(Issuer, changeGlobalLimitInTokensAction, defaultGasPrice); + let changeGlobalLimitInTokensReceipt = await common.sendTransaction(changeGlobalLimitInTokensAction); let changeGlobalLimitInTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeGlobalLimitInTokensReceipt.logs, 'GlobalTransferLimitInTokensSet'); console.log(chalk.green(`The default transfer limit is ${web3.utils.fromWei(changeGlobalLimitInTokensEvent._amount)} ${tokenSymbol}`)); break; @@ -643,7 +643,7 @@ async function singleTradeVolumeRestrictionTM() { limitMessage: "Must be greater than 0 and less than 100" })); let setTransferLimitInPercentageAction = currentTransferManager.methods.setTransferLimitInPercentage(percentageAccount, accountLimitInPercentage); - let setTransferLimitInPercentageReceipt = await common.sendTransaction(Issuer, setTransferLimitInPercentageAction, defaultGasPrice); + let setTransferLimitInPercentageReceipt = await common.sendTransaction(setTransferLimitInPercentageAction); let setTransferLimitInPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, setTransferLimitInPercentageReceipt.logs, 'TransferLimitInPercentageSet'); console.log(chalk.green(`The transfer limit for ${setTransferLimitInPercentageEvent._wallet} is ${fromWeiPercentage(setTransferLimitInPercentageEvent._percentage)} %`)); break; @@ -661,7 +661,7 @@ async function singleTradeVolumeRestrictionTM() { limitMessage: "Must be greater than zero" })); let setTransferLimitInTokensAction = currentTransferManager.methods.setTransferLimitInTokens(tokensAccount, accountLimitInTokens); - let setTransferLimitInTokensReceipt = await common.sendTransaction(Issuer, setTransferLimitInTokensAction, defaultGasPrice); + let setTransferLimitInTokensReceipt = await common.sendTransaction(setTransferLimitInTokensAction); let setTransferLimitInTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, setTransferLimitInTokensReceipt.logs, 'TransferLimitInTokensSet'); console.log(chalk.green(`The transfer limit for ${setTransferLimitInTokensEvent._wallet} is ${web3.utils.fromWei(setTransferLimitInTokensEvent._amount)} ${tokenSymbol}`)); break; @@ -673,7 +673,7 @@ async function singleTradeVolumeRestrictionTM() { limitMessage: "Must be a valid address" }); let removeTransferLimitInPercentageAction = currentTransferManager.methods.removeTransferLimitInPercentage(percentageAccountToRemove); - let removeTransferLimitInPercentageReceipt = await common.sendTransaction(Issuer, removeTransferLimitInPercentageAction, defaultGasPrice); + let removeTransferLimitInPercentageReceipt = await common.sendTransaction(removeTransferLimitInPercentageAction); let removeTransferLimitInPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, removeTransferLimitInPercentageReceipt.logs, 'TransferLimitInPercentageRemoved'); console.log(chalk.green(`The transfer limit for ${removeTransferLimitInPercentageEvent._wallet} is the default limit`)); break; @@ -685,7 +685,7 @@ async function singleTradeVolumeRestrictionTM() { limitMessage: "Must be a valid address" }); let removeTransferLimitInTokensAction = currentTransferManager.methods.removeTransferLimitInTokens(tokensAccountToRemove); - let removeTransferLimitInTokensReceipt = await common.sendTransaction(Issuer, removeTransferLimitInTokensAction, defaultGasPrice); + let removeTransferLimitInTokensReceipt = await common.sendTransaction(removeTransferLimitInTokensAction); let removeTransferLimitInTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, removeTransferLimitInTokensReceipt.logs, 'TransferLimitInTokensRemoved'); console.log(chalk.green(`The transfer limit for ${removeTransferLimitInTokensEvent._wallet} is the default limit`)); break; From 3da80db4f065e7c0fc6f7fd3af2ffc32da33f2d4 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Fri, 23 Nov 2018 17:47:12 -0300 Subject: [PATCH 083/139] General fixes --- CLI/commands/transfer_manager.js | 214 +++++++++++++++++++------------ 1 file changed, 135 insertions(+), 79 deletions(-) diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 2103304c2..c4147b073 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -3,6 +3,7 @@ var chalk = require('chalk'); var common = require('./common/common_functions'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); +var gbl = require('./common/global'); // App flow let tokenSymbol; @@ -12,68 +13,31 @@ let network; let currentTransferManager; async function executeApp() { - common.logAsciiBull(); - console.log("*********************************************"); - console.log("Welcome to the Command-Line Transfer Manager."); - console.log("*********************************************"); - console.log("Issuer Account: " + Issuer.address + "\n"); - - await setup(); - try { - await start_explorer(); - } catch (err) { - console.log(err); - return; - } -}; - -async function setup(){ - try { - let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); - let securityTokenRegistryABI = abis.securityTokenRegistry(); - securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); - securityTokenRegistry.setProvider(web3.currentProvider); - } catch (err) { - console.log(err) - console.log('\x1b[31m%s\x1b[0m',"There was a problem getting the contracts. Make sure they are deployed to the selected network."); - process.exit(0); - } -} - -async function start_explorer() { - console.log('\n\x1b[34m%s\x1b[0m',"Transfer Manager - Main Menu"); - - if (!tokenSymbol) - tokenSymbol = readlineSync.question('Enter the token symbol: '); - - let result = await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call(); - if (result == "0x0000000000000000000000000000000000000000") { - tokenSymbol = undefined; - console.log(chalk.red(`Token symbol provided is not a registered Security Token.`)); - } else { - let securityTokenABI = abis.securityToken(); - securityToken = new web3.eth.Contract(securityTokenABI,result); + let exit = false; + while (!exit) { + console.log('\n', chalk.blue('Transfer Manager - Main Menu', '\n')); - let tmModules = []; - let tmModuleAddresses = await securityToken.methods.getModulesByType(MODULES_TYPES.TRANSFER).call(); - for (const address of tmModuleAddresses) { - tmModules.push(await securityToken.methods.getModule(address).call()); + let tmModules = await getAllModulesByType(gbl.constants.MODULES_TYPES.TRANSFER); + let nonArchivedModules = tmModules.filter(m => !m.archived); + if (nonArchivedModules.length > 0) { + console.log(`Transfer Manager modules attached:`); + nonArchivedModules.map(m => console.log(`- ${m.name} at ${m.address}`)) + } else { + console.log(`There are no Transfer Manager modules attached`); } - // Show non-archived attached TM modules - console.log(); - console.log(`Transfer Manager modules attached:`); - tmModules.filter(m => m[3] == false).map(m => console.log(` - ${web3.utils.hexToAscii(m[0])} at ${m[1]}`)) - let options = ['Verify transfer', 'Transfer']; let forcedTransferDisabled = await securityToken.methods.controllerDisabled().call(); if (!forcedTransferDisabled) { options.push('Forced transfers'); } - options.push('Config existing modules', 'Add new Transfer Manager module'); + if (nonArchivedModules.length > 0) { + options.push('Config existing modules'); + } + options.push('Add new Transfer Manager module'); - let index = readlineSync.keyInSelect(options, 'Choose one:'); - let optionSelected = index != -1 ? options[index] : 'Cancel'; + let index = readlineSync.keyInSelect(options, 'What do you want to do?', {cancel: 'Exit'}); + let optionSelected = index != -1 ? options[index] : 'Exit'; console.log('Selected:', optionSelected, '\n'); switch (optionSelected) { case 'Verify transfer': @@ -130,18 +94,16 @@ async function start_explorer() { await forcedTransfers(); break; case 'Config existing modules': - await configExistingModules(tmModules); + await configExistingModules(nonArchivedModules); break; case 'Add new Transfer Manager module': await addTransferManagerModule(); break; - case 'Cancel': - process.exit(0); + case 'Exit': + exit = true; + break } } - - //Restart - await start_explorer(); } async function forcedTransfers() { @@ -150,9 +112,9 @@ async function forcedTransfers() { if (controller == Issuer.address) { options.push('Force Transfer'); } - let index = readlineSync.keyInSelect(options, 'What do you want to do?'); - let optionSelected = options[index]; - console.log('Selected:', index != -1 ? optionSelected : 'Cancel', '\n'); + let index = readlineSync.keyInSelect(options, 'What do you want to do?', {cancel: 'Return'}); + let optionSelected = index != -1 ? options[index] : 'Return'; + console.log('Selected:', optionSelected, '\n'); switch (optionSelected) { case 'Disable controller': if (readlineSync.keyInYNStrict()) { @@ -169,8 +131,7 @@ async function forcedTransfers() { limitMessage: "Must be a valid address", defaultInput: Issuer.address }); - let - rollerAction = securityToken.methods.setController(controllerAddress); + let setControllerAction = securityToken.methods.setController(controllerAddress); let setControllerReceipt = await common.sendTransaction(setControllerAction); let setControllerEvent = common.getEventFromLogs(securityToken._jsonInterface, setControllerReceipt.logs, 'SetController'); console.log(chalk.green(`New controller is ${setControllerEvent._newController}`)); @@ -215,16 +176,14 @@ async function forcedTransfers() { } async function configExistingModules(tmModules) { - let nonArchivedModules = tmModules.filter(m => m[3] == false); - - let options = nonArchivedModules.map(m => `${web3.utils.hexToAscii(m[0])} at ${m[1]}`); - let index = readlineSync.keyInSelect(options, 'Which module do you want to config? '); - console.log('Selected:', index != -1 ? options[index] : 'Cancel', '\n'); - let moduleNameSelected = web3.utils.hexToUtf8(nonArchivedModules[index][0]); + let options = tmModules.map(m => `${m.name} at ${m.address}`); + let index = readlineSync.keyInSelect(options, 'Which module do you want to config? ', {cancel: 'Return'}); + console.log('Selected:', index != -1 ? options[index] : 'Return', '\n'); + let moduleNameSelected = tmModules[index].name; switch (moduleNameSelected) { case 'GeneralTransferManager': - currentTransferManager = new web3.eth.Contract(abis.generalTransferManager(), nonArchivedModules[index][1]); + currentTransferManager = new web3.eth.Contract(abis.generalTransferManager(), nonArchivedModules[index].address); currentTransferManager.setProvider(web3.currentProvider); await generalTransferManager(); break; @@ -253,7 +212,7 @@ async function configExistingModules(tmModules) { )); break; case 'SingleTradeVolumeRestrictionTM': - currentTransferManager = new web3.eth.Contract(abis.singleTradeVolumeRestrictionTM(), nonArchivedModules[index][1]); + currentTransferManager = new web3.eth.Contract(abis.singleTradeVolumeRestrictionTM(), nonArchivedModules[index].address); currentTransferManager.setProvider(web3.currentProvider); await singleTradeVolumeRestrictionTM(); break; @@ -272,7 +231,7 @@ async function addTransferManagerModule() { let options = ['GeneralTransferManager', 'ManualApprovalTransferManager', 'PercentageTransferManager', 'CountTransferManager', 'SingleTradeVolumeRestrictionTM', 'LookupVolumeRestrictionTM']; - let index = readlineSync.keyInSelect(options, 'Which Transfer Manager module do you want to add? '); + let index = readlineSync.keyInSelect(options, 'Which Transfer Manager module do you want to add? ', {cancel: 'Return'}); if (index != -1 && readlineSync.keyInYNStrict(`Are you sure you want to add ${options[index]} module?`)) { let bytes; switch (options[index]) { @@ -312,7 +271,7 @@ async function addTransferManagerModule() { limit: function(input) { return parseInt(input) > 0; }, - limitMessage: "Must be greater than zero" + limitMessage: "Must be greater than 0" })); } let allowPrimaryIssuance = readlineSync.keyInYNStrict(`Do you want to allow all primary issuance transfers? `); @@ -347,13 +306,12 @@ async function addTransferManagerModule() { let addModuleAction = securityToken.methods.addModule(selectedTMFactoryAddress, bytes, 0, 0); let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); - console.log(`Module deployed at address: ${event._module}`); + console.log(chalk.green(`Module deployed at address: ${event._module}`)); } } async function generalTransferManager() { - console.log(chalk.blue(`General Transfer Manager at ${currentTransferManager.options.address}`)); - console.log(); + console.log(chalk.blue(`General Transfer Manager at ${currentTransferManager.options.address}`), '\n'); // Show current data let displayIssuanceAddress = await currentTransferManager.methods.issuanceAddress().call(); @@ -715,8 +673,106 @@ function fromWeiPercentage(number) { return web3.utils.fromWei(new web3.utils.BN(number).muln(100)); } +async function getAllModulesByType(type) { + function ModuleInfo(_moduleType, _name, _address, _factoryAddress, _archived, _paused) { + this.name = _name; + this.type = _moduleType; + this.address = _address; + this.factoryAddress = _factoryAddress; + this.archived = _archived; + this.paused = _paused; + } + + let modules = []; + + let allModules = await securityToken.methods.getModulesByType(type).call(); + + for (let i = 0; i < allModules.length; i++) { + let details = await securityToken.methods.getModule(allModules[i]).call(); + let nameTemp = web3.utils.hexToUtf8(details[0]); + let pausedTemp = null; + if (type == gbl.constants.MODULES_TYPES.STO || type == gbl.constants.MODULES_TYPES.TRANSFER) { + let abiTemp = JSON.parse(require('fs').readFileSync(`./build/contracts/${nameTemp}.json`).toString()).abi; + let contractTemp = new web3.eth.Contract(abiTemp, details[1]); + pausedTemp = await contractTemp.methods.paused().call(); + } + modules.push(new ModuleInfo(type, nameTemp, details[1], details[2], details[3], pausedTemp)); + } + + return modules; +} + +async function initialize(_tokenSymbol) { + welcome(); + await setup(); + if (typeof _tokenSymbol === 'undefined') { + tokenSymbol = await selectToken(); + } else { + tokenSymbol = _tokenSymbol; + } + let securityTokenAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call(); + if (securityTokenAddress == '0x0000000000000000000000000000000000000000') { + console.log(chalk.red(`Selected Security Token ${tokenSymbol} does not exist.`)); + process.exit(0); + } + let securityTokenABI = abis.securityToken(); + securityToken = new web3.eth.Contract(securityTokenABI, securityTokenAddress); + securityToken.setProvider(web3.currentProvider); +} + +function welcome() { + common.logAsciiBull(); + console.log("*********************************************"); + console.log("Welcome to the Command-Line Transfer Manager."); + console.log("*********************************************"); + console.log("Issuer Account: " + Issuer.address + "\n"); +} + +async function setup(){ + try { + let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); + let securityTokenRegistryABI = abis.securityTokenRegistry(); + securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress); + securityTokenRegistry.setProvider(web3.currentProvider); + } catch (err) { + console.log(err) + console.log('\x1b[31m%s\x1b[0m',"There was a problem getting the contracts. Make sure they are deployed to the selected network."); + process.exit(0); + } +} + +async function selectToken() { + let result = null; + + let userTokens = await securityTokenRegistry.methods.getTokensByOwner(Issuer.address).call(); + let tokenDataArray = await Promise.all(userTokens.map(async function (t) { + let tokenData = await securityTokenRegistry.methods.getSecurityTokenData(t).call(); + return {symbol: tokenData[0], address: t}; + })); + let options = tokenDataArray.map(function (t) { + return `${t.symbol} - Deployed at ${t.address}`; + }); + options.push('Enter token symbol manually'); + + let index = readlineSync.keyInSelect(options, 'Select a token:', {cancel: 'Exit'}); + switch (options[index]) { + case 'Enter token symbol manually': + result = readlineSync.question('Enter the token symbol: '); + break; + case 'Exit': + process.exit(); + break; + default: + result = tokenDataArray[index].symbol; + break; + } + + return result; +} + module.exports = { - executeApp: async function(type) { - return executeApp(type); + executeApp: async function(_tokenSymbol) { + await initialize(_tokenSymbol); + return executeApp(); } } \ No newline at end of file From 56261ba69db7edfde26db24db53c96d39bfea5d4 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Fri, 23 Nov 2018 18:17:06 -0300 Subject: [PATCH 084/139] Minor fixes --- CLI/commands/transfer_manager.js | 39 +++++++++++++++++++------------- CLI/polymath-cli.js | 5 ++-- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index c4147b073..8b79cf436 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -183,7 +183,7 @@ async function configExistingModules(tmModules) { switch (moduleNameSelected) { case 'GeneralTransferManager': - currentTransferManager = new web3.eth.Contract(abis.generalTransferManager(), nonArchivedModules[index].address); + currentTransferManager = new web3.eth.Contract(abis.generalTransferManager(), tmModules[index].address); currentTransferManager.setProvider(web3.currentProvider); await generalTransferManager(); break; @@ -205,17 +205,17 @@ async function configExistingModules(tmModules) { break; case 'CountTransferManager': //await countTransferManager(); + break; + case 'SingleTradeVolumeRestrictionTM': + //currentTransferManager = new web3.eth.Contract(abis.singleTradeVolumeRestrictionTM(), tmModules[index].address); + //currentTransferManager.setProvider(web3.currentProvider); + //await singleTradeVolumeRestrictionTM(); console.log(chalk.red(` ********************************* This option is not yet available. *********************************` )); break; - case 'SingleTradeVolumeRestrictionTM': - currentTransferManager = new web3.eth.Contract(abis.singleTradeVolumeRestrictionTM(), nonArchivedModules[index].address); - currentTransferManager.setProvider(web3.currentProvider); - await singleTradeVolumeRestrictionTM(); - break; case 'LookupVolumeRestrictionTM': //await lookupVolumeRestrictionTM(); console.log(chalk.red(` @@ -228,12 +228,12 @@ async function configExistingModules(tmModules) { } async function addTransferManagerModule() { - let options = ['GeneralTransferManager', 'ManualApprovalTransferManager', 'PercentageTransferManager', - 'CountTransferManager', 'SingleTradeVolumeRestrictionTM', 'LookupVolumeRestrictionTM']; + let options = ['GeneralTransferManager'/*, 'ManualApprovalTransferManager', 'PercentageTransferManager', +'CountTransferManager', 'SingleTradeVolumeRestrictionTM', 'LookupVolumeRestrictionTM'*/]; let index = readlineSync.keyInSelect(options, 'Which Transfer Manager module do you want to add? ', {cancel: 'Return'}); if (index != -1 && readlineSync.keyInYNStrict(`Are you sure you want to add ${options[index]} module?`)) { - let bytes; + let bytes = web3.utils.fromAscii('', 16); switch (options[index]) { case 'ManualApprovalTransferManager': console.log(chalk.red(` @@ -257,6 +257,7 @@ async function addTransferManagerModule() { )); break; case 'SingleTradeVolumeRestrictionTM': + /* let isTransferLimitInPercentage = !!readlineSync.keyInSelect(['In tokens', 'In percentage'], 'How do you want to set the transfer limit? ', {cancel: false}); let globalTransferLimitInPercentageOrToken; if (isTransferLimitInPercentage) { @@ -291,6 +292,12 @@ async function addTransferManagerModule() { } ] }, [isTransferLimitInPercentage, globalTransferLimitInPercentageOrToken, allowPrimaryIssuance]); + */ + console.log(chalk.red(` + ********************************* + This option is not yet available. + *********************************` + )); break; case 'LookupVolumeRestrictionTM': console.log(chalk.red(` @@ -298,11 +305,9 @@ async function addTransferManagerModule() { This option is not yet available. *********************************` )); - break; - default: - bytes = web3.utils.fromAscii('', 16); + break; } - let selectedTMFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, MODULES_TYPES.TRANSFER, options[index]); + let selectedTMFactoryAddress = await contracts.getModuleFactoryAddressByName(securityToken.options.address, gbl.constants.MODULES_TYPES.TRANSFER, options[index]); let addModuleAction = securityToken.methods.addModule(selectedTMFactoryAddress, bytes, 0, 0); let receipt = await common.sendTransaction(addModuleAction); let event = common.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded'); @@ -363,9 +368,11 @@ async function generalTransferManager() { }, limitMessage: "Must be a valid address" }); - let fromTime = readlineSync.questionInt('Enter the time (Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens: '); - let toTime = readlineSync.questionInt('Enter the time (Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others: '); - let expiryTime = readlineSync.questionInt('Enter the time till investors KYC will be validated (after that investor need to do re-KYC): '); + let now = Math.floor(Date.now() / 1000); + let fromTime = readlineSync.questionInt(`Enter the time (Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens (now = ${now}): `, {defaultInput: now}); + let toTime = readlineSync.questionInt(`Enter the time (Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others (now = ${now}): `, {defaultInput: now}); + let oneHourFromNow = Math.floor(Date.now() / 1000 + 3600); + let expiryTime = readlineSync.questionInt(`Enter the time till investors KYC will be validated (after that investor need to do re-KYC) (1 hour from now = ${oneHourFromNow}): `, {defaultInput: oneHourFromNow}); let canBuyFromSTO = readlineSync.keyInYNStrict('Is the investor a restricted investor?'); let modifyWhitelistAction = currentTransferManager.methods.modifyWhitelist(investor, fromTime, toTime, expiryTime, canBuyFromSTO); let modifyWhitelistReceipt = await common.sendTransaction(modifyWhitelistAction); diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index f2248b25a..fde89935d 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -119,10 +119,11 @@ program program .command('transfer_manager') .alias('tm') + .option('-t, --securityToken ', 'Selects a ST to manage transfer modules') .description('Runs transfer_manager') - .action(async function() { + .action(async function(cmd) { await gbl.initialize(program.remoteNode); - await transfer_manager.executeApp(); + await transfer_manager.executeApp(cmd.securityToken); }); program From 8d462aaa820008ae617f28bde43a63123b474175 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Sat, 24 Nov 2018 13:00:15 -0300 Subject: [PATCH 085/139] Revert "STRV TM added to migration script" This reverts commit d7e97bbaec22a7af6f99f5dbe6449d28fd742917. --- migrations/2_deploy_contracts.js | 51 +++++++++++--------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index 0809dcb08..694fdf03e 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -2,7 +2,6 @@ const PolymathRegistry = artifacts.require('./PolymathRegistry.sol') const GeneralTransferManagerFactory = artifacts.require('./GeneralTransferManagerFactory.sol') const GeneralPermissionManagerFactory = artifacts.require('./GeneralPermissionManagerFactory.sol') const PercentageTransferManagerFactory = artifacts.require('./PercentageTransferManagerFactory.sol') -const SingleTradeVolumeRestrictionTMFactory = artifacts.require('./SingleTradeVolumeRestrictionTMFactory.sol') const USDTieredSTOProxyFactory = artifacts.require('./USDTieredSTOProxyFactory.sol'); const CountTransferManagerFactory = artifacts.require('./CountTransferManagerFactory.sol') const EtherDividendCheckpointFactory = artifacts.require('./EtherDividendCheckpointFactory.sol') @@ -158,10 +157,6 @@ module.exports = function (deployer, network, accounts) { // D) Deploy the CountTransferManagerFactory Contract (Factory used to generate the CountTransferManager contract use // to track the counts of the investors of the security token) return deployer.deploy(CountTransferManagerFactory, PolyToken, 0, 0, 0, {from: PolymathAccount}); - }).then(() => { - // D) Deploy the SingleTradeVolumeRestrictionTMFactory Contract (Factory used to generate the SingleTradeVolumeRestrictionTM contract use - // to impose volume restriction on a single trade that the investors could do for a particular security token) - return deployer.deploy(SingleTradeVolumeRestrictionTMFactory, PolyToken, 0, 0, 0, {from: PolymathAccount}); }).then(() => { // D) Deploy the PercentageTransferManagerFactory Contract (Factory used to generate the PercentageTransferManager contract use // to track the percentage of investment the investors could do for a particular security token) @@ -201,10 +196,6 @@ module.exports = function (deployer, network, accounts) { }).then(() => { // Update all addresses into the registry contract by calling the function updateFromregistry return moduleRegistry.updateFromRegistry({from: PolymathAccount}); - }).then(() => { - // D) Register the SingleTradeVolumeRestrictionTMFactory in the ModuleRegistry to make the factory available at the protocol level. - // So any securityToken can use that factory to generate the SingleTradeVolumeRestrictionTM contract. - return moduleRegistry.registerModule(SingleTradeVolumeRestrictionTMFactory.address, {from: PolymathAccount}); }).then(() => { // D) Register the PercentageTransferManagerFactory in the ModuleRegistry to make the factory available at the protocol level. // So any securityToken can use that factory to generate the PercentageTransferManager contract. @@ -248,11 +239,6 @@ module.exports = function (deployer, network, accounts) { // contract, Factory should comes under the verified list of factories or those factories deployed by the securityToken issuers only. // Here it gets verified because it is deployed by the third party account (Polymath Account) not with the issuer accounts. return moduleRegistry.verifyModule(PercentageTransferManagerFactory.address, true, {from: PolymathAccount}); - }).then(() => { - // G) Once the SingleTradeVolumeRestrictionTMFactory registered with the ModuleRegistry contract then for making them accessble to the securityToken - // contract, Factory should comes under the verified list of factories or those factories deployed by the securityToken issuers only. - // Here it gets verified because it is deployed by the third party account (Polymath Account) not with the issuer accounts. - return moduleRegistry.verifyModule(SingleTradeVolumeRestrictionTMFactory.address, true, {from: PolymathAccount}); }).then(() => { // G) Once the GeneralPermissionManagerFactory registered with the ModuleRegistry contract then for making them accessble to the securityToken // contract, Factory should comes under the verified list of factories or those factories deployed by the securityToken issuers only. @@ -308,28 +294,27 @@ module.exports = function (deployer, network, accounts) { console.log('\n'); console.log(` ----------------------- Polymath Network Smart Contracts: ----------------------- - PolymathRegistry: ${PolymathRegistry.address} - SecurityTokenRegistry (Proxy): ${SecurityTokenRegistryProxy.address} - ModuleRegistry (Proxy): ${ModuleRegistryProxy.address} - FeatureRegistry: ${FeatureRegistry.address} + PolymathRegistry: ${PolymathRegistry.address} + SecurityTokenRegistry (Proxy): ${SecurityTokenRegistryProxy.address} + ModuleRegistry (Proxy): ${ModuleRegistryProxy.address} + FeatureRegistry: ${FeatureRegistry.address} + + ETHOracle: ${ETHOracle} + POLYOracle: ${POLYOracle} - ETHOracle: ${ETHOracle} - POLYOracle: ${POLYOracle} + STFactory: ${STFactory.address} + GeneralTransferManagerFactory: ${GeneralTransferManagerFactory.address} + GeneralPermissionManagerFactory: ${GeneralPermissionManagerFactory.address} - STFactory: ${STFactory.address} - GeneralTransferManagerFactory: ${GeneralTransferManagerFactory.address} - GeneralPermissionManagerFactory: ${GeneralPermissionManagerFactory.address} - - CappedSTOFactory: ${CappedSTOFactory.address} - USDTieredSTOFactory: ${USDTieredSTOFactory.address} - USDTieredSTOProxyFactory: ${USDTieredSTOProxyFactory.address} + CappedSTOFactory: ${CappedSTOFactory.address} + USDTieredSTOFactory: ${USDTieredSTOFactory.address} + USDTieredSTOProxyFactory: ${USDTieredSTOProxyFactory.address} - CountTransferManagerFactory: ${CountTransferManagerFactory.address} - PercentageTransferManagerFactory: ${PercentageTransferManagerFactory.address} - ManualApprovalTransferManagerFactory: ${ManualApprovalTransferManagerFactory.address} - SingleTradeVolumeRestrictionTMFactory: ${SingleTradeVolumeRestrictionTMFactory.address} - EtherDividendCheckpointFactory: ${EtherDividendCheckpointFactory.address} - ERC20DividendCheckpointFactory: ${ERC20DividendCheckpointFactory.address} + CountTransferManagerFactory: ${CountTransferManagerFactory.address} + PercentageTransferManagerFactory: ${PercentageTransferManagerFactory.address} + ManualApprovalTransferManagerFactory: ${ManualApprovalTransferManagerFactory.address} + EtherDividendCheckpointFactory: ${EtherDividendCheckpointFactory.address} + ERC20DividendCheckpointFactory: ${ERC20DividendCheckpointFactory.address} --------------------------------------------------------------------------------- `); console.log('\n'); From e8ad72317cc3270d78f7100b8064ca0df3dc5c80 Mon Sep 17 00:00:00 2001 From: Pablo Ruiz Date: Sun, 25 Nov 2018 14:33:05 -0300 Subject: [PATCH 086/139] Update CHANGELOG.md --- CHANGELOG.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c2ec5fdf..db3d8dcde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,19 +5,17 @@ All notable changes to this project will be documented in this file. [__2.1.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __13-09-18__ -## Added +# USDTieredSTO 2.0.1 * Added `buyTokensView` and `getTokensMintedByTier` to USDTSTO. * Added `getSTODetails` to USDTSTO. * Added an Array of Tiers that will hold data about every tier in USDTSTO. * Added `buyWithETHRateLimited`, `buyWithPOLYRateLimited` and `buyWithUSDRateLimited` to USDTSTO. * Added `getTokensSoldByTier` to return sold (not minted during finalisation) tokens in each tier to USDTSTO. +* Removed individual mappings for tier data removed in UDSTSTO. ##Changed * `getAllModulesAndPermsFromTypes()` does not take securityToken address as a parameter anymore. -## Removed -* Individual mappings for tier data removed in UDSTSTO. - # v1.5.0 [__1.5.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __15-08-18__ From 6e95bc68cc63714657ccfbf2d60bd0a78ddb0ac4 Mon Sep 17 00:00:00 2001 From: comeonbuddy Date: Mon, 26 Nov 2018 12:13:14 +0100 Subject: [PATCH 087/139] updated description for cappedSTO --- contracts/modules/STO/CappedSTOFactory.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/modules/STO/CappedSTOFactory.sol b/contracts/modules/STO/CappedSTOFactory.sol index 89f3311d2..3dcd0af72 100644 --- a/contracts/modules/STO/CappedSTOFactory.sol +++ b/contracts/modules/STO/CappedSTOFactory.sol @@ -19,7 +19,7 @@ contract CappedSTOFactory is ModuleFactory { version = "1.0.0"; name = "CappedSTO"; title = "Capped STO"; - description = "Use to collects the funds and once the cap is reached then investment will be no longer entertained"; + description = "This smart contract creates a maximum number of tokens (i.e. hard cap) which the total aggregate of tokens acquired by all investors cannot exceed. Security tokens are sent to the investor upon reception of the funds (ETH or POLY), and any security tokens left upon termination of the offering will not be minted."; compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); } From b8935b3d4bddde76058588c4ff6c49e2e402cc7c Mon Sep 17 00:00:00 2001 From: comeonbuddy Date: Mon, 26 Nov 2018 12:37:23 +0100 Subject: [PATCH 088/139] fix test --- test/b_capped_sto.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/b_capped_sto.js b/test/b_capped_sto.js index d89fe6eba..fce1ee5e5 100644 --- a/test/b_capped_sto.js +++ b/test/b_capped_sto.js @@ -855,7 +855,7 @@ contract("CappedSTO", accounts => { assert.equal(web3.utils.hexToString(await I_CappedSTOFactory.getName.call()), "CappedSTO", "Wrong Module added"); assert.equal( await I_CappedSTOFactory.description.call(), - "Use to collects the funds and once the cap is reached then investment will be no longer entertained", + "This smart contract creates a maximum number of tokens (i.e. hard cap) which the total aggregate of tokens acquired by all investors cannot exceed. Security tokens are sent to the investor upon reception of the funds (ETH or POLY), and any security tokens left upon termination of the offering will not be minted.", "Wrong Module added" ); assert.equal(await I_CappedSTOFactory.title.call(), "Capped STO", "Wrong Module added"); From 29dd21ce593b60577fb3173c8e59ecd7e416c734 Mon Sep 17 00:00:00 2001 From: Victor Vicente Date: Mon, 26 Nov 2018 11:17:20 -0300 Subject: [PATCH 089/139] Minor fix --- CLI/commands/ST20Generator.js | 2 +- CLI/polymath-cli.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CLI/commands/ST20Generator.js b/CLI/commands/ST20Generator.js index 727c112b4..1288fc17f 100644 --- a/CLI/commands/ST20Generator.js +++ b/CLI/commands/ST20Generator.js @@ -138,7 +138,7 @@ async function step_token_deploy(_name, _details, _divisible) { let divisibility; if (typeof _divisible !== 'undefined') { - divisibility = _divisible == 'true'; + divisibility = _divisible.toString() == 'true'; console.log(`Divisible: ${divisibility.toString()}`) } else { let divisible = readlineSync.question('Press "N" for Non-divisible type token or hit Enter for divisible type token (Default): '); diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 5ba286242..29bea752d 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -33,7 +33,7 @@ program .option('-o, --transferOwnership ', `Transfers the ticker's ownership to newOwner account. If newOwner is 'false', this step is skipped`) .option('-n, --tokenName ', 'Token name') .option('-d, --details
', 'Off-chain details of the token') - .option('-D, --divisible [div]', 'If token is divisible or not [true]', /^(true|false)/, 'true') + .option('-D, --divisible
', 'If token is divisible or not [true]', /^(true|false)/) .description('Wizard-like script that will guide technical users in the creation and deployment of an ST-20 token') .action(async function(cmd) { await gbl.initialize(program.remoteNode); From ec96190736b08c66ef964ea540f1bcaa7ab18a34 Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 26 Nov 2018 19:36:20 -0300 Subject: [PATCH 090/139] Linter fixes --- CLI/commands/transfer_manager.js | 133 ++++++++++++++++--------------- 1 file changed, 67 insertions(+), 66 deletions(-) diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 8b79cf436..6725f3529 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -16,7 +16,7 @@ async function executeApp() { let exit = false; while (!exit) { console.log('\n', chalk.blue('Transfer Manager - Main Menu', '\n')); - + let tmModules = await getAllModulesByType(gbl.constants.MODULES_TYPES.TRANSFER); let nonArchivedModules = tmModules.filter(m => !m.archived); if (nonArchivedModules.length > 0) { @@ -36,7 +36,7 @@ async function executeApp() { } options.push('Add new Transfer Manager module'); - let index = readlineSync.keyInSelect(options, 'What do you want to do?', {cancel: 'Exit'}); + let index = readlineSync.keyInSelect(options, 'What do you want to do?', { cancel: 'Exit' }); let optionSelected = index != -1 ? options[index] : 'Exit'; console.log('Selected:', optionSelected, '\n'); switch (optionSelected) { @@ -112,9 +112,9 @@ async function forcedTransfers() { if (controller == Issuer.address) { options.push('Force Transfer'); } - let index = readlineSync.keyInSelect(options, 'What do you want to do?', {cancel: 'Return'}); + let index = readlineSync.keyInSelect(options, 'What do you want to do?', { cancel: 'Return' }); let optionSelected = index != -1 ? options[index] : 'Return'; - console.log('Selected:', optionSelected, '\n'); + console.log('Selected:', optionSelected, '\n'); switch (optionSelected) { case 'Disable controller': if (readlineSync.keyInYNStrict()) { @@ -177,13 +177,13 @@ async function forcedTransfers() { async function configExistingModules(tmModules) { let options = tmModules.map(m => `${m.name} at ${m.address}`); - let index = readlineSync.keyInSelect(options, 'Which module do you want to config? ', {cancel: 'Return'}); + let index = readlineSync.keyInSelect(options, 'Which module do you want to config? ', { cancel: 'Return' }); console.log('Selected:', index != -1 ? options[index] : 'Return', '\n'); let moduleNameSelected = tmModules[index].name; - + switch (moduleNameSelected) { case 'GeneralTransferManager': - currentTransferManager = new web3.eth.Contract(abis.generalTransferManager(), tmModules[index].address); + currentTransferManager = new web3.eth.Contract(abis.generalTransferManager(), tmModules[index].address); currentTransferManager.setProvider(web3.currentProvider); await generalTransferManager(); break; @@ -230,8 +230,8 @@ async function configExistingModules(tmModules) { async function addTransferManagerModule() { let options = ['GeneralTransferManager'/*, 'ManualApprovalTransferManager', 'PercentageTransferManager', 'CountTransferManager', 'SingleTradeVolumeRestrictionTM', 'LookupVolumeRestrictionTM'*/]; - - let index = readlineSync.keyInSelect(options, 'Which Transfer Manager module do you want to add? ', {cancel: 'Return'}); + + let index = readlineSync.keyInSelect(options, 'Which Transfer Manager module do you want to add? ', { cancel: 'Return' }); if (index != -1 && readlineSync.keyInYNStrict(`Are you sure you want to add ${options[index]} module?`)) { let bytes = web3.utils.fromAscii('', 16); switch (options[index]) { @@ -333,9 +333,9 @@ async function generalTransferManager() { console.log(`- Allow all whitelist issuances: ${displayAllowAllWhitelistIssuances ? `YES` : `NO`}`); console.log(`- Allow all burn transfers: ${displayAllowAllBurnTransfers ? `YES` : `NO`}`); // ------------------ - + let options = ['Modify whitelist', 'Modify whitelist from CSV', /*'Modify Whitelist Signed',*/ - `Change issuance address`, 'Change signing address']; + `Change issuance address`, 'Change signing address']; if (displayAllowAllTransfers) { options.push('Disallow all transfers'); } else { @@ -363,16 +363,16 @@ async function generalTransferManager() { switch (optionSelected) { case 'Modify whitelist': let investor = readlineSync.question('Enter the address to whitelist: ', { - limit: function(input) { + limit: function (input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address" - }); + }); let now = Math.floor(Date.now() / 1000); - let fromTime = readlineSync.questionInt(`Enter the time (Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens (now = ${now}): `, {defaultInput: now}); - let toTime = readlineSync.questionInt(`Enter the time (Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others (now = ${now}): `, {defaultInput: now}); + let fromTime = readlineSync.questionInt(`Enter the time (Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens (now = ${now}): `, { defaultInput: now }); + let toTime = readlineSync.questionInt(`Enter the time (Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others (now = ${now}): `, { defaultInput: now }); let oneHourFromNow = Math.floor(Date.now() / 1000 + 3600); - let expiryTime = readlineSync.questionInt(`Enter the time till investors KYC will be validated (after that investor need to do re-KYC) (1 hour from now = ${oneHourFromNow}): `, {defaultInput: oneHourFromNow}); + let expiryTime = readlineSync.questionInt(`Enter the time till investors KYC will be validated (after that investor need to do re-KYC) (1 hour from now = ${oneHourFromNow}): `, { defaultInput: oneHourFromNow }); let canBuyFromSTO = readlineSync.keyInYNStrict('Is the investor a restricted investor?'); let modifyWhitelistAction = currentTransferManager.methods.modifyWhitelist(investor, fromTime, toTime, expiryTime, canBuyFromSTO); let modifyWhitelistReceipt = await common.sendTransaction(modifyWhitelistAction); @@ -408,11 +408,11 @@ async function generalTransferManager() { */ case 'Change issuance address': let issuanceAddress = readlineSync.question('Enter the new issuance address: ', { - limit: function(input) { + limit: function (input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address" - }); + }); let changeIssuanceAddressAction = currentTransferManager.methods.changeIssuanceAddress(issuanceAddress); let changeIssuanceAddressReceipt = await common.sendTransaction(changeIssuanceAddressAction); let changeIssuanceAddressEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeIssuanceAddressReceipt.logs, 'ChangeIssuanceAddress'); @@ -420,11 +420,11 @@ async function generalTransferManager() { break; case 'Change signing address': let signingAddress = readlineSync.question('Enter the new signing address: ', { - limit: function(input) { + limit: function (input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address" - }); + }); let changeSigningAddressAction = currentTransferManager.methods.changeSigningAddress(signingAddress); let changeSigningAddressReceipt = await common.sendTransaction(changeSigningAddressAction); let changeSigningAddressEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeSigningAddressReceipt.logs, 'ChangeSigningAddress'); @@ -481,20 +481,20 @@ async function singleTradeVolumeRestrictionTM() { console.log(chalk.blue(`Single Trade Volume Restriction Transfer Manager at ${currentTransferManager.options.address}`)); console.log(); - // Show current data - let displayIsInPercentage = await currentTransferManager.methods.isTransferLimitInPercentage().call(); - let displayGlobalTransferLimit; - if (displayIsInPercentage) { - displayGlobalTransferLimit = fromWeiPercentage(await currentTransferManager.methods.globalTransferLimitInPercentage().call()); - } else { - displayGlobalTransferLimit = web3.utils.fromWei(await currentTransferManager.methods.globalTransferLimitInTokens().call()); - } - let displayAllowPrimaryIssuance = await currentTransferManager.methods.allowPrimaryIssuance().call(); - - console.log(`- Limit type: ${displayIsInPercentage ? `Percentage` : `Tokens`}`); - console.log(`- Default transfer limit: ${displayGlobalTransferLimit} ${displayIsInPercentage ? `%` : `${tokenSymbol}`}`); - console.log(`- Allow primary issuance: ${displayAllowPrimaryIssuance ? `YES` : `NO`}`); - // ------------------ + // Show current data + let displayIsInPercentage = await currentTransferManager.methods.isTransferLimitInPercentage().call(); + let displayGlobalTransferLimit; + if (displayIsInPercentage) { + displayGlobalTransferLimit = fromWeiPercentage(await currentTransferManager.methods.globalTransferLimitInPercentage().call()); + } else { + displayGlobalTransferLimit = web3.utils.fromWei(await currentTransferManager.methods.globalTransferLimitInTokens().call()); + } + let displayAllowPrimaryIssuance = await currentTransferManager.methods.allowPrimaryIssuance().call(); + + console.log(`- Limit type: ${displayIsInPercentage ? `Percentage` : `Tokens`}`); + console.log(`- Default transfer limit: ${displayGlobalTransferLimit} ${displayIsInPercentage ? `%` : `${tokenSymbol}`}`); + console.log(`- Allow primary issuance: ${displayAllowPrimaryIssuance ? `YES` : `NO`}`); + // ------------------ let options = []; if (displayAllowPrimaryIssuance) { @@ -504,11 +504,11 @@ async function singleTradeVolumeRestrictionTM() { } options.push('Add exempted wallet', 'Remove exempted wallet'); if (displayIsInPercentage) { - options.push('Change transfer limit to tokens', 'Change default percentage limit', - 'Set percentage transfer limit per account', 'Remove percentage transfer limit per account'); + options.push('Change transfer limit to tokens', 'Change default percentage limit', + 'Set percentage transfer limit per account', 'Remove percentage transfer limit per account'); } else { - options.push('Change transfer limit to percentage', 'Change default tokens limit', - 'Set tokens transfer limit per account', 'Remove tokens transfer limit per account'); + options.push('Change transfer limit to percentage', 'Change default tokens limit', + 'Set tokens transfer limit per account', 'Remove tokens transfer limit per account'); } let index = readlineSync.keyInSelect(options, 'What do you want to do?'); @@ -522,11 +522,11 @@ async function singleTradeVolumeRestrictionTM() { break; case 'Add exempted wallet': let walletToExempt = readlineSync.question('Enter the wallet to exempt: ', { - limit: function(input) { + limit: function (input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address" - }); + }); let addExemptWalletAction = currentTransferManager.methods.addExemptWallet(walletToExempt); let addExemptWalletReceipt = await common.sendTransaction(addExemptWalletAction); let addExemptWalletEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, addExemptWalletReceipt.logs, 'ExemptWalletAdded'); @@ -534,11 +534,11 @@ async function singleTradeVolumeRestrictionTM() { break; case 'Remove exempted wallet': let exemptedWallet = readlineSync.question('Enter the wallet to remove from exempt: ', { - limit: function(input) { + limit: function (input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address" - }); + }); let removeExemptWalletAction = currentTransferManager.methods.removeExemptWallet(exemptedWallet); let removeExemptWalletReceipt = await common.sendTransaction(removeExemptWalletAction); let removeExemptWalletEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, removeExemptWalletReceipt.logs, 'ExemptWalletRemoved'); @@ -546,11 +546,11 @@ async function singleTradeVolumeRestrictionTM() { break; case 'Change transfer limit to tokens': let newDefaultLimitInTokens = web3.utils.toWei(readlineSync.question('Enter the amount of tokens for default limit: ', { - limit: function(input) { + limit: function (input) { return parseInt(input) > 0; }, limitMessage: "Must be greater than zero" - })); + })); let changeTransferLimitToTokensAction = currentTransferManager.methods.changeTransferLimitToTokens(newDefaultLimitInTokens); let changeTransferLimitToTokensReceipt = await common.sendTransaction(changeTransferLimitToTokensAction); let changeTransferLimitToTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeTransferLimitToTokensReceipt.logs, 'GlobalTransferLimitInTokensSet'); @@ -559,11 +559,11 @@ async function singleTradeVolumeRestrictionTM() { break; case 'Change transfer limit to percentage': let newDefaultLimitInPercentage = toWeiPercentage(readlineSync.question('Enter the percentage for default limit: ', { - limit: function(input) { + limit: function (input) { return (parseInt(input) > 0 && parseInt(input) <= 100); }, limitMessage: "Must be greater than 0 and less than 100" - })); + })); let changeTransferLimitToPercentageAction = currentTransferManager.methods.changeTransferLimitToPercentage(newDefaultLimitInPercentage); let changeTransferLimitToPercentageReceipt = await common.sendTransaction(changeTransferLimitToPercentageAction); let changeTransferLimitToPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeTransferLimitToPercentageReceipt.logs, 'GlobalTransferLimitInPercentageSet'); @@ -572,11 +572,11 @@ async function singleTradeVolumeRestrictionTM() { break; case 'Change default percentage limit': let defaultLimitInPercentage = toWeiPercentage(readlineSync.question('Enter the percentage for default limit: ', { - limit: function(input) { + limit: function (input) { return (parseInt(input) > 0 && parseInt(input) <= 100); }, limitMessage: "Must be greater than 0 and less than 100" - })); + })); let changeGlobalLimitInPercentageAction = currentTransferManager.methods.changeGlobalLimitInPercentage(defaultLimitInPercentage); let changeGlobalLimitInPercentageReceipt = await common.sendTransaction(changeGlobalLimitInPercentageAction); let changeGlobalLimitInPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeGlobalLimitInPercentageReceipt.logs, 'GlobalTransferLimitInPercentageSet'); @@ -584,11 +584,11 @@ async function singleTradeVolumeRestrictionTM() { break; case 'Change default tokens limit': let defaultLimitInTokens = web3.utils.toWei(readlineSync.question('Enter the amount of tokens for default limit: ', { - limit: function(input) { + limit: function (input) { return parseInt(input) > 0; }, limitMessage: "Must be greater than zero" - })); + })); let changeGlobalLimitInTokensAction = currentTransferManager.methods.changeGlobalLimitInTokens(defaultLimitInTokens); let changeGlobalLimitInTokensReceipt = await common.sendTransaction(changeGlobalLimitInTokensAction); let changeGlobalLimitInTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeGlobalLimitInTokensReceipt.logs, 'GlobalTransferLimitInTokensSet'); @@ -596,17 +596,17 @@ async function singleTradeVolumeRestrictionTM() { break; case 'Set percentage transfer limit per account': let percentageAccount = readlineSync.question('Enter the wallet: ', { - limit: function(input) { + limit: function (input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address" }); let accountLimitInPercentage = toWeiPercentage(readlineSync.question(`Enter the transfer limit for ${percentageAccount} in percentage: `, { - limit: function(input) { + limit: function (input) { return (parseInt(input) > 0 && parseInt(input) <= 100); }, limitMessage: "Must be greater than 0 and less than 100" - })); + })); let setTransferLimitInPercentageAction = currentTransferManager.methods.setTransferLimitInPercentage(percentageAccount, accountLimitInPercentage); let setTransferLimitInPercentageReceipt = await common.sendTransaction(setTransferLimitInPercentageAction); let setTransferLimitInPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, setTransferLimitInPercentageReceipt.logs, 'TransferLimitInPercentageSet'); @@ -614,17 +614,17 @@ async function singleTradeVolumeRestrictionTM() { break; case 'Set tokens transfer limit per account': let tokensAccount = readlineSync.question('Enter the wallet: ', { - limit: function(input) { + limit: function (input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address" }); let accountLimitInTokens = web3.utils.toWei(readlineSync.question(`Enter the transfer limit for ${tokensAccount} in amount of tokens: `, { - limit: function(input) { + limit: function (input) { return parseInt(input) > 0; }, limitMessage: "Must be greater than zero" - })); + })); let setTransferLimitInTokensAction = currentTransferManager.methods.setTransferLimitInTokens(tokensAccount, accountLimitInTokens); let setTransferLimitInTokensReceipt = await common.sendTransaction(setTransferLimitInTokensAction); let setTransferLimitInTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, setTransferLimitInTokensReceipt.logs, 'TransferLimitInTokensSet'); @@ -632,7 +632,7 @@ async function singleTradeVolumeRestrictionTM() { break; case 'Remove percentage transfer limit per account': let percentageAccountToRemove = readlineSync.question('Enter the wallet to remove: ', { - limit: function(input) { + limit: function (input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address" @@ -644,7 +644,7 @@ async function singleTradeVolumeRestrictionTM() { break; case 'Remove tokens transfer limit per account': let tokensAccountToRemove = readlineSync.question('Enter the wallet to remove: ', { - limit: function(input) { + limit: function (input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address" @@ -656,6 +656,7 @@ async function singleTradeVolumeRestrictionTM() { break; } } + /* // Copied from tests function signData(tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, pk) { @@ -718,7 +719,7 @@ async function initialize(_tokenSymbol) { tokenSymbol = _tokenSymbol; } let securityTokenAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call(); - if (securityTokenAddress == '0x0000000000000000000000000000000000000000') { + if (securityTokenAddress == '0x0000000000000000000000000000000000000000') { console.log(chalk.red(`Selected Security Token ${tokenSymbol} does not exist.`)); process.exit(0); } @@ -735,7 +736,7 @@ function welcome() { console.log("Issuer Account: " + Issuer.address + "\n"); } -async function setup(){ +async function setup() { try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); let securityTokenRegistryABI = abis.securityTokenRegistry(); @@ -743,25 +744,25 @@ async function setup(){ securityTokenRegistry.setProvider(web3.currentProvider); } catch (err) { console.log(err) - console.log('\x1b[31m%s\x1b[0m',"There was a problem getting the contracts. Make sure they are deployed to the selected network."); + console.log('\x1b[31m%s\x1b[0m', "There was a problem getting the contracts. Make sure they are deployed to the selected network."); process.exit(0); } } async function selectToken() { let result = null; - + let userTokens = await securityTokenRegistry.methods.getTokensByOwner(Issuer.address).call(); let tokenDataArray = await Promise.all(userTokens.map(async function (t) { let tokenData = await securityTokenRegistry.methods.getSecurityTokenData(t).call(); - return {symbol: tokenData[0], address: t}; + return { symbol: tokenData[0], address: t }; })); let options = tokenDataArray.map(function (t) { return `${t.symbol} - Deployed at ${t.address}`; }); options.push('Enter token symbol manually'); - let index = readlineSync.keyInSelect(options, 'Select a token:', {cancel: 'Exit'}); + let index = readlineSync.keyInSelect(options, 'Select a token:', { cancel: 'Exit' }); switch (options[index]) { case 'Enter token symbol manually': result = readlineSync.question('Enter the token symbol: '); @@ -773,12 +774,12 @@ async function selectToken() { result = tokenDataArray[index].symbol; break; } - + return result; } module.exports = { - executeApp: async function(_tokenSymbol) { + executeApp: async function (_tokenSymbol) { await initialize(_tokenSymbol); return executeApp(); } From 42e4a789931d47984429d84b78e40bb3c3320f6a Mon Sep 17 00:00:00 2001 From: Adam Dossa Date: Tue, 27 Nov 2018 09:20:35 +0000 Subject: [PATCH 091/139] Optimise GTM (#433) - Add an Offset that can be used to move all from & to dates forwards or backwards by a fixed offset. - Add address[] public investors to record a list of all addresses that have been added to the whitelist - Fix for when allowAllWhitelistIssuances is FALSE - Clearer logic around toTime, fromTime & expiryTime - Make GTM a Proxy based implementation to reduce deployment gas costs --- CHANGELOG.md | 6 + .../modules/Checkpoint/DividendCheckpoint.sol | 37 +- .../Checkpoint/DividendCheckpointStorage.sol | 43 + .../Checkpoint/ERC20DividendCheckpoint.sol | 39 +- .../ERC20DividendCheckpointFactory.sol | 9 +- .../ERC20DividendCheckpointStorage.sol | 11 + .../Checkpoint/EtherDividendCheckpoint.sol | 25 +- .../EtherDividendCheckpointFactory.sol | 9 +- contracts/modules/Module.sol | 20 +- contracts/modules/ModuleStorage.sol | 30 + .../GeneralTransferManager.sol | 156 ++- .../GeneralTransferManagerFactory.sol | 10 +- .../GeneralTransferManagerStorage.sol | 53 + .../proxy/ERC20DividendCheckpointProxy.sol | 31 + .../proxy/EtherDividendCheckpointProxy.sol | 30 + .../proxy/GeneralTransferManagerProxy.sol | 30 + contracts/proxy/OwnedProxy.sol | 91 ++ migrations/2_deploy_contracts.js | 24 +- package.json | 1 + scripts/compareStorageLayout.js | 139 ++ test/b_capped_sto.js | 14 +- test/c_checkpoints.js | 6 +- test/d_count_transfer_manager.js | 8 +- test/e_erc20_dividends.js | 12 +- test/f_ether_dividends.js | 12 +- test/h_general_transfer_manager.js | 168 ++- test/helpers/createInstances.js | 32 +- test/helpers/signData.js | 2 +- test/i_Issuance.js | 4 +- test/j_manual_approval_transfer_manager.js | 6 +- test/l_percentage_transfer_manager.js | 8 +- test/m_presale_sto.js | 6 +- test/o_security_token.js | 20 +- test/p_usd_tiered_sto.js | 18 +- test/q_usd_tiered_sto_sim.js | 6 +- test/r_concurrent_STO.js | 6 +- test/u_module_registry_proxy.js | 5 +- test/v_tracked_redemptions.js | 6 +- ...kup_volume_restriction_transfer_manager.js | 14 +- test/x_single_trade_volume_restriction.js | 24 +- test/y_scheduled_checkpoints.js | 6 +- yarn.lock | 1247 +---------------- 42 files changed, 975 insertions(+), 1449 deletions(-) create mode 100644 contracts/modules/Checkpoint/DividendCheckpointStorage.sol create mode 100644 contracts/modules/Checkpoint/ERC20DividendCheckpointStorage.sol create mode 100644 contracts/modules/ModuleStorage.sol create mode 100644 contracts/modules/TransferManager/GeneralTransferManagerStorage.sol create mode 100644 contracts/proxy/ERC20DividendCheckpointProxy.sol create mode 100644 contracts/proxy/EtherDividendCheckpointProxy.sol create mode 100644 contracts/proxy/GeneralTransferManagerProxy.sol create mode 100644 contracts/proxy/OwnedProxy.sol create mode 100644 scripts/compareStorageLayout.js diff --git a/CHANGELOG.md b/CHANGELOG.md index db3d8dcde..0e19e93ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,12 @@ All notable changes to this project will be documented in this file. * Added `getTokensSoldByTier` to return sold (not minted during finalisation) tokens in each tier to USDTSTO. * Removed individual mappings for tier data removed in UDSTSTO. +# GeneralTransferManager +* Add an Offset that can be used to move all from & to dates forwards or backwards by a fixed offset. +* Add `address[] public investors` to record a list of all addresses that have been added to the whitelist (`getInvestors`) +* Fix for when `allowAllWhitelistIssuances` is FALSE +* Make GTM a Proxy based implementation to reduce deployment gas costs + ##Changed * `getAllModulesAndPermsFromTypes()` does not take securityToken address as a parameter anymore. diff --git a/contracts/modules/Checkpoint/DividendCheckpoint.sol b/contracts/modules/Checkpoint/DividendCheckpoint.sol index 452a48b13..3a345af25 100644 --- a/contracts/modules/Checkpoint/DividendCheckpoint.sol +++ b/contracts/modules/Checkpoint/DividendCheckpoint.sol @@ -8,6 +8,7 @@ pragma solidity ^0.4.24; import "./ICheckpoint.sol"; +import "./DividendCheckpointStorage.sol"; import "../Module.sol"; import "../../interfaces/ISecurityToken.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; @@ -17,43 +18,9 @@ import "openzeppelin-solidity/contracts/math/Math.sol"; * @title Checkpoint module for issuing ether dividends * @dev abstract contract */ -contract DividendCheckpoint is ICheckpoint, Module { +contract DividendCheckpoint is DividendCheckpointStorage, ICheckpoint, Module { using SafeMath for uint256; - uint256 public EXCLUDED_ADDRESS_LIMIT = 50; - bytes32 public constant DISTRIBUTE = "DISTRIBUTE"; - bytes32 public constant MANAGE = "MANAGE"; - bytes32 public constant CHECKPOINT = "CHECKPOINT"; - - struct Dividend { - uint256 checkpointId; - uint256 created; // Time at which the dividend was created - uint256 maturity; // Time after which dividend can be claimed - set to 0 to bypass - uint256 expiry; // Time until which dividend can be claimed - after this time any remaining amount can be withdrawn by issuer - - // set to very high value to bypass - uint256 amount; // Dividend amount in WEI - uint256 claimedAmount; // Amount of dividend claimed so far - uint256 totalSupply; // Total supply at the associated checkpoint (avoids recalculating this) - bool reclaimed; // True if expiry has passed and issuer has reclaimed remaining dividend - uint256 dividendWithheld; - uint256 dividendWithheldReclaimed; - mapping (address => bool) claimed; // List of addresses which have claimed dividend - mapping (address => bool) dividendExcluded; // List of addresses which cannot claim dividends - bytes32 name; // Name/title - used for identification - } - - // List of all dividends - Dividend[] public dividends; - - // List of addresses which cannot claim dividends - address[] public excluded; - - // Mapping from address to withholding tax as a percentage * 10**16 - mapping (address => uint256) public withholdingTax; - - // Total amount of ETH withheld per investor - mapping (address => uint256) public investorWithheld; - event SetDefaultExcludedAddresses(address[] _excluded, uint256 _timestamp); event SetWithholding(address[] _investors, uint256[] _withholding, uint256 _timestamp); event SetWithholdingFixed(address[] _investors, uint256 _withholding, uint256 _timestamp); diff --git a/contracts/modules/Checkpoint/DividendCheckpointStorage.sol b/contracts/modules/Checkpoint/DividendCheckpointStorage.sol new file mode 100644 index 000000000..4cf1f2838 --- /dev/null +++ b/contracts/modules/Checkpoint/DividendCheckpointStorage.sol @@ -0,0 +1,43 @@ +pragma solidity ^0.4.24; + +/** + * @title Holds the storage variable for the DividendCheckpoint modules (i.e ERC20, Ether) + * @dev abstract contract + */ +contract DividendCheckpointStorage { + + uint256 public EXCLUDED_ADDRESS_LIMIT = 50; + bytes32 public constant DISTRIBUTE = "DISTRIBUTE"; + bytes32 public constant MANAGE = "MANAGE"; + bytes32 public constant CHECKPOINT = "CHECKPOINT"; + + struct Dividend { + uint256 checkpointId; + uint256 created; // Time at which the dividend was created + uint256 maturity; // Time after which dividend can be claimed - set to 0 to bypass + uint256 expiry; // Time until which dividend can be claimed - after this time any remaining amount can be withdrawn by issuer - + // set to very high value to bypass + uint256 amount; // Dividend amount in WEI + uint256 claimedAmount; // Amount of dividend claimed so far + uint256 totalSupply; // Total supply at the associated checkpoint (avoids recalculating this) + bool reclaimed; // True if expiry has passed and issuer has reclaimed remaining dividend + uint256 dividendWithheld; + uint256 dividendWithheldReclaimed; + mapping (address => bool) claimed; // List of addresses which have claimed dividend + mapping (address => bool) dividendExcluded; // List of addresses which cannot claim dividends + bytes32 name; // Name/title - used for identification + } + + // List of all dividends + Dividend[] public dividends; + + // List of addresses which cannot claim dividends + address[] public excluded; + + // Mapping from address to withholding tax as a percentage * 10**16 + mapping (address => uint256) public withholdingTax; + + // Total amount of ETH withheld per investor + mapping (address => uint256) public investorWithheld; + +} diff --git a/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol b/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol index 1f7f25cd5..b779088f7 100644 --- a/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol +++ b/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol @@ -1,17 +1,16 @@ pragma solidity ^0.4.24; import "./DividendCheckpoint.sol"; +import "./ERC20DividendCheckpointStorage.sol"; import "../../interfaces/IOwnable.sol"; import "../../interfaces/IERC20.sol"; /** * @title Checkpoint module for issuing ERC20 dividends */ -contract ERC20DividendCheckpoint is DividendCheckpoint { +contract ERC20DividendCheckpoint is ERC20DividendCheckpointStorage, DividendCheckpoint { using SafeMath for uint256; - // Mapping to token address for each dividend - mapping (uint256 => address) public dividendTokens; event ERC20DividendDeposited( address indexed _depositor, uint256 _checkpointId, @@ -68,8 +67,8 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { address _token, uint256 _amount, bytes32 _name - ) - external + ) + external withPerm(MANAGE) { createDividendWithExclusions(_maturity, _expiry, _token, _amount, excluded, _name); @@ -133,16 +132,16 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { * @param _name Name/Title for identification */ function createDividendWithCheckpointAndExclusions( - uint256 _maturity, - uint256 _expiry, - address _token, - uint256 _amount, - uint256 _checkpointId, + uint256 _maturity, + uint256 _expiry, + address _token, + uint256 _amount, + uint256 _checkpointId, address[] _excluded, bytes32 _name - ) + ) public - withPerm(MANAGE) + withPerm(MANAGE) { _createDividendWithCheckpointAndExclusions(_maturity, _expiry, _token, _amount, _checkpointId, _excluded, _name); } @@ -158,15 +157,15 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { * @param _name Name/Title for identification */ function _createDividendWithCheckpointAndExclusions( - uint256 _maturity, - uint256 _expiry, - address _token, - uint256 _amount, - uint256 _checkpointId, + uint256 _maturity, + uint256 _expiry, + address _token, + uint256 _amount, + uint256 _checkpointId, address[] _excluded, bytes32 _name - ) - internal + ) + internal { ISecurityToken securityTokenInstance = ISecurityToken(securityToken); require(_excluded.length <= EXCLUDED_ADDRESS_LIMIT, "Too many addresses excluded"); @@ -210,7 +209,7 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { } /** - * @notice Emits the ERC20DividendDeposited event. + * @notice Emits the ERC20DividendDeposited event. * Seperated into a different function as a workaround for stack too deep error */ function _emitERC20DividendDepositedEvent( diff --git a/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol b/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol index 5fd158c26..a684e553b 100644 --- a/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol +++ b/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./ERC20DividendCheckpoint.sol"; +import "../../proxy/ERC20DividendCheckpointProxy.sol"; import "../ModuleFactory.sol"; /** @@ -8,6 +8,8 @@ import "../ModuleFactory.sol"; */ contract ERC20DividendCheckpointFactory is ModuleFactory { + address public logicContract; + /** * @notice Constructor * @param _polyAddress Address of the polytoken @@ -15,7 +17,7 @@ contract ERC20DividendCheckpointFactory is ModuleFactory { * @param _usageCost Usage cost of the module * @param _subscriptionCost Subscription cost of the module */ - constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public + constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost, address _logicContract) public ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost) { version = "1.0.0"; @@ -24,6 +26,7 @@ contract ERC20DividendCheckpointFactory is ModuleFactory { description = "Create ERC20 dividends for token holders at a specific checkpoint"; compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); + logicContract = _logicContract; } /** @@ -33,7 +36,7 @@ contract ERC20DividendCheckpointFactory is ModuleFactory { function deploy(bytes /* _data */) external returns(address) { if (setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "insufficent allowance"); - address erc20DividendCheckpoint = new ERC20DividendCheckpoint(msg.sender, address(polyToken)); + address erc20DividendCheckpoint = new ERC20DividendCheckpointProxy(msg.sender, address(polyToken), logicContract); /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(erc20DividendCheckpoint, getName(), address(this), msg.sender, setupCost, now); return erc20DividendCheckpoint; diff --git a/contracts/modules/Checkpoint/ERC20DividendCheckpointStorage.sol b/contracts/modules/Checkpoint/ERC20DividendCheckpointStorage.sol new file mode 100644 index 000000000..29401f8d9 --- /dev/null +++ b/contracts/modules/Checkpoint/ERC20DividendCheckpointStorage.sol @@ -0,0 +1,11 @@ +pragma solidity ^0.4.24; + +/** + * @title It holds the storage variables related to ERC20DividendCheckpoint module + */ +contract ERC20DividendCheckpointStorage { + + // Mapping to token address for each dividend + mapping (uint256 => address) public dividendTokens; + +} diff --git a/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol b/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol index 4def51468..f5a916818 100644 --- a/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol +++ b/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol @@ -8,6 +8,7 @@ import "../../interfaces/IOwnable.sol"; */ contract EtherDividendCheckpoint is DividendCheckpoint { using SafeMath for uint256; + event EtherDividendDeposited( address indexed _depositor, uint256 _checkpointId, @@ -56,7 +57,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { uint256 _expiry, uint256 _checkpointId, bytes32 _name - ) + ) external payable withPerm(MANAGE) @@ -76,7 +77,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { uint256 _expiry, address[] _excluded, bytes32 _name - ) + ) public payable withPerm(MANAGE) @@ -94,10 +95,10 @@ contract EtherDividendCheckpoint is DividendCheckpoint { * @param _name Name/title for identification */ function createDividendWithCheckpointAndExclusions( - uint256 _maturity, - uint256 _expiry, - uint256 _checkpointId, - address[] _excluded, + uint256 _maturity, + uint256 _expiry, + uint256 _checkpointId, + address[] _excluded, bytes32 _name ) public @@ -116,12 +117,12 @@ contract EtherDividendCheckpoint is DividendCheckpoint { * @param _name Name/title for identification */ function _createDividendWithCheckpointAndExclusions( - uint256 _maturity, - uint256 _expiry, - uint256 _checkpointId, - address[] _excluded, + uint256 _maturity, + uint256 _expiry, + uint256 _checkpointId, + address[] _excluded, bytes32 _name - ) + ) internal { require(_excluded.length <= EXCLUDED_ADDRESS_LIMIT, "Too many addresses excluded"); @@ -169,7 +170,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { */ function _payDividend(address _payee, Dividend storage _dividend, uint256 _dividendIndex) internal { (uint256 claim, uint256 withheld) = calculateDividend(_dividendIndex, _payee); - _dividend.claimed[_payee] = true; + _dividend.claimed[_payee] = true; uint256 claimAfterWithheld = claim.sub(withheld); if (claimAfterWithheld > 0) { /*solium-disable-next-line security/no-send*/ diff --git a/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol b/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol index 315760be1..3129fba42 100644 --- a/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol +++ b/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./EtherDividendCheckpoint.sol"; +import "../../proxy/EtherDividendCheckpointProxy.sol"; import "../ModuleFactory.sol"; /** @@ -8,6 +8,8 @@ import "../ModuleFactory.sol"; */ contract EtherDividendCheckpointFactory is ModuleFactory { + address public logicContract; + /** * @notice Constructor * @param _polyAddress Address of the polytoken @@ -15,7 +17,7 @@ contract EtherDividendCheckpointFactory is ModuleFactory { * @param _usageCost Usage cost of the module * @param _subscriptionCost Subscription cost of the module */ - constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public + constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost, address _logicContract) public ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost) { version = "1.0.0"; @@ -24,6 +26,7 @@ contract EtherDividendCheckpointFactory is ModuleFactory { description = "Create ETH dividends for token holders at a specific checkpoint"; compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); + logicContract = _logicContract; } /** @@ -33,7 +36,7 @@ contract EtherDividendCheckpointFactory is ModuleFactory { function deploy(bytes /* _data */) external returns(address) { if(setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "Insufficent allowance or balance"); - address ethDividendCheckpoint = new EtherDividendCheckpoint(msg.sender, address(polyToken)); + address ethDividendCheckpoint = new EtherDividendCheckpointProxy(msg.sender, address(polyToken), logicContract); /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(ethDividendCheckpoint, getName(), address(this), msg.sender, setupCost, now); return ethDividendCheckpoint; diff --git a/contracts/modules/Module.sol b/contracts/modules/Module.sol index 1e27d424e..1566a3428 100644 --- a/contracts/modules/Module.sol +++ b/contracts/modules/Module.sol @@ -2,33 +2,23 @@ pragma solidity ^0.4.24; import "../interfaces/IModule.sol"; import "../interfaces/ISecurityToken.sol"; -import "../interfaces/IERC20.sol"; +import "./ModuleStorage.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; /** * @title Interface that any module contract should implement * @notice Contract is abstract */ -contract Module is IModule { - - address public factory; - - address public securityToken; - - bytes32 public constant FEE_ADMIN = "FEE_ADMIN"; - - IERC20 public polyToken; +contract Module is IModule, ModuleStorage { /** * @notice Constructor * @param _securityToken Address of the security token * @param _polyAddress Address of the polytoken */ - constructor (address _securityToken, address _polyAddress) public { - require(_securityToken != address(0) && _polyAddress != address(0), "Invalid address"); - securityToken = _securityToken; - factory = msg.sender; - polyToken = IERC20(_polyAddress); + constructor (address _securityToken, address _polyAddress) public + ModuleStorage(_securityToken, _polyAddress) + { } //Allows owner, factory or permissioned delegate diff --git a/contracts/modules/ModuleStorage.sol b/contracts/modules/ModuleStorage.sol new file mode 100644 index 000000000..cd52c9de2 --- /dev/null +++ b/contracts/modules/ModuleStorage.sol @@ -0,0 +1,30 @@ +pragma solidity ^0.4.24; + +import "../interfaces/IERC20.sol"; + +/** + * @title Storage for Module contract + * @notice Contract is abstract + */ +contract ModuleStorage { + + /** + * @notice Constructor + * @param _securityToken Address of the security token + * @param _polyAddress Address of the polytoken + */ + constructor (address _securityToken, address _polyAddress) public { + securityToken = _securityToken; + factory = msg.sender; + polyToken = IERC20(_polyAddress); + } + + address public factory; + + address public securityToken; + + bytes32 public constant FEE_ADMIN = "FEE_ADMIN"; + + IERC20 public polyToken; + +} diff --git a/contracts/modules/TransferManager/GeneralTransferManager.sol b/contracts/modules/TransferManager/GeneralTransferManager.sol index 814d54d7b..04028fead 100644 --- a/contracts/modules/TransferManager/GeneralTransferManager.sol +++ b/contracts/modules/TransferManager/GeneralTransferManager.sol @@ -1,47 +1,16 @@ pragma solidity ^0.4.24; import "./ITransferManager.sol"; +import "./GeneralTransferManagerStorage.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /** * @title Transfer Manager module for core transfer validation functionality */ -contract GeneralTransferManager is ITransferManager { +contract GeneralTransferManager is GeneralTransferManagerStorage, ITransferManager { using SafeMath for uint256; - //Address from which issuances come - address public issuanceAddress = address(0); - - //Address which can sign whitelist changes - address public signingAddress = address(0); - - bytes32 public constant WHITELIST = "WHITELIST"; - bytes32 public constant FLAGS = "FLAGS"; - - //from and to timestamps that an investor can send / receive tokens respectively - struct TimeRestriction { - uint256 fromTime; - uint256 toTime; - uint256 expiryTime; - bool canBuyFromSTO; - } - - // An address can only send / receive tokens once their corresponding uint256 > block.number - // (unless allowAllTransfers == true or allowAllWhitelistTransfers == true) - mapping (address => TimeRestriction) public whitelist; - // Map of used nonces by customer - mapping(address => mapping(uint256 => bool)) public nonceMap; - - //If true, there are no transfer restrictions, for any addresses - bool public allowAllTransfers = false; - //If true, time lock is ignored for transfers (address must still be on whitelist) - bool public allowAllWhitelistTransfers = false; - //If true, time lock is ignored for issuances (address must still be on whitelist) - bool public allowAllWhitelistIssuances = true; - //If true, time lock is ignored for burn transactions - bool public allowAllBurnTransfers = false; - // Emit when Issuance address get changed event ChangeIssuanceAddress(address _issuanceAddress); // Emit when there is change in the flag variable called allowAllTransfers @@ -55,14 +24,21 @@ contract GeneralTransferManager is ITransferManager { // Emit when there is change in the flag variable called signingAddress event ChangeSigningAddress(address _signingAddress); // Emit when investor details get modified related to their whitelisting + event OffsetModified(uint64 _time, uint8 _isForward); + + // _fromTime is the time from which the _investor can send tokens + // _toTime is the time from which the _investor can receive tokens + // if allowAllWhitelistIssuances is TRUE, then _toTime is ignored when receiving tokens from the issuance address + // if allowAllWhitelistTransfers is TRUE, then _toTime and _fromTime is ignored when sending or receiving tokens + // in any case, any investor sending or receiving tokens, must have a _expiryTime in the future event ModifyWhitelist( address _investor, uint256 _dateAdded, address _addedBy, - uint256 _fromTime, - uint256 _toTime, - uint256 _expiryTime, - bool _canBuyFromSTO + uint64 _fromTime, + uint64 _toTime, + uint64 _expiryTime, + uint8 _canBuyFromSTO ); /** @@ -76,6 +52,12 @@ contract GeneralTransferManager is ITransferManager { { } + function modifyOffset(uint64 _time, uint8 _isForward) public withPerm(FLAGS) { + offset.time = _time; + offset.isForward = _isForward; + emit OffsetModified(_time, _isForward); + } + /** * @notice This function returns the signature of configure function */ @@ -168,16 +150,19 @@ contract GeneralTransferManager is ITransferManager { //Anyone on the whitelist can transfer, regardless of time return (_onWhitelist(_to) && _onWhitelist(_from)) ? Result.VALID : Result.NA; } + if (_from == issuanceAddress && (whitelist[_to].canBuyFromSTO == 0) && _isSTOAttached()) { + return Result.NA; + } if (allowAllWhitelistIssuances && _from == issuanceAddress) { - if (!whitelist[_to].canBuyFromSTO && _isSTOAttached()) { - return Result.NA; - } return _onWhitelist(_to) ? Result.VALID : Result.NA; } + if (_from == issuanceAddress) { + return (_onWhitelist(_to) && _adjustTimes(whitelist[_to].toTime) <= uint64(now)) ? Result.VALID : Result.NA; + } //Anyone on the whitelist can transfer provided the blocknumber is large enough /*solium-disable-next-line security/no-block-members*/ - return ((_onWhitelist(_from) && whitelist[_from].fromTime <= now) && - (_onWhitelist(_to) && whitelist[_to].toTime <= now)) ? Result.VALID : Result.NA; /*solium-disable-line security/no-block-members*/ + return ((_onWhitelist(_from) && _adjustTimes(whitelist[_from].fromTime) <= uint64(now)) && + (_onWhitelist(_to) && _adjustTimes(whitelist[_to].toTime) <= uint64(now))) ? Result.VALID : Result.NA; /*solium-disable-line security/no-block-members*/ } return Result.NA; } @@ -192,16 +177,39 @@ contract GeneralTransferManager is ITransferManager { */ function modifyWhitelist( address _investor, - uint256 _fromTime, - uint256 _toTime, - uint256 _expiryTime, - bool _canBuyFromSTO + uint64 _fromTime, + uint64 _toTime, + uint64 _expiryTime, + uint8 _canBuyFromSTO ) public withPerm(WHITELIST) { - //Passing a _time == 0 into this function, is equivalent to removing the _investor from the whitelist - whitelist[_investor] = TimeRestriction(_fromTime, _toTime, _expiryTime, _canBuyFromSTO); + _modifyWhitelist(_investor, _fromTime, _toTime, _expiryTime, _canBuyFromSTO); + } + + /** + * @notice Adds or removes addresses from the whitelist. + * @param _investor is the address to whitelist + * @param _fromTime is the moment when the sale lockup period ends and the investor can freely sell his tokens + * @param _toTime is the moment when the purchase lockup period ends and the investor can freely purchase tokens from others + * @param _expiryTime is the moment till investors KYC will be validated. After that investor need to do re-KYC + * @param _canBuyFromSTO is used to know whether the investor is restricted investor or not. + */ + function _modifyWhitelist( + address _investor, + uint64 _fromTime, + uint64 _toTime, + uint64 _expiryTime, + uint8 _canBuyFromSTO + ) + internal + { + require(_investor != address(0), "Invalid investor"); + if (whitelist[_investor].added == uint8(0)) { + investors.push(_investor); + } + whitelist[_investor] = TimeRestriction(_fromTime, _toTime, _expiryTime, _canBuyFromSTO, uint8(1)); /*solium-disable-next-line security/no-block-members*/ emit ModifyWhitelist(_investor, now, msg.sender, _fromTime, _toTime, _expiryTime, _canBuyFromSTO); } @@ -216,17 +224,17 @@ contract GeneralTransferManager is ITransferManager { */ function modifyWhitelistMulti( address[] _investors, - uint256[] _fromTimes, - uint256[] _toTimes, - uint256[] _expiryTimes, - bool[] _canBuyFromSTO + uint64[] _fromTimes, + uint64[] _toTimes, + uint64[] _expiryTimes, + uint8[] _canBuyFromSTO ) public withPerm(WHITELIST) { require(_investors.length == _fromTimes.length, "Mismatched input lengths"); require(_fromTimes.length == _toTimes.length, "Mismatched input lengths"); require(_toTimes.length == _expiryTimes.length, "Mismatched input lengths"); require(_canBuyFromSTO.length == _toTimes.length, "Mismatched input length"); for (uint256 i = 0; i < _investors.length; i++) { - modifyWhitelist(_investors[i], _fromTimes[i], _toTimes[i], _expiryTimes[i], _canBuyFromSTO[i]); + _modifyWhitelist(_investors[i], _fromTimes[i], _toTimes[i], _expiryTimes[i], _canBuyFromSTO[i]); } } @@ -246,29 +254,31 @@ contract GeneralTransferManager is ITransferManager { */ function modifyWhitelistSigned( address _investor, - uint256 _fromTime, - uint256 _toTime, - uint256 _expiryTime, - bool _canBuyFromSTO, - uint256 _validFrom, - uint256 _validTo, + uint64 _fromTime, + uint64 _toTime, + uint64 _expiryTime, + uint8 _canBuyFromSTO, + uint64 _validFrom, + uint64 _validTo, uint256 _nonce, uint8 _v, bytes32 _r, bytes32 _s ) public { /*solium-disable-next-line security/no-block-members*/ - require(_validFrom <= now, "ValidFrom is too early"); + require(_validFrom <= uint64(now), "ValidFrom is too early"); /*solium-disable-next-line security/no-block-members*/ - require(_validTo >= now, "ValidTo is too late"); + require(_validTo >= uint64(now), "ValidTo is too late"); require(!nonceMap[_investor][_nonce], "Already used signature"); nonceMap[_investor][_nonce] = true; bytes32 hash = keccak256( abi.encodePacked(this, _investor, _fromTime, _toTime, _expiryTime, _canBuyFromSTO, _validFrom, _validTo, _nonce) ); _checkSig(hash, _v, _r, _s); - //Passing a _time == 0 into this function, is equivalent to removing the _investor from the whitelist - whitelist[_investor] = TimeRestriction(_fromTime, _toTime, _expiryTime, _canBuyFromSTO); + if (whitelist[_investor].added == uint8(0)) { + investors.push(_investor); + } + whitelist[_investor] = TimeRestriction(_fromTime, _toTime, _expiryTime, _canBuyFromSTO, uint8(1)); /*solium-disable-next-line security/no-block-members*/ emit ModifyWhitelist(_investor, now, msg.sender, _fromTime, _toTime, _expiryTime, _canBuyFromSTO); } @@ -289,8 +299,7 @@ contract GeneralTransferManager is ITransferManager { * @param _investor Address of the investor */ function _onWhitelist(address _investor) internal view returns(bool) { - return (((whitelist[_investor].fromTime != 0) || (whitelist[_investor].toTime != 0)) && - (whitelist[_investor].expiryTime >= now)); /*solium-disable-line security/no-block-members*/ + return (whitelist[_investor].expiryTime >= uint64(now)); /*solium-disable-line security/no-block-members*/ } /** @@ -301,6 +310,23 @@ contract GeneralTransferManager is ITransferManager { return attached; } + function _adjustTimes(uint64 _time) internal view returns(uint64) { + if (offset.isForward != 0) { + require(_time + offset.time > _time); + return _time + offset.time; + } else { + require(_time >= offset.time); + return _time - offset.time; + } + } + + /** + * @dev Returns list of all investors + */ + function getInvestors() external view returns(address[]) { + return investors; + } + /** * @notice Return the permissions flag that are associated with general trnasfer manager */ diff --git a/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol b/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol index c15eb52aa..4c81be20a 100644 --- a/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./GeneralTransferManager.sol"; +import "../../proxy/GeneralTransferManagerProxy.sol"; import "../ModuleFactory.sol"; /** @@ -8,19 +8,23 @@ import "../ModuleFactory.sol"; */ contract GeneralTransferManagerFactory is ModuleFactory { + address public logicContract; + /** * @notice Constructor * @param _polyAddress Address of the polytoken */ - constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public + constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost, address _logicContract) public ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost) { + require(_logicContract != address(0), "Invalid logic contract"); version = "1.0.0"; name = "GeneralTransferManager"; title = "General Transfer Manager"; description = "Manage transfers using a time based whitelist"; compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); + logicContract = _logicContract; } @@ -31,7 +35,7 @@ contract GeneralTransferManagerFactory is ModuleFactory { function deploy(bytes /* _data */) external returns(address) { if (setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom because of sufficent Allowance is not provided"); - address generalTransferManager = new GeneralTransferManager(msg.sender, address(polyToken)); + address generalTransferManager = new GeneralTransferManagerProxy(msg.sender, address(polyToken), logicContract); /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(generalTransferManager), getName(), address(this), msg.sender, setupCost, now); return address(generalTransferManager); diff --git a/contracts/modules/TransferManager/GeneralTransferManagerStorage.sol b/contracts/modules/TransferManager/GeneralTransferManagerStorage.sol new file mode 100644 index 000000000..f5c162080 --- /dev/null +++ b/contracts/modules/TransferManager/GeneralTransferManagerStorage.sol @@ -0,0 +1,53 @@ +pragma solidity ^0.4.24; + +/** + * @title Transfer Manager module for core transfer validation functionality + */ +contract GeneralTransferManagerStorage { + + //Address from which issuances come + address public issuanceAddress = address(0); + + //Address which can sign whitelist changes + address public signingAddress = address(0); + + bytes32 public constant WHITELIST = "WHITELIST"; + bytes32 public constant FLAGS = "FLAGS"; + + //from and to timestamps that an investor can send / receive tokens respectively + struct TimeRestriction { + uint64 fromTime; + uint64 toTime; + uint64 expiryTime; + uint8 canBuyFromSTO; + uint8 added; + } + + // Allows all TimeRestrictions to be offset + struct Offset { + uint64 time; + uint8 isForward; + } + + // Offset to be applied to all timings (except KYC expiry) + Offset public offset; + + // List of all addresses that have been added to the GTM at some point + address[] public investors; + + // An address can only send / receive tokens once their corresponding uint256 > block.number + // (unless allowAllTransfers == true or allowAllWhitelistTransfers == true) + mapping (address => TimeRestriction) public whitelist; + // Map of used nonces by customer + mapping(address => mapping(uint256 => bool)) public nonceMap; + + //If true, there are no transfer restrictions, for any addresses + bool public allowAllTransfers = false; + //If true, time lock is ignored for transfers (address must still be on whitelist) + bool public allowAllWhitelistTransfers = false; + //If true, time lock is ignored for issuances (address must still be on whitelist) + bool public allowAllWhitelistIssuances = true; + //If true, time lock is ignored for burn transactions + bool public allowAllBurnTransfers = false; + +} diff --git a/contracts/proxy/ERC20DividendCheckpointProxy.sol b/contracts/proxy/ERC20DividendCheckpointProxy.sol new file mode 100644 index 000000000..8839d30e1 --- /dev/null +++ b/contracts/proxy/ERC20DividendCheckpointProxy.sol @@ -0,0 +1,31 @@ +pragma solidity ^0.4.24; + +import "../modules/Checkpoint/ERC20DividendCheckpointStorage.sol"; +import "../modules/Checkpoint/DividendCheckpointStorage.sol"; +import "./OwnedProxy.sol"; +import "../Pausable.sol"; +import "../modules/ModuleStorage.sol"; + +/** + * @title Transfer Manager module for core transfer validation functionality + */ +contract ERC20DividendCheckpointProxy is ERC20DividendCheckpointStorage, DividendCheckpointStorage, ModuleStorage, Pausable, OwnedProxy { + + /** + * @notice Constructor + * @param _securityToken Address of the security token + * @param _polyAddress Address of the polytoken + * @param _implementation representing the address of the new implementation to be set + */ + constructor (address _securityToken, address _polyAddress, address _implementation) + public + ModuleStorage(_securityToken, _polyAddress) + { + require( + _implementation != address(0), + "Implementation address should not be 0x" + ); + __implementation = _implementation; + } + +} diff --git a/contracts/proxy/EtherDividendCheckpointProxy.sol b/contracts/proxy/EtherDividendCheckpointProxy.sol new file mode 100644 index 000000000..40b1c1332 --- /dev/null +++ b/contracts/proxy/EtherDividendCheckpointProxy.sol @@ -0,0 +1,30 @@ +pragma solidity ^0.4.24; + +import "../modules/Checkpoint/DividendCheckpointStorage.sol"; +import "./OwnedProxy.sol"; +import "../Pausable.sol"; +import "../modules/ModuleStorage.sol"; + +/** + * @title Transfer Manager module for core transfer validation functionality + */ +contract EtherDividendCheckpointProxy is DividendCheckpointStorage, ModuleStorage, Pausable, OwnedProxy { + + /** + * @notice Constructor + * @param _securityToken Address of the security token + * @param _polyAddress Address of the polytoken + * @param _implementation representing the address of the new implementation to be set + */ + constructor (address _securityToken, address _polyAddress, address _implementation) + public + ModuleStorage(_securityToken, _polyAddress) + { + require( + _implementation != address(0), + "Implementation address should not be 0x" + ); + __implementation = _implementation; + } + +} diff --git a/contracts/proxy/GeneralTransferManagerProxy.sol b/contracts/proxy/GeneralTransferManagerProxy.sol new file mode 100644 index 000000000..cb9b69070 --- /dev/null +++ b/contracts/proxy/GeneralTransferManagerProxy.sol @@ -0,0 +1,30 @@ +pragma solidity ^0.4.24; + +import "../modules/TransferManager/GeneralTransferManagerStorage.sol"; +import "./OwnedProxy.sol"; +import "../Pausable.sol"; +import "../modules/ModuleStorage.sol"; + +/** + * @title Transfer Manager module for core transfer validation functionality + */ +contract GeneralTransferManagerProxy is GeneralTransferManagerStorage, ModuleStorage, Pausable, OwnedProxy { + + /** + * @notice Constructor + * @param _securityToken Address of the security token + * @param _polyAddress Address of the polytoken + * @param _implementation representing the address of the new implementation to be set + */ + constructor (address _securityToken, address _polyAddress, address _implementation) + public + ModuleStorage(_securityToken, _polyAddress) + { + require( + _implementation != address(0), + "Implementation address should not be 0x" + ); + __implementation = _implementation; + } + +} diff --git a/contracts/proxy/OwnedProxy.sol b/contracts/proxy/OwnedProxy.sol new file mode 100644 index 000000000..b75142fbe --- /dev/null +++ b/contracts/proxy/OwnedProxy.sol @@ -0,0 +1,91 @@ +pragma solidity ^0.4.18; + +import "./Proxy.sol"; + +/** + * @title OwnedProxy + * @dev This contract combines an upgradeability proxy with basic authorization control functionalities + */ +contract OwnedProxy is Proxy { + + // Owner of the contract + address private __owner; + + // Address of the current implementation + address internal __implementation; + + /** + * @dev Event to show ownership has been transferred + * @param _previousOwner representing the address of the previous owner + * @param _newOwner representing the address of the new owner + */ + event ProxyOwnershipTransferred(address _previousOwner, address _newOwner); + + /** + * @dev Throws if called by any account other than the owner. + */ + modifier ifOwner() { + if (msg.sender == _owner()) { + _; + } else { + _fallback(); + } + } + + /** + * @dev the constructor sets the original owner of the contract to the sender account. + */ + constructor() public { + _setOwner(msg.sender); + } + + /** + * @dev Tells the address of the owner + * @return the address of the owner + */ + function _owner() internal view returns (address) { + return __owner; + } + + /** + * @dev Sets the address of the owner + */ + function _setOwner(address _newOwner) internal { + require(_newOwner != address(0), "Address should not be 0x"); + __owner = _newOwner; + } + + /** + * @notice Internal function to provide the address of the implementation contract + */ + function _implementation() internal view returns (address) { + return __implementation; + } + + /** + * @dev Tells the address of the proxy owner + * @return the address of the proxy owner + */ + function proxyOwner() external ifOwner returns (address) { + return _owner(); + } + + /** + * @dev Tells the address of the current implementation + * @return address of the current implementation + */ + function implementation() external ifOwner returns (address) { + return _implementation(); + } + + /** + * @dev Allows the current owner to transfer control of the contract to a newOwner. + * @param _newOwner The address to transfer ownership to. + */ + function transferProxyOwnership(address _newOwner) external ifOwner { + require(_newOwner != address(0), "Address should not be 0x"); + emit ProxyOwnershipTransferred(_owner(), _newOwner); + _setOwner(_newOwner); + } + +} diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index 694fdf03e..f25cfab35 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -1,9 +1,12 @@ const PolymathRegistry = artifacts.require('./PolymathRegistry.sol') const GeneralTransferManagerFactory = artifacts.require('./GeneralTransferManagerFactory.sol') +const GeneralTransferManagerLogic = artifacts.require('./GeneralTransferManager.sol') const GeneralPermissionManagerFactory = artifacts.require('./GeneralPermissionManagerFactory.sol') const PercentageTransferManagerFactory = artifacts.require('./PercentageTransferManagerFactory.sol') const USDTieredSTOProxyFactory = artifacts.require('./USDTieredSTOProxyFactory.sol'); const CountTransferManagerFactory = artifacts.require('./CountTransferManagerFactory.sol') +const EtherDividendCheckpointLogic = artifacts.require('./EtherDividendCheckpoint.sol') +const ERC20DividendCheckpointLogic = artifacts.require('./ERC20DividendCheckpoint.sol') const EtherDividendCheckpointFactory = artifacts.require('./EtherDividendCheckpointFactory.sol') const ERC20DividendCheckpointFactory = artifacts.require('./ERC20DividendCheckpointFactory.sol') const ModuleRegistry = artifacts.require('./ModuleRegistry.sol'); @@ -145,10 +148,22 @@ module.exports = function (deployer, network, accounts) { moduleRegistry = ModuleRegistry.at(ModuleRegistryProxy.address); // Add module registry to polymath registry return polymathRegistry.changeAddress("ModuleRegistry", ModuleRegistryProxy.address, {from: PolymathAccount}); + }).then(() => { + // B) Deploy the GeneralTransferManagerLogic Contract (Factory used to generate the GeneralTransferManager contract and this + // manager attach with the securityToken contract at the time of deployment) + return deployer.deploy(GeneralTransferManagerLogic, "0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", {from: PolymathAccount}); + }).then(() => { + // B) Deploy the GeneralTransferManagerLogic Contract (Factory used to generate the GeneralTransferManager contract and this + // manager attach with the securityToken contract at the time of deployment) + return deployer.deploy(ERC20DividendCheckpointLogic, "0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", {from: PolymathAccount}); + }).then(() => { + // B) Deploy the GeneralTransferManagerLogic Contract (Factory used to generate the GeneralTransferManager contract and this + // manager attach with the securityToken contract at the time of deployment) + return deployer.deploy(EtherDividendCheckpointLogic, "0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", {from: PolymathAccount}); }).then(() => { // B) Deploy the GeneralTransferManagerFactory Contract (Factory used to generate the GeneralTransferManager contract and this // manager attach with the securityToken contract at the time of deployment) - return deployer.deploy(GeneralTransferManagerFactory, PolyToken, 0, 0, 0, {from: PolymathAccount}); + return deployer.deploy(GeneralTransferManagerFactory, PolyToken, 0, 0, 0, GeneralTransferManagerLogic.address, {from: PolymathAccount}); }).then(() => { // C) Deploy the GeneralPermissionManagerFactory Contract (Factory used to generate the GeneralPermissionManager contract and // this manager attach with the securityToken contract at the time of deployment) @@ -164,11 +179,11 @@ module.exports = function (deployer, network, accounts) { }).then(() => { // D) Deploy the EtherDividendCheckpointFactory Contract (Factory used to generate the EtherDividendCheckpoint contract use // to provide the functionality of the dividend in terms of ETH) - return deployer.deploy(EtherDividendCheckpointFactory, PolyToken, 0, 0, 0, {from: PolymathAccount}); + return deployer.deploy(EtherDividendCheckpointFactory, PolyToken, 0, 0, 0, EtherDividendCheckpointLogic.address, {from: PolymathAccount}); }).then(() => { // D) Deploy the ERC20DividendCheckpointFactory Contract (Factory used to generate the ERC20DividendCheckpoint contract use // to provide the functionality of the dividend in terms of ERC20 token) - return deployer.deploy(ERC20DividendCheckpointFactory, PolyToken, 0, 0, 0, {from: PolymathAccount}); + return deployer.deploy(ERC20DividendCheckpointFactory, PolyToken, 0, 0, 0, ERC20DividendCheckpointLogic.address, {from: PolymathAccount}); }).then(() => { // D) Deploy the ManualApprovalTransferManagerFactory Contract (Factory used to generate the ManualApprovalTransferManager contract use // to manual approve the transfer that will overcome the other transfer restrictions) @@ -303,6 +318,7 @@ module.exports = function (deployer, network, accounts) { POLYOracle: ${POLYOracle} STFactory: ${STFactory.address} + GeneralTransferManagerLogic: ${GeneralTransferManagerLogic.address} GeneralTransferManagerFactory: ${GeneralTransferManagerFactory.address} GeneralPermissionManagerFactory: ${GeneralPermissionManagerFactory.address} @@ -313,6 +329,8 @@ module.exports = function (deployer, network, accounts) { CountTransferManagerFactory: ${CountTransferManagerFactory.address} PercentageTransferManagerFactory: ${PercentageTransferManagerFactory.address} ManualApprovalTransferManagerFactory: ${ManualApprovalTransferManagerFactory.address} + EtherDividendCheckpointLogic: ${EtherDividendCheckpointLogic.address} + ERC20DividendCheckpointLogic: ${ERC20DividendCheckpointLogic.address} EtherDividendCheckpointFactory: ${EtherDividendCheckpointFactory.address} ERC20DividendCheckpointFactory: ${ERC20DividendCheckpointFactory.address} --------------------------------------------------------------------------------- diff --git a/package.json b/package.json index ef2d76c38..58104d99b 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "ethers": "^3.0.15", "fs": "0.0.1-security", "openzeppelin-solidity": "1.10.0", + "prompt": "^1.0.0", "readline-sync": "^1.4.9", "request": "^2.88.0", "request-promise": "^4.2.2", diff --git a/scripts/compareStorageLayout.js b/scripts/compareStorageLayout.js new file mode 100644 index 000000000..c339bf095 --- /dev/null +++ b/scripts/compareStorageLayout.js @@ -0,0 +1,139 @@ +const fs = require('fs'); +const _ = require('underscore'); +const solc = require('solc'); +const prompt = require('prompt'); +const path = require('path'); +const util = require('util'); +const exec = util.promisify(require('child_process').exec); + +prompt.start(); + +prompt.get(['LogicContract', 'ProxyContract'], async(err, result) => { + + let logicContract; + let proxyContract; + + const fileList = walkSync('./contracts', []); + + let paths = findPath(result.LogicContract, result.ProxyContract, fileList); + + if (paths.length == 2) { + + console.log("Contracts exists \n"); + + await flatContracts(paths); + + if (path.basename(paths[0]) === result.LogicContract) { + logicContract = fs.readFileSync(`./flat/${path.basename(paths[0])}`, 'utf8'); + } else { + logicContract = fs.readFileSync(`./flat/${path.basename(paths[1])}`, 'utf8'); + } + if (path.basename(paths[0]) === result.ProxyContract) { + proxyContract = fs.readFileSync(`./flat/${path.basename(paths[0])}`, 'utf8'); + } else { + proxyContract = fs.readFileSync(`./flat/${path.basename(paths[1])}`, 'utf8'); + } + + let logicInput = { + 'contracts': logicContract + } + let proxyInput = { + 'contracts': proxyContract + } + + console.log(compareStorageLayouts(parseContract(logicInput), parseContract(proxyInput))); + + } else { + console.log("Contracts doesn't exists"); + } +}); + +function traverseAST(_input, _elements) { + if(_input.children) { + for(var i=0;i<_input.children.length;i++) { + traverseAST(_input.children[i], _elements); + } + } + _elements.push(_input); +} + +function compareStorageLayouts(logicLayout, proxyLayout) { + function makeComp(x) { + return [x.constant, x.name, x.stateVariable, x.storageLocation, x.type, x.value, x.visibility].join(':'); + } + // if(newLayout.length < oldLayout.length) return false; + for(var i=0; i < logicLayout.length; i++) { + const a = logicLayout[i].attributes; + const comp1 = makeComp(a) + console.log(comp1); + const b = proxyLayout[i].attributes; + const comp2 = makeComp(b); + console.log(comp2); + if(comp1 != comp2) { + return false; + } + } + return true; +} + +function parseContract(input) { + + var output = solc.compile({ sources: input }, 1, _.noop); + const elements = []; + const AST = output.sources.contracts.AST; + // console.log(AST); + traverseAST(AST, elements); + // console.log(elements); + + // filter out all Contract Definitions + const contractDefinitions = _.filter(elements, (e,i) => e.name == 'ContractDefinition'); + + // filter out all linearizedBaseContracts + // pick the last one as the last contract always has the full inheritance + const linearizedBaseContracts = _.last(_.map(contractDefinitions, e => e.attributes.linearizedBaseContracts)); + + // get all stateVariables + const stateVariables = _.filter(elements, e => e.attributes && e.attributes.stateVariable ) + + // group them by scope + const stateVariableMap = _.groupBy(stateVariables, e => e.attributes.scope); + + orderedStateVariables = _.reduceRight(linearizedBaseContracts, (a, b) => { + return a.concat(stateVariableMap[b] || []) + }, []); + return orderedStateVariables; +} + +var walkSync = function(dir, filelist) { + files = fs.readdirSync(dir); + filelist = filelist || []; + files.forEach(function(file) { + if (fs.statSync(path.join(dir, file)).isDirectory()) { + filelist = walkSync(path.join(dir, file), filelist); + } + else { + filelist.push(path.join(dir, file)); + } + }); + return filelist; +}; + +var findPath = function(logicContractName, proxyContractName, fileList) { + let paths = new Array(); + for (let i =0; i < fileList.length; i++) { + if ((logicContractName === path.basename(fileList[i]) || logicContractName === (path.basename(fileList[i])).split(".")[0]) || + (proxyContractName === path.basename(fileList[i]) || proxyContractName === (path.basename(fileList[i])).split(".")[0])) { + paths.push(fileList[i]); + } + } + return paths; +} + +async function flatContracts(_paths, _logic) { + let promises = new Array(); + for (let i = 0; i< _paths.length; i++) { + promises.push(await exec(`./node_modules/.bin/sol-merger ${_paths[i]} ./flat`)); + } + await Promise.all(promises); +} + diff --git a/test/b_capped_sto.js b/test/b_capped_sto.js index fce1ee5e5..b1365ad3b 100644 --- a/test/b_capped_sto.js +++ b/test/b_capped_sto.js @@ -130,7 +130,7 @@ contract("CappedSTO", accounts => { // STEP 5: Deploy the GeneralDelegateManagerFactory [I_GeneralPermissionManagerFactory] = await deployGPMAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, 0); - + // STEP 6: Deploy the CappedSTOFactory I_CappedSTOFactory = await CappedSTOFactory.new(I_PolyToken.address, cappedSTOSetupCost, 0, 0, { from: token_owner }); @@ -360,7 +360,7 @@ contract("CappedSTO", accounts => { balanceOfReceiver = await web3.eth.getBalance(account_fundsReceiver); // Add the Investor in to the whitelist - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, 1, { from: account_issuer }); @@ -443,7 +443,7 @@ contract("CappedSTO", accounts => { fromTime, toTime + duration.days(20), expiryTime, - true, + 1, { from: account_issuer } @@ -565,7 +565,7 @@ contract("CappedSTO", accounts => { it("Should successfully whitelist investor 3", async () => { balanceOfReceiver = await web3.eth.getBalance(account_fundsReceiver); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor3, fromTime, toTime, expiryTime, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor3, fromTime, toTime, expiryTime, 1, { from: account_issuer, gas: 500000 }); @@ -733,7 +733,7 @@ contract("CappedSTO", accounts => { "Tokens are not transfered properly" ); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, P_fromTime, P_toTime, P_expiryTime, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, P_fromTime, P_toTime, P_expiryTime, 1, { from: account_issuer, gas: 500000 }); @@ -800,7 +800,7 @@ contract("CappedSTO", accounts => { P_fromTime, P_toTime + duration.days(20), P_expiryTime, - true, + 1, { from: account_issuer, gas: 500000 @@ -997,7 +997,7 @@ contract("CappedSTO", accounts => { await I_PolyToken.getTokens(polyToInvest * Math.pow(10, 18), account_investor3); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor3, P_fromTime, P_toTime, P_expiryTime, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor3, P_fromTime, P_toTime, P_expiryTime, 1, { from: account_issuer, gas: 500000 }); diff --git a/test/c_checkpoints.js b/test/c_checkpoints.js index 6a08b6dea..2ba198f83 100644 --- a/test/c_checkpoints.js +++ b/test/c_checkpoints.js @@ -149,7 +149,7 @@ contract("Checkpoints", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - false, + 0, { from: account_issuer, gas: 6000000 @@ -176,7 +176,7 @@ contract("Checkpoints", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - false, + 0, { from: account_issuer, gas: 6000000 @@ -201,7 +201,7 @@ contract("Checkpoints", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - false, + 0, { from: account_issuer, gas: 6000000 diff --git a/test/d_count_transfer_manager.js b/test/d_count_transfer_manager.js index 1a1e7717a..4e86bdbb6 100644 --- a/test/d_count_transfer_manager.js +++ b/test/d_count_transfer_manager.js @@ -200,7 +200,7 @@ contract("CountTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 500000 @@ -230,7 +230,7 @@ contract("CountTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 500000 @@ -257,7 +257,7 @@ contract("CountTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 500000 @@ -282,7 +282,7 @@ contract("CountTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 500000 diff --git a/test/e_erc20_dividends.js b/test/e_erc20_dividends.js index b832bcee2..6a4baeab6 100644 --- a/test/e_erc20_dividends.js +++ b/test/e_erc20_dividends.js @@ -89,7 +89,7 @@ contract("ERC20DividendCheckpoint", accounts => { account_investor4 = accounts[9]; account_temp = accounts[2]; account_manager = accounts[5]; - + // Step 1: Deploy the genral PM ecosystem let instances = await setUpPolymathNetwork(account_polymath, token_owner); @@ -202,7 +202,7 @@ contract("ERC20DividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(30), - true, + 1, { from: account_issuer, gas: 500000 @@ -232,7 +232,7 @@ contract("ERC20DividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(30), - true, + 1, { from: account_issuer, gas: 500000 @@ -372,7 +372,7 @@ contract("ERC20DividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(20), - true, + 1, { from: account_issuer, gas: 500000 @@ -434,7 +434,7 @@ contract("ERC20DividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 500000 @@ -970,7 +970,7 @@ contract("ERC20DividendCheckpoint", accounts => { let expiry = latestTime() + duration.days(10); let exclusions = [1]; let checkpointID = await I_SecurityToken.createCheckpoint.call({ from: token_owner }); - await I_SecurityToken.createCheckpoint({ from: token_owner }); + await I_SecurityToken.createCheckpoint({ from: token_owner }); await catchRevert(I_ERC20DividendCheckpoint.createDividendWithCheckpointAndExclusions( maturity, expiry, diff --git a/test/f_ether_dividends.js b/test/f_ether_dividends.js index b4e5bbf2b..68c11f72f 100644 --- a/test/f_ether_dividends.js +++ b/test/f_ether_dividends.js @@ -200,7 +200,7 @@ contract("EtherDividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(30), - true, + 1, { from: account_issuer, gas: 500000 @@ -230,7 +230,7 @@ contract("EtherDividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(30), - true, + 1, { from: account_issuer, gas: 500000 @@ -364,7 +364,7 @@ contract("EtherDividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(20), - true, + 1, { from: account_issuer, gas: 500000 @@ -415,7 +415,7 @@ contract("EtherDividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 500000 @@ -719,7 +719,7 @@ contract("EtherDividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 500000 @@ -851,7 +851,7 @@ contract("EtherDividendCheckpoint", accounts => { let expiry = latestTime() + duration.days(10); let exclusions = [1]; let checkpointID = await I_SecurityToken.createCheckpoint.call({ from: token_owner }); - await I_SecurityToken.createCheckpoint({ from: token_owner }); + await I_SecurityToken.createCheckpoint({ from: token_owner }); await catchRevert(I_EtherDividendCheckpoint.createDividendWithCheckpointAndExclusions( maturity, expiry, diff --git a/test/h_general_transfer_manager.js b/test/h_general_transfer_manager.js index 3e060c288..5dbcf5a6c 100644 --- a/test/h_general_transfer_manager.js +++ b/test/h_general_transfer_manager.js @@ -92,6 +92,7 @@ contract("GeneralTransferManager", accounts => { account_investor1 = accounts[8]; account_investor2 = accounts[9]; account_delegate = accounts[7]; + account_investor3 = accounts[5]; account_investor4 = accounts[6]; account_affiliates1 = accounts[3]; @@ -172,14 +173,14 @@ contract("GeneralTransferManager", accounts => { await catchRevert( I_SecurityToken.addModule(P_GeneralTransferManagerFactory.address, "", web3.utils.toWei("500"), 0, {from: account_issuer}) ); - }) + }); it("Should attach the paid GTM", async() => { let snap_id = await takeSnapshot(); await I_PolyToken.getTokens(web3.utils.toWei("500"), I_SecurityToken.address); await I_SecurityToken.addModule(P_GeneralTransferManagerFactory.address, "", web3.utils.toWei("500"), 0, {from: account_issuer}); await revertToSnapshot(snap_id); - }) + }); it("Should whitelist the affiliates before the STO attached", async () => { let tx = await I_GeneralTransferManager.modifyWhitelistMulti( @@ -187,7 +188,7 @@ contract("GeneralTransferManager", accounts => { [latestTime() + duration.days(30), latestTime() + duration.days(30)], [latestTime() + duration.days(90), latestTime() + duration.days(90)], [latestTime() + duration.years(1), latestTime() + duration.years(1)], - [false, false], + [0, 0], { from: account_issuer, gas: 6000000 @@ -195,6 +196,30 @@ contract("GeneralTransferManager", accounts => { ); assert.equal(tx.logs[0].args._investor, account_affiliates1); assert.equal(tx.logs[1].args._investor, account_affiliates2); + assert.deepEqual(await I_GeneralTransferManager.getInvestors.call(), [account_affiliates1, account_affiliates2]); + }); + + it("Should whitelist lots of addresses and check gas", async () => { + let mockInvestors = []; + for (let i = 0; i < 50; i++) { + mockInvestors.push("0x1000000000000000000000000000000000000000".substring(0,42-i.toString().length) + i.toString()); + } + + let times = range1(50); + let bools = rangeB(50); + let tx = await I_GeneralTransferManager.modifyWhitelistMulti( + mockInvestors, + times, + times, + times, + bools, + { + from: account_issuer, + gas: 7900000 + } + ); + console.log("Multi Whitelist x 50: " + tx.receipt.gasUsed); + assert.deepEqual(await I_GeneralTransferManager.getInvestors.call(), [account_affiliates1, account_affiliates2].concat(mockInvestors)); }); it("Should mint the tokens to the affiliates", async () => { @@ -291,7 +316,7 @@ contract("GeneralTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 6000000 @@ -320,7 +345,7 @@ contract("GeneralTransferManager", accounts => { it("Should fail in buying the tokens from the STO -- because amount is 0", async() => { await catchRevert( I_DummySTO.generateTokens(account_investor1, 0, { from: token_owner }) - ); + ); }); it("Should fail in buying the tokens from the STO -- because STO is paused", async() => { @@ -342,6 +367,106 @@ contract("GeneralTransferManager", accounts => { }); }); + describe("Buy tokens using on-chain whitelist and negative offset", async () => { + // let snap_id; + + it("Should Buy the tokens", async () => { + // Add the Investor in to the whitelist + // snap_id = await takeSnapshot(); + let tx = await I_GeneralTransferManager.modifyWhitelist( + account_investor1, + latestTime() + duration.days(10), + latestTime() + duration.days(10), + latestTime() + duration.days(20), + 1, + { + from: account_issuer, + gas: 6000000 + } + ); + + assert.equal( + tx.logs[0].args._investor.toLowerCase(), + account_investor1.toLowerCase(), + "Failed in adding the investor in whitelist" + ); + + // Jump time + await increaseTime(5000); + + // Mint some tokens + await I_DummySTO.generateTokens(account_investor1, web3.utils.toWei("1", "ether"), { from: token_owner }); + + await catchRevert(I_SecurityToken.transfer(account_investor1, web3.utils.toWei("1", "ether"), {from: account_investor1})); + assert.equal((await I_SecurityToken.balanceOf(account_investor1)).toNumber(), web3.utils.toWei("3", "ether")); + }); + + it("Add an offset and check transfers are disabled", async () => { + let tx = await I_GeneralTransferManager.modifyOffset(duration.days(10), 0, {from: token_owner}); + await I_SecurityToken.transfer(account_investor1, web3.utils.toWei("1", "ether"), {from: account_investor1}); + assert.equal((await I_SecurityToken.balanceOf(account_investor1)).toNumber(), web3.utils.toWei("3", "ether")); + tx = await I_GeneralTransferManager.modifyOffset(0, 0, {from: token_owner}); + // await revertToSnapshot(snap_id); + }); + + }); + + + describe("Buy tokens using on-chain whitelist and positive offset", async () => { + // let snap_id; + + it("Should Buy the tokens", async () => { + + // Add the Investor in to the whitelist + // snap_id = await takeSnapshot(); + let tx = await I_GeneralTransferManager.modifyWhitelist( + account_investor1, + latestTime(), + latestTime(), + latestTime() + duration.days(20), + 1, + { + from: account_issuer, + gas: 6000000 + } + ); + + assert.equal( + tx.logs[0].args._investor.toLowerCase(), + account_investor1.toLowerCase(), + "Failed in adding the investor in whitelist" + ); + + // Jump time + await increaseTime(5000); + // console.log("vT1: " + JSON.stringify(await I_GeneralTransferManager.verifyTransfer.call(account_investor1, account_investor1, web3.utils.toWei("1", "ether"), "", false))); + // console.log("vT2: " + JSON.stringify(await I_GeneralTransferManager.verifyTransfer.call("0x0000000000000000000000000000000000000000", account_investor1, web3.utils.toWei("1", "ether"), "", false))); + + // Mint some tokens + console.log(await I_GeneralTransferManager.offset.call()); + await I_DummySTO.generateTokens(account_investor1, web3.utils.toWei("1", "ether"), { from: token_owner }); + + assert.equal((await I_SecurityToken.balanceOf(account_investor1)).toNumber(), web3.utils.toWei("4", "ether")); + await I_SecurityToken.transfer(account_investor1, web3.utils.toWei("1", "ether"), {from: account_investor1}); + }); + + it("Add an offset and check transfers are disabled", async () => { + let tx = await I_GeneralTransferManager.modifyOffset(duration.days(10), 1, {from: token_owner}); + // console.log("vT1: " + JSON.stringify(await I_GeneralTransferManager.verifyTransfer.call(account_investor1, account_investor1, web3.utils.toWei("1", "ether"), "", false))); + // console.log("vT2: " + JSON.stringify(await I_GeneralTransferManager.verifyTransfer.call("0x0000000000000000000000000000000000000000", account_investor1, web3.utils.toWei("1", "ether"), "", false))); + + await catchRevert(I_SecurityToken.transfer(account_investor1, web3.utils.toWei("1", "ether"), {from: account_investor1})); + await increaseTime(duration.days(10)); + // console.log("vT1: " + JSON.stringify(await I_GeneralTransferManager.verifyTransfer.call(account_investor1, account_investor1, web3.utils.toWei("1", "ether"), "", false))); + // console.log("vT2: " + JSON.stringify(await I_GeneralTransferManager.verifyTransfer.call("0x0000000000000000000000000000000000000000", account_investor1, web3.utils.toWei("1", "ether"), "", false))); + + await I_SecurityToken.transfer(account_investor1, web3.utils.toWei("1", "ether"), {from: account_investor1}); + tx = await I_GeneralTransferManager.modifyOffset(0, 0, {from: token_owner}); + // await revertToSnapshot(snap_id); + }); + + }); + describe("Buy tokens using off-chain whitelist", async () => { it("Should buy the tokens -- Failed due to investor is not in the whitelist", async () => { await catchRevert(I_DummySTO.generateTokens(account_investor2, web3.utils.toWei("1", "ether"), { from: token_owner })); @@ -359,7 +484,7 @@ contract("GeneralTransferManager", accounts => { fromTime, toTime, expiryTime, - true, + 1, validFrom, validTo, nonce, @@ -376,7 +501,7 @@ contract("GeneralTransferManager", accounts => { fromTime, toTime, expiryTime, - true, + 1, validFrom, validTo, nonce, @@ -403,7 +528,7 @@ contract("GeneralTransferManager", accounts => { fromTime, toTime, expiryTime, - true, + 1, validFrom, validTo, nonce, @@ -420,7 +545,7 @@ contract("GeneralTransferManager", accounts => { fromTime, toTime, expiryTime, - true, + 1, validFrom, validTo, nonce, @@ -447,7 +572,7 @@ contract("GeneralTransferManager", accounts => { fromTime, toTime, expiryTime, - true, + 1, validFrom, validTo, nonce, @@ -464,7 +589,7 @@ contract("GeneralTransferManager", accounts => { fromTime, toTime, expiryTime, - true, + 1, validFrom, validTo, nonce, @@ -491,7 +616,7 @@ contract("GeneralTransferManager", accounts => { latestTime(), latestTime() + duration.days(80), expiryTime + duration.days(200), - true, + 1, validFrom, validTo, nonce, @@ -507,7 +632,7 @@ contract("GeneralTransferManager", accounts => { latestTime(), latestTime() + duration.days(80), expiryTime + duration.days(200), - true, + 1, validFrom, validTo, nonce, @@ -547,7 +672,7 @@ contract("GeneralTransferManager", accounts => { latestTime(), latestTime() + duration.days(80), expiryTime + duration.days(200), - true, + 1, validFrom, validTo, nonce, @@ -563,7 +688,7 @@ contract("GeneralTransferManager", accounts => { latestTime(), latestTime() + duration.days(80), expiryTime + duration.days(200), - true, + 1, validFrom, validTo, nonce, @@ -670,7 +795,7 @@ contract("GeneralTransferManager", accounts => { [fromTime, fromTime], [toTime, toTime], [expiryTime, expiryTime], - [true, true], + [1, 1], { from: account_delegate, gas: 6000000 @@ -690,7 +815,7 @@ contract("GeneralTransferManager", accounts => { [fromTime], [toTime, toTime], [expiryTime, expiryTime], - [true, true], + [1, 1], { from: account_delegate, gas: 6000000 @@ -710,7 +835,7 @@ contract("GeneralTransferManager", accounts => { [fromTime, fromTime], [toTime], [expiryTime, expiryTime], - [true, true], + [1, 1], { from: account_delegate, gas: 6000000 @@ -730,7 +855,7 @@ contract("GeneralTransferManager", accounts => { [fromTime, fromTime], [toTime, toTime], [expiryTime], - [true, true], + [1, 1], { from: account_delegate, gas: 6000000 @@ -749,7 +874,7 @@ contract("GeneralTransferManager", accounts => { [fromTime, fromTime], [toTime, toTime], [expiryTime, expiryTime], - [true, true], + [1, 1], { from: token_owner, gas: 6000000 @@ -836,3 +961,6 @@ contract("GeneralTransferManager", accounts => { }) }); }); + +function range1(i) {return i?range1(i-1).concat(i):[]} +function rangeB(i) {return i?rangeB(i-1).concat(0):[]} diff --git a/test/helpers/createInstances.js b/test/helpers/createInstances.js index 2021d350e..a6118741f 100644 --- a/test/helpers/createInstances.js +++ b/test/helpers/createInstances.js @@ -8,6 +8,8 @@ const CappedSTOFactory = artifacts.require("./CappedSTOFactory.sol"); const SecurityTokenRegistryProxy = artifacts.require("./SecurityTokenRegistryProxy.sol"); const SecurityTokenRegistry = artifacts.require("./SecurityTokenRegistry.sol"); const SecurityTokenRegistryMock = artifacts.require("./SecurityTokenRegistryMock.sol"); +const ERC20DividendCheckpoint = artifacts.require("./ERC20DividendCheckpoint.sol"); +const EtherDividendCheckpoint = artifacts.require("./EtherDividendCheckpoint.sol"); const ERC20DividendCheckpointFactory = artifacts.require("./ERC20DividendCheckpointFactory.sol"); const EtherDividendCheckpointFactory = artifacts.require("./EtherDividendCheckpointFactory.sol"); const ManualApprovalTransferManagerFactory = artifacts.require("./ManualApprovalTransferManagerFactory.sol"); @@ -20,6 +22,7 @@ const USDTieredSTOProxyFactory = artifacts.require("./USDTieredSTOProxyFactory") const ManualApprovalTransferManager = artifacts.require("./ManualApprovalTransferManager"); const FeatureRegistry = artifacts.require("./FeatureRegistry.sol"); const STFactory = artifacts.require("./STFactory.sol"); +const GeneralTransferManager = artifacts.require("./GeneralTransferManager.sol"); const GeneralTransferManagerFactory = artifacts.require("./GeneralTransferManagerFactory.sol"); const GeneralPermissionManagerFactory = artifacts.require("./GeneralPermissionManagerFactory.sol"); const CountTransferManagerFactory = artifacts.require("./CountTransferManagerFactory.sol"); @@ -45,10 +48,13 @@ let I_SingleTradeVolumeRestrictionManagerFactory; let I_ManualApprovalTransferManagerFactory; let I_VolumeRestrictionTransferManagerFactory; let I_PercentageTransferManagerFactory; +let I_EtherDividendCheckpointLogic; let I_EtherDividendCheckpointFactory; let I_CountTransferManagerFactory; +let I_ERC20DividendCheckpointLogic; let I_ERC20DividendCheckpointFactory; let I_GeneralPermissionManagerFactory; +let I_GeneralTransferManagerLogic; let I_GeneralTransferManagerFactory; let I_GeneralTransferManager; let I_ModuleRegistryProxy; @@ -82,7 +88,9 @@ export async function setUpPolymathNetwork(account_polymath, token_owner) { let b = await deployFeatureRegistry(account_polymath); // STEP 3: Deploy the ModuleRegistry let c = await deployModuleRegistry(account_polymath); - // STEP 4: Deploy the GeneralTransferManagerFactory + // STEP 4a: Deploy the GeneralTransferManagerFactory + let logic = await deployGTMLogic(account_polymath); + // STEP 4b: Deploy the GeneralTransferManagerFactory let d = await deployGTM(account_polymath); // Step 6: Deploy the STversionProxy contract let e = await deploySTFactory(account_polymath); @@ -127,8 +135,20 @@ async function deployModuleRegistry(account_polymath) { return new Array(I_ModuleRegistry, I_ModuleRegistryProxy, I_MRProxied); } +async function deployGTMLogic(account_polymath) { + I_GeneralTransferManagerLogic = await GeneralTransferManager.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: account_polymath }); + + assert.notEqual( + I_GeneralTransferManagerLogic.address.valueOf(), + "0x0000000000000000000000000000000000000000", + "GeneralTransferManagerLogic contract was not deployed" + ); + + return new Array(I_GeneralTransferManagerLogic); +} + async function deployGTM(account_polymath) { - I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(I_PolyToken.address, 0, 0, 0, { from: account_polymath }); + I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(I_PolyToken.address, 0, 0, 0, I_GeneralTransferManagerLogic.address, { from: account_polymath }); assert.notEqual( I_GeneralTransferManagerFactory.address.valueOf(), @@ -193,7 +213,7 @@ async function registerAndVerifyByMR(factoryAdrress, owner, mr) { /// Deploy the TransferManagers export async function deployGTMAndVerifyed(accountPolymath, MRProxyInstance, polyToken, setupCost) { - I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath }); + I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(polyToken, setupCost, 0, 0, I_GeneralTransferManagerLogic.address, { from: accountPolymath }); assert.notEqual( I_GeneralPermissionManagerFactory.address.valueOf(), @@ -355,7 +375,8 @@ export async function deployUSDTieredSTOAndVerified(accountPolymath, MRProxyInst /// Deploy the Dividend Modules export async function deployERC20DividendAndVerifyed(accountPolymath, MRProxyInstance, polyToken, setupCost) { - I_ERC20DividendCheckpointFactory = await ERC20DividendCheckpointFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath }); + I_ERC20DividendCheckpointLogic = await ERC20DividendCheckpoint.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); + I_ERC20DividendCheckpointFactory = await ERC20DividendCheckpointFactory.new(polyToken, setupCost, 0, 0, I_ERC20DividendCheckpointLogic.address, { from: accountPolymath }); assert.notEqual( I_ERC20DividendCheckpointFactory.address.valueOf(), @@ -367,7 +388,8 @@ export async function deployERC20DividendAndVerifyed(accountPolymath, MRProxyIns } export async function deployEtherDividendAndVerifyed(accountPolymath, MRProxyInstance, polyToken, setupCost) { - I_EtherDividendCheckpointFactory = await EtherDividendCheckpointFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath }); + I_EtherDividendCheckpointLogic = await EtherDividendCheckpoint.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); + I_EtherDividendCheckpointFactory = await EtherDividendCheckpointFactory.new(polyToken, setupCost, 0, 0, I_EtherDividendCheckpointLogic.address, { from: accountPolymath }); assert.notEqual( I_EtherDividendCheckpointFactory.address.valueOf(), diff --git a/test/helpers/signData.js b/test/helpers/signData.js index ea7476cc3..2e5c1ad61 100644 --- a/test/helpers/signData.js +++ b/test/helpers/signData.js @@ -6,7 +6,7 @@ const ethUtil = require("ethereumjs-util"); function signData(tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, nonce, pk) { let packedData = utils .solidityKeccak256( - ["address", "address", "uint256", "uint256", "uint256", "bool", "uint256", "uint256", "uint256"], + ["address", "address", "uint64", "uint64", "uint64", "uint8", "uint64", "uint64", "uint256"], [tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, nonce] ) .slice(2); diff --git a/test/i_Issuance.js b/test/i_Issuance.js index ac1fcdd37..efcf0db96 100644 --- a/test/i_Issuance.js +++ b/test/i_Issuance.js @@ -215,7 +215,7 @@ contract("Issuance", accounts => { fromTime + duration.days(70), toTime + duration.days(90), expiryTime + duration.days(50), - true, + 1, { from: account_polymath } @@ -271,7 +271,7 @@ contract("Issuance", accounts => { }); it("should add the investor into the whitelist by the delegate", async () => { - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor2, fromTime, toTime, expiryTime, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor2, fromTime, toTime, expiryTime, 1, { from: account_delegate, gas: 7000000 }); diff --git a/test/j_manual_approval_transfer_manager.js b/test/j_manual_approval_transfer_manager.js index 0461f287a..c817f5c44 100644 --- a/test/j_manual_approval_transfer_manager.js +++ b/test/j_manual_approval_transfer_manager.js @@ -171,7 +171,7 @@ contract("ManualApprovalTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 6000000 @@ -201,7 +201,7 @@ contract("ManualApprovalTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 6000000 @@ -290,7 +290,7 @@ contract("ManualApprovalTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 6000000 diff --git a/test/l_percentage_transfer_manager.js b/test/l_percentage_transfer_manager.js index b15ee41a0..530b202c8 100644 --- a/test/l_percentage_transfer_manager.js +++ b/test/l_percentage_transfer_manager.js @@ -120,7 +120,7 @@ contract("PercentageTransferManager", accounts => { // STEP 4(b): Deploy the PercentageTransferManager [P_PercentageTransferManagerFactory] = await deployPercentageTMAndVerified(account_polymath, I_MRProxied, I_PolyToken.address, web3.utils.toWei("500", "ether")); - + // Printing all the contract addresses console.log(` --------------------- Polymath Network Smart Contracts: --------------------- @@ -192,7 +192,7 @@ contract("PercentageTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 6000000 @@ -222,7 +222,7 @@ contract("PercentageTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 6000000 @@ -287,7 +287,7 @@ contract("PercentageTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 6000000 diff --git a/test/m_presale_sto.js b/test/m_presale_sto.js index a89932dc4..35a348c30 100644 --- a/test/m_presale_sto.js +++ b/test/m_presale_sto.js @@ -236,7 +236,7 @@ contract("PreSaleSTO", accounts => { expiryTime = toTime + duration.days(100); // Add the Investor in to the whitelist - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, 1, { from: account_issuer, gas: 6000000 }); @@ -277,7 +277,7 @@ contract("PreSaleSTO", accounts => { expiryTime = toTime + duration.days(100); // Add the Investor in to the whitelist - let tx1 = await I_GeneralTransferManager.modifyWhitelist(account_investor2, fromTime, toTime, expiryTime, true, { + let tx1 = await I_GeneralTransferManager.modifyWhitelist(account_investor2, fromTime, toTime, expiryTime, 1, { from: account_issuer, gas: 6000000 }); @@ -285,7 +285,7 @@ contract("PreSaleSTO", accounts => { assert.equal(tx1.logs[0].args._investor, account_investor2, "Failed in adding the investor in whitelist"); // Add the Investor in to the whitelist - let tx2 = await I_GeneralTransferManager.modifyWhitelist(account_investor3, fromTime, toTime, expiryTime, true, { + let tx2 = await I_GeneralTransferManager.modifyWhitelist(account_investor3, fromTime, toTime, expiryTime, 1, { from: account_issuer, gas: 6000000 }); diff --git a/test/o_security_token.js b/test/o_security_token.js index 52521181e..7d2722a20 100644 --- a/test/o_security_token.js +++ b/test/o_security_token.js @@ -193,7 +193,7 @@ contract("SecurityToken", accounts => { let toTime = fromTime + duration.days(100); let expiryTime = toTime + duration.days(100); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_affiliate1, fromTime, toTime, expiryTime, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_affiliate1, fromTime, toTime, expiryTime, 1, { from: token_owner, gas: 6000000 }); @@ -212,7 +212,7 @@ contract("SecurityToken", accounts => { let toTime = fromTime + duration.days(100); let expiryTime = toTime + duration.days(100); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_affiliate2, fromTime, toTime, expiryTime, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_affiliate2, fromTime, toTime, expiryTime, 1, { from: token_owner, gas: 6000000 }); @@ -517,7 +517,7 @@ contract("SecurityToken", accounts => { toTime = fromTime + duration.days(100); expiryTime = toTime + duration.days(100); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, 1, { from: token_owner, gas: 6000000 }); @@ -614,7 +614,7 @@ contract("SecurityToken", accounts => { }); it("Should transfer from whitelist investor1 to whitelist investor 2", async () => { - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor2, fromTime, toTime, expiryTime, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor2, fromTime, toTime, expiryTime, 1, { from: token_owner, gas: 500000 }); @@ -636,7 +636,7 @@ contract("SecurityToken", accounts => { it("Should transferFrom from one investor to other", async () => { await I_SecurityToken.approve(account_investor1, 2 * Math.pow(10, 18), { from: account_investor2 }); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor3, fromTime, toTime, expiryTime, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor3, fromTime, toTime, expiryTime, 1, { from: token_owner, gas: 500000 }); @@ -682,7 +682,7 @@ contract("SecurityToken", accounts => { }); it("Should add the investor in the whitelist by the delegate", async () => { - let tx = await I_GeneralTransferManager.modifyWhitelist(account_temp, fromTime, toTime, expiryTime, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_temp, fromTime, toTime, expiryTime, 1, { from: account_delegate, gas: 6000000 }); @@ -722,7 +722,7 @@ contract("SecurityToken", accounts => { }); it("Should remove investor from the whitelist by the delegate", async () => { - let tx = await I_GeneralTransferManager.modifyWhitelist(account_temp, 0, 0, 0, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_temp, 0, 0, 0, 1, { from: account_delegate, gas: 6000000 }); @@ -751,7 +751,7 @@ contract("SecurityToken", accounts => { }); it("Should fail in buying to tokens", async () => { - let tx = await I_GeneralTransferManager.modifyWhitelist(account_temp, fromTime, toTime, expiryTime, true, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_temp, fromTime, toTime, expiryTime, 1, { from: account_delegate, gas: 6000000 }); @@ -939,7 +939,7 @@ contract("SecurityToken", accounts => { latestTime(), latestTime() + duration.seconds(2), latestTime() + duration.days(50), - true, + 1, { from: account_delegate, gas: 6000000 @@ -982,7 +982,7 @@ contract("SecurityToken", accounts => { latestTime(), latestTime() + duration.seconds(2), latestTime() + duration.days(50), - true, + 1, { from: account_delegate, gas: 6000000 diff --git a/test/p_usd_tiered_sto.js b/test/p_usd_tiered_sto.js index 604eb1aaf..8a274942a 100644 --- a/test/p_usd_tiered_sto.js +++ b/test/p_usd_tiered_sto.js @@ -222,7 +222,7 @@ contract("USDTieredSTO", accounts => { I_SecurityTokenRegistryProxy, I_STRProxied ] = instances; - + I_DaiToken = await PolyTokenFaucet.new({from: POLYMATH}); // STEP 4: Deploy the GeneralDelegateManagerFactory [I_GeneralPermissionManagerFactory] = await deployGPMAndVerifyed(POLYMATH, I_MRProxied, I_PolyToken.address, 0); @@ -1005,7 +1005,7 @@ contract("USDTieredSTO", accounts => { let fromTime = latestTime(); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let whitelisted = true; + let whitelisted = 1; await I_GeneralTransferManager.modifyWhitelist(ACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); @@ -1105,7 +1105,7 @@ contract("USDTieredSTO", accounts => { let fromTime = latestTime(); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let whitelisted = true; + let whitelisted = 1; await I_GeneralTransferManager.modifyWhitelist(ACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); @@ -1160,7 +1160,7 @@ contract("USDTieredSTO", accounts => { let fromTime = latestTime(); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let whitelisted = true; + let whitelisted = 1; await I_GeneralTransferManager.modifyWhitelist(ACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); @@ -1230,7 +1230,7 @@ contract("USDTieredSTO", accounts => { let fromTime = latestTime(); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let whitelisted = true; + let whitelisted = 1; await I_GeneralTransferManager.modifyWhitelist(ACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); @@ -1285,7 +1285,7 @@ contract("USDTieredSTO", accounts => { let fromTime = latestTime(); let toTime = latestTime(); let expiryTime = toTime + duration.days(100); - let whitelisted = true; + let whitelisted = 1; await I_GeneralTransferManager.modifyWhitelist(ACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); @@ -1353,7 +1353,7 @@ contract("USDTieredSTO", accounts => { let fromTime = latestTime(); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let whitelisted = true; + let whitelisted = 1; const tx1 = await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER @@ -4482,7 +4482,7 @@ contract("USDTieredSTO", accounts => { "fundsRaisedUSD not changed as expected" ); }); - + it("should return minted tokens in a tier", async () => { let totalMinted = (await I_USDTieredSTO_Array[0].getTokensSoldByTier.call(0)).toNumber(); let individualMinted = await I_USDTieredSTO_Array[0].getTokensMintedByTier.call(0); @@ -4564,7 +4564,7 @@ contract("USDTieredSTO", accounts => { assert.equal((await I_USDTieredSTOFactory.getSetupCost.call()).toNumber(), STOSetupCost); assert.equal((await I_USDTieredSTOFactory.getTypes.call())[0], 3); assert.equal(web3.utils.hexToString(await I_USDTieredSTOFactory.getName.call()), "USDTieredSTO", "Wrong Module added"); - assert.equal(await I_USDTieredSTOFactory.description.call(), + assert.equal(await I_USDTieredSTOFactory.description.call(), "It allows both accredited and non-accredited investors to contribute into the STO. Non-accredited investors will be capped at a maximum investment limit (as a default or specific to their jurisdiction). Tokens will be sold according to tiers sequentially & each tier has its own price and volume of tokens to sell. Upon receipt of funds (ETH, POLY or DAI), security tokens will automatically transfer to investor’s wallet address", "Wrong Module added"); assert.equal(await I_USDTieredSTOFactory.title.call(), "USD Tiered STO", "Wrong Module added"); diff --git a/test/q_usd_tiered_sto_sim.js b/test/q_usd_tiered_sto_sim.js index 55f84f2b3..31929ade5 100644 --- a/test/q_usd_tiered_sto_sim.js +++ b/test/q_usd_tiered_sto_sim.js @@ -195,7 +195,7 @@ contract("USDTieredSTO Sim", accounts => { I_SecurityTokenRegistryProxy, I_STRProxied ] = instances; - + I_DaiToken = await PolyTokenFaucet.new({from: POLYMATH}); // STEP 5: Deploy the USDTieredSTOFactory @@ -353,13 +353,13 @@ contract("USDTieredSTO Sim", accounts => { let fromTime = latestTime() + duration.days(15); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let canBuyFromSTO = true; + let canBuyFromSTO = 1; await I_GeneralTransferManager.modifyWhitelist(ACCREDITED1, fromTime, toTime, expiryTime, canBuyFromSTO, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(ACCREDITED2, fromTime, toTime, expiryTime, canBuyFromSTO, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, canBuyFromSTO, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED2, fromTime, toTime, expiryTime, canBuyFromSTO, { from: ISSUER }); - await I_GeneralTransferManager.modifyWhitelist(NOTAPPROVED, fromTime, toTime, expiryTime, false, { from: ISSUER }); + await I_GeneralTransferManager.modifyWhitelist(NOTAPPROVED, fromTime, toTime, expiryTime, 0, { from: ISSUER }); await increaseTime(duration.days(3)); diff --git a/test/r_concurrent_STO.js b/test/r_concurrent_STO.js index 7912658a4..36761308e 100644 --- a/test/r_concurrent_STO.js +++ b/test/r_concurrent_STO.js @@ -2,7 +2,7 @@ import latestTime from "./helpers/latestTime"; import { duration, promisifyLogWatch, latestBlock } from "./helpers/utils"; import { takeSnapshot, increaseTime, revertToSnapshot } from "./helpers/time"; import { encodeProxyCall, encodeModuleCall } from "./helpers/encodeCall"; -import { +import { setUpPolymathNetwork, deployDummySTOAndVerifyed, deployCappedSTOAndVerifyed, @@ -94,7 +94,7 @@ contract("Concurrent STO", accounts => { I_SecurityTokenRegistryProxy, I_STRProxied ] = instances; - + // STEP 2: Deploy the STO Factories [I_CappedSTOFactory] = await deployCappedSTOAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, STOSetupCost); @@ -159,7 +159,7 @@ contract("Concurrent STO", accounts => { let fromTime = latestTime(); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let canBuyFromSTO = true; + let canBuyFromSTO = 1; let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, canBuyFromSTO, { from: account_issuer, diff --git a/test/u_module_registry_proxy.js b/test/u_module_registry_proxy.js index 6d00b8fe2..877d173d4 100644 --- a/test/u_module_registry_proxy.js +++ b/test/u_module_registry_proxy.js @@ -9,6 +9,7 @@ const ModuleRegistryProxy = artifacts.require("./ModuleRegistryProxy.sol"); const ModuleRegistry = artifacts.require("./ModuleRegistry.sol"); const STFactory = artifacts.require("./STFactory.sol"); const SecurityToken = artifacts.require("./SecurityToken.sol"); +const GeneralTransferManagerLogic = artifacts.require("./GeneralTransferManager.sol"); const GeneralTransferManagerFactory = artifacts.require("./GeneralTransferManagerFactory.sol"); const GeneralPermissionManagerFactory = artifacts.require("./GeneralPermissionManagerFactory.sol"); @@ -122,7 +123,9 @@ contract("ModuleRegistryProxy", accounts => { await I_MRProxied.updateFromRegistry({ from: account_polymath }); // STEP 4: Deploy the GeneralTransferManagerFactory - I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(I_PolyToken.address, 0, 0, 0, { + let I_GeneralTransferManagerLogic = await GeneralTransferManagerLogic.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: account_polymath }); + + I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(I_PolyToken.address, 0, 0, 0, I_GeneralTransferManagerLogic.address, { from: account_polymath }); diff --git a/test/v_tracked_redemptions.js b/test/v_tracked_redemptions.js index 159564651..eacddd87e 100644 --- a/test/v_tracked_redemptions.js +++ b/test/v_tracked_redemptions.js @@ -102,7 +102,7 @@ contract("TrackedRedemption", accounts => { I_STRProxied ] = instances; - + // STEP 4: Deploy the TrackedRedemption [I_TrackedRedemptionFactory] = await deployRedemptionAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, 0); [P_TrackedRedemptionFactory] = await deployRedemptionAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, web3.utils.toWei("500")); @@ -190,7 +190,7 @@ contract("TrackedRedemption", accounts => { latestTime(), latestTime(), latestTime() + duration.days(30), - true, + 1, { from: account_issuer, gas: 500000 @@ -220,7 +220,7 @@ contract("TrackedRedemption", accounts => { latestTime(), latestTime(), latestTime() + duration.days(30), - true, + 1, { from: account_issuer, gas: 500000 diff --git a/test/w_lockup_volume_restriction_transfer_manager.js b/test/w_lockup_volume_restriction_transfer_manager.js index fe06f3f5c..7646fb031 100644 --- a/test/w_lockup_volume_restriction_transfer_manager.js +++ b/test/w_lockup_volume_restriction_transfer_manager.js @@ -112,7 +112,7 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { STFactory: ${I_STFactory.address} GeneralTransferManagerFactory: ${I_GeneralTransferManagerFactory.address} - LockupVolumeRestrictionTransferManagerFactory: + LockupVolumeRestrictionTransferManagerFactory: ${I_VolumeRestrictionTransferManagerFactory.address} ----------------------------------------------------------------------------- `); @@ -165,7 +165,7 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer }); @@ -192,7 +192,7 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer }); @@ -249,7 +249,7 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer }); @@ -346,14 +346,14 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { // balance should be 9000000000000000000 here (9 eth) let balance = await I_SecurityToken.balanceOf(account_investor2) - + // create a lockup for their entire balance // over 16 seconds total, with 4 periods of 4 seconds each. // this will generate an exception because 9000000000000000000 / 4 = 2250000000000000000 but the token granularity is 1000000000000000000 await catchRevert( I_VolumeRestrictionTransferManager.addLockUp(account_investor2, 16, 4, 0, balance, { from: token_owner }) ); - + }); it("Should prevent the transfer of tokens in a lockup", async() => { @@ -572,7 +572,7 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { }); it("Should revert if the parameters are bad when creating multiple lockups", async() => { - + await catchRevert( // pass in the wrong number of params. txn should revert I_VolumeRestrictionTransferManager.addLockUpMulti( diff --git a/test/x_single_trade_volume_restriction.js b/test/x_single_trade_volume_restriction.js index 15c01e68c..25243a638 100644 --- a/test/x_single_trade_volume_restriction.js +++ b/test/x_single_trade_volume_restriction.js @@ -107,7 +107,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { // STEP 4: Deploy the SingleTradeVolumeRestrictionManagerFactory [I_SingleTradeVolumeRestrictionManagerFactory] = await deploySingleTradeVolumeRMAndVerified(account_polymath, I_MRProxied, I_PolyToken.address, 0); [P_SingleTradeVolumeRestrictionManagerFactory] = await deploySingleTradeVolumeRMAndVerified(account_polymath, I_MRProxied, I_PolyToken.address, web3.utils.toWei("500")); - + }); describe("Generate the SecurityToken", async () => { @@ -165,7 +165,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, { + 1, { from: account_issuer }); @@ -193,7 +193,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, { + 1, { from: account_issuer }); @@ -212,7 +212,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { // it("Fails to attach the SingleTradeVolumeRestrictionManager with the security token due to fees not paid", async () => { let managerArgs = encodeModuleCall(STVRParameters, [true, 90, false]); - + await I_PolyToken.getTokens(web3.utils.toWei("500", "ether"), token_owner); await catchRevert( I_SecurityToken.addModule(P_SingleTradeVolumeRestrictionManagerFactory.address, managerArgs, web3.utils.toWei("500", "ether"), 0, { from: token_owner}) @@ -222,7 +222,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { it("Should successfully attach the Paid SingleTradeVolumeRestrictionManager with the security token", async () => { let managerArgs = encodeModuleCall(STVRParameters, [false, 90, false]); await I_PolyToken.transfer(I_SecurityToken.address, web3.utils.toWei("500", "ether"), { from: token_owner }); - + let tx = await I_SecurityToken.addModule(P_SingleTradeVolumeRestrictionManagerFactory.address, managerArgs, web3.utils.toWei("500", "ether"), 0, { from: token_owner }); @@ -291,7 +291,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { I_SingleTradeVolumeRestrictionManager.addExemptWallet(accounts[5]) ); - await catchRevert( + await catchRevert( I_SingleTradeVolumeRestrictionManager.addExemptWallet(zero_address, { from: token_owner }) ); @@ -342,7 +342,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { await catchRevert ( I_SingleTradeVolumeRestrictionPercentageManager.setTransferLimitInPercentage(accounts[4], 101 * 10 ** 16, { from: token_owner }) ); - // Transfer limit in tokens can not be set for a manager that has transfer limit set as percentage + // Transfer limit in tokens can not be set for a manager that has transfer limit set as percentage await catchRevert ( I_SingleTradeVolumeRestrictionPercentageManager.setTransferLimitInTokens(accounts[4], 1, { from: token_owner }) ); @@ -393,7 +393,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { from: token_owner }); assert.equal(tx.logs[0].args._amount, 10, "Global Limit not set"); - + //Global limit can be set by non-admins await catchRevert( I_SingleTradeVolumeRestrictionPercentageManager.changeGlobalLimitInTokens(89) @@ -542,7 +542,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, { + 1, { from: account_issuer } ); @@ -552,7 +552,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, { + 1, { from: account_issuer } ); @@ -562,7 +562,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, { + 1, { from: account_issuer } ); @@ -667,7 +667,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { }); it('should change transfer limits to tokens', async () => { - // Should not change to percentage again + // Should not change to percentage again await catchRevert( I_SingleTradeVolumeRestrictionPercentageManager.changeTransferLimitToPercentage(1, { from: token_owner }) ); diff --git a/test/y_scheduled_checkpoints.js b/test/y_scheduled_checkpoints.js index 5fcc03a74..864c6b9a1 100644 --- a/test/y_scheduled_checkpoints.js +++ b/test/y_scheduled_checkpoints.js @@ -192,7 +192,7 @@ contract('ScheduledCheckpoint', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 6000000 @@ -235,7 +235,7 @@ contract('ScheduledCheckpoint', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 6000000 @@ -270,7 +270,7 @@ contract('ScheduledCheckpoint', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - true, + 1, { from: account_issuer, gas: 6000000 diff --git a/yarn.lock b/yarn.lock index 27308427c..31973936e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,12 +5,10 @@ "@soldoc/markdown@^0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@soldoc/markdown/-/markdown-0.1.0.tgz#9f85be75049af9721b5129f133d52dafbf5f671e" - integrity sha512-V0UnvVVJ1qDzpuKLMuh7oHG94puwi8BI3t99Vrr7dQgIHuJdfZJ4SbGuWuFV/fSthyH++WY4ePO3d6gxfZ2//w== "@soldoc/soldoc@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@soldoc/soldoc/-/soldoc-0.4.3.tgz#24ffee9264228e1c3edd61fd3162d63587954933" - integrity sha1-JP/ukmQijhw+3WH9MWLWNYeVSTM= dependencies: "@soldoc/markdown" "^0.1.0" chalk "^2.3.1" @@ -24,31 +22,26 @@ abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== abbrev@1.0.x: version "1.0.9" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" - integrity sha1-kbR5JYinc4wl813W9jdSovh3YTU= abstract-leveldown@~2.6.0: version "2.6.3" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz#1c5e8c6a5ef965ae8c35dfb3a8770c476b82c4b8" - integrity sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA== dependencies: xtend "~4.0.0" abstract-leveldown@~2.7.1: version "2.7.2" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz#87a44d7ebebc341d59665204834c8b7e0932cc93" - integrity sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w== dependencies: xtend "~4.0.0" accepts@~1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" - integrity sha1-63d99gEXI6OxTopywIBcjoZ0a9I= dependencies: mime-types "~2.1.18" negotiator "0.6.1" @@ -56,56 +49,46 @@ accepts@~1.3.5: acorn-dynamic-import@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4" - integrity sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ= dependencies: acorn "^4.0.3" acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - integrity sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s= dependencies: acorn "^3.0.4" acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - integrity sha1-ReN/s56No/JbruP/U2niu18iAXo= acorn@^4.0.3: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" - integrity sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c= acorn@^5.0.0, acorn@^5.5.0: version "5.7.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" - integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== aes-js@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" - integrity sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0= aes-js@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.1.tgz#89fd1f94ae51b4c72d62466adc1a7323ff52f072" - integrity sha512-cEA0gBelItZZV7iBiL8ApCiNgc+gBWJJ4uoORhbu6vOqAJ0UL9wIlxr4RI7ij9SSVzy6AnPwiu37kVYiHCl3nw== ajv-keywords@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" - integrity sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I= ajv-keywords@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" - integrity sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo= ajv@^5.1.1, ajv@^5.2.2, ajv@^5.2.3, ajv@^5.3.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= dependencies: co "^4.6.0" fast-deep-equal "^1.0.0" @@ -115,7 +98,6 @@ ajv@^5.1.1, ajv@^5.2.2, ajv@^5.2.3, ajv@^5.3.0: ajv@^6.1.0: version "6.5.4" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.4.tgz#247d5274110db653706b550fcc2b797ca28cfc59" - integrity sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" @@ -125,7 +107,6 @@ ajv@^6.1.0: align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - integrity sha1-DNkKVhCT810KmSVsIrcGlDP60Rc= dependencies: kind-of "^3.0.2" longest "^1.0.1" @@ -134,7 +115,6 @@ align-text@^0.1.1, align-text@^0.1.3: ambi@^2.2.0: version "2.5.0" resolved "https://registry.yarnpkg.com/ambi/-/ambi-2.5.0.tgz#7c8e372be48891157e7cea01cb6f9143d1f74220" - integrity sha1-fI43K+SIkRV+fOoBy2+RQ9H3QiA= dependencies: editions "^1.1.1" typechecker "^4.3.0" @@ -142,44 +122,36 @@ ambi@^2.2.0: amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" - integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= ansi-escapes@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" - integrity sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw== ansi-regex@^2.0.0, ansi-regex@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" any-promise@1.3.0, any-promise@^1.0.0, any-promise@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" - integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= anymatch@^1.3.0: version "1.3.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== dependencies: micromatch "^2.1.5" normalize-path "^2.0.0" @@ -187,7 +159,6 @@ anymatch@^1.3.0: anymatch@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== dependencies: micromatch "^3.1.4" normalize-path "^2.1.1" @@ -195,12 +166,10 @@ anymatch@^2.0.0: aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== are-we-there-yet@~1.1.2: version "1.1.5" resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== dependencies: delegates "^1.0.0" readable-stream "^2.0.6" @@ -208,85 +177,56 @@ are-we-there-yet@~1.1.2: argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" -arguments-extended@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/arguments-extended/-/arguments-extended-0.0.3.tgz#6107e4917d0eb6f0a4dd66320fc15afc72ef4946" - integrity sha1-YQfkkX0OtvCk3WYyD8Fa/HLvSUY= - dependencies: - extended "~0.0.3" - is-extended "~0.0.8" - arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= dependencies: arr-flatten "^1.0.1" arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= arr-flatten@^1.0.1, arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-extended@~0.0.3, array-extended@~0.0.4, array-extended@~0.0.5: - version "0.0.11" - resolved "https://registry.yarnpkg.com/array-extended/-/array-extended-0.0.11.tgz#d7144ae748de93ca726f121009dbff1626d164bd" - integrity sha1-1xRK50jek8pybxIQCdv/FibRZL0= - dependencies: - arguments-extended "~0.0.3" - extended "~0.0.3" - is-extended "~0.0.3" array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= dependencies: array-uniq "^1.0.1" array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= asn1.js@^4.0.0: version "4.10.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" - integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== dependencies: bn.js "^4.0.0" inherits "^2.0.1" @@ -295,36 +235,30 @@ asn1.js@^4.0.0: asn1@~0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== dependencies: safer-buffer "~2.1.0" assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= assert@^1.1.1: version "1.4.1" resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" - integrity sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE= dependencies: util "0.10.3" assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" - integrity sha1-GdOGodntxufByF04iu28xW0zYC0= async-eventemitter@^0.2.2: version "0.2.4" resolved "https://registry.yarnpkg.com/async-eventemitter/-/async-eventemitter-0.2.4.tgz#f5e7c8ca7d3e46aab9ec40a292baf686a0bafaca" - integrity sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw== dependencies: async "^2.4.0" @@ -337,49 +271,44 @@ async-eventemitter@ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a async-limiter@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== async@1.x, async@^1.4.2, async@~1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.4.1, async@^2.5.0: version "2.6.1" resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" - integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== dependencies: lodash "^4.17.10" +async@~0.9.0: + version "0.9.2" + resolved "http://registry.npmjs.org/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" + async@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async/-/async-1.0.0.tgz#f8fc04ca3a13784ade9e1641af98578cfbd647a9" - integrity sha1-+PwEyjoTeErenhZBr5hXjPvWR6k= asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= atob@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= aws4@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" - integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= dependencies: chalk "^1.1.3" esutils "^2.0.2" @@ -388,7 +317,6 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: babel-core@^6.0.14, babel-core@^6.26.0: version "6.26.3" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== dependencies: babel-code-frame "^6.26.0" babel-generator "^6.26.0" @@ -413,7 +341,6 @@ babel-core@^6.0.14, babel-core@^6.26.0: babel-generator@^6.26.0: version "6.26.1" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" - integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== dependencies: babel-messages "^6.23.0" babel-runtime "^6.26.0" @@ -427,7 +354,6 @@ babel-generator@^6.26.0: babel-helper-bindify-decorators@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz#14c19e5f142d7b47f19a52431e52b1ccbc40a330" - integrity sha1-FMGeXxQte0fxmlJDHlKxzLxAozA= dependencies: babel-runtime "^6.22.0" babel-traverse "^6.24.1" @@ -436,7 +362,6 @@ babel-helper-bindify-decorators@^6.24.1: babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" - integrity sha1-zORReto1b0IgvK6KAsKzRvmlZmQ= dependencies: babel-helper-explode-assignable-expression "^6.24.1" babel-runtime "^6.22.0" @@ -445,7 +370,6 @@ babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: babel-helper-call-delegate@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" - integrity sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340= dependencies: babel-helper-hoist-variables "^6.24.1" babel-runtime "^6.22.0" @@ -455,7 +379,6 @@ babel-helper-call-delegate@^6.24.1: babel-helper-define-map@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" - integrity sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8= dependencies: babel-helper-function-name "^6.24.1" babel-runtime "^6.26.0" @@ -465,7 +388,6 @@ babel-helper-define-map@^6.24.1: babel-helper-explode-assignable-expression@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" - integrity sha1-8luCz33BBDPFX3BZLVdGQArCLKo= dependencies: babel-runtime "^6.22.0" babel-traverse "^6.24.1" @@ -474,7 +396,6 @@ babel-helper-explode-assignable-expression@^6.24.1: babel-helper-explode-class@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz#7dc2a3910dee007056e1e31d640ced3d54eaa9eb" - integrity sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes= dependencies: babel-helper-bindify-decorators "^6.24.1" babel-runtime "^6.22.0" @@ -484,7 +405,6 @@ babel-helper-explode-class@^6.24.1: babel-helper-function-name@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" - integrity sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= dependencies: babel-helper-get-function-arity "^6.24.1" babel-runtime "^6.22.0" @@ -495,7 +415,6 @@ babel-helper-function-name@^6.24.1: babel-helper-get-function-arity@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" - integrity sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -503,7 +422,6 @@ babel-helper-get-function-arity@^6.24.1: babel-helper-hoist-variables@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" - integrity sha1-HssnaJydJVE+rbyZFKc/VAi+enY= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -511,7 +429,6 @@ babel-helper-hoist-variables@^6.24.1: babel-helper-optimise-call-expression@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" - integrity sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -519,7 +436,6 @@ babel-helper-optimise-call-expression@^6.24.1: babel-helper-regex@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" - integrity sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI= dependencies: babel-runtime "^6.26.0" babel-types "^6.26.0" @@ -528,7 +444,6 @@ babel-helper-regex@^6.24.1: babel-helper-remap-async-to-generator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" - integrity sha1-XsWBgnrXI/7N04HxySg5BnbkVRs= dependencies: babel-helper-function-name "^6.24.1" babel-runtime "^6.22.0" @@ -539,7 +454,6 @@ babel-helper-remap-async-to-generator@^6.24.1: babel-helper-replace-supers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" - integrity sha1-v22/5Dk40XNpohPKiov3S2qQqxo= dependencies: babel-helper-optimise-call-expression "^6.24.1" babel-messages "^6.23.0" @@ -551,7 +465,6 @@ babel-helper-replace-supers@^6.24.1: babel-helpers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" - integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= dependencies: babel-runtime "^6.22.0" babel-template "^6.24.1" @@ -559,61 +472,50 @@ babel-helpers@^6.24.1: babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= dependencies: babel-runtime "^6.22.0" babel-plugin-check-es2015-constants@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - integrity sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o= dependencies: babel-runtime "^6.22.0" babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" - integrity sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU= babel-plugin-syntax-async-generators@^6.5.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" - integrity sha1-a8lj67FuzLrmuStZbrfzXDQqi5o= babel-plugin-syntax-class-properties@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" - integrity sha1-1+sjt5oxf4VDlixQW4J8fWysJ94= babel-plugin-syntax-decorators@^6.13.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b" - integrity sha1-MSVjtNvePMgGzuPkFszurd0RrAs= babel-plugin-syntax-dynamic-import@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da" - integrity sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo= babel-plugin-syntax-exponentiation-operator@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" - integrity sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4= babel-plugin-syntax-object-rest-spread@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" - integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= babel-plugin-syntax-trailing-function-commas@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" - integrity sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM= babel-plugin-transform-async-generator-functions@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" - integrity sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds= dependencies: babel-helper-remap-async-to-generator "^6.24.1" babel-plugin-syntax-async-generators "^6.5.0" @@ -622,7 +524,6 @@ babel-plugin-transform-async-generator-functions@^6.24.1: babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" - integrity sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E= dependencies: babel-helper-remap-async-to-generator "^6.24.1" babel-plugin-syntax-async-functions "^6.8.0" @@ -631,7 +532,6 @@ babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async- babel-plugin-transform-class-properties@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" - integrity sha1-anl2PqYdM9NvN7YRqp3vgagbRqw= dependencies: babel-helper-function-name "^6.24.1" babel-plugin-syntax-class-properties "^6.8.0" @@ -641,7 +541,6 @@ babel-plugin-transform-class-properties@^6.24.1: babel-plugin-transform-decorators@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz#788013d8f8c6b5222bdf7b344390dfd77569e24d" - integrity sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0= dependencies: babel-helper-explode-class "^6.24.1" babel-plugin-syntax-decorators "^6.13.0" @@ -652,21 +551,18 @@ babel-plugin-transform-decorators@^6.24.1: babel-plugin-transform-es2015-arrow-functions@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - integrity sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" - integrity sha1-u8UbSflk1wy42OC5ToICRs46YUE= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es2015-block-scoping@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" - integrity sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8= dependencies: babel-runtime "^6.26.0" babel-template "^6.26.0" @@ -677,7 +573,6 @@ babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es20 babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-classes@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" - integrity sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= dependencies: babel-helper-define-map "^6.24.1" babel-helper-function-name "^6.24.1" @@ -692,7 +587,6 @@ babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-cla babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transform-es2015-computed-properties@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" - integrity sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM= dependencies: babel-runtime "^6.22.0" babel-template "^6.24.1" @@ -700,14 +594,12 @@ babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transfor babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" - integrity sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2015-duplicate-keys@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" - integrity sha1-c+s9MQypaePvnskcU3QabxV2Qj4= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -715,14 +607,12 @@ babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2 babel-plugin-transform-es2015-for-of@^6.22.0, babel-plugin-transform-es2015-for-of@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" - integrity sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" - integrity sha1-g0yJhTvDaxrw86TF26qU/Y6sqos= dependencies: babel-helper-function-name "^6.24.1" babel-runtime "^6.22.0" @@ -731,14 +621,12 @@ babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es20 babel-plugin-transform-es2015-literals@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" - integrity sha1-T1SgLWzWbPkVKAAZox0xklN3yi4= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" - integrity sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ= dependencies: babel-plugin-transform-es2015-modules-commonjs "^6.24.1" babel-runtime "^6.22.0" @@ -747,7 +635,6 @@ babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015 babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: version "6.26.2" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" - integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q== dependencies: babel-plugin-transform-strict-mode "^6.24.1" babel-runtime "^6.26.0" @@ -757,7 +644,6 @@ babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-e babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-es2015-modules-systemjs@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" - integrity sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM= dependencies: babel-helper-hoist-variables "^6.24.1" babel-runtime "^6.22.0" @@ -766,7 +652,6 @@ babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-e babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015-modules-umd@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" - integrity sha1-rJl+YoXNGO1hdq22B9YCNErThGg= dependencies: babel-plugin-transform-es2015-modules-amd "^6.24.1" babel-runtime "^6.22.0" @@ -775,7 +660,6 @@ babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015 babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es2015-object-super@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" - integrity sha1-JM72muIcuDp/hgPa0CH1cusnj40= dependencies: babel-helper-replace-supers "^6.24.1" babel-runtime "^6.22.0" @@ -783,7 +667,6 @@ babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es201 babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015-parameters@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" - integrity sha1-V6w1GrScrxSpfNE7CfZv3wpiXys= dependencies: babel-helper-call-delegate "^6.24.1" babel-helper-get-function-arity "^6.24.1" @@ -795,7 +678,6 @@ babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015- babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" - integrity sha1-JPh11nIch2YbvZmkYi5R8U3jiqA= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -803,14 +685,12 @@ babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transfo babel-plugin-transform-es2015-spread@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" - integrity sha1-1taKmfia7cRTbIGlQujdnxdG+NE= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" - integrity sha1-AMHNsaynERLN8M9hJsLta0V8zbw= dependencies: babel-helper-regex "^6.24.1" babel-runtime "^6.22.0" @@ -819,21 +699,18 @@ babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es201 babel-plugin-transform-es2015-template-literals@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - integrity sha1-qEs0UPfp+PH2g51taH2oS7EjbY0= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-typeof-symbol@^6.22.0, babel-plugin-transform-es2015-typeof-symbol@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" - integrity sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" - integrity sha1-04sS9C6nMj9yk4fxinxa4frrNek= dependencies: babel-helper-regex "^6.24.1" babel-runtime "^6.22.0" @@ -842,7 +719,6 @@ babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es20 babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" - integrity sha1-KrDJx/MJj6SJB3cruBP+QejeOg4= dependencies: babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" babel-plugin-syntax-exponentiation-operator "^6.8.0" @@ -851,7 +727,6 @@ babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-e babel-plugin-transform-object-rest-spread@^6.22.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" - integrity sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY= dependencies: babel-plugin-syntax-object-rest-spread "^6.8.0" babel-runtime "^6.26.0" @@ -859,14 +734,12 @@ babel-plugin-transform-object-rest-spread@^6.22.0: babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" - integrity sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8= dependencies: regenerator-transform "^0.10.0" babel-plugin-transform-strict-mode@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" - integrity sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -874,7 +747,6 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-polyfill@6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" - integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= dependencies: babel-runtime "^6.26.0" core-js "^2.5.0" @@ -883,7 +755,6 @@ babel-polyfill@6.26.0: babel-preset-env@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" - integrity sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg== dependencies: babel-plugin-check-es2015-constants "^6.22.0" babel-plugin-syntax-trailing-function-commas "^6.22.0" @@ -919,7 +790,6 @@ babel-preset-env@^1.7.0: babel-preset-es2015@6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" - integrity sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk= dependencies: babel-plugin-check-es2015-constants "^6.22.0" babel-plugin-transform-es2015-arrow-functions "^6.22.0" @@ -949,7 +819,6 @@ babel-preset-es2015@6.24.1: babel-preset-stage-2@6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz#d9e2960fb3d71187f0e64eec62bc07767219bdc1" - integrity sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE= dependencies: babel-plugin-syntax-dynamic-import "^6.18.0" babel-plugin-transform-class-properties "^6.24.1" @@ -959,7 +828,6 @@ babel-preset-stage-2@6.24.1: babel-preset-stage-3@6.24.1, babel-preset-stage-3@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395" - integrity sha1-g2raCp56f6N8sTj7kyb4eTSkg5U= dependencies: babel-plugin-syntax-trailing-function-commas "^6.22.0" babel-plugin-transform-async-generator-functions "^6.24.1" @@ -970,7 +838,6 @@ babel-preset-stage-3@6.24.1, babel-preset-stage-3@^6.24.1: babel-register@6.26.0, babel-register@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" - integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= dependencies: babel-core "^6.26.0" babel-runtime "^6.26.0" @@ -983,7 +850,6 @@ babel-register@6.26.0, babel-register@^6.26.0: babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= dependencies: core-js "^2.4.0" regenerator-runtime "^0.11.0" @@ -991,7 +857,6 @@ babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: babel-template@^6.24.1, babel-template@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" - integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= dependencies: babel-runtime "^6.26.0" babel-traverse "^6.26.0" @@ -1002,7 +867,6 @@ babel-template@^6.24.1, babel-template@^6.26.0: babel-traverse@^6.24.1, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" - integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= dependencies: babel-code-frame "^6.26.0" babel-messages "^6.23.0" @@ -1017,7 +881,6 @@ babel-traverse@^6.24.1, babel-traverse@^6.26.0: babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" - integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= dependencies: babel-runtime "^6.26.0" esutils "^2.0.2" @@ -1027,7 +890,6 @@ babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: babelify@^7.3.0: version "7.3.0" resolved "https://registry.yarnpkg.com/babelify/-/babelify-7.3.0.tgz#aa56aede7067fd7bd549666ee16dc285087e88e5" - integrity sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU= dependencies: babel-core "^6.0.14" object-assign "^4.0.0" @@ -1035,34 +897,28 @@ babelify@^7.3.0: babylon@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" - integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= base-x@^3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.4.tgz#94c1788736da065edb1d68808869e357c977fa77" - integrity sha512-UYOadoSIkEI/VrRGSG6qp93rp2WdokiAiNYDfGW5qURAY8GiAQkvMbwNNSDYiVJopqv4gCna7xqf4rrNGp+5AA== dependencies: safe-buffer "^5.0.1" base64-js@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978" - integrity sha1-EQHpVE9KdrG8OybUUsqW16NeeXg= base64-js@^1.0.2: version "1.3.0" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" - integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== dependencies: cache-base "^1.0.1" class-utils "^0.3.5" @@ -1075,29 +931,24 @@ base@^0.11.1: bcrypt-pbkdf@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= dependencies: tweetnacl "^0.14.3" big.js@^3.1.3: version "3.2.0" resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" - integrity sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q== bignumber.js@^4.0.2: version "4.1.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1" - integrity sha512-eJzYkFYy9L4JzXsbymsFn3p54D+llV27oTQ+ziJG7WFRheJcNZilgVXMG0LoZtlQSKBsJdWtLFqOD0u+U0jZKA== bignumber.js@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-5.0.0.tgz#fbce63f09776b3000a83185badcde525daf34833" - integrity sha512-KWTu6ZMVk9sxlDJQh2YH1UOnfDP8O8TpxUxgQG/vKASoSnEjK9aVuOueFaPcQEYQ5fyNXNTOYwYw3099RYebWg== bignumber.js@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-6.0.0.tgz#bbfa047644609a5af093e9cbd83b0461fa3f6002" - integrity sha512-x247jIuy60/+FtMRvscqfxtVHQf8AGx2hm9c6btkgC0x/hp9yt+teISNhvF8WlwRkCc5yF2fDECH8SIMe8j+GA== "bignumber.js@git+https://github.com/debris/bignumber.js#master": version "2.0.7" @@ -1114,24 +965,20 @@ bignumber.js@^6.0.0: binary-extensions@^1.0.0: version "1.12.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" - integrity sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg== bindings@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7" - integrity sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw== bip66@^1.1.3: version "1.1.5" resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" - integrity sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI= dependencies: safe-buffer "^5.0.1" bitcore-lib@^0.15.0: version "0.15.0" resolved "https://registry.yarnpkg.com/bitcore-lib/-/bitcore-lib-0.15.0.tgz#f924be13869f2aab7e04aeec5642ad3359b6cec2" - integrity sha512-AeXLWhiivF6CDFzrABZHT4jJrflyylDWTi32o30rF92HW9msfuKpjzrHtFKYGa9w0kNVv5HABQjCB3OEav4PhQ== dependencies: bn.js "=4.11.8" bs58 "=4.0.1" @@ -1143,7 +990,6 @@ bitcore-lib@^0.15.0: bitcore-mnemonic@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bitcore-mnemonic/-/bitcore-mnemonic-1.5.0.tgz#c7e785beb6bf0616ed4992785dc3658670425a39" - integrity sha512-sbeP4xwkindLMfIQhVxj6rZSDMwtiKmfc1DqvwpR6Yg+Qo4I4WHO5pvzb12Y04uDh1N3zgD45esHhfH0HHmE4g== dependencies: bitcore-lib "^0.15.0" unorm "^1.3.3" @@ -1151,7 +997,6 @@ bitcore-mnemonic@^1.5.0: bl@^1.0.0: version "1.2.2" resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" - integrity sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA== dependencies: readable-stream "^2.3.5" safe-buffer "^5.1.1" @@ -1159,39 +1004,32 @@ bl@^1.0.0: block-stream@*: version "0.0.9" resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" - integrity sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo= dependencies: inherits "~2.0.0" bluebird@^2.9.34: version "2.11.0" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1" - integrity sha1-U0uQM8AiyVecVro7Plpcqvu2UOE= bluebird@^3.4.6, bluebird@^3.5.0: version "3.5.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.2.tgz#1be0908e054a751754549c270489c1505d4ab15a" - integrity sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg== bn.js@4.11.6: version "4.11.6" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" - integrity sha1-UzRK2xRhehP26N0s4okF0cC6MhU= bn.js@=4.11.8, bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.3, bn.js@^4.11.6, bn.js@^4.4.0, bn.js@^4.8.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== bn.js@^2.0.3: version "2.2.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-2.2.0.tgz#12162bc2ae71fc40a5626c33438f3a875cd37625" - integrity sha1-EhYrwq5x/EClYmwzQ486h1zTdiU= body-parser@1.18.3, body-parser@^1.16.0: version "1.18.3" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" - integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= dependencies: bytes "3.0.0" content-type "~1.0.4" @@ -1207,7 +1045,6 @@ body-parser@1.18.3, body-parser@^1.16.0: borc@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/borc/-/borc-2.0.3.tgz#08845ea73a6d3211120928ee3929f8dc2de9f52e" - integrity sha512-2mfipKUXn7yLgwn8D5jZkJqd2ZyzqmYZQX/9d4On33oGNDLwxj5qQMst+nkKyEdaujQRFfrZCId+k8wehQVANg== dependencies: bignumber.js "^6.0.0" commander "^2.15.0" @@ -1217,7 +1054,6 @@ borc@^2.0.2: brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" @@ -1225,7 +1061,6 @@ brace-expansion@^1.1.7: braces@^1.8.2: version "1.8.5" resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= dependencies: expand-range "^1.8.1" preserve "^0.2.0" @@ -1234,7 +1069,6 @@ braces@^1.8.2: braces@^2.3.0, braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== dependencies: arr-flatten "^1.1.0" array-unique "^0.3.2" @@ -1250,22 +1084,18 @@ braces@^2.3.0, braces@^2.3.1: brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= browser-stdout@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" - integrity sha1-81HTKWnTL6XXpVZxVCY9korjvR8= browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.0.6: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== dependencies: buffer-xor "^1.0.3" cipher-base "^1.0.0" @@ -1277,7 +1107,6 @@ browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.0.6: browserify-cipher@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" - integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== dependencies: browserify-aes "^1.0.4" browserify-des "^1.0.0" @@ -1286,7 +1115,6 @@ browserify-cipher@^1.0.0: browserify-des@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" - integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== dependencies: cipher-base "^1.0.1" des.js "^1.0.0" @@ -1296,7 +1124,6 @@ browserify-des@^1.0.0: browserify-rsa@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" - integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= dependencies: bn.js "^4.1.0" randombytes "^2.0.1" @@ -1304,14 +1131,12 @@ browserify-rsa@^4.0.0: browserify-sha3@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/browserify-sha3/-/browserify-sha3-0.0.1.tgz#3ff34a3006ef15c0fb3567e541b91a2340123d11" - integrity sha1-P/NKMAbvFcD7NWflQbkaI0ASPRE= dependencies: js-sha3 "^0.3.1" browserify-sign@^4.0.0: version "4.0.4" resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" - integrity sha1-qk62jl17ZYuqa/alfmMMvXqT0pg= dependencies: bn.js "^4.1.1" browserify-rsa "^4.0.0" @@ -1324,14 +1149,12 @@ browserify-sign@^4.0.0: browserify-zlib@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" - integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== dependencies: pako "~1.0.5" browserslist@^3.2.6: version "3.2.8" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" - integrity sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ== dependencies: caniuse-lite "^1.0.30000844" electron-to-chromium "^1.3.47" @@ -1339,19 +1162,16 @@ browserslist@^3.2.6: bs58@=4.0.1, bs58@^4.0.0, bs58@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" - integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= dependencies: base-x "^3.0.2" bs58@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/bs58/-/bs58-2.0.1.tgz#55908d58f1982aba2008fa1bed8f91998a29bf8d" - integrity sha1-VZCNWPGYKrogCPob7Y+RmYopv40= bs58check@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" - integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== dependencies: bs58 "^4.0.0" create-hash "^1.1.0" @@ -1360,17 +1180,14 @@ bs58check@^2.1.2: bson@^1.0.4: version "1.1.0" resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.0.tgz#bee57d1fb6a87713471af4e32bcae36de814b5b0" - integrity sha512-9Aeai9TacfNtWXOYarkFJRW2CWo+dRon+fuLZYJmvLV3+MiUp0bEI6IAZfXEIg7/Pl/7IWlLaDnhzTsD81etQA== buffer-alloc-unsafe@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== buffer-alloc@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== dependencies: buffer-alloc-unsafe "^1.1.0" buffer-fill "^1.0.0" @@ -1378,37 +1195,30 @@ buffer-alloc@^1.2.0: buffer-compare@=1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-compare/-/buffer-compare-1.1.1.tgz#5be7be853af89198d1f4ddc090d1d66a48aef596" - integrity sha1-W+e+hTr4kZjR9N3AkNHWakiu9ZY= buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= buffer-fill@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== buffer-to-arraybuffer@^0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz#6064a40fa76eb43c723aba9ef8f6e1216d10511a" - integrity sha1-YGSkD6dutDxyOrqe+PbhIW0QURo= buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= buffer@^3.0.1: version "3.6.0" resolved "https://registry.yarnpkg.com/buffer/-/buffer-3.6.0.tgz#a72c936f77b96bf52f5f7e7b467180628551defb" - integrity sha1-pyyTb3e5a/UvX357RnGAYoVR3vs= dependencies: base64-js "0.0.8" ieee754 "^1.1.4" @@ -1417,7 +1227,6 @@ buffer@^3.0.1: buffer@^4.3.0, buffer@^4.9.0: version "4.9.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" - integrity sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg= dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" @@ -1426,7 +1235,6 @@ buffer@^4.3.0, buffer@^4.9.0: buffer@^5.0.5: version "5.2.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" - integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg== dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" @@ -1434,22 +1242,18 @@ buffer@^5.0.5: builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= cache-base@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== dependencies: collection-visit "^1.0.0" component-emitter "^1.2.1" @@ -1464,34 +1268,28 @@ cache-base@^1.0.1: caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= dependencies: callsites "^0.2.0" callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - integrity sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk= camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" - integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo= camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= caminte@0.3.7: version "0.3.7" resolved "https://registry.yarnpkg.com/caminte/-/caminte-0.3.7.tgz#ec1ec0457664a0f092643b7c646c457d5cd6f693" - integrity sha1-7B7ARXZkoPCSZDt8ZGxFfVzW9pM= dependencies: bluebird "^3.4.6" uuid "^3.0.1" @@ -1499,17 +1297,14 @@ caminte@0.3.7: caniuse-lite@^1.0.30000844: version "1.0.30000890" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000890.tgz#86a18ffcc65d79ec6a437e985761b8bf1c4efeaf" - integrity sha512-4NI3s4Y6ROm+SgZN5sLUG4k7nVWQnedis3c/RWkynV5G6cHSY7+a8fwFyn2yoBDE3E6VswhTNNwR3PvzGqlTkg== caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= center-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - integrity sha1-qg0yYptu6XIgBBHL1EYckHvCt60= dependencies: align-text "^0.1.3" lazy-cache "^1.0.3" @@ -1517,7 +1312,6 @@ center-align@^0.1.1: chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= dependencies: ansi-styles "^2.2.1" escape-string-regexp "^1.0.2" @@ -1528,7 +1322,6 @@ chalk@^1.1.3: chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" - integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" @@ -1537,19 +1330,16 @@ chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1: chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" - integrity sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I= checkpoint-store@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/checkpoint-store/-/checkpoint-store-1.1.0.tgz#04e4cb516b91433893581e6d4601a78e9552ea06" - integrity sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY= dependencies: functional-red-black-tree "^1.0.1" chokidar@^1.6.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= dependencies: anymatch "^1.3.0" async-each "^1.0.0" @@ -1565,7 +1355,6 @@ chokidar@^1.6.0: chokidar@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" - integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== dependencies: anymatch "^2.0.0" async-each "^1.0.0" @@ -1585,12 +1374,10 @@ chokidar@^2.0.2: chownr@^1.0.1: version "1.1.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" @@ -1598,12 +1385,10 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: circular-json@^0.3.1: version "0.3.3" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" - integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== dependencies: arr-union "^3.1.0" define-property "^0.2.5" @@ -1613,7 +1398,6 @@ class-utils@^0.3.5: cli-color@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-1.3.0.tgz#cd2ec212efbd1a0eeb5b017f17d4e2d15e91420f" - integrity sha512-XmbLr8MzgOup/sPHF4nOZerCOcL7rD7vKWpEl0axUsMAY+AEimOhYva1ksskWqkLGY/bjR9h7Cfbr+RrJRfmTQ== dependencies: ansi-regex "^2.1.1" d "1" @@ -1625,19 +1409,16 @@ cli-color@^1.2.0: cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= dependencies: restore-cursor "^2.0.0" cli-width@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - integrity sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE= dependencies: center-align "^0.1.1" right-align "^0.1.1" @@ -1646,7 +1427,6 @@ cliui@^2.1.0: cliui@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= dependencies: string-width "^1.0.1" strip-ansi "^3.0.1" @@ -1655,7 +1435,6 @@ cliui@^3.2.0: cliui@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" - integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== dependencies: string-width "^2.1.1" strip-ansi "^4.0.0" @@ -1664,22 +1443,18 @@ cliui@^4.0.0: clone@2.x, clone@^2.0.0: version "2.1.2" resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= coinstring@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/coinstring/-/coinstring-2.3.0.tgz#cdb63363a961502404a25afb82c2e26d5ff627a4" - integrity sha1-zbYzY6lhUCQEolr7gsLibV/2J6Q= dependencies: bs58 "^2.0.1" create-hash "^1.1.1" @@ -1687,7 +1462,6 @@ coinstring@^2.0.0: collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= dependencies: map-visit "^1.0.0" object-visit "^1.0.0" @@ -1695,85 +1469,70 @@ collection-visit@^1.0.0: color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: color-name "1.1.3" color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= colors@1.0.x: version "1.0.3" resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" - integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= colors@^1.1.2: version "1.3.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.2.tgz#2df8ff573dfbf255af562f8ce7181d6b971a359b" - integrity sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ== combined-stream@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" - integrity sha1-cj599ugBrFYTETp+RFqbactjKBg= dependencies: delayed-stream "~1.0.0" combined-stream@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" - integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== dependencies: delayed-stream "~1.0.0" commander@2.11.0: version "2.11.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" - integrity sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ== commander@2.15.1: version "2.15.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" - integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== commander@^2.11.0, commander@^2.14.1, commander@^2.15.0, commander@^2.8.1, commander@^2.9.0: version "2.19.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" - integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== commander@~2.17.1: version "2.17.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" - integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== commander@~2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4" - integrity sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ= dependencies: graceful-readlink ">= 1.0.0" compare-versions@^3.0.1: version "3.4.0" resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.4.0.tgz#e0747df5c9cb7f054d6d3dc3e1dbc444f9e92b26" - integrity sha512-tK69D7oNXXqUW3ZNo/z7NXTEz22TCF0pTE+YF9cxvaAM9XnkLo1fV621xCLrRR6aevJlKxExkss0vWqUCUpqdg== component-emitter@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" - integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= concat-stream@^1.6.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== dependencies: buffer-from "^1.0.0" inherits "^2.0.3" @@ -1783,76 +1542,62 @@ concat-stream@^1.6.0: console-browserify@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" - integrity sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA= dependencies: date-now "^0.1.4" console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" - integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= content-disposition@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" - integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ= content-type@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== convert-source-map@^1.5.1: version "1.6.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" - integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== dependencies: safe-buffer "~5.1.1" cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= cookie@0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= cookiejar@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.2.tgz#dd8a235530752f988f9a0844f3fc589e3111125c" - integrity sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA== copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= core-js@^2.4.0, core-js@^2.5.0: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" - integrity sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= cors@^2.8.1: version "2.8.4" resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.4.tgz#2bd381f2eb201020105cd50ea59da63090694686" - integrity sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY= dependencies: object-assign "^4" vary "^1" @@ -1860,7 +1605,6 @@ cors@^2.8.1: coveralls@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.2.tgz#f5a0bcd90ca4e64e088b710fa8dda640aea4884f" - integrity sha512-Tv0LKe/MkBOilH2v7WBiTBdudg2ChfGbdXafc/s330djpF3zKOmuehTeRwjXWc7pzfj9FrDUTA7tEx6Div8NFw== dependencies: growl "~> 1.10.0" js-yaml "^3.11.0" @@ -1872,7 +1616,6 @@ coveralls@^3.0.1: create-ecdh@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" - integrity sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw== dependencies: bn.js "^4.1.0" elliptic "^6.0.0" @@ -1880,7 +1623,6 @@ create-ecdh@^4.0.0: create-hash@^1.1.0, create-hash@^1.1.1, create-hash@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== dependencies: cipher-base "^1.0.1" inherits "^2.0.1" @@ -1891,7 +1633,6 @@ create-hash@^1.1.0, create-hash@^1.1.1, create-hash@^1.1.2: create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: version "1.1.7" resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== dependencies: cipher-base "^1.0.3" create-hash "^1.1.0" @@ -1903,7 +1644,6 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: cron-parser@^2.4.0: version "2.6.0" resolved "https://registry.yarnpkg.com/cron-parser/-/cron-parser-2.6.0.tgz#ae2514ceda9ccb540256e201bdd23ae814e03674" - integrity sha512-KGfDDTjBIx85MnVYcdhLccoJH/7jcYW+5Z/t3Wsg2QlJhmmjf+97z+9sQftS71lopOYYapjEKEvmWaCsym5Z4g== dependencies: is-nan "^1.2.1" moment-timezone "^0.5.0" @@ -1911,7 +1651,6 @@ cron-parser@^2.4.0: cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= dependencies: lru-cache "^4.0.1" shebang-command "^1.2.0" @@ -1920,7 +1659,6 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0: crypto-browserify@3.12.0, crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== dependencies: browserify-cipher "^1.0.0" browserify-sign "^4.0.0" @@ -1937,115 +1675,84 @@ crypto-browserify@3.12.0, crypto-browserify@^3.11.0: crypto-js@^3.1.4, crypto-js@^3.1.5: version "3.1.8" resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.1.8.tgz#715f070bf6014f2ae992a98b3929258b713f08d5" - integrity sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU= crypto-js@^3.1.9-1: version "3.1.9-1" resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.1.9-1.tgz#fda19e761fc077e01ffbfdc6e9fdfc59e8806cd8" - integrity sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg= crypto-random-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" - integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= csextends@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/csextends/-/csextends-1.2.0.tgz#6374b210984b54d4495f29c99d3dd069b80543e5" - integrity sha512-S/8k1bDTJIwuGgQYmsRoE+8P+ohV32WhQ0l4zqrc0XDdxOhjQQD7/wTZwCzoZX53jSX3V/qwjT+OkPTxWQcmjg== cycle@1.0.x: version "1.0.3" resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2" - integrity sha1-IegLK+hYD5i0aPN5QwZisEbDStI= d@1: version "1.0.0" resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" - integrity sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8= dependencies: es5-ext "^0.10.9" dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= dependencies: assert-plus "^1.0.0" -date-extended@~0.0.3: - version "0.0.6" - resolved "https://registry.yarnpkg.com/date-extended/-/date-extended-0.0.6.tgz#23802d57dd1bf7818813fe0c32e851a86da267c9" - integrity sha1-I4AtV90b94GIE/4MMuhRqG2iZ8k= - dependencies: - array-extended "~0.0.3" - extended "~0.0.3" - is-extended "~0.0.3" - date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" - integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= death@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/death/-/death-1.1.0.tgz#01aa9c401edd92750514470b8266390c66c67318" - integrity sha1-AaqcQB7dknUFFEcLgmY5DGbGcxg= debug@*: version "4.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" - integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== dependencies: ms "^2.1.1" debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" debug@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== dependencies: ms "2.0.0" debug@^3.0.1, debug@^3.1.0: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== dependencies: ms "^2.1.1" decamelize@^1.0.0, decamelize@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -declare.js@~0.0.4: - version "0.0.8" - resolved "https://registry.yarnpkg.com/declare.js/-/declare.js-0.0.8.tgz#0478adff9564c004f51df73d8bc134019d28dcde" - integrity sha1-BHit/5VkwAT1Hfc9i8E0AZ0o3N4= decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= decompress-response@^3.2.0, decompress-response@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= dependencies: mimic-response "^1.0.0" decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/decompress-tar/-/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1" - integrity sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ== dependencies: file-type "^5.2.0" is-stream "^1.1.0" @@ -2054,7 +1761,6 @@ decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: decompress-tarbz2@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz#3082a5b880ea4043816349f378b56c516be1a39b" - integrity sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A== dependencies: decompress-tar "^4.1.0" file-type "^6.1.0" @@ -2065,7 +1771,6 @@ decompress-tarbz2@^4.0.0: decompress-targz@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/decompress-targz/-/decompress-targz-4.1.1.tgz#c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee" - integrity sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w== dependencies: decompress-tar "^4.1.1" file-type "^5.2.0" @@ -2074,7 +1779,6 @@ decompress-targz@^4.0.0: decompress-unzip@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/decompress-unzip/-/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69" - integrity sha1-3qrM39FK6vhVePczroIQ+bSEj2k= dependencies: file-type "^3.8.0" get-stream "^2.2.0" @@ -2084,7 +1788,6 @@ decompress-unzip@^4.0.1: decompress@^4.0.0: version "4.2.0" resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.0.tgz#7aedd85427e5a92dacfe55674a7c505e96d01f9d" - integrity sha1-eu3YVCflqS2s/lVnSnxQXpbQH50= dependencies: decompress-tar "^4.0.0" decompress-tarbz2 "^4.0.0" @@ -2098,57 +1801,52 @@ decompress@^4.0.0: deep-assign@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/deep-assign/-/deep-assign-2.0.0.tgz#ebe06b1f07f08dae597620e3dd1622f371a1c572" - integrity sha1-6+BrHwfwja5ZdiDj3RYi83GhxXI= dependencies: is-obj "^1.0.0" +deep-equal@~0.2.1: + version "0.2.2" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-0.2.2.tgz#84b745896f34c684e98f2ce0e42abaf43bba017d" + deep-equal@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" - integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= deferred-leveldown@~1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz#3acd2e0b75d1669924bc0a4b642851131173e1eb" - integrity sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA== dependencies: abstract-leveldown "~2.6.0" define-properties@^1.1.1, define-properties@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== dependencies: object-keys "^1.0.12" define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= dependencies: is-descriptor "^0.1.0" define-property@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= dependencies: is-descriptor "^1.0.0" define-property@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== dependencies: is-descriptor "^1.0.2" isobject "^3.0.1" @@ -2156,12 +1854,10 @@ define-property@^2.0.2: defined@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" - integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= del@^2.0.2: version "2.2.2" resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" - integrity sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag= dependencies: globby "^5.0.0" is-path-cwd "^1.0.0" @@ -2174,27 +1870,22 @@ del@^2.0.2: delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= delimit-stream@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/delimit-stream/-/delimit-stream-0.1.0.tgz#9b8319477c0e5f8aeb3ce357ae305fc25ea1cd2b" - integrity sha1-m4MZR3wOX4rrPONXrjBfwl6hzSs= depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= des.js@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" - integrity sha1-wHTS4qpqipoH29YfmhXCzYPsjsw= dependencies: inherits "^2.0.1" minimalistic-assert "^1.0.0" @@ -2202,34 +1893,28 @@ des.js@^1.0.0: destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= dependencies: repeating "^2.0.0" detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= diff@3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" - integrity sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww== diff@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" - integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== dependencies: bn.js "^4.1.0" miller-rabin "^4.0.0" @@ -2238,7 +1923,6 @@ diffie-hellman@^5.0.0: doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" - integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= dependencies: esutils "^2.0.2" isarray "^1.0.0" @@ -2246,24 +1930,20 @@ doctrine@1.5.0: doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== dependencies: esutils "^2.0.2" dom-walk@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" - integrity sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg= domain-browser@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" - integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== drbg.js@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/drbg.js/-/drbg.js-1.0.1.tgz#3e36b6c42b37043823cdbc332d58f31e2445480b" - integrity sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs= dependencies: browserify-aes "^1.0.6" create-hash "^1.1.2" @@ -2272,19 +1952,16 @@ drbg.js@^1.0.1: duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= eachr@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/eachr/-/eachr-2.0.4.tgz#466f7caa10708f610509e32c807aafe57fc122bf" - integrity sha1-Rm98qhBwj2EFCeMsgHqv5X/BIr8= dependencies: typechecker "^2.0.8" ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= dependencies: jsbn "~0.1.0" safer-buffer "^2.1.0" @@ -2292,12 +1969,10 @@ ecc-jsbn@~0.1.1: editions@^1.1.1, editions@^1.3.3, editions@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/editions/-/editions-1.3.4.tgz#3662cb592347c3168eb8e498a0ff73271d67f50b" - integrity sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg== editions@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/editions/-/editions-2.0.2.tgz#54fdac6fb24b0a1a72ffc1ba0126c10602c3e0bd" - integrity sha512-0B8aSTWUu9+JW99zHoeogavCi+lkE5l35FK0OKe0pCobixJYoeof3ZujtqYzSsU2MskhRadY5V9oWUuyG4aJ3A== dependencies: errlop "^1.0.2" semver "^5.5.0" @@ -2305,17 +1980,14 @@ editions@^2.0.2: ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.3.47: version "1.3.78" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.78.tgz#ecb72b5b166ba6598efb384461d63cad74678ebf" - integrity sha512-p4D/5iX08c3LNep5bWn/X3dFmec1K9le6O43lgRsO/vYKBTH2smWDMDfkGlPtERFcLVkI8xdKW5EokBZODh1xg== elliptic@6.3.3: version "6.3.3" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.3.tgz#5482d9646d54bcb89fd7d994fc9e2e9568876e3f" - integrity sha1-VILZZG1UvLif19mU/J4ulWiHbj8= dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -2325,7 +1997,6 @@ elliptic@6.3.3: elliptic@=6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" - integrity sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8= dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -2338,7 +2009,6 @@ elliptic@=6.4.0: elliptic@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-3.1.0.tgz#c21682ef762769b56a74201609105da11d5f60cc" - integrity sha1-whaC73YnabVqdCAWCRBdoR1fYMw= dependencies: bn.js "^2.0.3" brorand "^1.0.1" @@ -2348,7 +2018,6 @@ elliptic@^3.1.0: elliptic@^6.0.0, elliptic@^6.2.3, elliptic@^6.4.0: version "6.4.1" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a" - integrity sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ== dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -2361,31 +2030,26 @@ elliptic@^6.0.0, elliptic@^6.2.3, elliptic@^6.4.0: emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= encoding@^0.1.11: version "0.1.12" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" - integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s= dependencies: iconv-lite "~0.4.13" end-of-stream@^1.0.0: version "1.4.1" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== dependencies: once "^1.4.0" enhanced-resolve@^3.4.0: version "3.4.1" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz#0421e339fd71419b3da13d129b3979040230476e" - integrity sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24= dependencies: graceful-fs "^4.1.2" memory-fs "^0.4.0" @@ -2395,33 +2059,28 @@ enhanced-resolve@^3.4.0: eol@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/eol/-/eol-0.9.1.tgz#f701912f504074be35c6117a5c4ade49cd547acd" - integrity sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg== errlop@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/errlop/-/errlop-1.0.3.tgz#dba29c90cf832c3d2ce469fe515d7e5eef2c6676" - integrity sha512-5VTnt0yikY4LlQEfCXVSqfE6oLj1HVM4zVSvAKMnoYjL/zrb6nqiLowZS4XlG7xENfyj7lpYWvT+wfSCr6dtlA== dependencies: editions "^1.3.4" errno@^0.1.3, errno@~0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" - integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== dependencies: prr "~1.0.1" error-ex@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== dependencies: is-arrayish "^0.2.1" es-abstract@^1.5.0: version "1.12.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" - integrity sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA== dependencies: es-to-primitive "^1.1.1" function-bind "^1.1.1" @@ -2432,7 +2091,6 @@ es-abstract@^1.5.0: es-to-primitive@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" - integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== dependencies: is-callable "^1.1.4" is-date-object "^1.0.1" @@ -2441,7 +2099,6 @@ es-to-primitive@^1.1.1: es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.45, es5-ext@^0.10.46, es5-ext@^0.10.9, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: version "0.10.46" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.46.tgz#efd99f67c5a7ec789baa3daa7f79870388f7f572" - integrity sha512-24XxRvJXNFwEMpJb3nOkiRJKRoupmjYmOPVlI65Qy2SrtxwOTB+g6ODjBKOtwEHbYrhWRty9xxOWLNdClT2djw== dependencies: es6-iterator "~2.0.3" es6-symbol "~3.1.1" @@ -2450,7 +2107,6 @@ es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.45, es5-ext@^0.10.46, es5-ext@ es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.1, es6-iterator@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= dependencies: d "1" es5-ext "^0.10.35" @@ -2459,7 +2115,6 @@ es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.1, es6-iterator@~2.0 es6-map@^0.1.3: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" - integrity sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA= dependencies: d "1" es5-ext "~0.10.14" @@ -2471,7 +2126,6 @@ es6-map@^0.1.3: es6-set@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" - integrity sha1-0rPsXU2ADO2BjbU40ol02wpzzLE= dependencies: d "1" es5-ext "~0.10.14" @@ -2482,7 +2136,6 @@ es6-set@~0.1.5: es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - integrity sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc= dependencies: d "1" es5-ext "~0.10.14" @@ -2490,7 +2143,6 @@ es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: es6-weak-map@^2.0.1, es6-weak-map@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" - integrity sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8= dependencies: d "1" es5-ext "^0.10.14" @@ -2500,17 +2152,14 @@ es6-weak-map@^2.0.1, es6-weak-map@^2.0.2: escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= escodegen@1.8.x: version "1.8.1" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" - integrity sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg= dependencies: esprima "^2.7.1" estraverse "^1.9.1" @@ -2522,7 +2171,6 @@ escodegen@1.8.x: escope@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" - integrity sha1-4Bl16BJ4GhY6ba392AOY3GTIicM= dependencies: es6-map "^0.1.3" es6-weak-map "^2.0.1" @@ -2532,12 +2180,10 @@ escope@^3.6.0: eslint-config-standard@^11.0.0: version "11.0.0" resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz#87ee0d3c9d95382dc761958cbb23da9eea31e0ba" - integrity sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw== eslint-import-resolver-node@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" - integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== dependencies: debug "^2.6.9" resolve "^1.5.0" @@ -2545,7 +2191,6 @@ eslint-import-resolver-node@^0.3.1: eslint-module-utils@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746" - integrity sha1-snA2LNiLGkitMIl2zn+lTphBF0Y= dependencies: debug "^2.6.8" pkg-dir "^1.0.0" @@ -2553,7 +2198,6 @@ eslint-module-utils@^2.2.0: eslint-plugin-import@^2.10.0: version "2.14.0" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8" - integrity sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g== dependencies: contains-path "^0.1.0" debug "^2.6.8" @@ -2569,7 +2213,6 @@ eslint-plugin-import@^2.10.0: eslint-plugin-node@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz#bf19642298064379315d7a4b2a75937376fa05e4" - integrity sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw== dependencies: ignore "^3.3.6" minimatch "^3.0.4" @@ -2579,17 +2222,14 @@ eslint-plugin-node@^6.0.1: eslint-plugin-promise@^3.7.0: version "3.8.0" resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.8.0.tgz#65ebf27a845e3c1e9d6f6a5622ddd3801694b621" - integrity sha512-JiFL9UFR15NKpHyGii1ZcvmtIqa3UTwiDAGb8atSffe43qJ3+1czVGN6UtkklpcJ2DVnqvTMzEKRaJdBkAL2aQ== eslint-plugin-standard@^3.0.1: version "3.1.0" resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.1.0.tgz#2a9e21259ba4c47c02d53b2d0c9135d4b1022d47" - integrity sha512-fVcdyuKRr0EZ4fjWl3c+gp1BANFJD1+RaWa2UPYfMZ6jCtp5RG00kSaXnK/dE5sYzt4kaWJ9qdxqUfc0d9kX0w== eslint-scope@^3.7.1: version "3.7.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.3.tgz#bb507200d3d17f60247636160b4826284b108535" - integrity sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA== dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" @@ -2597,12 +2237,10 @@ eslint-scope@^3.7.1: eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" - integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== eslint@^4.19.1: version "4.19.1" resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" - integrity sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ== dependencies: ajv "^5.3.0" babel-code-frame "^6.22.0" @@ -2646,7 +2284,6 @@ eslint@^4.19.1: espree@^3.5.4: version "3.5.4" resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" - integrity sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A== dependencies: acorn "^5.5.0" acorn-jsx "^3.0.0" @@ -2654,51 +2291,42 @@ espree@^3.5.4: esprima@2.7.x, esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" - integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" - integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== dependencies: estraverse "^4.0.0" esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" - integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== dependencies: estraverse "^4.1.0" estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" - integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q= estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= eth-block-tracker@^2.2.2: version "2.3.1" resolved "https://registry.yarnpkg.com/eth-block-tracker/-/eth-block-tracker-2.3.1.tgz#ab6d177e5b50128fa06d7ae9e0489c7484bac95e" - integrity sha512-NamWuMBIl8kmkJFVj8WzGatySTzQPQag4Xr677yFxdVtIxACFbL/dQowk0MzEqIKk93U1TwY3MjVU6mOcwZnKA== dependencies: async-eventemitter ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c eth-query "^2.1.0" @@ -2712,7 +2340,6 @@ eth-block-tracker@^2.2.2: eth-lib@0.1.27, eth-lib@^0.1.26: version "0.1.27" resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.1.27.tgz#f0b0fd144f865d2d6bf8257a40004f2e75ca1dd6" - integrity sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA== dependencies: bn.js "^4.11.6" elliptic "^6.4.0" @@ -2725,7 +2352,6 @@ eth-lib@0.1.27, eth-lib@^0.1.26: eth-lib@0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.7.tgz#2f93f17b1e23aec3759cd4a3fe20c1286a3fc1ca" - integrity sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco= dependencies: bn.js "^4.11.6" elliptic "^6.4.0" @@ -2734,7 +2360,6 @@ eth-lib@0.2.7: eth-lightwallet@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/eth-lightwallet/-/eth-lightwallet-3.0.1.tgz#297022932aa568f4e4eb0873bff257f5e5b78709" - integrity sha512-79vVCETy+4l1b6wuOWwjqPW3Bom5ZK46BgkUNwaXhiMG1rrMRHjpjYEWMqH0JHeCzOzB4HBIFz7eK1/4s6w5nA== dependencies: bitcore-lib "^0.15.0" bitcore-mnemonic "^1.5.0" @@ -2751,7 +2376,6 @@ eth-lightwallet@^3.0.1: eth-query@^2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/eth-query/-/eth-query-2.1.2.tgz#d6741d9000106b51510c72db92d6365456a6da5e" - integrity sha1-1nQdkAAQa1FRDHLbktY2VFam2l4= dependencies: json-rpc-random-id "^1.0.0" xtend "^4.0.1" @@ -2759,7 +2383,6 @@ eth-query@^2.1.0: eth-sig-util@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-1.4.2.tgz#8d958202c7edbaae839707fba6f09ff327606210" - integrity sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA= dependencies: ethereumjs-abi "git+https://github.com/ethereumjs/ethereumjs-abi.git" ethereumjs-util "^5.1.1" @@ -2767,7 +2390,6 @@ eth-sig-util@^1.4.2: ethereum-bridge@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/ethereum-bridge/-/ethereum-bridge-0.6.1.tgz#53c93ed7c0e21752a91e5f089a5997e1d6fea228" - integrity sha512-yDTivI85618BoLI71yNRzW6iVcVN2rjnviCIzs0QOCOENj4XpYQhMDGhdqDi8XWDdzTd0Ja/Canuuh3vfE2IcA== dependencies: async "^2.4.1" borc "^2.0.2" @@ -2798,17 +2420,14 @@ ethereum-bridge@^0.6.1: ethereum-common@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.2.0.tgz#13bf966131cce1eeade62a1b434249bb4cb120ca" - integrity sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA== ethereum-common@^0.0.18: version "0.0.18" resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f" - integrity sha1-L9w1dvIykDNYl26znaeDIT/5Uj8= ethereumjs-abi@0.6.4: version "0.6.4" resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.4.tgz#9ba1bb056492d00c27279f6eccd4d58275912c1a" - integrity sha1-m6G7BWSS0AwnJ59uzNTVgnWRLBo= dependencies: bn.js "^4.10.0" ethereumjs-util "^4.3.0" @@ -2823,7 +2442,6 @@ ethereumjs-abi@^0.6.5, "ethereumjs-abi@git+https://github.com/ethereumjs/ethereu ethereumjs-account@^2.0.3: version "2.0.5" resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz#eeafc62de544cb07b0ee44b10f572c9c49e00a84" - integrity sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA== dependencies: ethereumjs-util "^5.0.0" rlp "^2.0.0" @@ -2832,7 +2450,6 @@ ethereumjs-account@^2.0.3: ethereumjs-block@^1.2.2, ethereumjs-block@~1.7.0: version "1.7.1" resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz#78b88e6cc56de29a6b4884ee75379b6860333c3f" - integrity sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg== dependencies: async "^2.0.1" ethereum-common "0.2.0" @@ -2843,26 +2460,22 @@ ethereumjs-block@^1.2.2, ethereumjs-block@~1.7.0: ethereumjs-common@~0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-0.4.1.tgz#27690a24a817b058cc3a2aedef9392e8d7d63984" - integrity sha512-ywYGsOeGCsMNWso5Y4GhjWI24FJv9FK7+VyVKiQgXg8ZRDPXJ7F/kJ1CnjtkjTvDF4e0yqU+FWswlqR3bmZQ9Q== ethereumjs-testrpc-sc@6.1.6: version "6.1.6" resolved "https://registry.yarnpkg.com/ethereumjs-testrpc-sc/-/ethereumjs-testrpc-sc-6.1.6.tgz#290595380b5182814564d4aa38f35b7788aab070" - integrity sha512-iv2qiGBFgk9mn5Nq2enX8dG5WQ7Lk+FCqpnxfPfH4Ns8KLPwttmNOy264nh3SXDJJvcQwz/XnlLteDQVILotbg== dependencies: source-map-support "^0.5.3" ethereumjs-testrpc@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/ethereumjs-testrpc/-/ethereumjs-testrpc-6.0.3.tgz#7a0b87bf3670f92f607f98fa6a78801d9741b124" - integrity sha512-lAxxsxDKK69Wuwqym2K49VpXtBvLEsXr1sryNG4AkvL5DomMdeCBbu3D87UEevKenLHBiT8GTjARwN6Yj039gA== dependencies: webpack "^3.0.0" ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.1, ethereumjs-tx@^1.3.3: version "1.3.7" resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz#88323a2d875b10549b8347e09f4862b546f3d89a" - integrity sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA== dependencies: ethereum-common "^0.0.18" ethereumjs-util "^5.0.0" @@ -2870,7 +2483,6 @@ ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.1, ethereumjs-tx@ ethereumjs-util@^4.3.0: version "4.5.0" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz#3e9428b317eebda3d7260d854fddda954b1f1bc6" - integrity sha1-PpQosxfuvaPXJg2FT93alUsfG8Y= dependencies: bn.js "^4.8.0" create-hash "^1.1.2" @@ -2881,7 +2493,6 @@ ethereumjs-util@^4.3.0: ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.3, ethereumjs-util@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz#3e0c0d1741471acf1036052d048623dee54ad642" - integrity sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA== dependencies: bn.js "^4.11.0" create-hash "^1.1.2" @@ -2894,7 +2505,6 @@ ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereum ethereumjs-vm@^2.0.2: version "2.4.0" resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-2.4.0.tgz#244f1e35f2755e537a13546111d1a4c159d34b13" - integrity sha512-MJ4lCWa5c6LhahhhvoDKW+YGjK00ZQn0RHHLh4L+WaH1k6Qv7/q3uTluew6sJGNCZdlO0yYMDXYW9qyxLHKlgQ== dependencies: async "^2.1.2" async-eventemitter "^0.2.2" @@ -2911,7 +2521,6 @@ ethereumjs-vm@^2.0.2: ethereumjs-wallet@^0.6.0: version "0.6.2" resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.2.tgz#67244b6af3e8113b53d709124b25477b64aeccda" - integrity sha512-DHEKPV9lYORM7dL8602dkb+AgdfzCYz2lxpdYQoD3OwG355LLDuivW9rGuLpDMCry/ORyBYV6n+QCo/71SwACg== dependencies: aes-js "^3.1.1" bs58check "^2.1.2" @@ -2925,7 +2534,6 @@ ethereumjs-wallet@^0.6.0: ethers@^3.0.15: version "3.0.29" resolved "https://registry.yarnpkg.com/ethers/-/ethers-3.0.29.tgz#ce8139955b4ed44456eb6764b089bb117c86775d" - integrity sha512-OGyA5pW5xFC5o/ZV5MfIoVp/EdA1QMg2bMJFf7Kznsz8m7IzzbgsPHTCjzSfKQDs/XDphGyRcA7A6bkIeJL4gw== dependencies: aes-js "3.0.0" bn.js "^4.4.0" @@ -2941,7 +2549,6 @@ ethers@^3.0.15: ethjs-abi@0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/ethjs-abi/-/ethjs-abi-0.1.8.tgz#cd288583ed628cdfadaf8adefa3ba1dbcbca6c18" - integrity sha1-zSiFg+1ijN+tr4re+juh28vKbBg= dependencies: bn.js "4.11.6" js-sha3 "0.5.5" @@ -2950,7 +2557,6 @@ ethjs-abi@0.1.8: ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" - integrity sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk= dependencies: bn.js "4.11.6" number-to-bn "1.7.0" @@ -2958,7 +2564,6 @@ ethjs-unit@0.1.6: ethjs-util@^0.1.3: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" - integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== dependencies: is-hex-prefixed "1.0.0" strip-hex-prefix "1.0.0" @@ -2966,7 +2571,6 @@ ethjs-util@^0.1.3: event-emitter@^0.3.5, event-emitter@~0.3.5: version "0.3.5" resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" - integrity sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk= dependencies: d "1" es5-ext "~0.10.14" @@ -2974,22 +2578,18 @@ event-emitter@^0.3.5, event-emitter@~0.3.5: eventemitter3@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.1.1.tgz#47786bdaa087caf7b1b75e73abc5c7d540158cd0" - integrity sha1-R3hr2qCHyvext15zq8XH1UAVjNA= events@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" - integrity sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ= events@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88" - integrity sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA== evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== dependencies: md5.js "^1.3.4" safe-buffer "^5.1.1" @@ -2997,7 +2597,6 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" @@ -3010,14 +2609,12 @@ execa@^0.7.0: expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= dependencies: is-posix-bracket "^0.1.0" expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= dependencies: debug "^2.3.3" define-property "^0.2.5" @@ -3030,14 +2627,12 @@ expand-brackets@^2.1.4: expand-range@^1.8.1: version "1.8.2" resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= dependencies: fill-range "^2.1.0" express@^4.14.0: version "4.16.4" resolved "https://registry.yarnpkg.com/express/-/express-4.16.4.tgz#fddef61926109e24c515ea97fd2f1bdbf62df12e" - integrity sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg== dependencies: accepts "~1.3.5" array-flatten "1.1.1" @@ -3073,14 +2668,12 @@ express@^4.14.0: extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= dependencies: is-extendable "^0.1.0" extend-shallow@^3.0.0, extend-shallow@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= dependencies: assign-symbols "^1.0.0" is-extendable "^1.0.1" @@ -3088,33 +2681,16 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extended@0.0.6, extended@~0.0.3: - version "0.0.6" - resolved "https://registry.yarnpkg.com/extended/-/extended-0.0.6.tgz#7fb8bf7b9dae397586e48570acfd642c78e50669" - integrity sha1-f7i/e52uOXWG5IVwrP1kLHjlBmk= - dependencies: - extender "~0.0.5" - -extender@~0.0.5: - version "0.0.10" - resolved "https://registry.yarnpkg.com/extender/-/extender-0.0.10.tgz#589c07482be61a1460b6d81f9c24aa67e8f324cd" - integrity sha1-WJwHSCvmGhRgttgfnCSqZ+jzJM0= - dependencies: - declare.js "~0.0.4" extendr@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/extendr/-/extendr-2.1.0.tgz#301aa0bbea565f4d2dc8f570f2a22611a8527b56" - integrity sha1-MBqgu+pWX00tyPVw8qImEahSe1Y= dependencies: typechecker "~2.0.1" external-editor@^2.0.4: version "2.2.0" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" - integrity sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A== dependencies: chardet "^0.4.0" iconv-lite "^0.4.17" @@ -3123,14 +2699,12 @@ external-editor@^2.0.4: extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= dependencies: is-extglob "^1.0.0" extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== dependencies: array-unique "^0.3.2" define-property "^1.0.0" @@ -3144,87 +2718,64 @@ extglob@^2.0.4: extract-opts@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/extract-opts/-/extract-opts-2.2.0.tgz#1fa28eba7352c6db480f885ceb71a46810be6d7d" - integrity sha1-H6KOunNSxttID4hc63GkaBC+bX0= dependencies: typechecker "~2.0.1" extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= extsprintf@^1.2.0: version "1.4.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= eyes@0.1.x: version "0.1.8" resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" - integrity sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A= fake-merkle-patricia-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz#4b8c3acfb520afadf9860b1f14cd8ce3402cddd3" - integrity sha1-S4w6z7Ugr635hgsfFM2M40As3dM= dependencies: checkpoint-store "^1.1.0" -fast-csv@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/fast-csv/-/fast-csv-2.4.1.tgz#bd7dd268391f729367b59445b8dd0ad026881b26" - integrity sha1-vX3SaDkfcpNntZRFuN0K0CaIGyY= - dependencies: - extended "0.0.6" - is-extended "0.0.10" - object-extended "0.0.7" - string-extended "0.0.8" - fast-deep-equal@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= fast-deep-equal@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fd-slicer@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= dependencies: pend "~1.2.0" fetch-ponyfill@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz#ae3ce5f732c645eab87e4ae8793414709b239893" - integrity sha1-rjzl9zLGReq4fkroeTQUcJsjmJM= dependencies: node-fetch "~1.7.1" figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= dependencies: escape-string-regexp "^1.0.5" file-entry-cache@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= dependencies: flat-cache "^1.2.1" object-assign "^4.0.1" @@ -3232,27 +2783,22 @@ file-entry-cache@^2.0.0: file-type@^3.8.0: version "3.9.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" - integrity sha1-JXoHg4TR24CHvESdEH1SpSZyuek= file-type@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6" - integrity sha1-LdvqfHP/42No365J3DOMBYwritY= file-type@^6.1.0: version "6.2.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919" - integrity sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg== filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= fill-range@^2.1.0: version "2.2.4" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== dependencies: is-number "^2.1.0" isobject "^2.0.0" @@ -3263,7 +2809,6 @@ fill-range@^2.1.0: fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= dependencies: extend-shallow "^2.0.1" is-number "^3.0.0" @@ -3273,7 +2818,6 @@ fill-range@^4.0.0: finalhandler@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" - integrity sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg== dependencies: debug "2.6.9" encodeurl "~1.0.2" @@ -3286,7 +2830,6 @@ finalhandler@1.1.1: find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= dependencies: path-exists "^2.0.0" pinkie-promise "^2.0.0" @@ -3294,14 +2837,12 @@ find-up@^1.0.0: find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= dependencies: locate-path "^2.0.0" flat-cache@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" - integrity sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE= dependencies: circular-json "^0.3.1" del "^2.0.2" @@ -3311,31 +2852,26 @@ flat-cache@^1.2.1: for-each@^0.3.2, for-each@~0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" - integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== dependencies: is-callable "^1.1.3" for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= for-own@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= dependencies: for-in "^1.0.1" forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= form-data@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" - integrity sha1-SXBJi+YEwgwAXU9cI67NIda0kJk= dependencies: asynckit "^0.4.0" combined-stream "1.0.6" @@ -3344,29 +2880,24 @@ form-data@~2.3.2: forwarded@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= dependencies: map-cache "^0.2.2" fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== fs-extra@^0.30.0: version "0.30.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= dependencies: graceful-fs "^4.1.2" jsonfile "^2.1.0" @@ -3377,7 +2908,6 @@ fs-extra@^0.30.0: fs-extra@^2.0.0, fs-extra@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-2.1.2.tgz#046c70163cef9aad46b0e4a7fa467fb22d71de35" - integrity sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU= dependencies: graceful-fs "^4.1.2" jsonfile "^2.1.0" @@ -3385,7 +2915,6 @@ fs-extra@^2.0.0, fs-extra@^2.1.2: fs-extra@^4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" - integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== dependencies: graceful-fs "^4.1.2" jsonfile "^4.0.0" @@ -3394,7 +2923,6 @@ fs-extra@^4.0.2: fs-extra@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd" - integrity sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ== dependencies: graceful-fs "^4.1.2" jsonfile "^4.0.0" @@ -3403,14 +2931,12 @@ fs-extra@^5.0.0: fs-minipass@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== dependencies: minipass "^2.2.1" fs-promise@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/fs-promise/-/fs-promise-2.0.3.tgz#f64e4f854bcf689aa8bddcba268916db3db46854" - integrity sha1-9k5PhUvPaJqovdy6JokW2z20aFQ= dependencies: any-promise "^1.3.0" fs-extra "^2.0.0" @@ -3420,17 +2946,14 @@ fs-promise@^2.0.0: fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fs@0.0.1-security: version "0.0.1-security" resolved "https://registry.yarnpkg.com/fs/-/fs-0.0.1-security.tgz#8a7bd37186b6dddf3813f23858b57ecaaf5e41d4" - integrity sha1-invTcYa23d84E/I4WLV+yq9eQdQ= fsevents@^1.0.0, fsevents@^1.2.2: version "1.2.4" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" - integrity sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg== dependencies: nan "^2.9.2" node-pre-gyp "^0.10.0" @@ -3438,7 +2961,6 @@ fsevents@^1.0.0, fsevents@^1.2.2: fstream@^1.0.2, fstream@^1.0.8: version "1.0.11" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" - integrity sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE= dependencies: graceful-fs "^4.1.2" inherits "~2.0.0" @@ -3448,24 +2970,20 @@ fstream@^1.0.2, fstream@^1.0.8: function-bind@^1.0.2, function-bind@^1.1.1, function-bind@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= ganache-cli@^6.1.8: version "6.1.8" resolved "https://registry.yarnpkg.com/ganache-cli/-/ganache-cli-6.1.8.tgz#49a8a331683a9652183f82ef1378d17e1814fcd3" - integrity sha512-yXzteu4SIgUL31mnpm9j+x6dpHUw0p/nsRVkcySKq0w+1vDxH9jMErP1QhZAJuTVE6ni4nfvGSNkaQx5cD3jfg== dependencies: source-map-support "^0.5.3" gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -3479,12 +2997,10 @@ gauge@~2.7.3: get-caller-file@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== get-stream@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" - integrity sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4= dependencies: object-assign "^4.0.1" pinkie-promise "^2.0.0" @@ -3492,24 +3008,20 @@ get-stream@^2.2.0: get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= dependencies: assert-plus "^1.0.0" glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= dependencies: glob-parent "^2.0.0" is-glob "^2.0.0" @@ -3517,14 +3029,12 @@ glob-base@^0.3.0: glob-parent@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= dependencies: is-glob "^2.0.0" glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= dependencies: is-glob "^3.1.0" path-dirname "^1.0.0" @@ -3532,7 +3042,6 @@ glob-parent@^3.1.0: glob@7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -3544,7 +3053,6 @@ glob@7.1.2: glob@^5.0.15: version "5.0.15" resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= dependencies: inflight "^1.0.4" inherits "2" @@ -3555,7 +3063,6 @@ glob@^5.0.15: glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.2: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -3567,7 +3074,6 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.2: glob@~6.0.4: version "6.0.4" resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" - integrity sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI= dependencies: inflight "^1.0.4" inherits "2" @@ -3578,7 +3084,6 @@ glob@~6.0.4: global@~4.3.0: version "4.3.2" resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" - integrity sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8= dependencies: min-document "^2.19.0" process "~0.5.1" @@ -3586,17 +3091,14 @@ global@~4.3.0: globals@^11.0.1: version "11.8.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.8.0.tgz#c1ef45ee9bed6badf0663c5cb90e8d1adec1321d" - integrity sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA== globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== globby@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" - integrity sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0= dependencies: array-union "^1.0.1" arrify "^1.0.0" @@ -3608,7 +3110,6 @@ globby@^5.0.0: got@7.1.0, got@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" - integrity sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw== dependencies: decompress-response "^3.2.0" duplexer3 "^0.1.4" @@ -3628,27 +3129,22 @@ got@7.1.0, got@^7.1.0: graceful-fs@*, graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= "graceful-readlink@>= 1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU= growl@1.10.3: version "1.10.3" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" - integrity sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q== growl@1.10.5, "growl@~> 1.10.0": version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== handlebars@^4.0.1: version "4.0.12" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5" - integrity sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA== dependencies: async "^2.5.0" optimist "^0.6.1" @@ -3659,12 +3155,10 @@ handlebars@^4.0.1: har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= har-validator@~5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" - integrity sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA== dependencies: ajv "^5.3.0" har-schema "^2.0.0" @@ -3672,51 +3166,42 @@ har-validator@~5.1.0: has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= dependencies: ansi-regex "^2.0.0" has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= has-symbol-support-x@^1.4.1: version "1.4.2" resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" - integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== has-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" - integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= has-to-string-tag-x@^1.2.0: version "1.4.1" resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" - integrity sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw== dependencies: has-symbol-support-x "^1.4.1" has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= dependencies: get-value "^2.0.3" has-values "^0.1.4" @@ -3725,7 +3210,6 @@ has-value@^0.3.1: has-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= dependencies: get-value "^2.0.6" has-values "^1.0.0" @@ -3734,12 +3218,10 @@ has-value@^1.0.0: has-values@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= has-values@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= dependencies: is-number "^3.0.0" kind-of "^4.0.0" @@ -3747,14 +3229,12 @@ has-values@^1.0.0: has@^1.0.1, has@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: function-bind "^1.1.1" hash-base@^3.0.0: version "3.0.4" resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" - integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" @@ -3762,7 +3242,6 @@ hash-base@^3.0.0: hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.5" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.5.tgz#e38ab4b85dfb1e0c40fe9265c0e9b54854c23812" - integrity sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA== dependencies: inherits "^2.0.3" minimalistic-assert "^1.0.1" @@ -3770,7 +3249,6 @@ hash.js@^1.0.0, hash.js@^1.0.3: hdkey@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/hdkey/-/hdkey-1.1.0.tgz#e74e7b01d2c47f797fa65d1d839adb7a44639f29" - integrity sha512-E7aU8pNlWUJbXGjTz/+lKf1LkMcA3hUrC5ZleeizrmLSd++kvf8mSOe3q8CmBDA9j4hdfXO5iY6hGiTUCOV2jQ== dependencies: coinstring "^2.0.0" safe-buffer "^5.1.1" @@ -3779,12 +3257,10 @@ hdkey@^1.0.0: he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= dependencies: hash.js "^1.0.3" minimalistic-assert "^1.0.0" @@ -3793,7 +3269,6 @@ hmac-drbg@^1.0.0: home-or-tmp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.1" @@ -3801,12 +3276,10 @@ home-or-tmp@^2.0.0: hosted-git-info@^2.1.4: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" - integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: version "1.6.3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= dependencies: depd "~1.1.2" inherits "2.0.3" @@ -3816,12 +3289,10 @@ http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: http-https@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b" - integrity sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs= http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= dependencies: assert-plus "^1.0.0" jsprim "^1.2.2" @@ -3830,12 +3301,10 @@ http-signature@~1.2.0: https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= i18n@^0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/i18n/-/i18n-0.8.3.tgz#2d8cf1c24722602c2041d01ba6ae5eaa51388f0e" - integrity sha1-LYzxwkciYCwgQdAbpq5eqlE4jw4= dependencies: debug "*" make-plural "^3.0.3" @@ -3844,41 +3313,39 @@ i18n@^0.8.3: mustache "*" sprintf-js ">=1.0.3" +i@0.3.x: + version "0.3.6" + resolved "https://registry.yarnpkg.com/i/-/i-0.3.6.tgz#d96c92732076f072711b6b10fd7d4f65ad8ee23d" + iconv-lite@0.4.23: version "0.4.23" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== dependencies: safer-buffer ">= 2.1.2 < 3" iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" ieee754@^1.1.4, ieee754@^1.1.8: version "1.1.12" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b" - integrity sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA== ignore-walk@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== dependencies: minimatch "^3.0.4" ignore@^3.3.3, ignore@^3.3.6: version "3.3.10" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" - integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== ignorefs@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/ignorefs/-/ignorefs-1.2.0.tgz#da59fb858976e4a5e43702ccd1f282fdbc9e5756" - integrity sha1-2ln7hYl25KXkNwLM0fKC/byeV1Y= dependencies: editions "^1.3.3" ignorepatterns "^1.1.0" @@ -3886,27 +3353,22 @@ ignorefs@^1.0.0: ignorepatterns@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/ignorepatterns/-/ignorepatterns-1.1.0.tgz#ac8f436f2239b5dfb66d5f0d3a904a87ac67cc5e" - integrity sha1-rI9DbyI5td+2bV8NOpBKh6xnzF4= immediate@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c" - integrity sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw= imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= indexof@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" @@ -3914,22 +3376,18 @@ inflight@^1.0.4: inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= inherits@2.0.1, inherits@=2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== inquirer@^3.0.6: version "3.3.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" - integrity sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ== dependencies: ansi-escapes "^3.0.0" chalk "^2.0.0" @@ -3949,91 +3407,76 @@ inquirer@^3.0.6: interpret@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" - integrity sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ= invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== dependencies: loose-envify "^1.0.0" invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= ipaddr.js@1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.8.0.tgz#eaa33d6ddd7ace8f7f6fe0c9ca0440e706738b1e" - integrity sha1-6qM9bd16zo9/b+DJygRA5wZzix4= is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= dependencies: kind-of "^3.0.2" is-accessor-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== dependencies: kind-of "^6.0.0" is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= is-binary-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= dependencies: binary-extensions "^1.0.0" is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== is-builtin-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74= dependencies: builtin-modules "^1.0.0" is-callable@^1.1.3, is-callable@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" - integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= dependencies: kind-of "^3.0.2" is-data-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== dependencies: kind-of "^6.0.0" is-date-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== dependencies: is-accessor-descriptor "^0.1.6" is-data-descriptor "^0.1.4" @@ -4042,7 +3485,6 @@ is-descriptor@^0.1.0: is-descriptor@^1.0.0, is-descriptor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== dependencies: is-accessor-descriptor "^1.0.0" is-data-descriptor "^1.0.0" @@ -4051,261 +3493,210 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-dotfile@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= is-equal-shallow@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= dependencies: is-primitive "^2.0.0" is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= is-extendable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== dependencies: is-plain-object "^2.0.4" -is-extended@0.0.10, is-extended@~0.0.3, is-extended@~0.0.8: - version "0.0.10" - resolved "https://registry.yarnpkg.com/is-extended/-/is-extended-0.0.10.tgz#244e140df75bb1c9a3106f412ff182fb534a6d62" - integrity sha1-JE4UDfdbscmjEG9BL/GC+1NKbWI= - dependencies: - extended "~0.0.3" - is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-finite@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" - integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= dependencies: number-is-nan "^1.0.0" is-fn@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fn/-/is-fn-1.0.0.tgz#9543d5de7bcf5b08a22ec8a20bae6e286d510d8c" - integrity sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw= is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= dependencies: number-is-nan "^1.0.0" is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= is-function@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" - integrity sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU= is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= dependencies: is-extglob "^1.0.0" is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= dependencies: is-extglob "^2.1.0" is-glob@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" - integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= dependencies: is-extglob "^2.1.1" is-hex-prefixed@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" - integrity sha1-fY035q135dEnFIkTxXPggtd39VQ= is-nan@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.2.1.tgz#9faf65b6fb6db24b7f5c0628475ea71f988401e2" - integrity sha1-n69ltvttskt/XAYoR16nH5iEAeI= dependencies: define-properties "^1.1.1" is-natural-number@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" - integrity sha1-q5124dtM7VHjXeDHLr7PCfc0zeg= is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= dependencies: kind-of "^3.0.2" is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= dependencies: kind-of "^3.0.2" is-number@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== is-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" - integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= is-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" - integrity sha1-iVJojF7C/9awPsyF52ngKQMINHA= is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= is-path-in-cwd@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" - integrity sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ== dependencies: is-path-inside "^1.0.0" is-path-inside@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" - integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= dependencies: path-is-inside "^1.0.1" is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: isobject "^3.0.1" is-posix-bracket@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= is-promise@^2.1, is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= is-regex@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= dependencies: has "^1.0.1" is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" - integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== is-retry-allowed@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" - integrity sha1-EaBgVotnM5REAz0BJaYaINVk+zQ= is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= is-symbol@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" - integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== dependencies: has-symbols "^1.0.0" is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= dependencies: isarray "1.0.0" isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= isomorphic-fetch@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" - integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk= dependencies: node-fetch "^1.0.1" whatwg-fetch ">=0.10.0" @@ -4313,12 +3704,10 @@ isomorphic-fetch@^2.2.0: isstream@0.1.x, isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= istanbul@^0.4.5: version "0.4.5" resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" - integrity sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs= dependencies: abbrev "1.0.x" async "1.x" @@ -4338,7 +3727,6 @@ istanbul@^0.4.5: isurl@^1.0.0-alpha5: version "1.0.0" resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" - integrity sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w== dependencies: has-to-string-tag-x "^1.2.0" is-object "^1.0.1" @@ -4346,37 +3734,30 @@ isurl@^1.0.0-alpha5: js-sha3@0.5.5: version "0.5.5" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.5.tgz#baf0c0e8c54ad5903447df96ade7a4a1bca79a4a" - integrity sha1-uvDA6MVK1ZA0R9+Wreekobynmko= js-sha3@0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" - integrity sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc= js-sha3@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.3.1.tgz#86122802142f0828502a0d1dee1d95e253bb0243" - integrity sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM= js-string-escape@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef" - integrity sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8= "js-tokens@^3.0.0 || ^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= js-yaml@3.x, js-yaml@^3.11.0, js-yaml@^3.9.1: version "3.12.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" - integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -4384,27 +3765,22 @@ js-yaml@3.x, js-yaml@^3.11.0, js-yaml@^3.9.1: jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" - integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= json-loader@^0.5.4: version "0.5.7" resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" - integrity sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w== json-rpc-engine@^3.6.0: version "3.8.0" resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz#9d4ff447241792e1d0a232f6ef927302bb0c62a9" - integrity sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA== dependencies: async "^2.0.1" babel-preset-env "^1.7.0" @@ -4416,82 +3792,68 @@ json-rpc-engine@^3.6.0: json-rpc-error@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/json-rpc-error/-/json-rpc-error-2.0.0.tgz#a7af9c202838b5e905c7250e547f1aff77258a02" - integrity sha1-p6+cICg4tekFxyUOVH8a/3cligI= dependencies: inherits "^2.0.1" json-rpc-random-id@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz#ba49d96aded1444dbb8da3d203748acbbcdec8c8" - integrity sha1-uknZat7RRE27jaPSA3SKy7zeyMg= json-schema-traverse@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - integrity sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8= dependencies: jsonify "~0.0.0" json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= json-text-sequence@^0.1: version "0.1.1" resolved "https://registry.yarnpkg.com/json-text-sequence/-/json-text-sequence-0.1.1.tgz#a72f217dc4afc4629fff5feb304dc1bd51a2f3d2" - integrity sha1-py8hfcSvxGKf/1/rME3BvVGi89I= dependencies: delimit-stream "0.1.0" json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= optionalDependencies: graceful-fs "^4.1.6" jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= optionalDependencies: graceful-fs "^4.1.6" jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= dependencies: assert-plus "1.0.0" extsprintf "1.3.0" @@ -4501,7 +3863,6 @@ jsprim@^1.2.2: keccak@^1.0.2: version "1.4.0" resolved "https://registry.yarnpkg.com/keccak/-/keccak-1.4.0.tgz#572f8a6dbee8e7b3aa421550f9e6408ca2186f80" - integrity sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw== dependencies: bindings "^1.2.1" inherits "^2.0.3" @@ -4511,7 +3872,6 @@ keccak@^1.0.2: keccakjs@^0.2.0, keccakjs@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/keccakjs/-/keccakjs-0.2.1.tgz#1d633af907ef305bbf9f2fa616d56c44561dfa4d" - integrity sha1-HWM6+QfvMFu/ny+mFtVsRFYd+k0= dependencies: browserify-sha3 "^0.0.1" sha3 "^1.1.0" @@ -4519,74 +3879,62 @@ keccakjs@^0.2.0, keccakjs@^0.2.1: kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= dependencies: is-buffer "^1.1.5" kind-of@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= dependencies: is-buffer "^1.1.5" kind-of@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== klaw@^1.0.0: version "1.3.1" resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= optionalDependencies: graceful-fs "^4.1.9" lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= lcid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= dependencies: invert-kv "^1.0.0" lcov-parse@^0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" - integrity sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM= level-codec@~7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-7.0.1.tgz#341f22f907ce0f16763f24bddd681e395a0fb8a7" - integrity sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ== level-errors@^1.0.3: version "1.1.2" resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.1.2.tgz#4399c2f3d3ab87d0625f7e3676e2d807deff404d" - integrity sha512-Sw/IJwWbPKF5Ai4Wz60B52yj0zYeqzObLh8k1Tk88jVmD51cJSKWSYpRyhVIvFzZdvsPqlH5wfhp/yxdsaQH4w== dependencies: errno "~0.1.1" level-errors@~1.0.3: version "1.0.5" resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.0.5.tgz#83dbfb12f0b8a2516bdc9a31c4876038e227b859" - integrity sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig== dependencies: errno "~0.1.1" level-iterator-stream@~1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz#e43b78b1a8143e6fa97a4f485eb8ea530352f2ed" - integrity sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0= dependencies: inherits "^2.0.1" level-errors "^1.0.3" @@ -4596,7 +3944,6 @@ level-iterator-stream@~1.3.0: level-ws@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-0.0.0.tgz#372e512177924a00424b0b43aef2bb42496d228b" - integrity sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos= dependencies: readable-stream "~1.0.15" xtend "~2.1.1" @@ -4604,7 +3951,6 @@ level-ws@0.0.0: levelup@^1.2.1: version "1.3.9" resolved "https://registry.yarnpkg.com/levelup/-/levelup-1.3.9.tgz#2dbcae845b2bb2b6bea84df334c475533bbd82ab" - integrity sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ== dependencies: deferred-leveldown "~1.2.1" level-codec "~7.0.0" @@ -4617,7 +3963,6 @@ levelup@^1.2.1: levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= dependencies: prelude-ls "~1.1.2" type-check "~0.3.2" @@ -4625,7 +3970,6 @@ levn@^0.3.0, levn@~0.3.0: load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" - integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" @@ -4636,7 +3980,6 @@ load-json-file@^1.0.0: load-json-file@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" - integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" @@ -4646,12 +3989,10 @@ load-json-file@^2.0.0: loader-runner@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.1.tgz#026f12fe7c3115992896ac02ba022ba92971b979" - integrity sha512-By6ZFY7ETWOc9RFaAIb23IjJVcM4dvJC/N57nmdz9RSkMXvAXGI7SyVlAw3v8vjtDRlqThgVDVmTnr9fqMlxkw== loader-utils@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd" - integrity sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0= dependencies: big.js "^3.1.3" emojis-list "^2.0.0" @@ -4660,7 +4001,6 @@ loader-utils@^1.1.0: locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= dependencies: p-locate "^2.0.0" path-exists "^3.0.0" @@ -4668,54 +4008,44 @@ locate-path@^2.0.0: lodash.assign@^4.0.3, lodash.assign@^4.0.6: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" - integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= lodash@4.x, lodash@^4.13.1, lodash@^4.14.2, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== lodash@=4.17.4: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" - integrity sha1-eCA6TRwyiuHYbcpkYONptX9AVa4= log-driver@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" - integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== long-timeout@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/long-timeout/-/long-timeout-0.1.1.tgz#9721d788b47e0bcb5a24c2e2bee1a0da55dab514" - integrity sha1-lyHXiLR+C8taJMLivuGg2lXatRQ= longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - integrity sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc= loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: js-tokens "^3.0.0 || ^4.0.0" lowercase-keys@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" - integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== lru-cache@^4.0.1: version "4.1.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" - integrity sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA== dependencies: pseudomap "^1.0.2" yallist "^2.1.2" @@ -4723,57 +4053,48 @@ lru-cache@^4.0.1: lru-queue@0.1: version "0.1.0" resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" - integrity sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM= dependencies: es5-ext "~0.10.2" ltgt@~2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" - integrity sha1-81ypHEk/e3PaDgdJUwTxezH4fuU= make-dir@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" - integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== dependencies: pify "^3.0.0" make-plural@^3.0.3, make-plural@~3.0.3: version "3.0.6" resolved "https://registry.yarnpkg.com/make-plural/-/make-plural-3.0.6.tgz#2033a03bac290b8f3bb91258f65b9df7e8b01ca7" - integrity sha1-IDOgO6wpC487uRJY9lud9+iwHKc= optionalDependencies: minimist "^1.2.0" map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= map-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= dependencies: object-visit "^1.0.0" math-interval-parser@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/math-interval-parser/-/math-interval-parser-1.1.0.tgz#dbeda5b06b3249973c6df6170fde2386f0afd893" - integrity sha1-2+2lsGsySZc8bfYXD94jhvCv2JM= dependencies: xregexp "^2.0.0" math-random@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" - integrity sha1-izqsWIuKZuSXXjzepn97sylgH6w= md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== dependencies: hash-base "^3.0.0" inherits "^2.0.1" @@ -4782,19 +4103,16 @@ md5.js@^1.3.4: media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= mem@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" - integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= dependencies: mimic-fn "^1.0.0" memdown@^1.0.0: version "1.4.1" resolved "https://registry.yarnpkg.com/memdown/-/memdown-1.4.1.tgz#b4e4e192174664ffbae41361aa500f3119efe215" - integrity sha1-tOThkhdGZP+65BNhqlAPMRnv4hU= dependencies: abstract-leveldown "~2.7.1" functional-red-black-tree "^1.0.1" @@ -4806,7 +4124,6 @@ memdown@^1.0.0: memoizee@^0.4.14: version "0.4.14" resolved "https://registry.yarnpkg.com/memoizee/-/memoizee-0.4.14.tgz#07a00f204699f9a95c2d9e77218271c7cd610d57" - integrity sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg== dependencies: d "1" es5-ext "^0.10.45" @@ -4820,7 +4137,6 @@ memoizee@^0.4.14: memory-fs@^0.4.0, memory-fs@~0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" - integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= dependencies: errno "^0.1.3" readable-stream "^2.0.1" @@ -4828,17 +4144,14 @@ memory-fs@^0.4.0, memory-fs@~0.4.1: memorystream@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" - integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= merkle-patricia-tree@^2.1.2: version "2.3.2" resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz#982ca1b5a0fde00eed2f6aeed1f9152860b8208a" - integrity sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g== dependencies: async "^1.4.2" ethereumjs-util "^5.0.0" @@ -4852,7 +4165,6 @@ merkle-patricia-tree@^2.1.2: messageformat@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/messageformat/-/messageformat-0.3.1.tgz#e58fff8245e9b3971799e5b43db58b3e9417f5a2" - integrity sha1-5Y//gkXps5cXmeW0PbWLPpQX9aI= dependencies: async "~1.5.2" glob "~6.0.4" @@ -4863,12 +4175,10 @@ messageformat@^0.3.1: methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= micromatch@^2.1.5: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= dependencies: arr-diff "^2.0.0" array-unique "^0.2.1" @@ -4887,7 +4197,6 @@ micromatch@^2.1.5: micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -4906,7 +4215,6 @@ micromatch@^3.1.10, micromatch@^3.1.4: miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== dependencies: bn.js "^4.0.0" brorand "^1.0.1" @@ -4914,73 +4222,60 @@ miller-rabin@^4.0.0: mime-db@~1.36.0: version "1.36.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" - integrity sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw== mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.18, mime-types@~2.1.19: version "2.1.20" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" - integrity sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A== dependencies: mime-db "~1.36.0" mime@1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" - integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ== mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== mimic-response@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== min-document@^2.19.0: version "2.19.0" resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" - integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU= dependencies: dom-walk "^0.1.0" minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= "minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= minimist@^1.2.0, minimist@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= minimist@~0.0.1: version "0.0.10" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= minipass@^2.2.1, minipass@^2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.4.tgz#4768d7605ed6194d6d576169b9e12ef71e9d9957" - integrity sha512-mlouk1OHlaUE8Odt1drMtG1bAJA4ZA6B/ehysgV0LUIrDHdKgo1KorZq3pK0b/7Z7LJIQ12MNM6aC+Tn6lUZ5w== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" @@ -4988,14 +4283,12 @@ minipass@^2.2.1, minipass@^2.3.3: minizlib@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.1.tgz#6734acc045a46e61d596a43bb9d9cd326e19cc42" - integrity sha512-TrfjCjk4jLhcJyGMYymBH6oTXcWjYbUAXTHDbtnWHjZC25h0cdajHuPE1zxb4DVmu8crfh+HwH/WMuyLG0nHBg== dependencies: minipass "^2.2.1" mixin-deep@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" @@ -5003,21 +4296,18 @@ mixin-deep@^1.2.0: mkdirp-promise@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" - integrity sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE= dependencies: mkdirp "*" -mkdirp@*, mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +mkdirp@*, mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@0.x.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" mocha@^4.0.1, mocha@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.1.0.tgz#7d86cfbcf35cb829e2754c32e17355ec05338794" - integrity sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA== dependencies: browser-stdout "1.3.0" commander "2.11.0" @@ -5033,7 +4323,6 @@ mocha@^4.0.1, mocha@^4.1.0: mocha@^5.0.1: version "5.2.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" - integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== dependencies: browser-stdout "1.3.1" commander "2.15.1" @@ -5050,39 +4339,32 @@ mocha@^5.0.1: mock-fs@^4.1.0: version "4.7.0" resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.7.0.tgz#9f17e219cacb8094f4010e0a8c38589e2b33c299" - integrity sha512-WlQNtUlzMRpvLHf8dqeUmNqfdPjGY29KrJF50Ldb4AcL+vQeR8QH3wQcFMgrhTwb1gHjZn9xggho+84tBskLgA== moment-timezone@^0.5.0: version "0.5.21" resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.21.tgz#3cba247d84492174dbf71de2a9848fa13207b845" - integrity sha512-j96bAh4otsgj3lKydm3K7kdtA3iKf2m6MY2iSYCzCm5a1zmHo1g+aK3068dDEeocLZQIS9kU8bsdQHLqEvgW0A== dependencies: moment ">= 2.9.0" "moment@>= 2.9.0", moment@^2.22.2: version "2.22.2" resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66" - integrity sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y= mout@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/mout/-/mout-0.11.1.tgz#ba3611df5f0e5b1ffbfd01166b8f02d1f5fa2b99" - integrity sha1-ujYR318OWx/7/QEWa48C0fX6K5k= ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= ms@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== multihashes@^0.4.5: version "0.4.14" resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-0.4.14.tgz#774db9a161f81a8a27dc60788f91248e020f5244" - integrity sha512-V/g/EIN6nALXfS/xHUAgtfPP3mn3sPIF/i9beuGKf25QXS2QZYCpeVJbDPEannkz32B2fihzCe2D/KMrbcmefg== dependencies: bs58 "^4.0.1" varint "^5.0.0" @@ -5090,22 +4372,18 @@ multihashes@^0.4.5: mustache@*: version "3.0.0" resolved "https://registry.yarnpkg.com/mustache/-/mustache-3.0.0.tgz#3de22dd9ba38152f7355399a953dd4528c403338" - integrity sha512-bhBDkK/PioIbtQzRIbGUGypvc3MC4c389QnJt8KDIEJ666OidRPoXAQAHPivikfS3JkMEaWoPvcDL7YrQxtSwg== mustache@^2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/mustache/-/mustache-2.3.2.tgz#a6d4d9c3f91d13359ab889a812954f9230a3d0c5" - integrity sha512-KpMNwdQsYz3O/SBS1qJ/o3sqUJ5wSb8gb0pul8CO0S56b9Y2ALm8zCfsjPXsqGFfoNBkDwZuZIAjhsZI03gYVQ== -mute-stream@0.0.7: +mute-stream@0.0.7, mute-stream@~0.0.4: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= mz@^2.6.0: version "2.7.0" resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" - integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== dependencies: any-promise "^1.0.0" object-assign "^4.0.1" @@ -5114,22 +4392,18 @@ mz@^2.6.0: nan@2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" - integrity sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA== nan@^2.0.8, nan@^2.2.1, nan@^2.3.3, nan@^2.9.2: version "2.11.1" resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.1.tgz#90e22bccb8ca57ea4cd37cc83d3819b52eea6766" - integrity sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA== nano-json-stream-parser@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" - integrity sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18= nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -5146,12 +4420,14 @@ nanomatch@^1.2.9: natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +ncp@1.0.x: + version "1.0.1" + resolved "http://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz#d15367e5cb87432ba117d2bf80fdf45aecfb4246" needle@^2.2.1: version "2.2.4" resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" - integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== dependencies: debug "^2.1.2" iconv-lite "^0.4.4" @@ -5160,27 +4436,22 @@ needle@^2.2.1: negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" - integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= neo-async@^2.5.0: version "2.5.2" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.2.tgz#489105ce7bc54e709d736b195f82135048c50fcc" - integrity sha512-vdqTKI9GBIYcAEbFAcpKPErKINfPF5zIuz3/niBfq8WUZjpT2tytLlFVrBgWdOtqI4uaA/Rb6No0hux39XXDuw== next-tick@1: version "1.0.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" - integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= node-async-loop@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/node-async-loop/-/node-async-loop-1.2.2.tgz#c5870299bf6477b780c88b431aa5b37733f55a3d" - integrity sha1-xYcCmb9kd7eAyItDGqWzdzP1Wj0= node-cache@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/node-cache/-/node-cache-4.2.0.tgz#48ac796a874e762582692004a376d26dfa875811" - integrity sha512-obRu6/f7S024ysheAjoYFEEBqqDWv4LOMNJEuO8vMeEw2AT4z+NCzO4hlc2lhI4vATzbCQv6kke9FVdx0RbCOw== dependencies: clone "2.x" lodash "4.x" @@ -5188,7 +4459,6 @@ node-cache@^4.1.1: node-fetch@^1.0.1, node-fetch@~1.7.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" - integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== dependencies: encoding "^0.1.11" is-stream "^1.0.1" @@ -5196,7 +4466,6 @@ node-fetch@^1.0.1, node-fetch@~1.7.1: node-libs-browser@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.1.0.tgz#5f94263d404f6e44767d726901fff05478d600df" - integrity sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg== dependencies: assert "^1.1.1" browserify-zlib "^0.2.0" @@ -5225,7 +4494,6 @@ node-libs-browser@^2.0.0: node-pre-gyp@^0.10.0: version "0.10.3" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" - integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== dependencies: detect-libc "^1.0.2" mkdirp "^0.5.1" @@ -5241,7 +4509,6 @@ node-pre-gyp@^0.10.0: node-schedule@^1.2.3: version "1.3.0" resolved "https://registry.yarnpkg.com/node-schedule/-/node-schedule-1.3.0.tgz#e7a7e816a7f2550d5b170bd106e765db28bdf030" - integrity sha512-NNwO9SUPjBwFmPh3vXiPVEhJLn4uqYmZYvJV358SRGM06BR4UoIqxJpeJwDDXB6atULsgQA97MfD1zMd5xsu+A== dependencies: cron-parser "^2.4.0" long-timeout "0.1.1" @@ -5250,14 +4517,12 @@ node-schedule@^1.2.3: nopt@3.x, nopt@~3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" - integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= dependencies: abbrev "1" nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= dependencies: abbrev "1" osenv "^0.1.4" @@ -5265,7 +4530,6 @@ nopt@^4.0.1: normalize-package-data@^2.3.2: version "2.4.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" - integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw== dependencies: hosted-git-info "^2.1.4" is-builtin-module "^1.0.0" @@ -5275,19 +4539,16 @@ normalize-package-data@^2.3.2: normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= dependencies: remove-trailing-separator "^1.0.1" npm-bundled@^1.0.1: version "1.0.5" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" - integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== npm-packlist@^1.1.6: version "1.1.12" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.12.tgz#22bde2ebc12e72ca482abd67afc51eb49377243a" - integrity sha512-WJKFOVMeAlsU/pjXuqVdzU0WfgtIBCupkEVwn+1Y0ERAbUfWw8R4GjgVbaKnUjRoD2FoQbHOCbOyT5Mbs9Lw4g== dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" @@ -5295,14 +4556,12 @@ npm-packlist@^1.1.6: npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= dependencies: path-key "^2.0.0" npmlog@^4.0.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== dependencies: are-we-there-yet "~1.1.2" console-control-strings "~1.1.0" @@ -5312,12 +4571,10 @@ npmlog@^4.0.2: number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= number-to-bn@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" - integrity sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA= dependencies: bn.js "4.11.6" strip-hex-prefix "1.0.0" @@ -5325,57 +4582,40 @@ number-to-bn@1.7.0: oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== object-assign@^4, object-assign@^4.0.0, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= dependencies: copy-descriptor "^0.1.0" define-property "^0.2.5" kind-of "^3.0.3" -object-extended@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/object-extended/-/object-extended-0.0.7.tgz#84fd23f56b15582aeb3e88b05cb55d2432d68a33" - integrity sha1-hP0j9WsVWCrrPoiwXLVdJDLWijM= - dependencies: - array-extended "~0.0.4" - extended "~0.0.3" - is-extended "~0.0.3" - object-inspect@~1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" - integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== object-keys@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" - integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== object-keys@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" - integrity sha1-KKaq50KN0sOpLz2V8hM13SBOAzY= object-visit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= dependencies: isobject "^3.0.0" object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= dependencies: for-own "^0.1.4" is-extendable "^0.1.1" @@ -5383,47 +4623,40 @@ object.omit@^2.0.0: object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= dependencies: isobject "^3.0.1" oboe@2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.3.tgz#2b4865dbd46be81225713f4e9bfe4bcf4f680a4f" - integrity sha1-K0hl29Rr6BIlcT9Om/5Lz09oCk8= dependencies: http-https "^1.0.0" on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= dependencies: ee-first "1.1.1" once@1.x, once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" onetime@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= dependencies: mimic-fn "^1.0.0" openzeppelin-solidity@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/openzeppelin-solidity/-/openzeppelin-solidity-1.10.0.tgz#d77eee6653f5958d051318a61ba0b436f92216c0" - integrity sha512-igkrumQQ2lrN2zjeQV4Dnb0GpTBj1fzMcd8HPyBUqwI0hhuscX/HzXiqKT6gFQl1j9Wy/ppVVs9fqL/foF7Gmg== optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= dependencies: minimist "~0.0.1" wordwrap "~0.0.2" @@ -5431,7 +4664,6 @@ optimist@^0.6.1: optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= dependencies: deep-is "~0.1.3" fast-levenshtein "~2.0.4" @@ -5443,29 +4675,24 @@ optionator@^0.8.1, optionator@^0.8.2: original-require@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/original-require/-/original-require-1.0.1.tgz#0f130471584cd33511c5ec38c8d59213f9ac5e20" - integrity sha1-DxMEcVhM0zURxew4yNWSE/msXiA= os-browserify@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= os-locale@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= dependencies: lcid "^1.0.0" os-locale@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" - integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== dependencies: execa "^0.7.0" lcid "^1.0.0" @@ -5474,12 +4701,10 @@ os-locale@^2.0.0: os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= osenv@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" @@ -5487,48 +4712,40 @@ osenv@^0.1.4: p-cancelable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" - integrity sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw== p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== dependencies: p-try "^1.0.0" p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= dependencies: p-limit "^1.1.0" p-timeout@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" - integrity sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y= dependencies: p-finally "^1.0.0" p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= pako@~1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" - integrity sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg== parse-asn1@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.1.tgz#f6bf293818332bd0dab54efb16087724745e6ca8" - integrity sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw== dependencies: asn1.js "^4.0.0" browserify-aes "^1.0.0" @@ -5539,7 +4756,6 @@ parse-asn1@^5.0.0: parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= dependencies: glob-base "^0.3.0" is-dotfile "^1.0.0" @@ -5549,7 +4765,6 @@ parse-glob@^3.0.4: parse-headers@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.1.tgz#6ae83a7aa25a9d9b700acc28698cd1f1ed7e9536" - integrity sha1-aug6eqJanZtwCswoaYzR8e1+lTY= dependencies: for-each "^0.3.2" trim "0.0.1" @@ -5557,71 +4772,58 @@ parse-headers@^2.0.0: parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= dependencies: error-ex "^1.2.0" parseurl@~1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" - integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= path-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" - integrity sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo= path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= dependencies: pinkie-promise "^2.0.0" path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= path-key@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= path-parse@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= dependencies: graceful-fs "^4.1.2" pify "^2.0.0" @@ -5630,14 +4832,12 @@ path-type@^1.0.0: path-type@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" - integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= dependencies: pify "^2.0.0" pbkdf2@^3.0.3: version "3.0.17" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" - integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== dependencies: create-hash "^1.1.2" create-hmac "^1.1.4" @@ -5648,119 +4848,116 @@ pbkdf2@^3.0.3: pegjs@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/pegjs/-/pegjs-0.10.0.tgz#cf8bafae6eddff4b5a7efb185269eaaf4610ddbd" - integrity sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0= pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= dependencies: pinkie "^2.0.0" pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= pkg-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= dependencies: find-up "^1.0.0" +pkginfo@0.3.x: + version "0.3.1" + resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21" + +pkginfo@0.x.x: + version "0.4.1" + resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff" + pluralize@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= pragma-singleton@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/pragma-singleton/-/pragma-singleton-1.0.3.tgz#6894317bb8d47157e59de2a4a009db7e6f63e30e" - integrity sha1-aJQxe7jUcVflneKkoAnbfm9j4w4= prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= prettier@^1.14.3: version "1.14.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895" - integrity sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg== private@^0.1.6, private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== process-nextick-args@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= process@~0.5.1: version "0.5.2" resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" - integrity sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8= progress@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" - integrity sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8= promise-to-callback@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/promise-to-callback/-/promise-to-callback-1.0.0.tgz#5d2a749010bfb67d963598fcd3960746a68feef7" - integrity sha1-XSp0kBC/tn2WNZj805YHRqaP7vc= dependencies: is-fn "^1.0.0" set-immediate-shim "^1.0.1" +prompt@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prompt/-/prompt-1.0.0.tgz#8e57123c396ab988897fb327fd3aedc3e735e4fe" + dependencies: + colors "^1.1.2" + pkginfo "0.x.x" + read "1.0.x" + revalidator "0.1.x" + utile "0.3.x" + winston "2.1.x" + prop-types@^15.6.2: version "15.6.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102" - integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ== dependencies: loose-envify "^1.3.1" object-assign "^4.1.1" @@ -5768,7 +4965,6 @@ prop-types@^15.6.2: proxy-addr@~2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.4.tgz#ecfc733bf22ff8c6f407fa275327b9ab67e48b93" - integrity sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA== dependencies: forwarded "~0.1.2" ipaddr.js "1.8.0" @@ -5776,22 +4972,18 @@ proxy-addr@~2.0.4: prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= psl@^1.1.24: version "1.1.29" resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" - integrity sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ== public-encrypt@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" - integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== dependencies: bn.js "^4.1.0" browserify-rsa "^4.0.0" @@ -5803,27 +4995,22 @@ public-encrypt@^4.0.0: punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= punycode@^1.2.4, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== qs@6.5.2, qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== query-string@^5.0.1: version "5.1.1" resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" - integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== dependencies: decode-uri-component "^0.2.0" object-assign "^4.1.0" @@ -5832,17 +5019,14 @@ query-string@^5.0.1: querystring-es3@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= querystring@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= randomatic@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.0.tgz#36f2ca708e9e567f5ed2ec01949026d50aa10116" - integrity sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ== dependencies: is-number "^4.0.0" kind-of "^6.0.0" @@ -5851,14 +5035,12 @@ randomatic@^3.0.0: randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: version "2.0.6" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80" - integrity sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A== dependencies: safe-buffer "^5.1.0" randomfill@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" - integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== dependencies: randombytes "^2.0.5" safe-buffer "^5.1.0" @@ -5866,17 +5048,14 @@ randomfill@^1.0.3: randomhex@0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/randomhex/-/randomhex-0.1.5.tgz#baceef982329091400f2a2912c6cd02f1094f585" - integrity sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU= range-parser@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= raw-body@2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" - integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== dependencies: bytes "3.0.0" http-errors "1.6.3" @@ -5886,7 +5065,6 @@ raw-body@2.3.3: rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== dependencies: deep-extend "^0.6.0" ini "~1.3.0" @@ -5896,7 +5074,6 @@ rc@^1.2.7: react-dom@^16.2.0: version "16.5.2" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.5.2.tgz#b69ee47aa20bab5327b2b9d7c1fe2a30f2cfa9d7" - integrity sha512-RC8LDw8feuZOHVgzEf7f+cxBr/DnKdqp56VU0lAs1f4UfKc4cU8wU4fTq/mgnvynLQo8OtlPC19NUFh/zjZPuA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -5906,7 +5083,6 @@ react-dom@^16.2.0: react@^16.2.0: version "16.5.2" resolved "https://registry.yarnpkg.com/react/-/react-16.5.2.tgz#19f6b444ed139baa45609eee6dc3d318b3895d42" - integrity sha512-FDCSVd3DjVTmbEAjUNX6FgfAmQ+ypJfHUsqUJOYNCBUp1h8lqmtC+0mXJ+JjsWx4KAVTkk1vKd1hLQPvEviSuw== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -5916,7 +5092,6 @@ react@^16.2.0: read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= dependencies: find-up "^1.0.0" read-pkg "^1.0.0" @@ -5924,7 +5099,6 @@ read-pkg-up@^1.0.1: read-pkg-up@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" - integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= dependencies: find-up "^2.0.0" read-pkg "^2.0.0" @@ -5932,7 +5106,6 @@ read-pkg-up@^2.0.0: read-pkg@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= dependencies: load-json-file "^1.0.0" normalize-package-data "^2.3.2" @@ -5941,16 +5114,20 @@ read-pkg@^1.0.0: read-pkg@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" - integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= dependencies: load-json-file "^2.0.0" normalize-package-data "^2.3.2" path-type "^2.0.0" +read@1.0.x: + version "1.0.7" + resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" + dependencies: + mute-stream "~0.0.4" + readable-stream@^1.0.33: version "1.1.14" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= dependencies: core-util-is "~1.0.0" inherits "~2.0.1" @@ -5960,7 +5137,6 @@ readable-stream@^1.0.33: readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@^2.2.9, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -5973,7 +5149,6 @@ readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable readable-stream@~1.0.15: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" - integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= dependencies: core-util-is "~1.0.0" inherits "~2.0.1" @@ -5983,7 +5158,6 @@ readable-stream@~1.0.15: readdirp@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== dependencies: graceful-fs "^4.1.11" micromatch "^3.1.10" @@ -5992,34 +5166,28 @@ readdirp@^2.0.0: readline-sync@^1.4.9: version "1.4.9" resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.9.tgz#3eda8e65f23cd2a17e61301b1f0003396af5ecda" - integrity sha1-PtqOZfI80qF+YTAbHwADOWr17No= rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= dependencies: resolve "^1.1.6" regenerate@^1.2.1: version "1.4.0" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" - integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== regenerator-runtime@^0.10.5: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" - integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= regenerator-runtime@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== regenerator-transform@^0.10.0: version "0.10.1" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" - integrity sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q== dependencies: babel-runtime "^6.18.0" babel-types "^6.19.0" @@ -6028,14 +5196,12 @@ regenerator-transform@^0.10.0: regex-cache@^0.4.2: version "0.4.4" resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== dependencies: is-equal-shallow "^0.1.3" regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== dependencies: extend-shallow "^3.0.2" safe-regex "^1.1.0" @@ -6043,12 +5209,10 @@ regex-not@^1.0.0, regex-not@^1.0.2: regexpp@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" - integrity sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw== regexpu-core@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" - integrity sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA= dependencies: regenerate "^1.2.1" regjsgen "^0.2.0" @@ -6057,62 +5221,52 @@ regexpu-core@^2.0.0: regjsgen@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" - integrity sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc= regjsparser@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" - integrity sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw= dependencies: jsesc "~0.5.0" remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= repeat-element@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== repeat-string@^1.5.2, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= dependencies: is-finite "^1.0.0" req-cwd@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/req-cwd/-/req-cwd-1.0.1.tgz#0d73aeae9266e697a78f7976019677e76acf0fff" - integrity sha1-DXOurpJm5penj3l2AZZ352rPD/8= dependencies: req-from "^1.0.1" req-from@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/req-from/-/req-from-1.0.1.tgz#bf81da5147947d32d13b947dc12a58ad4587350e" - integrity sha1-v4HaUUeUfTLRO5R9wSpYrUWHNQ4= dependencies: resolve-from "^2.0.0" request-promise-core@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" - integrity sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY= dependencies: lodash "^4.13.1" request-promise@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.2.tgz#d1ea46d654a6ee4f8ee6a4fea1018c22911904b4" - integrity sha1-0epG1lSm7k+O5qT+oQGMIpEZBLQ= dependencies: bluebird "^3.5.0" request-promise-core "1.1.1" @@ -6122,7 +5276,6 @@ request-promise@^4.2.2: request@^2.67.0, request@^2.79.0, request@^2.81.0, request@^2.85.0, request@^2.88.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" - integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== dependencies: aws-sign2 "~0.7.0" aws4 "^1.8.0" @@ -6148,22 +5301,18 @@ request@^2.67.0, request@^2.79.0, request@^2.81.0, request@^2.85.0, request@^2.8 require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= require-from-string@^1.1.0: version "1.2.1" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" - integrity sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg= require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= dependencies: caller-path "^0.1.0" resolve-from "^1.0.0" @@ -6171,41 +5320,34 @@ require-uncached@^1.0.3: resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= resolve-from@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" - integrity sha1-lICrIOlP+h2egKgEx+oUdhGWa1c= resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= resolve@1.1.x: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= resolve@^1.1.6, resolve@^1.3.3, resolve@^1.5.0, resolve@^1.6.0: version "1.8.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" - integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== dependencies: path-parse "^1.0.5" resolve@~1.7.1: version "1.7.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3" - integrity sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw== dependencies: path-parse "^1.0.5" restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= dependencies: onetime "^2.0.0" signal-exit "^3.0.2" @@ -6213,33 +5355,32 @@ restore-cursor@^2.0.0: resumer@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" - integrity sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k= dependencies: through "~2.3.4" ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +revalidator@0.1.x: + version "0.1.8" + resolved "https://registry.yarnpkg.com/revalidator/-/revalidator-0.1.8.tgz#fece61bfa0c1b52a206bd6b18198184bdd523a3b" right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - integrity sha1-YTObci/mo1FWiSENJOFMlhSGE+8= dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.6.1: +rimraf@2, rimraf@2.x.x, rimraf@^2.2.8, rimraf@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" - integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== dependencies: glob "^7.0.5" ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== dependencies: hash-base "^3.0.0" inherits "^2.0.1" @@ -6247,79 +5388,66 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: rlp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.1.0.tgz#e4f9886d5a982174f314543831e36e1a658460f9" - integrity sha512-93U7IKH5j7nmXFVg19MeNBGzQW5uXW1pmCuKY8veeKIhYTE32C2d0mOegfiIAfXcHOKJjjPlJisn8iHDF5AezA== dependencies: safe-buffer "^5.1.1" run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" - integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= dependencies: is-promise "^2.1.0" rustbn.js@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" - integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== rx-lite-aggregates@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" - integrity sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74= dependencies: rx-lite "*" rx-lite@*, rx-lite@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" - integrity sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ= safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== safe-event-emitter@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz#5b692ef22329ed8f69fdce607e50ca734f6f20af" - integrity sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg== dependencies: events "^3.0.0" safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= dependencies: ret "~0.1.10" safe@^0.4.5: version "0.4.6" resolved "https://registry.yarnpkg.com/safe/-/safe-0.4.6.tgz#1d5580cf2635c5cb940ea48fb5081ae3c25b1be1" - integrity sha1-HVWAzyY1xcuUDqSPtQga48JbG+E= safefs@^3.1.2: version "3.2.2" resolved "https://registry.yarnpkg.com/safefs/-/safefs-3.2.2.tgz#8170c1444d7038e08caea05a374fae2fa349e15c" - integrity sha1-gXDBRE1wOOCMrqBaN0+uL6NJ4Vw= dependencies: graceful-fs "*" "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== scandirectory@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/scandirectory/-/scandirectory-2.5.0.tgz#6ce03f54a090b668e3cbedbf20edf9e310593e72" - integrity sha1-bOA/VKCQtmjjy+2/IO354xBZPnI= dependencies: ignorefs "^1.0.0" safefs "^3.1.2" @@ -6328,24 +5456,20 @@ scandirectory@^2.5.0: schedule@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/schedule/-/schedule-0.5.0.tgz#c128fffa0b402488b08b55ae74bb9df55cc29cc8" - integrity sha512-HUcJicG5Ou8xfR//c2rPT0lPIRR09vVvN81T9fqfVgBmhERUbDEQoYKjpBxbueJnCPpSu2ujXzOnRQt6x9o/jw== dependencies: object-assign "^4.1.1" scrypt-async@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/scrypt-async/-/scrypt-async-1.3.1.tgz#a11fd6fac981b4b823ee01dee0221169500ddae9" - integrity sha1-oR/W+smBtLgj7gHe4CIRaVAN2uk= scrypt-js@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.3.tgz#bb0040be03043da9a012a2cea9fc9f852cfc87d4" - integrity sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q= scrypt.js@0.2.0, scrypt.js@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/scrypt.js/-/scrypt.js-0.2.0.tgz#af8d1465b71e9990110bedfc593b9479e03a8ada" - integrity sha1-r40UZbcemZARC+38WTuUeeA6ito= dependencies: scrypt "^6.0.2" scryptsy "^1.2.1" @@ -6353,21 +5477,18 @@ scrypt.js@0.2.0, scrypt.js@^0.2.0: scrypt@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/scrypt/-/scrypt-6.0.3.tgz#04e014a5682b53fa50c2d5cce167d719c06d870d" - integrity sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0= dependencies: nan "^2.0.8" scryptsy@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-1.2.1.tgz#a3225fa4b2524f802700761e2855bdf3b2d92163" - integrity sha1-oyJfpLJST4AnAHYeKFW987LZIWM= dependencies: pbkdf2 "^3.0.3" secp256k1@^3.0.1: version "3.5.2" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.5.2.tgz#f95f952057310722184fe9c914e6b71281f2f2ae" - integrity sha512-iin3kojdybY6NArd+UFsoTuapOF7bnJNf2UbcWXaY3z+E1sJDipl60vtzB5hbO/uquBu7z0fd4VC4Irp+xoFVQ== dependencies: bindings "^1.2.1" bip66 "^1.1.3" @@ -6381,29 +5502,24 @@ secp256k1@^3.0.1: seek-bzip@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc" - integrity sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w= dependencies: commander "~2.8.1" semaphore@>=1.0.1, semaphore@^1.0.3: version "1.1.0" resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa" - integrity sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA== "semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== semver@~5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" - integrity sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg== send@0.16.2: version "0.16.2" resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" - integrity sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw== dependencies: debug "2.6.9" depd "~1.1.2" @@ -6422,7 +5538,6 @@ send@0.16.2: serve-static@1.13.2: version "1.13.2" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" - integrity sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" @@ -6432,7 +5547,6 @@ serve-static@1.13.2: servify@^0.1.12: version "0.1.12" resolved "https://registry.yarnpkg.com/servify/-/servify-0.1.12.tgz#142ab7bee1f1d033b66d0707086085b17c06db95" - integrity sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw== dependencies: body-parser "^1.16.0" cors "^2.8.1" @@ -6443,17 +5557,14 @@ servify@^0.1.12: set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= set-immediate-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" - integrity sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E= set-value@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -6463,7 +5574,6 @@ set-value@^0.4.3: set-value@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -6473,22 +5583,18 @@ set-value@^2.0.0: setimmediate@1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" - integrity sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48= setimmediate@^1.0.4, setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= setprototypeof@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" @@ -6496,35 +5602,30 @@ sha.js@^2.4.0, sha.js@^2.4.8: sha3@^1.1.0: version "1.2.2" resolved "https://registry.yarnpkg.com/sha3/-/sha3-1.2.2.tgz#a66c5098de4c25bc88336ec8b4817d005bca7ba9" - integrity sha1-pmxQmN5MJbyIM27ItIF9AFvKe6k= dependencies: nan "2.10.0" shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= dependencies: shebang-regex "^1.0.0" shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= shelljs@^0.7.4: version "0.7.8" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" - integrity sha1-3svPh0sNHl+3LhSxZKloMEjprLM= dependencies: glob "^7.0.0" interpret "^1.0.0" rechoir "^0.6.2" -shelljs@^0.8.1, shelljs@^0.8.2: +shelljs@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.2.tgz#345b7df7763f4c2340d584abb532c5f752ca9e35" - integrity sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ== dependencies: glob "^7.0.0" interpret "^1.0.0" @@ -6533,17 +5634,14 @@ shelljs@^0.8.1, shelljs@^0.8.2: signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= simple-concat@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" - integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY= simple-get@^2.7.0: version "2.8.1" resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d" - integrity sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw== dependencies: decompress-response "^3.3.0" once "^1.3.1" @@ -6552,19 +5650,16 @@ simple-get@^2.7.0: slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= slice-ansi@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" - integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== dependencies: is-fullwidth-code-point "^2.0.0" snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== dependencies: define-property "^1.0.0" isobject "^3.0.0" @@ -6573,14 +5668,12 @@ snapdragon-node@^2.0.1: snapdragon-util@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== dependencies: kind-of "^3.2.0" snapdragon@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== dependencies: base "^0.11.1" debug "^2.2.0" @@ -6594,22 +5687,18 @@ snapdragon@^0.8.1: sol-digger@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/sol-digger/-/sol-digger-0.0.2.tgz#406c4a9d31e269e7f88eb1c2ea101318e5e09025" - integrity sha1-QGxKnTHiaef4jrHC6hATGOXgkCU= sol-explore@1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/sol-explore/-/sol-explore-1.6.1.tgz#b59f073c69fe332560d5a10c32ba8ca7f2986cfb" - integrity sha1-tZ8HPGn+MyVg1aEMMrqMp/KYbPs= sol-explore@^1.6.2: version "1.6.2" resolved "https://registry.yarnpkg.com/sol-explore/-/sol-explore-1.6.2.tgz#43ae8c419fd3ac056a05f8a9d1fb1022cd41ecc2" - integrity sha1-Q66MQZ/TrAVqBfip0fsQIs1B7MI= sol-merger@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/sol-merger/-/sol-merger-0.1.2.tgz#1f12500f42d427dc0ec8e4c113392acd8a6f62d9" - integrity sha512-12Z84jxeb5VFlQOGS38HOiTrHYohU07oQ5wHOcFJmcRRbaL5kWN7IcldMO1QdW8kONyKdj0xhukzLlN5m5ix4w== dependencies: bluebird "^3.5.0" cli-color "^1.2.0" @@ -6621,7 +5710,6 @@ sol-merger@^0.1.2: solc@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.24.tgz#354f14b269b38cbaa82a47d1ff151723502b954e" - integrity sha512-2xd7Cf1HeVwrIb6Bu1cwY2/TaLRodrppCq3l7rhLimFQgmxptXhTC3+/wesVLpB09F1A2kZgvbMOgH7wvhFnBQ== dependencies: fs-extra "^0.30.0" memorystream "^0.3.1" @@ -6632,7 +5720,6 @@ solc@0.4.24: solc@^0.4.19, solc@^0.4.2, solc@^0.4.24: version "0.4.25" resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.25.tgz#06b8321f7112d95b4b903639b1138a4d292f5faa" - integrity sha512-jU1YygRVy6zatgXrLY2rRm7HW1d7a8CkkEgNJwvH2VLpWhMFsMdWcJn6kUqZwcSz/Vm+w89dy7Z/aB5p6AFTrg== dependencies: fs-extra "^0.30.0" memorystream "^0.3.1" @@ -6643,7 +5730,6 @@ solc@^0.4.19, solc@^0.4.2, solc@^0.4.24: solidity-coverage@^0.5.11: version "0.5.11" resolved "https://registry.yarnpkg.com/solidity-coverage/-/solidity-coverage-0.5.11.tgz#1ee45f6d98b75a615aadb8f9aa7db4a2b32258e7" - integrity sha512-qikdsSi6+9XbfvwA0aI7HUVpF9fIFNqRWTw23M89GMDY+b6Gj0wWU9IngJS0fimoZIAdEp3bfChxvpfVcrUesg== dependencies: death "^1.1.0" ethereumjs-testrpc-sc "6.1.6" @@ -6659,7 +5745,6 @@ solidity-coverage@^0.5.11: solidity-docgen@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/solidity-docgen/-/solidity-docgen-0.1.0.tgz#f3a56ff074e8c7d832af3a3d462c3b5abf0f64cb" - integrity sha512-F7ufNWmlP5c5hIi66Ijv9tc+HNosyO7ijWq6pRtyBR1WqyJBH/0DJkD6QZI8HkE8p6LEXiPKxGBWbAeVT9Nu9g== dependencies: commander "^2.14.1" lodash "^4.17.5" @@ -6672,7 +5757,6 @@ solidity-docgen@^0.1.0: solidity-parser-sc@0.4.11: version "0.4.11" resolved "https://registry.yarnpkg.com/solidity-parser-sc/-/solidity-parser-sc-0.4.11.tgz#86734c9205537007f4d6201b57176e41696ee607" - integrity sha512-1kV5iC7m3CtMDfmHaVNwz2saSGQVIuF16rIxU417Al38MVCWHMQQ5vT6cmLsNwDe60S74auobWij9vNawSeOyw== dependencies: mocha "^4.1.0" pegjs "^0.10.0" @@ -6681,12 +5765,10 @@ solidity-parser-sc@0.4.11: solium-plugin-security@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/solium-plugin-security/-/solium-plugin-security-0.1.1.tgz#2a87bcf8f8c3abf7d198e292e4ac080284e3f3f6" - integrity sha512-kpLirBwIq4mhxk0Y/nn5cQ6qdJTI+U1LO3gpoNIcqNaW+sI058moXBe2UiHs+9wvF9IzYD49jcKhFTxcR9u9SQ== solium@^1.1.6: version "1.1.8" resolved "https://registry.yarnpkg.com/solium/-/solium-1.1.8.tgz#35d30a15c572a233ce8a90226d6cfccb762fadb7" - integrity sha512-fn0lusM6of14CytIDDHK73SGjn6NsVTaCVJjaKCKJyqKhT00rH/hDtvnIeZ2ZTD9z/xaXd4Js2brW3az6AV9RA== dependencies: ajv "^5.2.2" chokidar "^1.6.0" @@ -6704,7 +5786,6 @@ solium@^1.1.6: solparse@2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/solparse/-/solparse-2.2.5.tgz#72709c867cd6bfc50ec2325f4b81d2b3ea365d99" - integrity sha512-t7tvtR6KU6QfPYLMv1nlCh9DA8HYIu5tbjHpKu0fhGFZ1NuSp0KKDHfFHv07g6v1xgcuUY3rVqNFjZt5b9+5qA== dependencies: mocha "^4.0.1" pegjs "^0.10.0" @@ -6713,17 +5794,14 @@ solparse@2.2.5: sorted-array-functions@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/sorted-array-functions/-/sorted-array-functions-1.2.0.tgz#43265b21d6e985b7df31621b1c11cc68d8efc7c3" - integrity sha512-sWpjPhIZJtqO77GN+LD8dDsDKcWZ9GCOJNqKzi1tvtjGIzwfoyuRH8S0psunmc6Z5P+qfDqztSbwYR5X/e1UTg== source-list-map@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" - integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== source-map-resolve@^0.5.0: version "0.5.2" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" - integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== dependencies: atob "^2.1.1" decode-uri-component "^0.2.0" @@ -6734,14 +5812,12 @@ source-map-resolve@^0.5.0: source-map-support@^0.4.15: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== dependencies: source-map "^0.5.6" source-map-support@^0.5.3: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -6749,29 +5825,24 @@ source-map-support@^0.5.3: source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== source-map@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" - integrity sha1-2rc/vPwrqBm03gO9b26qSBZLP50= dependencies: amdefine ">=0.0.4" spdx-correct@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.2.tgz#19bb409e91b47b1ad54159243f7312a858db3c2e" - integrity sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids "^3.0.0" @@ -6779,12 +5850,10 @@ spdx-correct@^3.0.0: spdx-exceptions@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" - integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== spdx-expression-parse@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== dependencies: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0" @@ -6792,29 +5861,24 @@ spdx-expression-parse@^3.0.0: spdx-license-ids@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz#e2a303236cac54b04031fa7a5a79c7e701df852f" - integrity sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== dependencies: extend-shallow "^3.0.0" sprintf-js@>=1.0.3: version "1.1.1" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.1.tgz#36be78320afe5801f6cea3ee78b6e5aab940ea0c" - integrity sha1-Nr54Mgr+WAH2zqPueLblqrlA6gw= sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sshpk@^1.7.0: version "1.15.1" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.15.1.tgz#b79a089a732e346c6e0714830f36285cd38191a2" - integrity sha512-mSdgNUaidk+dRU5MhYtN9zebdzF2iG0cNPWy8HG+W8y+fT1JnSkh0fzzpjOa0L7P8i1Rscz38t0h4gPcKz43xA== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -6829,12 +5893,10 @@ sshpk@^1.7.0: stack-trace@0.0.x: version "0.0.10" resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" - integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= dependencies: define-property "^0.2.5" object-copy "^0.1.0" @@ -6842,27 +5904,22 @@ static-extend@^0.1.1: "statuses@>= 1.4.0 < 2": version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= statuses@~1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" - integrity sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew== stdio@^0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/stdio/-/stdio-0.2.7.tgz#a1c57da10fe1cfaa0c3bf683c9d0743d1b660839" - integrity sha1-ocV9oQ/hz6oMO/aDydB0PRtmCDk= stealthy-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" - integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= stream-browserify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" - integrity sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds= dependencies: inherits "~2.0.1" readable-stream "^2.0.2" @@ -6870,7 +5927,6 @@ stream-browserify@^2.0.1: stream-http@^2.7.2: version "2.8.3" resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" - integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== dependencies: builtin-status-codes "^3.0.0" inherits "^2.0.1" @@ -6881,22 +5937,10 @@ stream-http@^2.7.2: strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= - -string-extended@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/string-extended/-/string-extended-0.0.8.tgz#741957dff487b0272a79eec5a44f239ee6f17ccd" - integrity sha1-dBlX3/SHsCcqee7FpE8jnubxfM0= - dependencies: - array-extended "~0.0.5" - date-extended "~0.0.3" - extended "~0.0.3" - is-extended "~0.0.3" string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= dependencies: code-point-at "^1.0.0" is-fullwidth-code-point "^1.0.0" @@ -6905,7 +5949,6 @@ string-width@^1.0.1: "string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== dependencies: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" @@ -6913,7 +5956,6 @@ string-width@^1.0.1: string.prototype.trim@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" - integrity sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo= dependencies: define-properties "^1.1.2" es-abstract "^1.5.0" @@ -6922,109 +5964,92 @@ string.prototype.trim@~1.1.2: string_decoder@^1.0.0, string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== dependencies: safe-buffer "~5.1.0" string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= dependencies: ansi-regex "^2.0.0" strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= dependencies: ansi-regex "^3.0.0" strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= dependencies: is-utf8 "^0.2.0" strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= strip-dirs@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5" - integrity sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g== dependencies: is-natural-number "^4.0.1" strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= strip-hex-prefix@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" - integrity sha1-DF8VX+8RUTczd96du1iNoFUA428= dependencies: is-hex-prefixed "1.0.0" strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= supports-color@4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" - integrity sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ== dependencies: has-flag "^2.0.0" supports-color@5.4.0: version "5.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" - integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== dependencies: has-flag "^3.0.0" supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= supports-color@^3.1.0: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" - integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= dependencies: has-flag "^1.0.0" supports-color@^4.2.1: version "4.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" - integrity sha1-vnoN5ITexcXN34s9WRJQRJEvY1s= dependencies: has-flag "^2.0.0" supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" swarm-js@0.1.37: version "0.1.37" resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.37.tgz#27d485317a340bbeec40292af783cc10acfa4663" - integrity sha512-G8gi5fcXP/2upwiuOShJ258sIufBVztekgobr3cVgYXObZwJ5AXLqZn52AI+/ffft29pJexF9WNdUxjlkVehoQ== dependencies: bluebird "^3.5.0" buffer "^5.0.5" @@ -7043,7 +6068,6 @@ swarm-js@0.1.37: table@4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" - integrity sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA== dependencies: ajv "^5.2.3" ajv-keywords "^2.1.0" @@ -7055,12 +6079,10 @@ table@4.0.2: tapable@^0.2.7: version "0.2.8" resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" - integrity sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI= tape@^4.4.0, tape@^4.6.3: version "4.9.1" resolved "https://registry.yarnpkg.com/tape/-/tape-4.9.1.tgz#1173d7337e040c76fbf42ec86fcabedc9b3805c9" - integrity sha512-6fKIXknLpoe/Jp4rzHKFPpJUHDHDqn8jus99IfPnHIjyz78HYlefTGD3b5EkbQzuLfaEvmfPK3IolLgq2xT3kw== dependencies: deep-equal "~1.0.1" defined "~1.0.0" @@ -7079,7 +6101,6 @@ tape@^4.4.0, tape@^4.6.3: tar-stream@^1.5.2: version "1.6.2" resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" - integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A== dependencies: bl "^1.0.0" buffer-alloc "^1.2.0" @@ -7092,7 +6113,6 @@ tar-stream@^1.5.2: tar.gz@^1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/tar.gz/-/tar.gz-1.0.7.tgz#577ef2c595faaa73452ef0415fed41113212257b" - integrity sha512-uhGatJvds/3diZrETqMj4RxBR779LKlIE74SsMcn5JProZsfs9j0QBwWO1RW+IWNJxS2x8Zzra1+AW6OQHWphg== dependencies: bluebird "^2.9.34" commander "^2.8.1" @@ -7103,7 +6123,6 @@ tar.gz@^1.0.5: tar@^2.1.1: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" - integrity sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE= dependencies: block-stream "*" fstream "^1.0.2" @@ -7112,7 +6131,6 @@ tar@^2.1.1: tar@^4: version "4.4.6" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b" - integrity sha512-tMkTnh9EdzxyfW+6GK6fCahagXsnYk6kE6S9Gr9pjVdys769+laCTbodXDhPAjzVtEBazRgP0gYqOjnk9dQzLg== dependencies: chownr "^1.0.1" fs-minipass "^1.2.5" @@ -7125,7 +6143,6 @@ tar@^4: taskgroup@^4.0.5, taskgroup@^4.2.0: version "4.3.1" resolved "https://registry.yarnpkg.com/taskgroup/-/taskgroup-4.3.1.tgz#7de193febd768273c457730497024d512c27915a" - integrity sha1-feGT/r12gnPEV3MElwJNUSwnkVo= dependencies: ambi "^2.2.0" csextends "^1.0.3" @@ -7133,43 +6150,36 @@ taskgroup@^4.0.5, taskgroup@^4.2.0: text-table@^0.2.0, text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= thenify-all@^1.0.0, thenify-all@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" - integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= dependencies: thenify ">= 3.1.0 < 4" "thenify@>= 3.1.0 < 4": version "3.3.0" resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.0.tgz#e69e38a1babe969b0108207978b9f62b88604839" - integrity sha1-5p44obq+lpsBCCB5eLn2K4hgSDk= dependencies: any-promise "^1.0.0" through@^2.3.6, through@~2.3.4, through@~2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= timed-out@^4.0.0, timed-out@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= timers-browserify@^2.0.4: version "2.0.10" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" - integrity sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg== dependencies: setimmediate "^1.0.4" timers-ext@^0.1.5: version "0.1.7" resolved "https://registry.yarnpkg.com/timers-ext/-/timers-ext-0.1.7.tgz#6f57ad8578e07a3fb9f91d9387d65647555e25c6" - integrity sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ== dependencies: es5-ext "~0.10.46" next-tick "1" @@ -7177,7 +6187,6 @@ timers-ext@^0.1.5: tingodb@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/tingodb/-/tingodb-0.6.1.tgz#f63336259af7dfa6c90dfe2556a0dfb0d4eede59" - integrity sha1-9jM2JZr336bJDf4lVqDfsNTu3lk= dependencies: lodash "^4.17.5" safe "^0.4.5" @@ -7188,36 +6197,30 @@ tingodb@^0.6.1: tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== dependencies: os-tmpdir "~1.0.2" to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= to-buffer@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" - integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= dependencies: kind-of "^3.0.2" to-regex-range@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= dependencies: is-number "^3.0.0" repeat-string "^1.6.1" @@ -7225,7 +6228,6 @@ to-regex-range@^2.1.0: to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== dependencies: define-property "^2.0.2" extend-shallow "^3.0.2" @@ -7235,7 +6237,6 @@ to-regex@^3.0.1, to-regex@^3.0.2: tough-cookie@>=2.3.3, tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" - integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== dependencies: psl "^1.1.24" punycode "^1.4.1" @@ -7243,27 +6244,22 @@ tough-cookie@>=2.3.3, tough-cookie@~2.4.3: tree-kill@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" - integrity sha512-DlX6dR0lOIRDFxI0mjL9IYg6OTncLm/Zt+JiBhE5OlFcAR8yc9S7FFXU9so0oda47frdM/JFsk7UjNt9vscKcg== trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= trim@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" - integrity sha1-WFhUf2spB1fulczMZm+1AITEYN0= truffle-blockchain-utils@^0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/truffle-blockchain-utils/-/truffle-blockchain-utils-0.0.5.tgz#a4e5c064dadd69f782a137f3d276d21095da7a47" - integrity sha1-pOXAZNrdafeCoTfz0nbSEJXaekc= truffle-contract-schema@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/truffle-contract-schema/-/truffle-contract-schema-2.0.1.tgz#9bf821d32e26e674ba15eb5d40f96b10b1c9d568" - integrity sha1-m/gh0y4m5nS6FetdQPlrELHJ1Wg= dependencies: ajv "^5.1.1" crypto-js "^3.1.9-1" @@ -7272,7 +6268,6 @@ truffle-contract-schema@^2.0.1: truffle-contract@^3.0.4: version "3.0.6" resolved "https://registry.yarnpkg.com/truffle-contract/-/truffle-contract-3.0.6.tgz#2ef6fc32d7faafa9f4aed8e50001a9fdea342192" - integrity sha1-Lvb8Mtf6r6n0rtjlAAGp/eo0IZI= dependencies: ethjs-abi "0.1.8" truffle-blockchain-utils "^0.0.5" @@ -7283,12 +6278,10 @@ truffle-contract@^3.0.4: truffle-error@^0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/truffle-error/-/truffle-error-0.0.3.tgz#4bf55242e14deee1c7194932709182deff2c97ca" - integrity sha1-S/VSQuFN7uHHGUkycJGC3v8sl8o= truffle-hdwallet-provider-privkey@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/truffle-hdwallet-provider-privkey/-/truffle-hdwallet-provider-privkey-0.1.0.tgz#9417047a74ad37d923df926154b6486ffb57f6c9" - integrity sha512-Vj04yr2d9qLRZspoHztbE/YQnVaoFb90JNZHtggRUm+JFm/NOiSJHLVI63+3mtUIuQ04EuKZ7Df8JQw0Ni7IeA== dependencies: ethereumjs-tx "^1.3.3" ethereumjs-wallet "^0.6.0" @@ -7298,7 +6291,6 @@ truffle-hdwallet-provider-privkey@^0.1.0: truffle-wallet-provider@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/truffle-wallet-provider/-/truffle-wallet-provider-0.0.5.tgz#db59ce6fa1c558766011137509a94dfca8d1408e" - integrity sha1-21nOb6HFWHZgERN1CalN/KjRQI4= dependencies: ethereumjs-wallet "^0.6.0" web3 "^0.18.2" @@ -7307,7 +6299,6 @@ truffle-wallet-provider@0.0.5: truffle@^4.1.13: version "4.1.14" resolved "https://registry.yarnpkg.com/truffle/-/truffle-4.1.14.tgz#8d2c298e29abf9b1e486e44ff9faca6d34bb9030" - integrity sha512-e7tTLvKP3bN9dE7MagfWyFjy4ZgoEGbeujECy1me1ENBzbj/aO/+45gs72qsL3+3IkCNNcWNOJjjrm8BYZZNNg== dependencies: mocha "^4.1.0" original-require "1.0.1" @@ -7316,36 +6307,30 @@ truffle@^4.1.13: tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= dependencies: safe-buffer "^5.0.1" tweetnacl@0.13.2: version "0.13.2" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.13.2.tgz#453161770469d45cd266c36404e2bc99a8fa9944" - integrity sha1-RTFhdwRp1FzSZsNkBOK8maj6mUQ= tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= dependencies: prelude-ls "~1.1.2" type-is@~1.6.16: version "1.6.16" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" - integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== dependencies: media-typer "0.3.0" mime-types "~2.1.18" @@ -7353,36 +6338,30 @@ type-is@~1.6.16: typechecker@^2.0.8: version "2.1.0" resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-2.1.0.tgz#d1c2093a54ff8a19f58cff877eeaa54f2242d383" - integrity sha1-0cIJOlT/ihn1jP+HfuqlTyJC04M= typechecker@^4.3.0: version "4.6.0" resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-4.6.0.tgz#d245d9c2df21147d5e2a942fff170b68ece73c87" - integrity sha512-83OrXpyP3LNr7aRbLkt2nkjE/d7q8su8/uRvrKxCpswqVCVGOgyaKpaz8/MTjQqBYe4eLNuJ44pNakFZKqyPMA== dependencies: editions "^2.0.2" typechecker@~2.0.1: version "2.0.8" resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-2.0.8.tgz#e83da84bb64c584ccb345838576c40b0337db82e" - integrity sha1-6D2oS7ZMWEzLNFg4V2xAsDN9uC4= typedarray-to-buffer@^3.1.2: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== dependencies: is-typedarray "^1.0.0" typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= uglify-js@^2.8.29: version "2.8.29" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" - integrity sha1-KcVzMUgFe7Th913zW3qcty5qWd0= dependencies: source-map "~0.5.1" yargs "~3.10.0" @@ -7392,7 +6371,6 @@ uglify-js@^2.8.29: uglify-js@^3.1.4: version "3.4.9" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3" - integrity sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q== dependencies: commander "~2.17.1" source-map "~0.6.1" @@ -7400,12 +6378,10 @@ uglify-js@^3.1.4: uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - integrity sha1-bgkk1r2mta/jSeOabWMoUKD4grc= uglifyjs-webpack-plugin@^0.4.6: version "0.4.6" resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309" - integrity sha1-uVH0q7a9YX5m9j64kUmOORdj4wk= dependencies: source-map "^0.5.6" uglify-js "^2.8.29" @@ -7414,12 +6390,10 @@ uglifyjs-webpack-plugin@^0.4.6: ultron@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== unbzip2-stream@^1.0.9: version "1.3.1" resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.3.1.tgz#7854da51622a7e63624221196357803b552966a1" - integrity sha512-fIZnvdjblYs7Cru/xC6tCPVhz7JkYcVQQkePwMLyQELzYTds2Xn8QefPVnvdVhhZqubxNA1cASXEH5wcK0Bucw== dependencies: buffer "^3.0.1" through "^2.3.6" @@ -7427,17 +6401,14 @@ unbzip2-stream@^1.0.9: underscore@1.8.3: version "1.8.3" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" - integrity sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI= underscore@^1.8.3: version "1.9.1" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" - integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== union-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= dependencies: arr-union "^3.1.0" get-value "^2.0.6" @@ -7447,22 +6418,18 @@ union-value@^1.0.0: universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== unorm@^1.3.3: version "1.4.1" resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.4.1.tgz#364200d5f13646ca8bcd44490271335614792300" - integrity sha1-NkIA1fE2RsqLzURJAnEzVhR5IwA= unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= dependencies: has-value "^0.3.1" isobject "^3.0.0" @@ -7470,41 +6437,34 @@ unset-value@^1.0.0: upath@^1.0.5: version "1.1.0" resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" - integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== dependencies: punycode "^2.1.0" urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= url-parse-lax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= dependencies: prepend-http "^1.0.1" url-set-query@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" - integrity sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk= url-to-options@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" - integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k= url@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= dependencies: punycode "1.3.2" querystring "0.2.0" @@ -7512,66 +6472,65 @@ url@^0.11.0: use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== utf8@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/utf8/-/utf8-2.1.1.tgz#2e01db02f7d8d0944f77104f1609eb0c304cf768" - integrity sha1-LgHbAvfY0JRPdxBPFgnrDDBM92g= utf8@^2.1.1, utf8@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/utf8/-/utf8-2.1.2.tgz#1fa0d9270e9be850d9b05027f63519bf46457d96" - integrity sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY= utf8@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" - integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= util@0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= dependencies: inherits "2.0.1" util@^0.10.3: version "0.10.4" resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" - integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== dependencies: inherits "2.0.3" +utile@0.3.x: + version "0.3.0" + resolved "https://registry.yarnpkg.com/utile/-/utile-0.3.0.tgz#1352c340eb820e4d8ddba039a4fbfaa32ed4ef3a" + dependencies: + async "~0.9.0" + deep-equal "~0.2.1" + i "0.3.x" + mkdirp "0.x.x" + ncp "1.0.x" + rimraf "2.x.x" + utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= uuid@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" - integrity sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w= uuid@^3.0.1, uuid@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== valid-url@^1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200" - integrity sha1-HBRHm0DxOXp1eC8RXkCGRHQzogA= validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== dependencies: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" @@ -7579,17 +6538,14 @@ validate-npm-package-license@^3.0.1: varint@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.0.tgz#d826b89f7490732fabc0c0ed693ed475dcb29ebf" - integrity sha1-2Ca4n3SQcy+rwMDtaT7Uddyynr8= vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= dependencies: assert-plus "^1.0.0" core-util-is "1.0.2" @@ -7598,14 +6554,12 @@ verror@1.10.0: vm-browserify@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" - integrity sha1-XX6kW7755Kb/ZflUOOCofDV9WnM= dependencies: indexof "0.0.1" watchpack@^1.4.0: version "1.6.0" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" - integrity sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA== dependencies: chokidar "^2.0.2" graceful-fs "^4.1.2" @@ -7614,7 +6568,6 @@ watchpack@^1.4.0: watchr@~2.4.13: version "2.4.13" resolved "https://registry.yarnpkg.com/watchr/-/watchr-2.4.13.tgz#d74847bb4d6f90f61fe2c74f9f68662aa0e07601" - integrity sha1-10hHu01vkPYf4sdPn2hmKqDgdgE= dependencies: eachr "^2.0.2" extendr "^2.1.0" @@ -7628,7 +6581,6 @@ watchr@~2.4.13: web3-bzz@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.0.0-beta.34.tgz#068d37777ab65e5c60f8ec8b9a50cfe45277929c" - integrity sha1-Bo03d3q2Xlxg+OyLmlDP5FJ3kpw= dependencies: got "7.1.0" swarm-js "0.1.37" @@ -7637,7 +6589,6 @@ web3-bzz@1.0.0-beta.34: web3-core-helpers@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.34.tgz#b168da00d3e19e156bc15ae203203dd4dfee2d03" - integrity sha1-sWjaANPhnhVrwVriAyA91N/uLQM= dependencies: underscore "1.8.3" web3-eth-iban "1.0.0-beta.34" @@ -7646,7 +6597,6 @@ web3-core-helpers@1.0.0-beta.34: web3-core-method@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.0.0-beta.34.tgz#ec163c8a2c490fa02a7ec15559fa7307fc7cc6dd" - integrity sha1-7BY8iixJD6AqfsFVWfpzB/x8xt0= dependencies: underscore "1.8.3" web3-core-helpers "1.0.0-beta.34" @@ -7657,7 +6607,6 @@ web3-core-method@1.0.0-beta.34: web3-core-promievent@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.34.tgz#a4f4fa6784bb293e82c60960ae5b56a94cd03edc" - integrity sha1-pPT6Z4S7KT6CxglgrltWqUzQPtw= dependencies: any-promise "1.3.0" eventemitter3 "1.1.1" @@ -7665,7 +6614,6 @@ web3-core-promievent@1.0.0-beta.34: web3-core-requestmanager@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.34.tgz#01f8f6cf2ae6b6f0b70c38bae1ef741b5bab215c" - integrity sha1-Afj2zyrmtvC3DDi64e90G1urIVw= dependencies: underscore "1.8.3" web3-core-helpers "1.0.0-beta.34" @@ -7676,7 +6624,6 @@ web3-core-requestmanager@1.0.0-beta.34: web3-core-subscriptions@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.34.tgz#9fed144033f221c3cf21060302ffdaf5ef2de2de" - integrity sha1-n+0UQDPyIcPPIQYDAv/a9e8t4t4= dependencies: eventemitter3 "1.1.1" underscore "1.8.3" @@ -7685,7 +6632,6 @@ web3-core-subscriptions@1.0.0-beta.34: web3-core@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.0.0-beta.34.tgz#121be8555e9fb00d2c5d05ddd3381d0c9e46987e" - integrity sha1-EhvoVV6fsA0sXQXd0zgdDJ5GmH4= dependencies: web3-core-helpers "1.0.0-beta.34" web3-core-method "1.0.0-beta.34" @@ -7695,7 +6641,6 @@ web3-core@1.0.0-beta.34: web3-eth-abi@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.34.tgz#034533e3aa2f7e59ff31793eaea685c0ed5af67a" - integrity sha1-A0Uz46ovfln/MXk+rqaFwO1a9no= dependencies: bn.js "4.11.6" underscore "1.8.3" @@ -7705,7 +6650,6 @@ web3-eth-abi@1.0.0-beta.34: web3-eth-accounts@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.34.tgz#e09142eeecc797ac3459b75e9b23946d3695f333" - integrity sha1-4JFC7uzHl6w0WbdemyOUbTaV8zM= dependencies: any-promise "1.3.0" crypto-browserify "3.12.0" @@ -7721,7 +6665,6 @@ web3-eth-accounts@1.0.0-beta.34: web3-eth-contract@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.34.tgz#9dbb38fae7643a808427a20180470ec7415c91e6" - integrity sha1-nbs4+udkOoCEJ6IBgEcOx0FckeY= dependencies: underscore "1.8.3" web3-core "1.0.0-beta.34" @@ -7735,7 +6678,6 @@ web3-eth-contract@1.0.0-beta.34: web3-eth-iban@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.34.tgz#9af458605867ccf74ea979aaf326b38ba6a5ba0c" - integrity sha1-mvRYYFhnzPdOqXmq8yazi6alugw= dependencies: bn.js "4.11.6" web3-utils "1.0.0-beta.34" @@ -7743,7 +6685,6 @@ web3-eth-iban@1.0.0-beta.34: web3-eth-personal@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.34.tgz#9afba167342ebde5420bcd5895c3f6c34388f205" - integrity sha1-mvuhZzQuveVCC81YlcP2w0OI8gU= dependencies: web3-core "1.0.0-beta.34" web3-core-helpers "1.0.0-beta.34" @@ -7754,7 +6695,6 @@ web3-eth-personal@1.0.0-beta.34: web3-eth@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.0.0-beta.34.tgz#74086000850c6fe6f535ef49837d6d4bb6113268" - integrity sha1-dAhgAIUMb+b1Ne9Jg31tS7YRMmg= dependencies: underscore "1.8.3" web3-core "1.0.0-beta.34" @@ -7772,7 +6712,6 @@ web3-eth@1.0.0-beta.34: web3-net@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.0.0-beta.34.tgz#427cea2f431881449c8e38d523290f173f9ff63d" - integrity sha1-QnzqL0MYgUScjjjVIykPFz+f9j0= dependencies: web3-core "1.0.0-beta.34" web3-core-method "1.0.0-beta.34" @@ -7781,7 +6720,6 @@ web3-net@1.0.0-beta.34: web3-provider-engine@^13.6.4: version "13.8.0" resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-13.8.0.tgz#4c7c1ad2af5f1fe10343b8a65495879a2f9c00df" - integrity sha512-fZXhX5VWwWpoFfrfocslyg6P7cN3YWPG/ASaevNfeO80R+nzgoPUBXcWQekSGSsNDkeRTis4aMmpmofYf1TNtQ== dependencies: async "^2.5.0" clone "^2.0.0" @@ -7806,7 +6744,6 @@ web3-provider-engine@^13.6.4: web3-provider-engine@^8.4.0: version "8.6.1" resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-8.6.1.tgz#4d86e19e30caaf97df351511ec0f60136e5b30eb" - integrity sha1-TYbhnjDKr5ffNRUR7A9gE25bMOs= dependencies: async "^2.1.2" clone "^2.0.0" @@ -7826,7 +6763,6 @@ web3-provider-engine@^8.4.0: web3-providers-http@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.0.0-beta.34.tgz#e561b52bbb43766282007d40285bfe3550c27e7a" - integrity sha1-5WG1K7tDdmKCAH1AKFv+NVDCfno= dependencies: web3-core-helpers "1.0.0-beta.34" xhr2 "0.1.4" @@ -7834,7 +6770,6 @@ web3-providers-http@1.0.0-beta.34: web3-providers-ipc@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.34.tgz#a1b77f1a306d73649a9c039052e40cb71328d00a" - integrity sha1-obd/GjBtc2SanAOQUuQMtxMo0Ao= dependencies: oboe "2.1.3" underscore "1.8.3" @@ -7843,7 +6778,6 @@ web3-providers-ipc@1.0.0-beta.34: web3-providers-ws@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.34.tgz#7de70f1b83f2de36476772156becfef6e3516eb3" - integrity sha1-fecPG4Py3jZHZ3IVa+z+9uNRbrM= dependencies: underscore "1.8.3" web3-core-helpers "1.0.0-beta.34" @@ -7852,7 +6786,6 @@ web3-providers-ws@1.0.0-beta.34: web3-shh@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.0.0-beta.34.tgz#975061d71eaec42ccee576f7bd8f70f03844afe0" - integrity sha1-l1Bh1x6uxCzO5Xb3vY9w8DhEr+A= dependencies: web3-core "1.0.0-beta.34" web3-core-method "1.0.0-beta.34" @@ -7862,7 +6795,6 @@ web3-shh@1.0.0-beta.34: web3-utils@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.0.0-beta.34.tgz#9411fc39aaef39ca4e06169f762297d9ff020970" - integrity sha1-lBH8OarvOcpOBhafdiKX2f8CCXA= dependencies: bn.js "4.11.6" eth-lib "0.1.27" @@ -7875,7 +6807,6 @@ web3-utils@1.0.0-beta.34: web3@0.19.1: version "0.19.1" resolved "https://registry.yarnpkg.com/web3/-/web3-0.19.1.tgz#e763d5b1107c4bc24abd4f8cbee1ba3659e6eb31" - integrity sha1-52PVsRB8S8JKvU+MvuG6Nlnm6zE= dependencies: bignumber.js "^4.0.2" crypto-js "^3.1.4" @@ -7886,7 +6817,6 @@ web3@0.19.1: web3@0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.2.tgz#c54dac5fc0e377399c04c1a6ecbb12e4513278d6" - integrity sha1-xU2sX8DjdzmcBMGm7LsS5FEyeNY= dependencies: bignumber.js "git+https://github.com/frozeman/bignumber.js-nolookahead.git" crypto-js "^3.1.4" @@ -7897,7 +6827,6 @@ web3@0.20.2: web3@0.20.6: version "0.20.6" resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.6.tgz#3e97306ae024fb24e10a3d75c884302562215120" - integrity sha1-PpcwauAk+yThCj11yIQwJWIhUSA= dependencies: bignumber.js "git+https://github.com/frozeman/bignumber.js-nolookahead.git" crypto-js "^3.1.4" @@ -7908,7 +6837,6 @@ web3@0.20.6: web3@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3/-/web3-1.0.0-beta.34.tgz#347e561b784098cb5563315f490479a1d91f2ab1" - integrity sha1-NH5WG3hAmMtVYzFfSQR5odkfKrE= dependencies: web3-bzz "1.0.0-beta.34" web3-core "1.0.0-beta.34" @@ -7921,7 +6849,6 @@ web3@1.0.0-beta.34: web3@^0.16.0: version "0.16.0" resolved "https://registry.yarnpkg.com/web3/-/web3-0.16.0.tgz#a4554175cd462943035b1f1d39432f741c6b6019" - integrity sha1-pFVBdc1GKUMDWx8dOUMvdBxrYBk= dependencies: bignumber.js "git+https://github.com/debris/bignumber.js#master" crypto-js "^3.1.4" @@ -7931,7 +6858,6 @@ web3@^0.16.0: web3@^0.18.2, web3@^0.18.4: version "0.18.4" resolved "https://registry.yarnpkg.com/web3/-/web3-0.18.4.tgz#81ec1784145491f2eaa8955b31c06049e07c5e7d" - integrity sha1-gewXhBRUkfLqqJVbMcBgSeB8Xn0= dependencies: bignumber.js "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" crypto-js "^3.1.4" @@ -7942,7 +6868,6 @@ web3@^0.18.2, web3@^0.18.4: web3@^0.20.5: version "0.20.7" resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.7.tgz#1605e6d81399ed6f85a471a4f3da0c8be57df2f7" - integrity sha512-VU6/DSUX93d1fCzBz7WP/SGCQizO1rKZi4Px9j/3yRyfssHyFcZamMw2/sj4E8TlfMXONvZLoforR8B4bRoyTQ== dependencies: bignumber.js "git+https://github.com/frozeman/bignumber.js-nolookahead.git" crypto-js "^3.1.4" @@ -7953,7 +6878,6 @@ web3@^0.20.5: webpack-sources@^1.0.1: version "1.3.0" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" - integrity sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA== dependencies: source-list-map "^2.0.0" source-map "~0.6.1" @@ -7961,7 +6885,6 @@ webpack-sources@^1.0.1: webpack@^3.0.0: version "3.12.0" resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.12.0.tgz#3f9e34360370602fcf639e97939db486f4ec0d74" - integrity sha512-Sw7MdIIOv/nkzPzee4o0EdvCuPmxT98+vVpIvwtcwcF1Q4SDSNp92vwcKc4REe7NItH9f1S4ra9FuQ7yuYZ8bQ== dependencies: acorn "^5.0.0" acorn-dynamic-import "^2.0.0" @@ -7998,46 +6921,50 @@ webpack@^3.0.0: whatwg-fetch@>=0.10.0: version "3.0.0" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" - integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" - integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= which@^1.1.1, which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" wide-align@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== dependencies: string-width "^1.0.2 || 2" window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - integrity sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0= window-size@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" - integrity sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU= + +winston@2.1.x: + version "2.1.1" + resolved "http://registry.npmjs.org/winston/-/winston-2.1.1.tgz#3c9349d196207fd1bdff9d4bc43ef72510e3a12e" + dependencies: + async "~1.0.0" + colors "1.0.x" + cycle "1.0.x" + eyes "0.1.x" + isstream "0.1.x" + pkginfo "0.3.x" + stack-trace "0.0.x" winston@^2.3.1: version "2.4.4" resolved "https://registry.yarnpkg.com/winston/-/winston-2.4.4.tgz#a01e4d1d0a103cf4eada6fc1f886b3110d71c34b" - integrity sha512-NBo2Pepn4hK4V01UfcWcDlmiVTs7VTB1h7bgnB0rgP146bYhMxX0ypCz3lBOfNxCO4Zuek7yeT+y/zM1OfMw4Q== dependencies: async "~1.0.0" colors "1.0.x" @@ -8049,22 +6976,18 @@ winston@^2.3.1: wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - integrity sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8= wordwrap@^1.0.0, wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= dependencies: string-width "^1.0.1" strip-ansi "^3.0.1" @@ -8072,19 +6995,16 @@ wrap-ansi@^2.0.0: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= dependencies: mkdirp "^0.5.1" ws@^3.0.0: version "3.3.3" resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== dependencies: async-limiter "~1.0.0" safe-buffer "~5.1.0" @@ -8093,14 +7013,12 @@ ws@^3.0.0: xhr-request-promise@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.2.tgz#343c44d1ee7726b8648069682d0f840c83b4261d" - integrity sha1-NDxE0e53JrhkgGloLQ+EDIO0Jh0= dependencies: xhr-request "^1.0.1" xhr-request@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/xhr-request/-/xhr-request-1.1.0.tgz#f4a7c1868b9f198723444d82dcae317643f2e2ed" - integrity sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA== dependencies: buffer-to-arraybuffer "^0.0.5" object-assign "^4.1.1" @@ -8113,19 +7031,16 @@ xhr-request@^1.0.1: xhr2-cookies@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz#7d77449d0999197f155cb73b23df72505ed89d48" - integrity sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg= dependencies: cookiejar "^2.1.1" xhr2@*, xhr2@0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.1.4.tgz#7f87658847716db5026323812f818cadab387a5f" - integrity sha1-f4dliEdxbbUCYyOBL4GMras4el8= xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: version "2.5.0" resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.5.0.tgz#bed8d1676d5ca36108667692b74b316c496e49dd" - integrity sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ== dependencies: global "~4.3.0" is-function "^1.0.1" @@ -8135,49 +7050,40 @@ xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: xmlhttprequest@*, xmlhttprequest@1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" - integrity sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw= xregexp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" - integrity sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM= xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= xtend@~2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" - integrity sha1-bv7MKk2tjmlixJAbM3znuoe10os= dependencies: object-keys "~0.4.0" y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= yaeti@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" - integrity sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc= yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= yallist@^3.0.0, yallist@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" - integrity sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k= yargs-parser@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" - integrity sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ= dependencies: camelcase "^3.0.0" lodash.assign "^4.0.6" @@ -8185,28 +7091,24 @@ yargs-parser@^2.4.1: yargs-parser@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" - integrity sha1-jQrELxbqVd69MyyvTEA4s+P139k= dependencies: camelcase "^4.1.0" yargs-parser@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.1.0.tgz#f1376a33b6629a5d063782944da732631e966950" - integrity sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ== dependencies: camelcase "^4.1.0" yargs-parser@^9.0.2: version "9.0.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" - integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= dependencies: camelcase "^4.1.0" yargs@^10.0.3: version "10.1.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.1.2.tgz#454d074c2b16a51a43e2fb7807e4f9de69ccb5c5" - integrity sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig== dependencies: cliui "^4.0.0" decamelize "^1.1.1" @@ -8224,7 +7126,6 @@ yargs@^10.0.3: yargs@^11.0.0: version "11.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" - integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== dependencies: cliui "^4.0.0" decamelize "^1.1.1" @@ -8242,7 +7143,6 @@ yargs@^11.0.0: yargs@^4.6.0, yargs@^4.7.1: version "4.8.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" - integrity sha1-wMQpJMpKqmsObaFznfshZDn53cA= dependencies: cliui "^3.2.0" decamelize "^1.1.1" @@ -8262,7 +7162,6 @@ yargs@^4.6.0, yargs@^4.7.1: yargs@^8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" - integrity sha1-YpmpBVsc78lp/355wdkY3Osiw2A= dependencies: camelcase "^4.1.0" cliui "^3.2.0" @@ -8281,7 +7180,6 @@ yargs@^8.0.2: yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - integrity sha1-9+572FfdfB0tOMDnTvvWgdFDH9E= dependencies: camelcase "^1.0.2" cliui "^2.1.0" @@ -8291,7 +7189,6 @@ yargs@~3.10.0: yauzl@^2.4.2: version "2.10.0" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= dependencies: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" From ea663e75ca6f4377013afb8c971ca6fd5ce66248 Mon Sep 17 00:00:00 2001 From: Adam Dossa Date: Tue, 27 Nov 2018 13:33:09 +0000 Subject: [PATCH 092/139] Revert "Optimise GTM (#433)" (#436) This reverts commit 42e4a789931d47984429d84b78e40bb3c3320f6a. --- CHANGELOG.md | 6 - .../modules/Checkpoint/DividendCheckpoint.sol | 37 +- .../Checkpoint/DividendCheckpointStorage.sol | 43 - .../Checkpoint/ERC20DividendCheckpoint.sol | 39 +- .../ERC20DividendCheckpointFactory.sol | 9 +- .../ERC20DividendCheckpointStorage.sol | 11 - .../Checkpoint/EtherDividendCheckpoint.sol | 25 +- .../EtherDividendCheckpointFactory.sol | 9 +- contracts/modules/Module.sol | 20 +- contracts/modules/ModuleStorage.sol | 30 - .../GeneralTransferManager.sol | 156 +-- .../GeneralTransferManagerFactory.sol | 10 +- .../GeneralTransferManagerStorage.sol | 53 - .../proxy/ERC20DividendCheckpointProxy.sol | 31 - .../proxy/EtherDividendCheckpointProxy.sol | 30 - .../proxy/GeneralTransferManagerProxy.sol | 30 - contracts/proxy/OwnedProxy.sol | 91 -- migrations/2_deploy_contracts.js | 24 +- package.json | 1 - scripts/compareStorageLayout.js | 139 -- test/b_capped_sto.js | 14 +- test/c_checkpoints.js | 6 +- test/d_count_transfer_manager.js | 8 +- test/e_erc20_dividends.js | 12 +- test/f_ether_dividends.js | 12 +- test/h_general_transfer_manager.js | 168 +-- test/helpers/createInstances.js | 32 +- test/helpers/signData.js | 2 +- test/i_Issuance.js | 4 +- test/j_manual_approval_transfer_manager.js | 6 +- test/l_percentage_transfer_manager.js | 8 +- test/m_presale_sto.js | 6 +- test/o_security_token.js | 20 +- test/p_usd_tiered_sto.js | 18 +- test/q_usd_tiered_sto_sim.js | 6 +- test/r_concurrent_STO.js | 6 +- test/u_module_registry_proxy.js | 5 +- test/v_tracked_redemptions.js | 6 +- ...kup_volume_restriction_transfer_manager.js | 14 +- test/x_single_trade_volume_restriction.js | 24 +- test/y_scheduled_checkpoints.js | 6 +- yarn.lock | 1247 ++++++++++++++++- 42 files changed, 1449 insertions(+), 975 deletions(-) delete mode 100644 contracts/modules/Checkpoint/DividendCheckpointStorage.sol delete mode 100644 contracts/modules/Checkpoint/ERC20DividendCheckpointStorage.sol delete mode 100644 contracts/modules/ModuleStorage.sol delete mode 100644 contracts/modules/TransferManager/GeneralTransferManagerStorage.sol delete mode 100644 contracts/proxy/ERC20DividendCheckpointProxy.sol delete mode 100644 contracts/proxy/EtherDividendCheckpointProxy.sol delete mode 100644 contracts/proxy/GeneralTransferManagerProxy.sol delete mode 100644 contracts/proxy/OwnedProxy.sol delete mode 100644 scripts/compareStorageLayout.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e19e93ce..db3d8dcde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,12 +13,6 @@ All notable changes to this project will be documented in this file. * Added `getTokensSoldByTier` to return sold (not minted during finalisation) tokens in each tier to USDTSTO. * Removed individual mappings for tier data removed in UDSTSTO. -# GeneralTransferManager -* Add an Offset that can be used to move all from & to dates forwards or backwards by a fixed offset. -* Add `address[] public investors` to record a list of all addresses that have been added to the whitelist (`getInvestors`) -* Fix for when `allowAllWhitelistIssuances` is FALSE -* Make GTM a Proxy based implementation to reduce deployment gas costs - ##Changed * `getAllModulesAndPermsFromTypes()` does not take securityToken address as a parameter anymore. diff --git a/contracts/modules/Checkpoint/DividendCheckpoint.sol b/contracts/modules/Checkpoint/DividendCheckpoint.sol index 3a345af25..452a48b13 100644 --- a/contracts/modules/Checkpoint/DividendCheckpoint.sol +++ b/contracts/modules/Checkpoint/DividendCheckpoint.sol @@ -8,7 +8,6 @@ pragma solidity ^0.4.24; import "./ICheckpoint.sol"; -import "./DividendCheckpointStorage.sol"; import "../Module.sol"; import "../../interfaces/ISecurityToken.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; @@ -18,9 +17,43 @@ import "openzeppelin-solidity/contracts/math/Math.sol"; * @title Checkpoint module for issuing ether dividends * @dev abstract contract */ -contract DividendCheckpoint is DividendCheckpointStorage, ICheckpoint, Module { +contract DividendCheckpoint is ICheckpoint, Module { using SafeMath for uint256; + uint256 public EXCLUDED_ADDRESS_LIMIT = 50; + bytes32 public constant DISTRIBUTE = "DISTRIBUTE"; + bytes32 public constant MANAGE = "MANAGE"; + bytes32 public constant CHECKPOINT = "CHECKPOINT"; + + struct Dividend { + uint256 checkpointId; + uint256 created; // Time at which the dividend was created + uint256 maturity; // Time after which dividend can be claimed - set to 0 to bypass + uint256 expiry; // Time until which dividend can be claimed - after this time any remaining amount can be withdrawn by issuer - + // set to very high value to bypass + uint256 amount; // Dividend amount in WEI + uint256 claimedAmount; // Amount of dividend claimed so far + uint256 totalSupply; // Total supply at the associated checkpoint (avoids recalculating this) + bool reclaimed; // True if expiry has passed and issuer has reclaimed remaining dividend + uint256 dividendWithheld; + uint256 dividendWithheldReclaimed; + mapping (address => bool) claimed; // List of addresses which have claimed dividend + mapping (address => bool) dividendExcluded; // List of addresses which cannot claim dividends + bytes32 name; // Name/title - used for identification + } + + // List of all dividends + Dividend[] public dividends; + + // List of addresses which cannot claim dividends + address[] public excluded; + + // Mapping from address to withholding tax as a percentage * 10**16 + mapping (address => uint256) public withholdingTax; + + // Total amount of ETH withheld per investor + mapping (address => uint256) public investorWithheld; + event SetDefaultExcludedAddresses(address[] _excluded, uint256 _timestamp); event SetWithholding(address[] _investors, uint256[] _withholding, uint256 _timestamp); event SetWithholdingFixed(address[] _investors, uint256 _withholding, uint256 _timestamp); diff --git a/contracts/modules/Checkpoint/DividendCheckpointStorage.sol b/contracts/modules/Checkpoint/DividendCheckpointStorage.sol deleted file mode 100644 index 4cf1f2838..000000000 --- a/contracts/modules/Checkpoint/DividendCheckpointStorage.sol +++ /dev/null @@ -1,43 +0,0 @@ -pragma solidity ^0.4.24; - -/** - * @title Holds the storage variable for the DividendCheckpoint modules (i.e ERC20, Ether) - * @dev abstract contract - */ -contract DividendCheckpointStorage { - - uint256 public EXCLUDED_ADDRESS_LIMIT = 50; - bytes32 public constant DISTRIBUTE = "DISTRIBUTE"; - bytes32 public constant MANAGE = "MANAGE"; - bytes32 public constant CHECKPOINT = "CHECKPOINT"; - - struct Dividend { - uint256 checkpointId; - uint256 created; // Time at which the dividend was created - uint256 maturity; // Time after which dividend can be claimed - set to 0 to bypass - uint256 expiry; // Time until which dividend can be claimed - after this time any remaining amount can be withdrawn by issuer - - // set to very high value to bypass - uint256 amount; // Dividend amount in WEI - uint256 claimedAmount; // Amount of dividend claimed so far - uint256 totalSupply; // Total supply at the associated checkpoint (avoids recalculating this) - bool reclaimed; // True if expiry has passed and issuer has reclaimed remaining dividend - uint256 dividendWithheld; - uint256 dividendWithheldReclaimed; - mapping (address => bool) claimed; // List of addresses which have claimed dividend - mapping (address => bool) dividendExcluded; // List of addresses which cannot claim dividends - bytes32 name; // Name/title - used for identification - } - - // List of all dividends - Dividend[] public dividends; - - // List of addresses which cannot claim dividends - address[] public excluded; - - // Mapping from address to withholding tax as a percentage * 10**16 - mapping (address => uint256) public withholdingTax; - - // Total amount of ETH withheld per investor - mapping (address => uint256) public investorWithheld; - -} diff --git a/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol b/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol index b779088f7..1f7f25cd5 100644 --- a/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol +++ b/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol @@ -1,16 +1,17 @@ pragma solidity ^0.4.24; import "./DividendCheckpoint.sol"; -import "./ERC20DividendCheckpointStorage.sol"; import "../../interfaces/IOwnable.sol"; import "../../interfaces/IERC20.sol"; /** * @title Checkpoint module for issuing ERC20 dividends */ -contract ERC20DividendCheckpoint is ERC20DividendCheckpointStorage, DividendCheckpoint { +contract ERC20DividendCheckpoint is DividendCheckpoint { using SafeMath for uint256; + // Mapping to token address for each dividend + mapping (uint256 => address) public dividendTokens; event ERC20DividendDeposited( address indexed _depositor, uint256 _checkpointId, @@ -67,8 +68,8 @@ contract ERC20DividendCheckpoint is ERC20DividendCheckpointStorage, DividendChec address _token, uint256 _amount, bytes32 _name - ) - external + ) + external withPerm(MANAGE) { createDividendWithExclusions(_maturity, _expiry, _token, _amount, excluded, _name); @@ -132,16 +133,16 @@ contract ERC20DividendCheckpoint is ERC20DividendCheckpointStorage, DividendChec * @param _name Name/Title for identification */ function createDividendWithCheckpointAndExclusions( - uint256 _maturity, - uint256 _expiry, - address _token, - uint256 _amount, - uint256 _checkpointId, + uint256 _maturity, + uint256 _expiry, + address _token, + uint256 _amount, + uint256 _checkpointId, address[] _excluded, bytes32 _name - ) + ) public - withPerm(MANAGE) + withPerm(MANAGE) { _createDividendWithCheckpointAndExclusions(_maturity, _expiry, _token, _amount, _checkpointId, _excluded, _name); } @@ -157,15 +158,15 @@ contract ERC20DividendCheckpoint is ERC20DividendCheckpointStorage, DividendChec * @param _name Name/Title for identification */ function _createDividendWithCheckpointAndExclusions( - uint256 _maturity, - uint256 _expiry, - address _token, - uint256 _amount, - uint256 _checkpointId, + uint256 _maturity, + uint256 _expiry, + address _token, + uint256 _amount, + uint256 _checkpointId, address[] _excluded, bytes32 _name - ) - internal + ) + internal { ISecurityToken securityTokenInstance = ISecurityToken(securityToken); require(_excluded.length <= EXCLUDED_ADDRESS_LIMIT, "Too many addresses excluded"); @@ -209,7 +210,7 @@ contract ERC20DividendCheckpoint is ERC20DividendCheckpointStorage, DividendChec } /** - * @notice Emits the ERC20DividendDeposited event. + * @notice Emits the ERC20DividendDeposited event. * Seperated into a different function as a workaround for stack too deep error */ function _emitERC20DividendDepositedEvent( diff --git a/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol b/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol index a684e553b..5fd158c26 100644 --- a/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol +++ b/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../../proxy/ERC20DividendCheckpointProxy.sol"; +import "./ERC20DividendCheckpoint.sol"; import "../ModuleFactory.sol"; /** @@ -8,8 +8,6 @@ import "../ModuleFactory.sol"; */ contract ERC20DividendCheckpointFactory is ModuleFactory { - address public logicContract; - /** * @notice Constructor * @param _polyAddress Address of the polytoken @@ -17,7 +15,7 @@ contract ERC20DividendCheckpointFactory is ModuleFactory { * @param _usageCost Usage cost of the module * @param _subscriptionCost Subscription cost of the module */ - constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost, address _logicContract) public + constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost) { version = "1.0.0"; @@ -26,7 +24,6 @@ contract ERC20DividendCheckpointFactory is ModuleFactory { description = "Create ERC20 dividends for token holders at a specific checkpoint"; compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); - logicContract = _logicContract; } /** @@ -36,7 +33,7 @@ contract ERC20DividendCheckpointFactory is ModuleFactory { function deploy(bytes /* _data */) external returns(address) { if (setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "insufficent allowance"); - address erc20DividendCheckpoint = new ERC20DividendCheckpointProxy(msg.sender, address(polyToken), logicContract); + address erc20DividendCheckpoint = new ERC20DividendCheckpoint(msg.sender, address(polyToken)); /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(erc20DividendCheckpoint, getName(), address(this), msg.sender, setupCost, now); return erc20DividendCheckpoint; diff --git a/contracts/modules/Checkpoint/ERC20DividendCheckpointStorage.sol b/contracts/modules/Checkpoint/ERC20DividendCheckpointStorage.sol deleted file mode 100644 index 29401f8d9..000000000 --- a/contracts/modules/Checkpoint/ERC20DividendCheckpointStorage.sol +++ /dev/null @@ -1,11 +0,0 @@ -pragma solidity ^0.4.24; - -/** - * @title It holds the storage variables related to ERC20DividendCheckpoint module - */ -contract ERC20DividendCheckpointStorage { - - // Mapping to token address for each dividend - mapping (uint256 => address) public dividendTokens; - -} diff --git a/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol b/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol index f5a916818..4def51468 100644 --- a/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol +++ b/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol @@ -8,7 +8,6 @@ import "../../interfaces/IOwnable.sol"; */ contract EtherDividendCheckpoint is DividendCheckpoint { using SafeMath for uint256; - event EtherDividendDeposited( address indexed _depositor, uint256 _checkpointId, @@ -57,7 +56,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { uint256 _expiry, uint256 _checkpointId, bytes32 _name - ) + ) external payable withPerm(MANAGE) @@ -77,7 +76,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { uint256 _expiry, address[] _excluded, bytes32 _name - ) + ) public payable withPerm(MANAGE) @@ -95,10 +94,10 @@ contract EtherDividendCheckpoint is DividendCheckpoint { * @param _name Name/title for identification */ function createDividendWithCheckpointAndExclusions( - uint256 _maturity, - uint256 _expiry, - uint256 _checkpointId, - address[] _excluded, + uint256 _maturity, + uint256 _expiry, + uint256 _checkpointId, + address[] _excluded, bytes32 _name ) public @@ -117,12 +116,12 @@ contract EtherDividendCheckpoint is DividendCheckpoint { * @param _name Name/title for identification */ function _createDividendWithCheckpointAndExclusions( - uint256 _maturity, - uint256 _expiry, - uint256 _checkpointId, - address[] _excluded, + uint256 _maturity, + uint256 _expiry, + uint256 _checkpointId, + address[] _excluded, bytes32 _name - ) + ) internal { require(_excluded.length <= EXCLUDED_ADDRESS_LIMIT, "Too many addresses excluded"); @@ -170,7 +169,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { */ function _payDividend(address _payee, Dividend storage _dividend, uint256 _dividendIndex) internal { (uint256 claim, uint256 withheld) = calculateDividend(_dividendIndex, _payee); - _dividend.claimed[_payee] = true; + _dividend.claimed[_payee] = true; uint256 claimAfterWithheld = claim.sub(withheld); if (claimAfterWithheld > 0) { /*solium-disable-next-line security/no-send*/ diff --git a/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol b/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol index 3129fba42..315760be1 100644 --- a/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol +++ b/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../../proxy/EtherDividendCheckpointProxy.sol"; +import "./EtherDividendCheckpoint.sol"; import "../ModuleFactory.sol"; /** @@ -8,8 +8,6 @@ import "../ModuleFactory.sol"; */ contract EtherDividendCheckpointFactory is ModuleFactory { - address public logicContract; - /** * @notice Constructor * @param _polyAddress Address of the polytoken @@ -17,7 +15,7 @@ contract EtherDividendCheckpointFactory is ModuleFactory { * @param _usageCost Usage cost of the module * @param _subscriptionCost Subscription cost of the module */ - constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost, address _logicContract) public + constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost) { version = "1.0.0"; @@ -26,7 +24,6 @@ contract EtherDividendCheckpointFactory is ModuleFactory { description = "Create ETH dividends for token holders at a specific checkpoint"; compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); - logicContract = _logicContract; } /** @@ -36,7 +33,7 @@ contract EtherDividendCheckpointFactory is ModuleFactory { function deploy(bytes /* _data */) external returns(address) { if(setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "Insufficent allowance or balance"); - address ethDividendCheckpoint = new EtherDividendCheckpointProxy(msg.sender, address(polyToken), logicContract); + address ethDividendCheckpoint = new EtherDividendCheckpoint(msg.sender, address(polyToken)); /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(ethDividendCheckpoint, getName(), address(this), msg.sender, setupCost, now); return ethDividendCheckpoint; diff --git a/contracts/modules/Module.sol b/contracts/modules/Module.sol index 1566a3428..1e27d424e 100644 --- a/contracts/modules/Module.sol +++ b/contracts/modules/Module.sol @@ -2,23 +2,33 @@ pragma solidity ^0.4.24; import "../interfaces/IModule.sol"; import "../interfaces/ISecurityToken.sol"; -import "./ModuleStorage.sol"; +import "../interfaces/IERC20.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; /** * @title Interface that any module contract should implement * @notice Contract is abstract */ -contract Module is IModule, ModuleStorage { +contract Module is IModule { + + address public factory; + + address public securityToken; + + bytes32 public constant FEE_ADMIN = "FEE_ADMIN"; + + IERC20 public polyToken; /** * @notice Constructor * @param _securityToken Address of the security token * @param _polyAddress Address of the polytoken */ - constructor (address _securityToken, address _polyAddress) public - ModuleStorage(_securityToken, _polyAddress) - { + constructor (address _securityToken, address _polyAddress) public { + require(_securityToken != address(0) && _polyAddress != address(0), "Invalid address"); + securityToken = _securityToken; + factory = msg.sender; + polyToken = IERC20(_polyAddress); } //Allows owner, factory or permissioned delegate diff --git a/contracts/modules/ModuleStorage.sol b/contracts/modules/ModuleStorage.sol deleted file mode 100644 index cd52c9de2..000000000 --- a/contracts/modules/ModuleStorage.sol +++ /dev/null @@ -1,30 +0,0 @@ -pragma solidity ^0.4.24; - -import "../interfaces/IERC20.sol"; - -/** - * @title Storage for Module contract - * @notice Contract is abstract - */ -contract ModuleStorage { - - /** - * @notice Constructor - * @param _securityToken Address of the security token - * @param _polyAddress Address of the polytoken - */ - constructor (address _securityToken, address _polyAddress) public { - securityToken = _securityToken; - factory = msg.sender; - polyToken = IERC20(_polyAddress); - } - - address public factory; - - address public securityToken; - - bytes32 public constant FEE_ADMIN = "FEE_ADMIN"; - - IERC20 public polyToken; - -} diff --git a/contracts/modules/TransferManager/GeneralTransferManager.sol b/contracts/modules/TransferManager/GeneralTransferManager.sol index 04028fead..814d54d7b 100644 --- a/contracts/modules/TransferManager/GeneralTransferManager.sol +++ b/contracts/modules/TransferManager/GeneralTransferManager.sol @@ -1,16 +1,47 @@ pragma solidity ^0.4.24; import "./ITransferManager.sol"; -import "./GeneralTransferManagerStorage.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /** * @title Transfer Manager module for core transfer validation functionality */ -contract GeneralTransferManager is GeneralTransferManagerStorage, ITransferManager { +contract GeneralTransferManager is ITransferManager { using SafeMath for uint256; + //Address from which issuances come + address public issuanceAddress = address(0); + + //Address which can sign whitelist changes + address public signingAddress = address(0); + + bytes32 public constant WHITELIST = "WHITELIST"; + bytes32 public constant FLAGS = "FLAGS"; + + //from and to timestamps that an investor can send / receive tokens respectively + struct TimeRestriction { + uint256 fromTime; + uint256 toTime; + uint256 expiryTime; + bool canBuyFromSTO; + } + + // An address can only send / receive tokens once their corresponding uint256 > block.number + // (unless allowAllTransfers == true or allowAllWhitelistTransfers == true) + mapping (address => TimeRestriction) public whitelist; + // Map of used nonces by customer + mapping(address => mapping(uint256 => bool)) public nonceMap; + + //If true, there are no transfer restrictions, for any addresses + bool public allowAllTransfers = false; + //If true, time lock is ignored for transfers (address must still be on whitelist) + bool public allowAllWhitelistTransfers = false; + //If true, time lock is ignored for issuances (address must still be on whitelist) + bool public allowAllWhitelistIssuances = true; + //If true, time lock is ignored for burn transactions + bool public allowAllBurnTransfers = false; + // Emit when Issuance address get changed event ChangeIssuanceAddress(address _issuanceAddress); // Emit when there is change in the flag variable called allowAllTransfers @@ -24,21 +55,14 @@ contract GeneralTransferManager is GeneralTransferManagerStorage, ITransferManag // Emit when there is change in the flag variable called signingAddress event ChangeSigningAddress(address _signingAddress); // Emit when investor details get modified related to their whitelisting - event OffsetModified(uint64 _time, uint8 _isForward); - - // _fromTime is the time from which the _investor can send tokens - // _toTime is the time from which the _investor can receive tokens - // if allowAllWhitelistIssuances is TRUE, then _toTime is ignored when receiving tokens from the issuance address - // if allowAllWhitelistTransfers is TRUE, then _toTime and _fromTime is ignored when sending or receiving tokens - // in any case, any investor sending or receiving tokens, must have a _expiryTime in the future event ModifyWhitelist( address _investor, uint256 _dateAdded, address _addedBy, - uint64 _fromTime, - uint64 _toTime, - uint64 _expiryTime, - uint8 _canBuyFromSTO + uint256 _fromTime, + uint256 _toTime, + uint256 _expiryTime, + bool _canBuyFromSTO ); /** @@ -52,12 +76,6 @@ contract GeneralTransferManager is GeneralTransferManagerStorage, ITransferManag { } - function modifyOffset(uint64 _time, uint8 _isForward) public withPerm(FLAGS) { - offset.time = _time; - offset.isForward = _isForward; - emit OffsetModified(_time, _isForward); - } - /** * @notice This function returns the signature of configure function */ @@ -150,19 +168,16 @@ contract GeneralTransferManager is GeneralTransferManagerStorage, ITransferManag //Anyone on the whitelist can transfer, regardless of time return (_onWhitelist(_to) && _onWhitelist(_from)) ? Result.VALID : Result.NA; } - if (_from == issuanceAddress && (whitelist[_to].canBuyFromSTO == 0) && _isSTOAttached()) { - return Result.NA; - } if (allowAllWhitelistIssuances && _from == issuanceAddress) { + if (!whitelist[_to].canBuyFromSTO && _isSTOAttached()) { + return Result.NA; + } return _onWhitelist(_to) ? Result.VALID : Result.NA; } - if (_from == issuanceAddress) { - return (_onWhitelist(_to) && _adjustTimes(whitelist[_to].toTime) <= uint64(now)) ? Result.VALID : Result.NA; - } //Anyone on the whitelist can transfer provided the blocknumber is large enough /*solium-disable-next-line security/no-block-members*/ - return ((_onWhitelist(_from) && _adjustTimes(whitelist[_from].fromTime) <= uint64(now)) && - (_onWhitelist(_to) && _adjustTimes(whitelist[_to].toTime) <= uint64(now))) ? Result.VALID : Result.NA; /*solium-disable-line security/no-block-members*/ + return ((_onWhitelist(_from) && whitelist[_from].fromTime <= now) && + (_onWhitelist(_to) && whitelist[_to].toTime <= now)) ? Result.VALID : Result.NA; /*solium-disable-line security/no-block-members*/ } return Result.NA; } @@ -177,39 +192,16 @@ contract GeneralTransferManager is GeneralTransferManagerStorage, ITransferManag */ function modifyWhitelist( address _investor, - uint64 _fromTime, - uint64 _toTime, - uint64 _expiryTime, - uint8 _canBuyFromSTO + uint256 _fromTime, + uint256 _toTime, + uint256 _expiryTime, + bool _canBuyFromSTO ) public withPerm(WHITELIST) { - _modifyWhitelist(_investor, _fromTime, _toTime, _expiryTime, _canBuyFromSTO); - } - - /** - * @notice Adds or removes addresses from the whitelist. - * @param _investor is the address to whitelist - * @param _fromTime is the moment when the sale lockup period ends and the investor can freely sell his tokens - * @param _toTime is the moment when the purchase lockup period ends and the investor can freely purchase tokens from others - * @param _expiryTime is the moment till investors KYC will be validated. After that investor need to do re-KYC - * @param _canBuyFromSTO is used to know whether the investor is restricted investor or not. - */ - function _modifyWhitelist( - address _investor, - uint64 _fromTime, - uint64 _toTime, - uint64 _expiryTime, - uint8 _canBuyFromSTO - ) - internal - { - require(_investor != address(0), "Invalid investor"); - if (whitelist[_investor].added == uint8(0)) { - investors.push(_investor); - } - whitelist[_investor] = TimeRestriction(_fromTime, _toTime, _expiryTime, _canBuyFromSTO, uint8(1)); + //Passing a _time == 0 into this function, is equivalent to removing the _investor from the whitelist + whitelist[_investor] = TimeRestriction(_fromTime, _toTime, _expiryTime, _canBuyFromSTO); /*solium-disable-next-line security/no-block-members*/ emit ModifyWhitelist(_investor, now, msg.sender, _fromTime, _toTime, _expiryTime, _canBuyFromSTO); } @@ -224,17 +216,17 @@ contract GeneralTransferManager is GeneralTransferManagerStorage, ITransferManag */ function modifyWhitelistMulti( address[] _investors, - uint64[] _fromTimes, - uint64[] _toTimes, - uint64[] _expiryTimes, - uint8[] _canBuyFromSTO + uint256[] _fromTimes, + uint256[] _toTimes, + uint256[] _expiryTimes, + bool[] _canBuyFromSTO ) public withPerm(WHITELIST) { require(_investors.length == _fromTimes.length, "Mismatched input lengths"); require(_fromTimes.length == _toTimes.length, "Mismatched input lengths"); require(_toTimes.length == _expiryTimes.length, "Mismatched input lengths"); require(_canBuyFromSTO.length == _toTimes.length, "Mismatched input length"); for (uint256 i = 0; i < _investors.length; i++) { - _modifyWhitelist(_investors[i], _fromTimes[i], _toTimes[i], _expiryTimes[i], _canBuyFromSTO[i]); + modifyWhitelist(_investors[i], _fromTimes[i], _toTimes[i], _expiryTimes[i], _canBuyFromSTO[i]); } } @@ -254,31 +246,29 @@ contract GeneralTransferManager is GeneralTransferManagerStorage, ITransferManag */ function modifyWhitelistSigned( address _investor, - uint64 _fromTime, - uint64 _toTime, - uint64 _expiryTime, - uint8 _canBuyFromSTO, - uint64 _validFrom, - uint64 _validTo, + uint256 _fromTime, + uint256 _toTime, + uint256 _expiryTime, + bool _canBuyFromSTO, + uint256 _validFrom, + uint256 _validTo, uint256 _nonce, uint8 _v, bytes32 _r, bytes32 _s ) public { /*solium-disable-next-line security/no-block-members*/ - require(_validFrom <= uint64(now), "ValidFrom is too early"); + require(_validFrom <= now, "ValidFrom is too early"); /*solium-disable-next-line security/no-block-members*/ - require(_validTo >= uint64(now), "ValidTo is too late"); + require(_validTo >= now, "ValidTo is too late"); require(!nonceMap[_investor][_nonce], "Already used signature"); nonceMap[_investor][_nonce] = true; bytes32 hash = keccak256( abi.encodePacked(this, _investor, _fromTime, _toTime, _expiryTime, _canBuyFromSTO, _validFrom, _validTo, _nonce) ); _checkSig(hash, _v, _r, _s); - if (whitelist[_investor].added == uint8(0)) { - investors.push(_investor); - } - whitelist[_investor] = TimeRestriction(_fromTime, _toTime, _expiryTime, _canBuyFromSTO, uint8(1)); + //Passing a _time == 0 into this function, is equivalent to removing the _investor from the whitelist + whitelist[_investor] = TimeRestriction(_fromTime, _toTime, _expiryTime, _canBuyFromSTO); /*solium-disable-next-line security/no-block-members*/ emit ModifyWhitelist(_investor, now, msg.sender, _fromTime, _toTime, _expiryTime, _canBuyFromSTO); } @@ -299,7 +289,8 @@ contract GeneralTransferManager is GeneralTransferManagerStorage, ITransferManag * @param _investor Address of the investor */ function _onWhitelist(address _investor) internal view returns(bool) { - return (whitelist[_investor].expiryTime >= uint64(now)); /*solium-disable-line security/no-block-members*/ + return (((whitelist[_investor].fromTime != 0) || (whitelist[_investor].toTime != 0)) && + (whitelist[_investor].expiryTime >= now)); /*solium-disable-line security/no-block-members*/ } /** @@ -310,23 +301,6 @@ contract GeneralTransferManager is GeneralTransferManagerStorage, ITransferManag return attached; } - function _adjustTimes(uint64 _time) internal view returns(uint64) { - if (offset.isForward != 0) { - require(_time + offset.time > _time); - return _time + offset.time; - } else { - require(_time >= offset.time); - return _time - offset.time; - } - } - - /** - * @dev Returns list of all investors - */ - function getInvestors() external view returns(address[]) { - return investors; - } - /** * @notice Return the permissions flag that are associated with general trnasfer manager */ diff --git a/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol b/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol index 4c81be20a..c15eb52aa 100644 --- a/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../../proxy/GeneralTransferManagerProxy.sol"; +import "./GeneralTransferManager.sol"; import "../ModuleFactory.sol"; /** @@ -8,23 +8,19 @@ import "../ModuleFactory.sol"; */ contract GeneralTransferManagerFactory is ModuleFactory { - address public logicContract; - /** * @notice Constructor * @param _polyAddress Address of the polytoken */ - constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost, address _logicContract) public + constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost) { - require(_logicContract != address(0), "Invalid logic contract"); version = "1.0.0"; name = "GeneralTransferManager"; title = "General Transfer Manager"; description = "Manage transfers using a time based whitelist"; compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); - logicContract = _logicContract; } @@ -35,7 +31,7 @@ contract GeneralTransferManagerFactory is ModuleFactory { function deploy(bytes /* _data */) external returns(address) { if (setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom because of sufficent Allowance is not provided"); - address generalTransferManager = new GeneralTransferManagerProxy(msg.sender, address(polyToken), logicContract); + address generalTransferManager = new GeneralTransferManager(msg.sender, address(polyToken)); /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(generalTransferManager), getName(), address(this), msg.sender, setupCost, now); return address(generalTransferManager); diff --git a/contracts/modules/TransferManager/GeneralTransferManagerStorage.sol b/contracts/modules/TransferManager/GeneralTransferManagerStorage.sol deleted file mode 100644 index f5c162080..000000000 --- a/contracts/modules/TransferManager/GeneralTransferManagerStorage.sol +++ /dev/null @@ -1,53 +0,0 @@ -pragma solidity ^0.4.24; - -/** - * @title Transfer Manager module for core transfer validation functionality - */ -contract GeneralTransferManagerStorage { - - //Address from which issuances come - address public issuanceAddress = address(0); - - //Address which can sign whitelist changes - address public signingAddress = address(0); - - bytes32 public constant WHITELIST = "WHITELIST"; - bytes32 public constant FLAGS = "FLAGS"; - - //from and to timestamps that an investor can send / receive tokens respectively - struct TimeRestriction { - uint64 fromTime; - uint64 toTime; - uint64 expiryTime; - uint8 canBuyFromSTO; - uint8 added; - } - - // Allows all TimeRestrictions to be offset - struct Offset { - uint64 time; - uint8 isForward; - } - - // Offset to be applied to all timings (except KYC expiry) - Offset public offset; - - // List of all addresses that have been added to the GTM at some point - address[] public investors; - - // An address can only send / receive tokens once their corresponding uint256 > block.number - // (unless allowAllTransfers == true or allowAllWhitelistTransfers == true) - mapping (address => TimeRestriction) public whitelist; - // Map of used nonces by customer - mapping(address => mapping(uint256 => bool)) public nonceMap; - - //If true, there are no transfer restrictions, for any addresses - bool public allowAllTransfers = false; - //If true, time lock is ignored for transfers (address must still be on whitelist) - bool public allowAllWhitelistTransfers = false; - //If true, time lock is ignored for issuances (address must still be on whitelist) - bool public allowAllWhitelistIssuances = true; - //If true, time lock is ignored for burn transactions - bool public allowAllBurnTransfers = false; - -} diff --git a/contracts/proxy/ERC20DividendCheckpointProxy.sol b/contracts/proxy/ERC20DividendCheckpointProxy.sol deleted file mode 100644 index 8839d30e1..000000000 --- a/contracts/proxy/ERC20DividendCheckpointProxy.sol +++ /dev/null @@ -1,31 +0,0 @@ -pragma solidity ^0.4.24; - -import "../modules/Checkpoint/ERC20DividendCheckpointStorage.sol"; -import "../modules/Checkpoint/DividendCheckpointStorage.sol"; -import "./OwnedProxy.sol"; -import "../Pausable.sol"; -import "../modules/ModuleStorage.sol"; - -/** - * @title Transfer Manager module for core transfer validation functionality - */ -contract ERC20DividendCheckpointProxy is ERC20DividendCheckpointStorage, DividendCheckpointStorage, ModuleStorage, Pausable, OwnedProxy { - - /** - * @notice Constructor - * @param _securityToken Address of the security token - * @param _polyAddress Address of the polytoken - * @param _implementation representing the address of the new implementation to be set - */ - constructor (address _securityToken, address _polyAddress, address _implementation) - public - ModuleStorage(_securityToken, _polyAddress) - { - require( - _implementation != address(0), - "Implementation address should not be 0x" - ); - __implementation = _implementation; - } - -} diff --git a/contracts/proxy/EtherDividendCheckpointProxy.sol b/contracts/proxy/EtherDividendCheckpointProxy.sol deleted file mode 100644 index 40b1c1332..000000000 --- a/contracts/proxy/EtherDividendCheckpointProxy.sol +++ /dev/null @@ -1,30 +0,0 @@ -pragma solidity ^0.4.24; - -import "../modules/Checkpoint/DividendCheckpointStorage.sol"; -import "./OwnedProxy.sol"; -import "../Pausable.sol"; -import "../modules/ModuleStorage.sol"; - -/** - * @title Transfer Manager module for core transfer validation functionality - */ -contract EtherDividendCheckpointProxy is DividendCheckpointStorage, ModuleStorage, Pausable, OwnedProxy { - - /** - * @notice Constructor - * @param _securityToken Address of the security token - * @param _polyAddress Address of the polytoken - * @param _implementation representing the address of the new implementation to be set - */ - constructor (address _securityToken, address _polyAddress, address _implementation) - public - ModuleStorage(_securityToken, _polyAddress) - { - require( - _implementation != address(0), - "Implementation address should not be 0x" - ); - __implementation = _implementation; - } - -} diff --git a/contracts/proxy/GeneralTransferManagerProxy.sol b/contracts/proxy/GeneralTransferManagerProxy.sol deleted file mode 100644 index cb9b69070..000000000 --- a/contracts/proxy/GeneralTransferManagerProxy.sol +++ /dev/null @@ -1,30 +0,0 @@ -pragma solidity ^0.4.24; - -import "../modules/TransferManager/GeneralTransferManagerStorage.sol"; -import "./OwnedProxy.sol"; -import "../Pausable.sol"; -import "../modules/ModuleStorage.sol"; - -/** - * @title Transfer Manager module for core transfer validation functionality - */ -contract GeneralTransferManagerProxy is GeneralTransferManagerStorage, ModuleStorage, Pausable, OwnedProxy { - - /** - * @notice Constructor - * @param _securityToken Address of the security token - * @param _polyAddress Address of the polytoken - * @param _implementation representing the address of the new implementation to be set - */ - constructor (address _securityToken, address _polyAddress, address _implementation) - public - ModuleStorage(_securityToken, _polyAddress) - { - require( - _implementation != address(0), - "Implementation address should not be 0x" - ); - __implementation = _implementation; - } - -} diff --git a/contracts/proxy/OwnedProxy.sol b/contracts/proxy/OwnedProxy.sol deleted file mode 100644 index b75142fbe..000000000 --- a/contracts/proxy/OwnedProxy.sol +++ /dev/null @@ -1,91 +0,0 @@ -pragma solidity ^0.4.18; - -import "./Proxy.sol"; - -/** - * @title OwnedProxy - * @dev This contract combines an upgradeability proxy with basic authorization control functionalities - */ -contract OwnedProxy is Proxy { - - // Owner of the contract - address private __owner; - - // Address of the current implementation - address internal __implementation; - - /** - * @dev Event to show ownership has been transferred - * @param _previousOwner representing the address of the previous owner - * @param _newOwner representing the address of the new owner - */ - event ProxyOwnershipTransferred(address _previousOwner, address _newOwner); - - /** - * @dev Throws if called by any account other than the owner. - */ - modifier ifOwner() { - if (msg.sender == _owner()) { - _; - } else { - _fallback(); - } - } - - /** - * @dev the constructor sets the original owner of the contract to the sender account. - */ - constructor() public { - _setOwner(msg.sender); - } - - /** - * @dev Tells the address of the owner - * @return the address of the owner - */ - function _owner() internal view returns (address) { - return __owner; - } - - /** - * @dev Sets the address of the owner - */ - function _setOwner(address _newOwner) internal { - require(_newOwner != address(0), "Address should not be 0x"); - __owner = _newOwner; - } - - /** - * @notice Internal function to provide the address of the implementation contract - */ - function _implementation() internal view returns (address) { - return __implementation; - } - - /** - * @dev Tells the address of the proxy owner - * @return the address of the proxy owner - */ - function proxyOwner() external ifOwner returns (address) { - return _owner(); - } - - /** - * @dev Tells the address of the current implementation - * @return address of the current implementation - */ - function implementation() external ifOwner returns (address) { - return _implementation(); - } - - /** - * @dev Allows the current owner to transfer control of the contract to a newOwner. - * @param _newOwner The address to transfer ownership to. - */ - function transferProxyOwnership(address _newOwner) external ifOwner { - require(_newOwner != address(0), "Address should not be 0x"); - emit ProxyOwnershipTransferred(_owner(), _newOwner); - _setOwner(_newOwner); - } - -} diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index f25cfab35..694fdf03e 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -1,12 +1,9 @@ const PolymathRegistry = artifacts.require('./PolymathRegistry.sol') const GeneralTransferManagerFactory = artifacts.require('./GeneralTransferManagerFactory.sol') -const GeneralTransferManagerLogic = artifacts.require('./GeneralTransferManager.sol') const GeneralPermissionManagerFactory = artifacts.require('./GeneralPermissionManagerFactory.sol') const PercentageTransferManagerFactory = artifacts.require('./PercentageTransferManagerFactory.sol') const USDTieredSTOProxyFactory = artifacts.require('./USDTieredSTOProxyFactory.sol'); const CountTransferManagerFactory = artifacts.require('./CountTransferManagerFactory.sol') -const EtherDividendCheckpointLogic = artifacts.require('./EtherDividendCheckpoint.sol') -const ERC20DividendCheckpointLogic = artifacts.require('./ERC20DividendCheckpoint.sol') const EtherDividendCheckpointFactory = artifacts.require('./EtherDividendCheckpointFactory.sol') const ERC20DividendCheckpointFactory = artifacts.require('./ERC20DividendCheckpointFactory.sol') const ModuleRegistry = artifacts.require('./ModuleRegistry.sol'); @@ -148,22 +145,10 @@ module.exports = function (deployer, network, accounts) { moduleRegistry = ModuleRegistry.at(ModuleRegistryProxy.address); // Add module registry to polymath registry return polymathRegistry.changeAddress("ModuleRegistry", ModuleRegistryProxy.address, {from: PolymathAccount}); - }).then(() => { - // B) Deploy the GeneralTransferManagerLogic Contract (Factory used to generate the GeneralTransferManager contract and this - // manager attach with the securityToken contract at the time of deployment) - return deployer.deploy(GeneralTransferManagerLogic, "0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", {from: PolymathAccount}); - }).then(() => { - // B) Deploy the GeneralTransferManagerLogic Contract (Factory used to generate the GeneralTransferManager contract and this - // manager attach with the securityToken contract at the time of deployment) - return deployer.deploy(ERC20DividendCheckpointLogic, "0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", {from: PolymathAccount}); - }).then(() => { - // B) Deploy the GeneralTransferManagerLogic Contract (Factory used to generate the GeneralTransferManager contract and this - // manager attach with the securityToken contract at the time of deployment) - return deployer.deploy(EtherDividendCheckpointLogic, "0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", {from: PolymathAccount}); }).then(() => { // B) Deploy the GeneralTransferManagerFactory Contract (Factory used to generate the GeneralTransferManager contract and this // manager attach with the securityToken contract at the time of deployment) - return deployer.deploy(GeneralTransferManagerFactory, PolyToken, 0, 0, 0, GeneralTransferManagerLogic.address, {from: PolymathAccount}); + return deployer.deploy(GeneralTransferManagerFactory, PolyToken, 0, 0, 0, {from: PolymathAccount}); }).then(() => { // C) Deploy the GeneralPermissionManagerFactory Contract (Factory used to generate the GeneralPermissionManager contract and // this manager attach with the securityToken contract at the time of deployment) @@ -179,11 +164,11 @@ module.exports = function (deployer, network, accounts) { }).then(() => { // D) Deploy the EtherDividendCheckpointFactory Contract (Factory used to generate the EtherDividendCheckpoint contract use // to provide the functionality of the dividend in terms of ETH) - return deployer.deploy(EtherDividendCheckpointFactory, PolyToken, 0, 0, 0, EtherDividendCheckpointLogic.address, {from: PolymathAccount}); + return deployer.deploy(EtherDividendCheckpointFactory, PolyToken, 0, 0, 0, {from: PolymathAccount}); }).then(() => { // D) Deploy the ERC20DividendCheckpointFactory Contract (Factory used to generate the ERC20DividendCheckpoint contract use // to provide the functionality of the dividend in terms of ERC20 token) - return deployer.deploy(ERC20DividendCheckpointFactory, PolyToken, 0, 0, 0, ERC20DividendCheckpointLogic.address, {from: PolymathAccount}); + return deployer.deploy(ERC20DividendCheckpointFactory, PolyToken, 0, 0, 0, {from: PolymathAccount}); }).then(() => { // D) Deploy the ManualApprovalTransferManagerFactory Contract (Factory used to generate the ManualApprovalTransferManager contract use // to manual approve the transfer that will overcome the other transfer restrictions) @@ -318,7 +303,6 @@ module.exports = function (deployer, network, accounts) { POLYOracle: ${POLYOracle} STFactory: ${STFactory.address} - GeneralTransferManagerLogic: ${GeneralTransferManagerLogic.address} GeneralTransferManagerFactory: ${GeneralTransferManagerFactory.address} GeneralPermissionManagerFactory: ${GeneralPermissionManagerFactory.address} @@ -329,8 +313,6 @@ module.exports = function (deployer, network, accounts) { CountTransferManagerFactory: ${CountTransferManagerFactory.address} PercentageTransferManagerFactory: ${PercentageTransferManagerFactory.address} ManualApprovalTransferManagerFactory: ${ManualApprovalTransferManagerFactory.address} - EtherDividendCheckpointLogic: ${EtherDividendCheckpointLogic.address} - ERC20DividendCheckpointLogic: ${ERC20DividendCheckpointLogic.address} EtherDividendCheckpointFactory: ${EtherDividendCheckpointFactory.address} ERC20DividendCheckpointFactory: ${ERC20DividendCheckpointFactory.address} --------------------------------------------------------------------------------- diff --git a/package.json b/package.json index 58104d99b..ef2d76c38 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,6 @@ "ethers": "^3.0.15", "fs": "0.0.1-security", "openzeppelin-solidity": "1.10.0", - "prompt": "^1.0.0", "readline-sync": "^1.4.9", "request": "^2.88.0", "request-promise": "^4.2.2", diff --git a/scripts/compareStorageLayout.js b/scripts/compareStorageLayout.js deleted file mode 100644 index c339bf095..000000000 --- a/scripts/compareStorageLayout.js +++ /dev/null @@ -1,139 +0,0 @@ -const fs = require('fs'); -const _ = require('underscore'); -const solc = require('solc'); -const prompt = require('prompt'); -const path = require('path'); -const util = require('util'); -const exec = util.promisify(require('child_process').exec); - -prompt.start(); - -prompt.get(['LogicContract', 'ProxyContract'], async(err, result) => { - - let logicContract; - let proxyContract; - - const fileList = walkSync('./contracts', []); - - let paths = findPath(result.LogicContract, result.ProxyContract, fileList); - - if (paths.length == 2) { - - console.log("Contracts exists \n"); - - await flatContracts(paths); - - if (path.basename(paths[0]) === result.LogicContract) { - logicContract = fs.readFileSync(`./flat/${path.basename(paths[0])}`, 'utf8'); - } else { - logicContract = fs.readFileSync(`./flat/${path.basename(paths[1])}`, 'utf8'); - } - if (path.basename(paths[0]) === result.ProxyContract) { - proxyContract = fs.readFileSync(`./flat/${path.basename(paths[0])}`, 'utf8'); - } else { - proxyContract = fs.readFileSync(`./flat/${path.basename(paths[1])}`, 'utf8'); - } - - let logicInput = { - 'contracts': logicContract - } - let proxyInput = { - 'contracts': proxyContract - } - - console.log(compareStorageLayouts(parseContract(logicInput), parseContract(proxyInput))); - - } else { - console.log("Contracts doesn't exists"); - } -}); - -function traverseAST(_input, _elements) { - if(_input.children) { - for(var i=0;i<_input.children.length;i++) { - traverseAST(_input.children[i], _elements); - } - } - _elements.push(_input); -} - -function compareStorageLayouts(logicLayout, proxyLayout) { - function makeComp(x) { - return [x.constant, x.name, x.stateVariable, x.storageLocation, x.type, x.value, x.visibility].join(':'); - } - // if(newLayout.length < oldLayout.length) return false; - for(var i=0; i < logicLayout.length; i++) { - const a = logicLayout[i].attributes; - const comp1 = makeComp(a) - console.log(comp1); - const b = proxyLayout[i].attributes; - const comp2 = makeComp(b); - console.log(comp2); - if(comp1 != comp2) { - return false; - } - } - return true; -} - -function parseContract(input) { - - var output = solc.compile({ sources: input }, 1, _.noop); - const elements = []; - const AST = output.sources.contracts.AST; - // console.log(AST); - traverseAST(AST, elements); - // console.log(elements); - - // filter out all Contract Definitions - const contractDefinitions = _.filter(elements, (e,i) => e.name == 'ContractDefinition'); - - // filter out all linearizedBaseContracts - // pick the last one as the last contract always has the full inheritance - const linearizedBaseContracts = _.last(_.map(contractDefinitions, e => e.attributes.linearizedBaseContracts)); - - // get all stateVariables - const stateVariables = _.filter(elements, e => e.attributes && e.attributes.stateVariable ) - - // group them by scope - const stateVariableMap = _.groupBy(stateVariables, e => e.attributes.scope); - - orderedStateVariables = _.reduceRight(linearizedBaseContracts, (a, b) => { - return a.concat(stateVariableMap[b] || []) - }, []); - return orderedStateVariables; -} - -var walkSync = function(dir, filelist) { - files = fs.readdirSync(dir); - filelist = filelist || []; - files.forEach(function(file) { - if (fs.statSync(path.join(dir, file)).isDirectory()) { - filelist = walkSync(path.join(dir, file), filelist); - } - else { - filelist.push(path.join(dir, file)); - } - }); - return filelist; -}; - -var findPath = function(logicContractName, proxyContractName, fileList) { - let paths = new Array(); - for (let i =0; i < fileList.length; i++) { - if ((logicContractName === path.basename(fileList[i]) || logicContractName === (path.basename(fileList[i])).split(".")[0]) || - (proxyContractName === path.basename(fileList[i]) || proxyContractName === (path.basename(fileList[i])).split(".")[0])) { - paths.push(fileList[i]); - } - } - return paths; -} - -async function flatContracts(_paths, _logic) { - let promises = new Array(); - for (let i = 0; i< _paths.length; i++) { - promises.push(await exec(`./node_modules/.bin/sol-merger ${_paths[i]} ./flat`)); - } - await Promise.all(promises); -} - diff --git a/test/b_capped_sto.js b/test/b_capped_sto.js index b1365ad3b..fce1ee5e5 100644 --- a/test/b_capped_sto.js +++ b/test/b_capped_sto.js @@ -130,7 +130,7 @@ contract("CappedSTO", accounts => { // STEP 5: Deploy the GeneralDelegateManagerFactory [I_GeneralPermissionManagerFactory] = await deployGPMAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, 0); - + // STEP 6: Deploy the CappedSTOFactory I_CappedSTOFactory = await CappedSTOFactory.new(I_PolyToken.address, cappedSTOSetupCost, 0, 0, { from: token_owner }); @@ -360,7 +360,7 @@ contract("CappedSTO", accounts => { balanceOfReceiver = await web3.eth.getBalance(account_fundsReceiver); // Add the Investor in to the whitelist - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, true, { from: account_issuer }); @@ -443,7 +443,7 @@ contract("CappedSTO", accounts => { fromTime, toTime + duration.days(20), expiryTime, - 1, + true, { from: account_issuer } @@ -565,7 +565,7 @@ contract("CappedSTO", accounts => { it("Should successfully whitelist investor 3", async () => { balanceOfReceiver = await web3.eth.getBalance(account_fundsReceiver); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor3, fromTime, toTime, expiryTime, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor3, fromTime, toTime, expiryTime, true, { from: account_issuer, gas: 500000 }); @@ -733,7 +733,7 @@ contract("CappedSTO", accounts => { "Tokens are not transfered properly" ); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, P_fromTime, P_toTime, P_expiryTime, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, P_fromTime, P_toTime, P_expiryTime, true, { from: account_issuer, gas: 500000 }); @@ -800,7 +800,7 @@ contract("CappedSTO", accounts => { P_fromTime, P_toTime + duration.days(20), P_expiryTime, - 1, + true, { from: account_issuer, gas: 500000 @@ -997,7 +997,7 @@ contract("CappedSTO", accounts => { await I_PolyToken.getTokens(polyToInvest * Math.pow(10, 18), account_investor3); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor3, P_fromTime, P_toTime, P_expiryTime, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor3, P_fromTime, P_toTime, P_expiryTime, true, { from: account_issuer, gas: 500000 }); diff --git a/test/c_checkpoints.js b/test/c_checkpoints.js index 2ba198f83..6a08b6dea 100644 --- a/test/c_checkpoints.js +++ b/test/c_checkpoints.js @@ -149,7 +149,7 @@ contract("Checkpoints", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 0, + false, { from: account_issuer, gas: 6000000 @@ -176,7 +176,7 @@ contract("Checkpoints", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 0, + false, { from: account_issuer, gas: 6000000 @@ -201,7 +201,7 @@ contract("Checkpoints", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 0, + false, { from: account_issuer, gas: 6000000 diff --git a/test/d_count_transfer_manager.js b/test/d_count_transfer_manager.js index 4e86bdbb6..1a1e7717a 100644 --- a/test/d_count_transfer_manager.js +++ b/test/d_count_transfer_manager.js @@ -200,7 +200,7 @@ contract("CountTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 500000 @@ -230,7 +230,7 @@ contract("CountTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 500000 @@ -257,7 +257,7 @@ contract("CountTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 500000 @@ -282,7 +282,7 @@ contract("CountTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 500000 diff --git a/test/e_erc20_dividends.js b/test/e_erc20_dividends.js index 6a4baeab6..b832bcee2 100644 --- a/test/e_erc20_dividends.js +++ b/test/e_erc20_dividends.js @@ -89,7 +89,7 @@ contract("ERC20DividendCheckpoint", accounts => { account_investor4 = accounts[9]; account_temp = accounts[2]; account_manager = accounts[5]; - + // Step 1: Deploy the genral PM ecosystem let instances = await setUpPolymathNetwork(account_polymath, token_owner); @@ -202,7 +202,7 @@ contract("ERC20DividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(30), - 1, + true, { from: account_issuer, gas: 500000 @@ -232,7 +232,7 @@ contract("ERC20DividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(30), - 1, + true, { from: account_issuer, gas: 500000 @@ -372,7 +372,7 @@ contract("ERC20DividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(20), - 1, + true, { from: account_issuer, gas: 500000 @@ -434,7 +434,7 @@ contract("ERC20DividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 500000 @@ -970,7 +970,7 @@ contract("ERC20DividendCheckpoint", accounts => { let expiry = latestTime() + duration.days(10); let exclusions = [1]; let checkpointID = await I_SecurityToken.createCheckpoint.call({ from: token_owner }); - await I_SecurityToken.createCheckpoint({ from: token_owner }); + await I_SecurityToken.createCheckpoint({ from: token_owner }); await catchRevert(I_ERC20DividendCheckpoint.createDividendWithCheckpointAndExclusions( maturity, expiry, diff --git a/test/f_ether_dividends.js b/test/f_ether_dividends.js index 68c11f72f..b4e5bbf2b 100644 --- a/test/f_ether_dividends.js +++ b/test/f_ether_dividends.js @@ -200,7 +200,7 @@ contract("EtherDividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(30), - 1, + true, { from: account_issuer, gas: 500000 @@ -230,7 +230,7 @@ contract("EtherDividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(30), - 1, + true, { from: account_issuer, gas: 500000 @@ -364,7 +364,7 @@ contract("EtherDividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(20), - 1, + true, { from: account_issuer, gas: 500000 @@ -415,7 +415,7 @@ contract("EtherDividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 500000 @@ -719,7 +719,7 @@ contract("EtherDividendCheckpoint", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 500000 @@ -851,7 +851,7 @@ contract("EtherDividendCheckpoint", accounts => { let expiry = latestTime() + duration.days(10); let exclusions = [1]; let checkpointID = await I_SecurityToken.createCheckpoint.call({ from: token_owner }); - await I_SecurityToken.createCheckpoint({ from: token_owner }); + await I_SecurityToken.createCheckpoint({ from: token_owner }); await catchRevert(I_EtherDividendCheckpoint.createDividendWithCheckpointAndExclusions( maturity, expiry, diff --git a/test/h_general_transfer_manager.js b/test/h_general_transfer_manager.js index 5dbcf5a6c..3e060c288 100644 --- a/test/h_general_transfer_manager.js +++ b/test/h_general_transfer_manager.js @@ -92,7 +92,6 @@ contract("GeneralTransferManager", accounts => { account_investor1 = accounts[8]; account_investor2 = accounts[9]; account_delegate = accounts[7]; - account_investor3 = accounts[5]; account_investor4 = accounts[6]; account_affiliates1 = accounts[3]; @@ -173,14 +172,14 @@ contract("GeneralTransferManager", accounts => { await catchRevert( I_SecurityToken.addModule(P_GeneralTransferManagerFactory.address, "", web3.utils.toWei("500"), 0, {from: account_issuer}) ); - }); + }) it("Should attach the paid GTM", async() => { let snap_id = await takeSnapshot(); await I_PolyToken.getTokens(web3.utils.toWei("500"), I_SecurityToken.address); await I_SecurityToken.addModule(P_GeneralTransferManagerFactory.address, "", web3.utils.toWei("500"), 0, {from: account_issuer}); await revertToSnapshot(snap_id); - }); + }) it("Should whitelist the affiliates before the STO attached", async () => { let tx = await I_GeneralTransferManager.modifyWhitelistMulti( @@ -188,7 +187,7 @@ contract("GeneralTransferManager", accounts => { [latestTime() + duration.days(30), latestTime() + duration.days(30)], [latestTime() + duration.days(90), latestTime() + duration.days(90)], [latestTime() + duration.years(1), latestTime() + duration.years(1)], - [0, 0], + [false, false], { from: account_issuer, gas: 6000000 @@ -196,30 +195,6 @@ contract("GeneralTransferManager", accounts => { ); assert.equal(tx.logs[0].args._investor, account_affiliates1); assert.equal(tx.logs[1].args._investor, account_affiliates2); - assert.deepEqual(await I_GeneralTransferManager.getInvestors.call(), [account_affiliates1, account_affiliates2]); - }); - - it("Should whitelist lots of addresses and check gas", async () => { - let mockInvestors = []; - for (let i = 0; i < 50; i++) { - mockInvestors.push("0x1000000000000000000000000000000000000000".substring(0,42-i.toString().length) + i.toString()); - } - - let times = range1(50); - let bools = rangeB(50); - let tx = await I_GeneralTransferManager.modifyWhitelistMulti( - mockInvestors, - times, - times, - times, - bools, - { - from: account_issuer, - gas: 7900000 - } - ); - console.log("Multi Whitelist x 50: " + tx.receipt.gasUsed); - assert.deepEqual(await I_GeneralTransferManager.getInvestors.call(), [account_affiliates1, account_affiliates2].concat(mockInvestors)); }); it("Should mint the tokens to the affiliates", async () => { @@ -316,7 +291,7 @@ contract("GeneralTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 6000000 @@ -345,7 +320,7 @@ contract("GeneralTransferManager", accounts => { it("Should fail in buying the tokens from the STO -- because amount is 0", async() => { await catchRevert( I_DummySTO.generateTokens(account_investor1, 0, { from: token_owner }) - ); + ); }); it("Should fail in buying the tokens from the STO -- because STO is paused", async() => { @@ -367,106 +342,6 @@ contract("GeneralTransferManager", accounts => { }); }); - describe("Buy tokens using on-chain whitelist and negative offset", async () => { - // let snap_id; - - it("Should Buy the tokens", async () => { - // Add the Investor in to the whitelist - // snap_id = await takeSnapshot(); - let tx = await I_GeneralTransferManager.modifyWhitelist( - account_investor1, - latestTime() + duration.days(10), - latestTime() + duration.days(10), - latestTime() + duration.days(20), - 1, - { - from: account_issuer, - gas: 6000000 - } - ); - - assert.equal( - tx.logs[0].args._investor.toLowerCase(), - account_investor1.toLowerCase(), - "Failed in adding the investor in whitelist" - ); - - // Jump time - await increaseTime(5000); - - // Mint some tokens - await I_DummySTO.generateTokens(account_investor1, web3.utils.toWei("1", "ether"), { from: token_owner }); - - await catchRevert(I_SecurityToken.transfer(account_investor1, web3.utils.toWei("1", "ether"), {from: account_investor1})); - assert.equal((await I_SecurityToken.balanceOf(account_investor1)).toNumber(), web3.utils.toWei("3", "ether")); - }); - - it("Add an offset and check transfers are disabled", async () => { - let tx = await I_GeneralTransferManager.modifyOffset(duration.days(10), 0, {from: token_owner}); - await I_SecurityToken.transfer(account_investor1, web3.utils.toWei("1", "ether"), {from: account_investor1}); - assert.equal((await I_SecurityToken.balanceOf(account_investor1)).toNumber(), web3.utils.toWei("3", "ether")); - tx = await I_GeneralTransferManager.modifyOffset(0, 0, {from: token_owner}); - // await revertToSnapshot(snap_id); - }); - - }); - - - describe("Buy tokens using on-chain whitelist and positive offset", async () => { - // let snap_id; - - it("Should Buy the tokens", async () => { - - // Add the Investor in to the whitelist - // snap_id = await takeSnapshot(); - let tx = await I_GeneralTransferManager.modifyWhitelist( - account_investor1, - latestTime(), - latestTime(), - latestTime() + duration.days(20), - 1, - { - from: account_issuer, - gas: 6000000 - } - ); - - assert.equal( - tx.logs[0].args._investor.toLowerCase(), - account_investor1.toLowerCase(), - "Failed in adding the investor in whitelist" - ); - - // Jump time - await increaseTime(5000); - // console.log("vT1: " + JSON.stringify(await I_GeneralTransferManager.verifyTransfer.call(account_investor1, account_investor1, web3.utils.toWei("1", "ether"), "", false))); - // console.log("vT2: " + JSON.stringify(await I_GeneralTransferManager.verifyTransfer.call("0x0000000000000000000000000000000000000000", account_investor1, web3.utils.toWei("1", "ether"), "", false))); - - // Mint some tokens - console.log(await I_GeneralTransferManager.offset.call()); - await I_DummySTO.generateTokens(account_investor1, web3.utils.toWei("1", "ether"), { from: token_owner }); - - assert.equal((await I_SecurityToken.balanceOf(account_investor1)).toNumber(), web3.utils.toWei("4", "ether")); - await I_SecurityToken.transfer(account_investor1, web3.utils.toWei("1", "ether"), {from: account_investor1}); - }); - - it("Add an offset and check transfers are disabled", async () => { - let tx = await I_GeneralTransferManager.modifyOffset(duration.days(10), 1, {from: token_owner}); - // console.log("vT1: " + JSON.stringify(await I_GeneralTransferManager.verifyTransfer.call(account_investor1, account_investor1, web3.utils.toWei("1", "ether"), "", false))); - // console.log("vT2: " + JSON.stringify(await I_GeneralTransferManager.verifyTransfer.call("0x0000000000000000000000000000000000000000", account_investor1, web3.utils.toWei("1", "ether"), "", false))); - - await catchRevert(I_SecurityToken.transfer(account_investor1, web3.utils.toWei("1", "ether"), {from: account_investor1})); - await increaseTime(duration.days(10)); - // console.log("vT1: " + JSON.stringify(await I_GeneralTransferManager.verifyTransfer.call(account_investor1, account_investor1, web3.utils.toWei("1", "ether"), "", false))); - // console.log("vT2: " + JSON.stringify(await I_GeneralTransferManager.verifyTransfer.call("0x0000000000000000000000000000000000000000", account_investor1, web3.utils.toWei("1", "ether"), "", false))); - - await I_SecurityToken.transfer(account_investor1, web3.utils.toWei("1", "ether"), {from: account_investor1}); - tx = await I_GeneralTransferManager.modifyOffset(0, 0, {from: token_owner}); - // await revertToSnapshot(snap_id); - }); - - }); - describe("Buy tokens using off-chain whitelist", async () => { it("Should buy the tokens -- Failed due to investor is not in the whitelist", async () => { await catchRevert(I_DummySTO.generateTokens(account_investor2, web3.utils.toWei("1", "ether"), { from: token_owner })); @@ -484,7 +359,7 @@ contract("GeneralTransferManager", accounts => { fromTime, toTime, expiryTime, - 1, + true, validFrom, validTo, nonce, @@ -501,7 +376,7 @@ contract("GeneralTransferManager", accounts => { fromTime, toTime, expiryTime, - 1, + true, validFrom, validTo, nonce, @@ -528,7 +403,7 @@ contract("GeneralTransferManager", accounts => { fromTime, toTime, expiryTime, - 1, + true, validFrom, validTo, nonce, @@ -545,7 +420,7 @@ contract("GeneralTransferManager", accounts => { fromTime, toTime, expiryTime, - 1, + true, validFrom, validTo, nonce, @@ -572,7 +447,7 @@ contract("GeneralTransferManager", accounts => { fromTime, toTime, expiryTime, - 1, + true, validFrom, validTo, nonce, @@ -589,7 +464,7 @@ contract("GeneralTransferManager", accounts => { fromTime, toTime, expiryTime, - 1, + true, validFrom, validTo, nonce, @@ -616,7 +491,7 @@ contract("GeneralTransferManager", accounts => { latestTime(), latestTime() + duration.days(80), expiryTime + duration.days(200), - 1, + true, validFrom, validTo, nonce, @@ -632,7 +507,7 @@ contract("GeneralTransferManager", accounts => { latestTime(), latestTime() + duration.days(80), expiryTime + duration.days(200), - 1, + true, validFrom, validTo, nonce, @@ -672,7 +547,7 @@ contract("GeneralTransferManager", accounts => { latestTime(), latestTime() + duration.days(80), expiryTime + duration.days(200), - 1, + true, validFrom, validTo, nonce, @@ -688,7 +563,7 @@ contract("GeneralTransferManager", accounts => { latestTime(), latestTime() + duration.days(80), expiryTime + duration.days(200), - 1, + true, validFrom, validTo, nonce, @@ -795,7 +670,7 @@ contract("GeneralTransferManager", accounts => { [fromTime, fromTime], [toTime, toTime], [expiryTime, expiryTime], - [1, 1], + [true, true], { from: account_delegate, gas: 6000000 @@ -815,7 +690,7 @@ contract("GeneralTransferManager", accounts => { [fromTime], [toTime, toTime], [expiryTime, expiryTime], - [1, 1], + [true, true], { from: account_delegate, gas: 6000000 @@ -835,7 +710,7 @@ contract("GeneralTransferManager", accounts => { [fromTime, fromTime], [toTime], [expiryTime, expiryTime], - [1, 1], + [true, true], { from: account_delegate, gas: 6000000 @@ -855,7 +730,7 @@ contract("GeneralTransferManager", accounts => { [fromTime, fromTime], [toTime, toTime], [expiryTime], - [1, 1], + [true, true], { from: account_delegate, gas: 6000000 @@ -874,7 +749,7 @@ contract("GeneralTransferManager", accounts => { [fromTime, fromTime], [toTime, toTime], [expiryTime, expiryTime], - [1, 1], + [true, true], { from: token_owner, gas: 6000000 @@ -961,6 +836,3 @@ contract("GeneralTransferManager", accounts => { }) }); }); - -function range1(i) {return i?range1(i-1).concat(i):[]} -function rangeB(i) {return i?rangeB(i-1).concat(0):[]} diff --git a/test/helpers/createInstances.js b/test/helpers/createInstances.js index a6118741f..2021d350e 100644 --- a/test/helpers/createInstances.js +++ b/test/helpers/createInstances.js @@ -8,8 +8,6 @@ const CappedSTOFactory = artifacts.require("./CappedSTOFactory.sol"); const SecurityTokenRegistryProxy = artifacts.require("./SecurityTokenRegistryProxy.sol"); const SecurityTokenRegistry = artifacts.require("./SecurityTokenRegistry.sol"); const SecurityTokenRegistryMock = artifacts.require("./SecurityTokenRegistryMock.sol"); -const ERC20DividendCheckpoint = artifacts.require("./ERC20DividendCheckpoint.sol"); -const EtherDividendCheckpoint = artifacts.require("./EtherDividendCheckpoint.sol"); const ERC20DividendCheckpointFactory = artifacts.require("./ERC20DividendCheckpointFactory.sol"); const EtherDividendCheckpointFactory = artifacts.require("./EtherDividendCheckpointFactory.sol"); const ManualApprovalTransferManagerFactory = artifacts.require("./ManualApprovalTransferManagerFactory.sol"); @@ -22,7 +20,6 @@ const USDTieredSTOProxyFactory = artifacts.require("./USDTieredSTOProxyFactory") const ManualApprovalTransferManager = artifacts.require("./ManualApprovalTransferManager"); const FeatureRegistry = artifacts.require("./FeatureRegistry.sol"); const STFactory = artifacts.require("./STFactory.sol"); -const GeneralTransferManager = artifacts.require("./GeneralTransferManager.sol"); const GeneralTransferManagerFactory = artifacts.require("./GeneralTransferManagerFactory.sol"); const GeneralPermissionManagerFactory = artifacts.require("./GeneralPermissionManagerFactory.sol"); const CountTransferManagerFactory = artifacts.require("./CountTransferManagerFactory.sol"); @@ -48,13 +45,10 @@ let I_SingleTradeVolumeRestrictionManagerFactory; let I_ManualApprovalTransferManagerFactory; let I_VolumeRestrictionTransferManagerFactory; let I_PercentageTransferManagerFactory; -let I_EtherDividendCheckpointLogic; let I_EtherDividendCheckpointFactory; let I_CountTransferManagerFactory; -let I_ERC20DividendCheckpointLogic; let I_ERC20DividendCheckpointFactory; let I_GeneralPermissionManagerFactory; -let I_GeneralTransferManagerLogic; let I_GeneralTransferManagerFactory; let I_GeneralTransferManager; let I_ModuleRegistryProxy; @@ -88,9 +82,7 @@ export async function setUpPolymathNetwork(account_polymath, token_owner) { let b = await deployFeatureRegistry(account_polymath); // STEP 3: Deploy the ModuleRegistry let c = await deployModuleRegistry(account_polymath); - // STEP 4a: Deploy the GeneralTransferManagerFactory - let logic = await deployGTMLogic(account_polymath); - // STEP 4b: Deploy the GeneralTransferManagerFactory + // STEP 4: Deploy the GeneralTransferManagerFactory let d = await deployGTM(account_polymath); // Step 6: Deploy the STversionProxy contract let e = await deploySTFactory(account_polymath); @@ -135,20 +127,8 @@ async function deployModuleRegistry(account_polymath) { return new Array(I_ModuleRegistry, I_ModuleRegistryProxy, I_MRProxied); } -async function deployGTMLogic(account_polymath) { - I_GeneralTransferManagerLogic = await GeneralTransferManager.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: account_polymath }); - - assert.notEqual( - I_GeneralTransferManagerLogic.address.valueOf(), - "0x0000000000000000000000000000000000000000", - "GeneralTransferManagerLogic contract was not deployed" - ); - - return new Array(I_GeneralTransferManagerLogic); -} - async function deployGTM(account_polymath) { - I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(I_PolyToken.address, 0, 0, 0, I_GeneralTransferManagerLogic.address, { from: account_polymath }); + I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(I_PolyToken.address, 0, 0, 0, { from: account_polymath }); assert.notEqual( I_GeneralTransferManagerFactory.address.valueOf(), @@ -213,7 +193,7 @@ async function registerAndVerifyByMR(factoryAdrress, owner, mr) { /// Deploy the TransferManagers export async function deployGTMAndVerifyed(accountPolymath, MRProxyInstance, polyToken, setupCost) { - I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(polyToken, setupCost, 0, 0, I_GeneralTransferManagerLogic.address, { from: accountPolymath }); + I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath }); assert.notEqual( I_GeneralPermissionManagerFactory.address.valueOf(), @@ -375,8 +355,7 @@ export async function deployUSDTieredSTOAndVerified(accountPolymath, MRProxyInst /// Deploy the Dividend Modules export async function deployERC20DividendAndVerifyed(accountPolymath, MRProxyInstance, polyToken, setupCost) { - I_ERC20DividendCheckpointLogic = await ERC20DividendCheckpoint.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_ERC20DividendCheckpointFactory = await ERC20DividendCheckpointFactory.new(polyToken, setupCost, 0, 0, I_ERC20DividendCheckpointLogic.address, { from: accountPolymath }); + I_ERC20DividendCheckpointFactory = await ERC20DividendCheckpointFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath }); assert.notEqual( I_ERC20DividendCheckpointFactory.address.valueOf(), @@ -388,8 +367,7 @@ export async function deployERC20DividendAndVerifyed(accountPolymath, MRProxyIns } export async function deployEtherDividendAndVerifyed(accountPolymath, MRProxyInstance, polyToken, setupCost) { - I_EtherDividendCheckpointLogic = await EtherDividendCheckpoint.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_EtherDividendCheckpointFactory = await EtherDividendCheckpointFactory.new(polyToken, setupCost, 0, 0, I_EtherDividendCheckpointLogic.address, { from: accountPolymath }); + I_EtherDividendCheckpointFactory = await EtherDividendCheckpointFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath }); assert.notEqual( I_EtherDividendCheckpointFactory.address.valueOf(), diff --git a/test/helpers/signData.js b/test/helpers/signData.js index 2e5c1ad61..ea7476cc3 100644 --- a/test/helpers/signData.js +++ b/test/helpers/signData.js @@ -6,7 +6,7 @@ const ethUtil = require("ethereumjs-util"); function signData(tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, nonce, pk) { let packedData = utils .solidityKeccak256( - ["address", "address", "uint64", "uint64", "uint64", "uint8", "uint64", "uint64", "uint256"], + ["address", "address", "uint256", "uint256", "uint256", "bool", "uint256", "uint256", "uint256"], [tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, nonce] ) .slice(2); diff --git a/test/i_Issuance.js b/test/i_Issuance.js index efcf0db96..ac1fcdd37 100644 --- a/test/i_Issuance.js +++ b/test/i_Issuance.js @@ -215,7 +215,7 @@ contract("Issuance", accounts => { fromTime + duration.days(70), toTime + duration.days(90), expiryTime + duration.days(50), - 1, + true, { from: account_polymath } @@ -271,7 +271,7 @@ contract("Issuance", accounts => { }); it("should add the investor into the whitelist by the delegate", async () => { - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor2, fromTime, toTime, expiryTime, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor2, fromTime, toTime, expiryTime, true, { from: account_delegate, gas: 7000000 }); diff --git a/test/j_manual_approval_transfer_manager.js b/test/j_manual_approval_transfer_manager.js index c817f5c44..0461f287a 100644 --- a/test/j_manual_approval_transfer_manager.js +++ b/test/j_manual_approval_transfer_manager.js @@ -171,7 +171,7 @@ contract("ManualApprovalTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 6000000 @@ -201,7 +201,7 @@ contract("ManualApprovalTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 6000000 @@ -290,7 +290,7 @@ contract("ManualApprovalTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 6000000 diff --git a/test/l_percentage_transfer_manager.js b/test/l_percentage_transfer_manager.js index 530b202c8..b15ee41a0 100644 --- a/test/l_percentage_transfer_manager.js +++ b/test/l_percentage_transfer_manager.js @@ -120,7 +120,7 @@ contract("PercentageTransferManager", accounts => { // STEP 4(b): Deploy the PercentageTransferManager [P_PercentageTransferManagerFactory] = await deployPercentageTMAndVerified(account_polymath, I_MRProxied, I_PolyToken.address, web3.utils.toWei("500", "ether")); - + // Printing all the contract addresses console.log(` --------------------- Polymath Network Smart Contracts: --------------------- @@ -192,7 +192,7 @@ contract("PercentageTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 6000000 @@ -222,7 +222,7 @@ contract("PercentageTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 6000000 @@ -287,7 +287,7 @@ contract("PercentageTransferManager", accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 6000000 diff --git a/test/m_presale_sto.js b/test/m_presale_sto.js index 35a348c30..a89932dc4 100644 --- a/test/m_presale_sto.js +++ b/test/m_presale_sto.js @@ -236,7 +236,7 @@ contract("PreSaleSTO", accounts => { expiryTime = toTime + duration.days(100); // Add the Investor in to the whitelist - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, true, { from: account_issuer, gas: 6000000 }); @@ -277,7 +277,7 @@ contract("PreSaleSTO", accounts => { expiryTime = toTime + duration.days(100); // Add the Investor in to the whitelist - let tx1 = await I_GeneralTransferManager.modifyWhitelist(account_investor2, fromTime, toTime, expiryTime, 1, { + let tx1 = await I_GeneralTransferManager.modifyWhitelist(account_investor2, fromTime, toTime, expiryTime, true, { from: account_issuer, gas: 6000000 }); @@ -285,7 +285,7 @@ contract("PreSaleSTO", accounts => { assert.equal(tx1.logs[0].args._investor, account_investor2, "Failed in adding the investor in whitelist"); // Add the Investor in to the whitelist - let tx2 = await I_GeneralTransferManager.modifyWhitelist(account_investor3, fromTime, toTime, expiryTime, 1, { + let tx2 = await I_GeneralTransferManager.modifyWhitelist(account_investor3, fromTime, toTime, expiryTime, true, { from: account_issuer, gas: 6000000 }); diff --git a/test/o_security_token.js b/test/o_security_token.js index 7d2722a20..52521181e 100644 --- a/test/o_security_token.js +++ b/test/o_security_token.js @@ -193,7 +193,7 @@ contract("SecurityToken", accounts => { let toTime = fromTime + duration.days(100); let expiryTime = toTime + duration.days(100); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_affiliate1, fromTime, toTime, expiryTime, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_affiliate1, fromTime, toTime, expiryTime, true, { from: token_owner, gas: 6000000 }); @@ -212,7 +212,7 @@ contract("SecurityToken", accounts => { let toTime = fromTime + duration.days(100); let expiryTime = toTime + duration.days(100); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_affiliate2, fromTime, toTime, expiryTime, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_affiliate2, fromTime, toTime, expiryTime, true, { from: token_owner, gas: 6000000 }); @@ -517,7 +517,7 @@ contract("SecurityToken", accounts => { toTime = fromTime + duration.days(100); expiryTime = toTime + duration.days(100); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, true, { from: token_owner, gas: 6000000 }); @@ -614,7 +614,7 @@ contract("SecurityToken", accounts => { }); it("Should transfer from whitelist investor1 to whitelist investor 2", async () => { - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor2, fromTime, toTime, expiryTime, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor2, fromTime, toTime, expiryTime, true, { from: token_owner, gas: 500000 }); @@ -636,7 +636,7 @@ contract("SecurityToken", accounts => { it("Should transferFrom from one investor to other", async () => { await I_SecurityToken.approve(account_investor1, 2 * Math.pow(10, 18), { from: account_investor2 }); - let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor3, fromTime, toTime, expiryTime, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor3, fromTime, toTime, expiryTime, true, { from: token_owner, gas: 500000 }); @@ -682,7 +682,7 @@ contract("SecurityToken", accounts => { }); it("Should add the investor in the whitelist by the delegate", async () => { - let tx = await I_GeneralTransferManager.modifyWhitelist(account_temp, fromTime, toTime, expiryTime, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_temp, fromTime, toTime, expiryTime, true, { from: account_delegate, gas: 6000000 }); @@ -722,7 +722,7 @@ contract("SecurityToken", accounts => { }); it("Should remove investor from the whitelist by the delegate", async () => { - let tx = await I_GeneralTransferManager.modifyWhitelist(account_temp, 0, 0, 0, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_temp, 0, 0, 0, true, { from: account_delegate, gas: 6000000 }); @@ -751,7 +751,7 @@ contract("SecurityToken", accounts => { }); it("Should fail in buying to tokens", async () => { - let tx = await I_GeneralTransferManager.modifyWhitelist(account_temp, fromTime, toTime, expiryTime, 1, { + let tx = await I_GeneralTransferManager.modifyWhitelist(account_temp, fromTime, toTime, expiryTime, true, { from: account_delegate, gas: 6000000 }); @@ -939,7 +939,7 @@ contract("SecurityToken", accounts => { latestTime(), latestTime() + duration.seconds(2), latestTime() + duration.days(50), - 1, + true, { from: account_delegate, gas: 6000000 @@ -982,7 +982,7 @@ contract("SecurityToken", accounts => { latestTime(), latestTime() + duration.seconds(2), latestTime() + duration.days(50), - 1, + true, { from: account_delegate, gas: 6000000 diff --git a/test/p_usd_tiered_sto.js b/test/p_usd_tiered_sto.js index 8a274942a..604eb1aaf 100644 --- a/test/p_usd_tiered_sto.js +++ b/test/p_usd_tiered_sto.js @@ -222,7 +222,7 @@ contract("USDTieredSTO", accounts => { I_SecurityTokenRegistryProxy, I_STRProxied ] = instances; - + I_DaiToken = await PolyTokenFaucet.new({from: POLYMATH}); // STEP 4: Deploy the GeneralDelegateManagerFactory [I_GeneralPermissionManagerFactory] = await deployGPMAndVerifyed(POLYMATH, I_MRProxied, I_PolyToken.address, 0); @@ -1005,7 +1005,7 @@ contract("USDTieredSTO", accounts => { let fromTime = latestTime(); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let whitelisted = 1; + let whitelisted = true; await I_GeneralTransferManager.modifyWhitelist(ACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); @@ -1105,7 +1105,7 @@ contract("USDTieredSTO", accounts => { let fromTime = latestTime(); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let whitelisted = 1; + let whitelisted = true; await I_GeneralTransferManager.modifyWhitelist(ACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); @@ -1160,7 +1160,7 @@ contract("USDTieredSTO", accounts => { let fromTime = latestTime(); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let whitelisted = 1; + let whitelisted = true; await I_GeneralTransferManager.modifyWhitelist(ACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); @@ -1230,7 +1230,7 @@ contract("USDTieredSTO", accounts => { let fromTime = latestTime(); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let whitelisted = 1; + let whitelisted = true; await I_GeneralTransferManager.modifyWhitelist(ACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); @@ -1285,7 +1285,7 @@ contract("USDTieredSTO", accounts => { let fromTime = latestTime(); let toTime = latestTime(); let expiryTime = toTime + duration.days(100); - let whitelisted = 1; + let whitelisted = true; await I_GeneralTransferManager.modifyWhitelist(ACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER }); @@ -1353,7 +1353,7 @@ contract("USDTieredSTO", accounts => { let fromTime = latestTime(); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let whitelisted = 1; + let whitelisted = true; const tx1 = await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, whitelisted, { from: ISSUER @@ -4482,7 +4482,7 @@ contract("USDTieredSTO", accounts => { "fundsRaisedUSD not changed as expected" ); }); - + it("should return minted tokens in a tier", async () => { let totalMinted = (await I_USDTieredSTO_Array[0].getTokensSoldByTier.call(0)).toNumber(); let individualMinted = await I_USDTieredSTO_Array[0].getTokensMintedByTier.call(0); @@ -4564,7 +4564,7 @@ contract("USDTieredSTO", accounts => { assert.equal((await I_USDTieredSTOFactory.getSetupCost.call()).toNumber(), STOSetupCost); assert.equal((await I_USDTieredSTOFactory.getTypes.call())[0], 3); assert.equal(web3.utils.hexToString(await I_USDTieredSTOFactory.getName.call()), "USDTieredSTO", "Wrong Module added"); - assert.equal(await I_USDTieredSTOFactory.description.call(), + assert.equal(await I_USDTieredSTOFactory.description.call(), "It allows both accredited and non-accredited investors to contribute into the STO. Non-accredited investors will be capped at a maximum investment limit (as a default or specific to their jurisdiction). Tokens will be sold according to tiers sequentially & each tier has its own price and volume of tokens to sell. Upon receipt of funds (ETH, POLY or DAI), security tokens will automatically transfer to investor’s wallet address", "Wrong Module added"); assert.equal(await I_USDTieredSTOFactory.title.call(), "USD Tiered STO", "Wrong Module added"); diff --git a/test/q_usd_tiered_sto_sim.js b/test/q_usd_tiered_sto_sim.js index 31929ade5..55f84f2b3 100644 --- a/test/q_usd_tiered_sto_sim.js +++ b/test/q_usd_tiered_sto_sim.js @@ -195,7 +195,7 @@ contract("USDTieredSTO Sim", accounts => { I_SecurityTokenRegistryProxy, I_STRProxied ] = instances; - + I_DaiToken = await PolyTokenFaucet.new({from: POLYMATH}); // STEP 5: Deploy the USDTieredSTOFactory @@ -353,13 +353,13 @@ contract("USDTieredSTO Sim", accounts => { let fromTime = latestTime() + duration.days(15); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let canBuyFromSTO = 1; + let canBuyFromSTO = true; await I_GeneralTransferManager.modifyWhitelist(ACCREDITED1, fromTime, toTime, expiryTime, canBuyFromSTO, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(ACCREDITED2, fromTime, toTime, expiryTime, canBuyFromSTO, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED1, fromTime, toTime, expiryTime, canBuyFromSTO, { from: ISSUER }); await I_GeneralTransferManager.modifyWhitelist(NONACCREDITED2, fromTime, toTime, expiryTime, canBuyFromSTO, { from: ISSUER }); - await I_GeneralTransferManager.modifyWhitelist(NOTAPPROVED, fromTime, toTime, expiryTime, 0, { from: ISSUER }); + await I_GeneralTransferManager.modifyWhitelist(NOTAPPROVED, fromTime, toTime, expiryTime, false, { from: ISSUER }); await increaseTime(duration.days(3)); diff --git a/test/r_concurrent_STO.js b/test/r_concurrent_STO.js index 36761308e..7912658a4 100644 --- a/test/r_concurrent_STO.js +++ b/test/r_concurrent_STO.js @@ -2,7 +2,7 @@ import latestTime from "./helpers/latestTime"; import { duration, promisifyLogWatch, latestBlock } from "./helpers/utils"; import { takeSnapshot, increaseTime, revertToSnapshot } from "./helpers/time"; import { encodeProxyCall, encodeModuleCall } from "./helpers/encodeCall"; -import { +import { setUpPolymathNetwork, deployDummySTOAndVerifyed, deployCappedSTOAndVerifyed, @@ -94,7 +94,7 @@ contract("Concurrent STO", accounts => { I_SecurityTokenRegistryProxy, I_STRProxied ] = instances; - + // STEP 2: Deploy the STO Factories [I_CappedSTOFactory] = await deployCappedSTOAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, STOSetupCost); @@ -159,7 +159,7 @@ contract("Concurrent STO", accounts => { let fromTime = latestTime(); let toTime = latestTime() + duration.days(15); let expiryTime = toTime + duration.days(100); - let canBuyFromSTO = 1; + let canBuyFromSTO = true; let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor1, fromTime, toTime, expiryTime, canBuyFromSTO, { from: account_issuer, diff --git a/test/u_module_registry_proxy.js b/test/u_module_registry_proxy.js index 877d173d4..6d00b8fe2 100644 --- a/test/u_module_registry_proxy.js +++ b/test/u_module_registry_proxy.js @@ -9,7 +9,6 @@ const ModuleRegistryProxy = artifacts.require("./ModuleRegistryProxy.sol"); const ModuleRegistry = artifacts.require("./ModuleRegistry.sol"); const STFactory = artifacts.require("./STFactory.sol"); const SecurityToken = artifacts.require("./SecurityToken.sol"); -const GeneralTransferManagerLogic = artifacts.require("./GeneralTransferManager.sol"); const GeneralTransferManagerFactory = artifacts.require("./GeneralTransferManagerFactory.sol"); const GeneralPermissionManagerFactory = artifacts.require("./GeneralPermissionManagerFactory.sol"); @@ -123,9 +122,7 @@ contract("ModuleRegistryProxy", accounts => { await I_MRProxied.updateFromRegistry({ from: account_polymath }); // STEP 4: Deploy the GeneralTransferManagerFactory - let I_GeneralTransferManagerLogic = await GeneralTransferManagerLogic.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: account_polymath }); - - I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(I_PolyToken.address, 0, 0, 0, I_GeneralTransferManagerLogic.address, { + I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(I_PolyToken.address, 0, 0, 0, { from: account_polymath }); diff --git a/test/v_tracked_redemptions.js b/test/v_tracked_redemptions.js index eacddd87e..159564651 100644 --- a/test/v_tracked_redemptions.js +++ b/test/v_tracked_redemptions.js @@ -102,7 +102,7 @@ contract("TrackedRedemption", accounts => { I_STRProxied ] = instances; - + // STEP 4: Deploy the TrackedRedemption [I_TrackedRedemptionFactory] = await deployRedemptionAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, 0); [P_TrackedRedemptionFactory] = await deployRedemptionAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, web3.utils.toWei("500")); @@ -190,7 +190,7 @@ contract("TrackedRedemption", accounts => { latestTime(), latestTime(), latestTime() + duration.days(30), - 1, + true, { from: account_issuer, gas: 500000 @@ -220,7 +220,7 @@ contract("TrackedRedemption", accounts => { latestTime(), latestTime(), latestTime() + duration.days(30), - 1, + true, { from: account_issuer, gas: 500000 diff --git a/test/w_lockup_volume_restriction_transfer_manager.js b/test/w_lockup_volume_restriction_transfer_manager.js index 7646fb031..fe06f3f5c 100644 --- a/test/w_lockup_volume_restriction_transfer_manager.js +++ b/test/w_lockup_volume_restriction_transfer_manager.js @@ -112,7 +112,7 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { STFactory: ${I_STFactory.address} GeneralTransferManagerFactory: ${I_GeneralTransferManagerFactory.address} - LockupVolumeRestrictionTransferManagerFactory: + LockupVolumeRestrictionTransferManagerFactory: ${I_VolumeRestrictionTransferManagerFactory.address} ----------------------------------------------------------------------------- `); @@ -165,7 +165,7 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer }); @@ -192,7 +192,7 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer }); @@ -249,7 +249,7 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer }); @@ -346,14 +346,14 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { // balance should be 9000000000000000000 here (9 eth) let balance = await I_SecurityToken.balanceOf(account_investor2) - + // create a lockup for their entire balance // over 16 seconds total, with 4 periods of 4 seconds each. // this will generate an exception because 9000000000000000000 / 4 = 2250000000000000000 but the token granularity is 1000000000000000000 await catchRevert( I_VolumeRestrictionTransferManager.addLockUp(account_investor2, 16, 4, 0, balance, { from: token_owner }) ); - + }); it("Should prevent the transfer of tokens in a lockup", async() => { @@ -572,7 +572,7 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { }); it("Should revert if the parameters are bad when creating multiple lockups", async() => { - + await catchRevert( // pass in the wrong number of params. txn should revert I_VolumeRestrictionTransferManager.addLockUpMulti( diff --git a/test/x_single_trade_volume_restriction.js b/test/x_single_trade_volume_restriction.js index 25243a638..15c01e68c 100644 --- a/test/x_single_trade_volume_restriction.js +++ b/test/x_single_trade_volume_restriction.js @@ -107,7 +107,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { // STEP 4: Deploy the SingleTradeVolumeRestrictionManagerFactory [I_SingleTradeVolumeRestrictionManagerFactory] = await deploySingleTradeVolumeRMAndVerified(account_polymath, I_MRProxied, I_PolyToken.address, 0); [P_SingleTradeVolumeRestrictionManagerFactory] = await deploySingleTradeVolumeRMAndVerified(account_polymath, I_MRProxied, I_PolyToken.address, web3.utils.toWei("500")); - + }); describe("Generate the SecurityToken", async () => { @@ -165,7 +165,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, { + true, { from: account_issuer }); @@ -193,7 +193,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, { + true, { from: account_issuer }); @@ -212,7 +212,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { // it("Fails to attach the SingleTradeVolumeRestrictionManager with the security token due to fees not paid", async () => { let managerArgs = encodeModuleCall(STVRParameters, [true, 90, false]); - + await I_PolyToken.getTokens(web3.utils.toWei("500", "ether"), token_owner); await catchRevert( I_SecurityToken.addModule(P_SingleTradeVolumeRestrictionManagerFactory.address, managerArgs, web3.utils.toWei("500", "ether"), 0, { from: token_owner}) @@ -222,7 +222,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { it("Should successfully attach the Paid SingleTradeVolumeRestrictionManager with the security token", async () => { let managerArgs = encodeModuleCall(STVRParameters, [false, 90, false]); await I_PolyToken.transfer(I_SecurityToken.address, web3.utils.toWei("500", "ether"), { from: token_owner }); - + let tx = await I_SecurityToken.addModule(P_SingleTradeVolumeRestrictionManagerFactory.address, managerArgs, web3.utils.toWei("500", "ether"), 0, { from: token_owner }); @@ -291,7 +291,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { I_SingleTradeVolumeRestrictionManager.addExemptWallet(accounts[5]) ); - await catchRevert( + await catchRevert( I_SingleTradeVolumeRestrictionManager.addExemptWallet(zero_address, { from: token_owner }) ); @@ -342,7 +342,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { await catchRevert ( I_SingleTradeVolumeRestrictionPercentageManager.setTransferLimitInPercentage(accounts[4], 101 * 10 ** 16, { from: token_owner }) ); - // Transfer limit in tokens can not be set for a manager that has transfer limit set as percentage + // Transfer limit in tokens can not be set for a manager that has transfer limit set as percentage await catchRevert ( I_SingleTradeVolumeRestrictionPercentageManager.setTransferLimitInTokens(accounts[4], 1, { from: token_owner }) ); @@ -393,7 +393,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { from: token_owner }); assert.equal(tx.logs[0].args._amount, 10, "Global Limit not set"); - + //Global limit can be set by non-admins await catchRevert( I_SingleTradeVolumeRestrictionPercentageManager.changeGlobalLimitInTokens(89) @@ -542,7 +542,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, { + true, { from: account_issuer } ); @@ -552,7 +552,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, { + true, { from: account_issuer } ); @@ -562,7 +562,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, { + true, { from: account_issuer } ); @@ -667,7 +667,7 @@ contract('SingleTradeVolumeRestrictionManager', accounts => { }); it('should change transfer limits to tokens', async () => { - // Should not change to percentage again + // Should not change to percentage again await catchRevert( I_SingleTradeVolumeRestrictionPercentageManager.changeTransferLimitToPercentage(1, { from: token_owner }) ); diff --git a/test/y_scheduled_checkpoints.js b/test/y_scheduled_checkpoints.js index 864c6b9a1..5fcc03a74 100644 --- a/test/y_scheduled_checkpoints.js +++ b/test/y_scheduled_checkpoints.js @@ -192,7 +192,7 @@ contract('ScheduledCheckpoint', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 6000000 @@ -235,7 +235,7 @@ contract('ScheduledCheckpoint', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 6000000 @@ -270,7 +270,7 @@ contract('ScheduledCheckpoint', accounts => { latestTime(), latestTime(), latestTime() + duration.days(10), - 1, + true, { from: account_issuer, gas: 6000000 diff --git a/yarn.lock b/yarn.lock index 31973936e..27308427c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,10 +5,12 @@ "@soldoc/markdown@^0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@soldoc/markdown/-/markdown-0.1.0.tgz#9f85be75049af9721b5129f133d52dafbf5f671e" + integrity sha512-V0UnvVVJ1qDzpuKLMuh7oHG94puwi8BI3t99Vrr7dQgIHuJdfZJ4SbGuWuFV/fSthyH++WY4ePO3d6gxfZ2//w== "@soldoc/soldoc@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@soldoc/soldoc/-/soldoc-0.4.3.tgz#24ffee9264228e1c3edd61fd3162d63587954933" + integrity sha1-JP/ukmQijhw+3WH9MWLWNYeVSTM= dependencies: "@soldoc/markdown" "^0.1.0" chalk "^2.3.1" @@ -22,26 +24,31 @@ abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== abbrev@1.0.x: version "1.0.9" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" + integrity sha1-kbR5JYinc4wl813W9jdSovh3YTU= abstract-leveldown@~2.6.0: version "2.6.3" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz#1c5e8c6a5ef965ae8c35dfb3a8770c476b82c4b8" + integrity sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA== dependencies: xtend "~4.0.0" abstract-leveldown@~2.7.1: version "2.7.2" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz#87a44d7ebebc341d59665204834c8b7e0932cc93" + integrity sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w== dependencies: xtend "~4.0.0" accepts@~1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" + integrity sha1-63d99gEXI6OxTopywIBcjoZ0a9I= dependencies: mime-types "~2.1.18" negotiator "0.6.1" @@ -49,46 +56,56 @@ accepts@~1.3.5: acorn-dynamic-import@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4" + integrity sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ= dependencies: acorn "^4.0.3" acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + integrity sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s= dependencies: acorn "^3.0.4" acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + integrity sha1-ReN/s56No/JbruP/U2niu18iAXo= acorn@^4.0.3: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" + integrity sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c= acorn@^5.0.0, acorn@^5.5.0: version "5.7.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== aes-js@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" + integrity sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0= aes-js@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.1.tgz#89fd1f94ae51b4c72d62466adc1a7323ff52f072" + integrity sha512-cEA0gBelItZZV7iBiL8ApCiNgc+gBWJJ4uoORhbu6vOqAJ0UL9wIlxr4RI7ij9SSVzy6AnPwiu37kVYiHCl3nw== ajv-keywords@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" + integrity sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I= ajv-keywords@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" + integrity sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo= ajv@^5.1.1, ajv@^5.2.2, ajv@^5.2.3, ajv@^5.3.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= dependencies: co "^4.6.0" fast-deep-equal "^1.0.0" @@ -98,6 +115,7 @@ ajv@^5.1.1, ajv@^5.2.2, ajv@^5.2.3, ajv@^5.3.0: ajv@^6.1.0: version "6.5.4" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.4.tgz#247d5274110db653706b550fcc2b797ca28cfc59" + integrity sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" @@ -107,6 +125,7 @@ ajv@^6.1.0: align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + integrity sha1-DNkKVhCT810KmSVsIrcGlDP60Rc= dependencies: kind-of "^3.0.2" longest "^1.0.1" @@ -115,6 +134,7 @@ align-text@^0.1.1, align-text@^0.1.3: ambi@^2.2.0: version "2.5.0" resolved "https://registry.yarnpkg.com/ambi/-/ambi-2.5.0.tgz#7c8e372be48891157e7cea01cb6f9143d1f74220" + integrity sha1-fI43K+SIkRV+fOoBy2+RQ9H3QiA= dependencies: editions "^1.1.1" typechecker "^4.3.0" @@ -122,36 +142,44 @@ ambi@^2.2.0: amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= ansi-escapes@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" + integrity sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw== ansi-regex@^2.0.0, ansi-regex@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" any-promise@1.3.0, any-promise@^1.0.0, any-promise@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= anymatch@^1.3.0: version "1.3.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== dependencies: micromatch "^2.1.5" normalize-path "^2.0.0" @@ -159,6 +187,7 @@ anymatch@^1.3.0: anymatch@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== dependencies: micromatch "^3.1.4" normalize-path "^2.1.1" @@ -166,10 +195,12 @@ anymatch@^2.0.0: aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== are-we-there-yet@~1.1.2: version "1.1.5" resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== dependencies: delegates "^1.0.0" readable-stream "^2.0.6" @@ -177,56 +208,85 @@ are-we-there-yet@~1.1.2: argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" +arguments-extended@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/arguments-extended/-/arguments-extended-0.0.3.tgz#6107e4917d0eb6f0a4dd66320fc15afc72ef4946" + integrity sha1-YQfkkX0OtvCk3WYyD8Fa/HLvSUY= + dependencies: + extended "~0.0.3" + is-extended "~0.0.8" + arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= dependencies: arr-flatten "^1.0.1" arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= arr-flatten@^1.0.1, arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-extended@~0.0.3, array-extended@~0.0.4, array-extended@~0.0.5: + version "0.0.11" + resolved "https://registry.yarnpkg.com/array-extended/-/array-extended-0.0.11.tgz#d7144ae748de93ca726f121009dbff1626d164bd" + integrity sha1-1xRK50jek8pybxIQCdv/FibRZL0= + dependencies: + arguments-extended "~0.0.3" + extended "~0.0.3" + is-extended "~0.0.3" array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= dependencies: array-uniq "^1.0.1" array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= asn1.js@^4.0.0: version "4.10.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" + integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== dependencies: bn.js "^4.0.0" inherits "^2.0.1" @@ -235,30 +295,36 @@ asn1.js@^4.0.0: asn1@~0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== dependencies: safer-buffer "~2.1.0" assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= assert@^1.1.1: version "1.4.1" resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" + integrity sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE= dependencies: util "0.10.3" assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + integrity sha1-GdOGodntxufByF04iu28xW0zYC0= async-eventemitter@^0.2.2: version "0.2.4" resolved "https://registry.yarnpkg.com/async-eventemitter/-/async-eventemitter-0.2.4.tgz#f5e7c8ca7d3e46aab9ec40a292baf686a0bafaca" + integrity sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw== dependencies: async "^2.4.0" @@ -271,44 +337,49 @@ async-eventemitter@ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a async-limiter@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== async@1.x, async@^1.4.2, async@~1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.4.1, async@^2.5.0: version "2.6.1" resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" + integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== dependencies: lodash "^4.17.10" -async@~0.9.0: - version "0.9.2" - resolved "http://registry.npmjs.org/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" - async@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async/-/async-1.0.0.tgz#f8fc04ca3a13784ade9e1641af98578cfbd647a9" + integrity sha1-+PwEyjoTeErenhZBr5hXjPvWR6k= asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= atob@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= aws4@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= dependencies: chalk "^1.1.3" esutils "^2.0.2" @@ -317,6 +388,7 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: babel-core@^6.0.14, babel-core@^6.26.0: version "6.26.3" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== dependencies: babel-code-frame "^6.26.0" babel-generator "^6.26.0" @@ -341,6 +413,7 @@ babel-core@^6.0.14, babel-core@^6.26.0: babel-generator@^6.26.0: version "6.26.1" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== dependencies: babel-messages "^6.23.0" babel-runtime "^6.26.0" @@ -354,6 +427,7 @@ babel-generator@^6.26.0: babel-helper-bindify-decorators@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz#14c19e5f142d7b47f19a52431e52b1ccbc40a330" + integrity sha1-FMGeXxQte0fxmlJDHlKxzLxAozA= dependencies: babel-runtime "^6.22.0" babel-traverse "^6.24.1" @@ -362,6 +436,7 @@ babel-helper-bindify-decorators@^6.24.1: babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + integrity sha1-zORReto1b0IgvK6KAsKzRvmlZmQ= dependencies: babel-helper-explode-assignable-expression "^6.24.1" babel-runtime "^6.22.0" @@ -370,6 +445,7 @@ babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: babel-helper-call-delegate@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + integrity sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340= dependencies: babel-helper-hoist-variables "^6.24.1" babel-runtime "^6.22.0" @@ -379,6 +455,7 @@ babel-helper-call-delegate@^6.24.1: babel-helper-define-map@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + integrity sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8= dependencies: babel-helper-function-name "^6.24.1" babel-runtime "^6.26.0" @@ -388,6 +465,7 @@ babel-helper-define-map@^6.24.1: babel-helper-explode-assignable-expression@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + integrity sha1-8luCz33BBDPFX3BZLVdGQArCLKo= dependencies: babel-runtime "^6.22.0" babel-traverse "^6.24.1" @@ -396,6 +474,7 @@ babel-helper-explode-assignable-expression@^6.24.1: babel-helper-explode-class@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz#7dc2a3910dee007056e1e31d640ced3d54eaa9eb" + integrity sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes= dependencies: babel-helper-bindify-decorators "^6.24.1" babel-runtime "^6.22.0" @@ -405,6 +484,7 @@ babel-helper-explode-class@^6.24.1: babel-helper-function-name@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + integrity sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= dependencies: babel-helper-get-function-arity "^6.24.1" babel-runtime "^6.22.0" @@ -415,6 +495,7 @@ babel-helper-function-name@^6.24.1: babel-helper-get-function-arity@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + integrity sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -422,6 +503,7 @@ babel-helper-get-function-arity@^6.24.1: babel-helper-hoist-variables@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + integrity sha1-HssnaJydJVE+rbyZFKc/VAi+enY= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -429,6 +511,7 @@ babel-helper-hoist-variables@^6.24.1: babel-helper-optimise-call-expression@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + integrity sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -436,6 +519,7 @@ babel-helper-optimise-call-expression@^6.24.1: babel-helper-regex@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + integrity sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI= dependencies: babel-runtime "^6.26.0" babel-types "^6.26.0" @@ -444,6 +528,7 @@ babel-helper-regex@^6.24.1: babel-helper-remap-async-to-generator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + integrity sha1-XsWBgnrXI/7N04HxySg5BnbkVRs= dependencies: babel-helper-function-name "^6.24.1" babel-runtime "^6.22.0" @@ -454,6 +539,7 @@ babel-helper-remap-async-to-generator@^6.24.1: babel-helper-replace-supers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + integrity sha1-v22/5Dk40XNpohPKiov3S2qQqxo= dependencies: babel-helper-optimise-call-expression "^6.24.1" babel-messages "^6.23.0" @@ -465,6 +551,7 @@ babel-helper-replace-supers@^6.24.1: babel-helpers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= dependencies: babel-runtime "^6.22.0" babel-template "^6.24.1" @@ -472,50 +559,61 @@ babel-helpers@^6.24.1: babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= dependencies: babel-runtime "^6.22.0" babel-plugin-check-es2015-constants@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + integrity sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o= dependencies: babel-runtime "^6.22.0" babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + integrity sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU= babel-plugin-syntax-async-generators@^6.5.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" + integrity sha1-a8lj67FuzLrmuStZbrfzXDQqi5o= babel-plugin-syntax-class-properties@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" + integrity sha1-1+sjt5oxf4VDlixQW4J8fWysJ94= babel-plugin-syntax-decorators@^6.13.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b" + integrity sha1-MSVjtNvePMgGzuPkFszurd0RrAs= babel-plugin-syntax-dynamic-import@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da" + integrity sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo= babel-plugin-syntax-exponentiation-operator@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + integrity sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4= babel-plugin-syntax-object-rest-spread@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= babel-plugin-syntax-trailing-function-commas@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + integrity sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM= babel-plugin-transform-async-generator-functions@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" + integrity sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds= dependencies: babel-helper-remap-async-to-generator "^6.24.1" babel-plugin-syntax-async-generators "^6.5.0" @@ -524,6 +622,7 @@ babel-plugin-transform-async-generator-functions@^6.24.1: babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + integrity sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E= dependencies: babel-helper-remap-async-to-generator "^6.24.1" babel-plugin-syntax-async-functions "^6.8.0" @@ -532,6 +631,7 @@ babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async- babel-plugin-transform-class-properties@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" + integrity sha1-anl2PqYdM9NvN7YRqp3vgagbRqw= dependencies: babel-helper-function-name "^6.24.1" babel-plugin-syntax-class-properties "^6.8.0" @@ -541,6 +641,7 @@ babel-plugin-transform-class-properties@^6.24.1: babel-plugin-transform-decorators@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz#788013d8f8c6b5222bdf7b344390dfd77569e24d" + integrity sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0= dependencies: babel-helper-explode-class "^6.24.1" babel-plugin-syntax-decorators "^6.13.0" @@ -551,18 +652,21 @@ babel-plugin-transform-decorators@^6.24.1: babel-plugin-transform-es2015-arrow-functions@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + integrity sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + integrity sha1-u8UbSflk1wy42OC5ToICRs46YUE= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es2015-block-scoping@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + integrity sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8= dependencies: babel-runtime "^6.26.0" babel-template "^6.26.0" @@ -573,6 +677,7 @@ babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es20 babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-classes@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + integrity sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= dependencies: babel-helper-define-map "^6.24.1" babel-helper-function-name "^6.24.1" @@ -587,6 +692,7 @@ babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-cla babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transform-es2015-computed-properties@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + integrity sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM= dependencies: babel-runtime "^6.22.0" babel-template "^6.24.1" @@ -594,12 +700,14 @@ babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transfor babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + integrity sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2015-duplicate-keys@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + integrity sha1-c+s9MQypaePvnskcU3QabxV2Qj4= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -607,12 +715,14 @@ babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2 babel-plugin-transform-es2015-for-of@^6.22.0, babel-plugin-transform-es2015-for-of@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + integrity sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + integrity sha1-g0yJhTvDaxrw86TF26qU/Y6sqos= dependencies: babel-helper-function-name "^6.24.1" babel-runtime "^6.22.0" @@ -621,12 +731,14 @@ babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es20 babel-plugin-transform-es2015-literals@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + integrity sha1-T1SgLWzWbPkVKAAZox0xklN3yi4= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + integrity sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ= dependencies: babel-plugin-transform-es2015-modules-commonjs "^6.24.1" babel-runtime "^6.22.0" @@ -635,6 +747,7 @@ babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015 babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: version "6.26.2" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" + integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q== dependencies: babel-plugin-transform-strict-mode "^6.24.1" babel-runtime "^6.26.0" @@ -644,6 +757,7 @@ babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-e babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-es2015-modules-systemjs@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + integrity sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM= dependencies: babel-helper-hoist-variables "^6.24.1" babel-runtime "^6.22.0" @@ -652,6 +766,7 @@ babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-e babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015-modules-umd@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + integrity sha1-rJl+YoXNGO1hdq22B9YCNErThGg= dependencies: babel-plugin-transform-es2015-modules-amd "^6.24.1" babel-runtime "^6.22.0" @@ -660,6 +775,7 @@ babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015 babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es2015-object-super@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + integrity sha1-JM72muIcuDp/hgPa0CH1cusnj40= dependencies: babel-helper-replace-supers "^6.24.1" babel-runtime "^6.22.0" @@ -667,6 +783,7 @@ babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es201 babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015-parameters@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + integrity sha1-V6w1GrScrxSpfNE7CfZv3wpiXys= dependencies: babel-helper-call-delegate "^6.24.1" babel-helper-get-function-arity "^6.24.1" @@ -678,6 +795,7 @@ babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015- babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + integrity sha1-JPh11nIch2YbvZmkYi5R8U3jiqA= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -685,12 +803,14 @@ babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transfo babel-plugin-transform-es2015-spread@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + integrity sha1-1taKmfia7cRTbIGlQujdnxdG+NE= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + integrity sha1-AMHNsaynERLN8M9hJsLta0V8zbw= dependencies: babel-helper-regex "^6.24.1" babel-runtime "^6.22.0" @@ -699,18 +819,21 @@ babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es201 babel-plugin-transform-es2015-template-literals@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + integrity sha1-qEs0UPfp+PH2g51taH2oS7EjbY0= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-typeof-symbol@^6.22.0, babel-plugin-transform-es2015-typeof-symbol@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + integrity sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + integrity sha1-04sS9C6nMj9yk4fxinxa4frrNek= dependencies: babel-helper-regex "^6.24.1" babel-runtime "^6.22.0" @@ -719,6 +842,7 @@ babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es20 babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + integrity sha1-KrDJx/MJj6SJB3cruBP+QejeOg4= dependencies: babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" babel-plugin-syntax-exponentiation-operator "^6.8.0" @@ -727,6 +851,7 @@ babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-e babel-plugin-transform-object-rest-spread@^6.22.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" + integrity sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY= dependencies: babel-plugin-syntax-object-rest-spread "^6.8.0" babel-runtime "^6.26.0" @@ -734,12 +859,14 @@ babel-plugin-transform-object-rest-spread@^6.22.0: babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + integrity sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8= dependencies: regenerator-transform "^0.10.0" babel-plugin-transform-strict-mode@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + integrity sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -747,6 +874,7 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-polyfill@6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= dependencies: babel-runtime "^6.26.0" core-js "^2.5.0" @@ -755,6 +883,7 @@ babel-polyfill@6.26.0: babel-preset-env@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" + integrity sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg== dependencies: babel-plugin-check-es2015-constants "^6.22.0" babel-plugin-syntax-trailing-function-commas "^6.22.0" @@ -790,6 +919,7 @@ babel-preset-env@^1.7.0: babel-preset-es2015@6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" + integrity sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk= dependencies: babel-plugin-check-es2015-constants "^6.22.0" babel-plugin-transform-es2015-arrow-functions "^6.22.0" @@ -819,6 +949,7 @@ babel-preset-es2015@6.24.1: babel-preset-stage-2@6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz#d9e2960fb3d71187f0e64eec62bc07767219bdc1" + integrity sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE= dependencies: babel-plugin-syntax-dynamic-import "^6.18.0" babel-plugin-transform-class-properties "^6.24.1" @@ -828,6 +959,7 @@ babel-preset-stage-2@6.24.1: babel-preset-stage-3@6.24.1, babel-preset-stage-3@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395" + integrity sha1-g2raCp56f6N8sTj7kyb4eTSkg5U= dependencies: babel-plugin-syntax-trailing-function-commas "^6.22.0" babel-plugin-transform-async-generator-functions "^6.24.1" @@ -838,6 +970,7 @@ babel-preset-stage-3@6.24.1, babel-preset-stage-3@^6.24.1: babel-register@6.26.0, babel-register@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= dependencies: babel-core "^6.26.0" babel-runtime "^6.26.0" @@ -850,6 +983,7 @@ babel-register@6.26.0, babel-register@^6.26.0: babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= dependencies: core-js "^2.4.0" regenerator-runtime "^0.11.0" @@ -857,6 +991,7 @@ babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: babel-template@^6.24.1, babel-template@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= dependencies: babel-runtime "^6.26.0" babel-traverse "^6.26.0" @@ -867,6 +1002,7 @@ babel-template@^6.24.1, babel-template@^6.26.0: babel-traverse@^6.24.1, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= dependencies: babel-code-frame "^6.26.0" babel-messages "^6.23.0" @@ -881,6 +1017,7 @@ babel-traverse@^6.24.1, babel-traverse@^6.26.0: babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= dependencies: babel-runtime "^6.26.0" esutils "^2.0.2" @@ -890,6 +1027,7 @@ babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: babelify@^7.3.0: version "7.3.0" resolved "https://registry.yarnpkg.com/babelify/-/babelify-7.3.0.tgz#aa56aede7067fd7bd549666ee16dc285087e88e5" + integrity sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU= dependencies: babel-core "^6.0.14" object-assign "^4.0.0" @@ -897,28 +1035,34 @@ babelify@^7.3.0: babylon@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= base-x@^3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.4.tgz#94c1788736da065edb1d68808869e357c977fa77" + integrity sha512-UYOadoSIkEI/VrRGSG6qp93rp2WdokiAiNYDfGW5qURAY8GiAQkvMbwNNSDYiVJopqv4gCna7xqf4rrNGp+5AA== dependencies: safe-buffer "^5.0.1" base64-js@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978" + integrity sha1-EQHpVE9KdrG8OybUUsqW16NeeXg= base64-js@^1.0.2: version "1.3.0" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" + integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== dependencies: cache-base "^1.0.1" class-utils "^0.3.5" @@ -931,24 +1075,29 @@ base@^0.11.1: bcrypt-pbkdf@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= dependencies: tweetnacl "^0.14.3" big.js@^3.1.3: version "3.2.0" resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" + integrity sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q== bignumber.js@^4.0.2: version "4.1.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1" + integrity sha512-eJzYkFYy9L4JzXsbymsFn3p54D+llV27oTQ+ziJG7WFRheJcNZilgVXMG0LoZtlQSKBsJdWtLFqOD0u+U0jZKA== bignumber.js@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-5.0.0.tgz#fbce63f09776b3000a83185badcde525daf34833" + integrity sha512-KWTu6ZMVk9sxlDJQh2YH1UOnfDP8O8TpxUxgQG/vKASoSnEjK9aVuOueFaPcQEYQ5fyNXNTOYwYw3099RYebWg== bignumber.js@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-6.0.0.tgz#bbfa047644609a5af093e9cbd83b0461fa3f6002" + integrity sha512-x247jIuy60/+FtMRvscqfxtVHQf8AGx2hm9c6btkgC0x/hp9yt+teISNhvF8WlwRkCc5yF2fDECH8SIMe8j+GA== "bignumber.js@git+https://github.com/debris/bignumber.js#master": version "2.0.7" @@ -965,20 +1114,24 @@ bignumber.js@^6.0.0: binary-extensions@^1.0.0: version "1.12.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" + integrity sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg== bindings@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7" + integrity sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw== bip66@^1.1.3: version "1.1.5" resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" + integrity sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI= dependencies: safe-buffer "^5.0.1" bitcore-lib@^0.15.0: version "0.15.0" resolved "https://registry.yarnpkg.com/bitcore-lib/-/bitcore-lib-0.15.0.tgz#f924be13869f2aab7e04aeec5642ad3359b6cec2" + integrity sha512-AeXLWhiivF6CDFzrABZHT4jJrflyylDWTi32o30rF92HW9msfuKpjzrHtFKYGa9w0kNVv5HABQjCB3OEav4PhQ== dependencies: bn.js "=4.11.8" bs58 "=4.0.1" @@ -990,6 +1143,7 @@ bitcore-lib@^0.15.0: bitcore-mnemonic@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bitcore-mnemonic/-/bitcore-mnemonic-1.5.0.tgz#c7e785beb6bf0616ed4992785dc3658670425a39" + integrity sha512-sbeP4xwkindLMfIQhVxj6rZSDMwtiKmfc1DqvwpR6Yg+Qo4I4WHO5pvzb12Y04uDh1N3zgD45esHhfH0HHmE4g== dependencies: bitcore-lib "^0.15.0" unorm "^1.3.3" @@ -997,6 +1151,7 @@ bitcore-mnemonic@^1.5.0: bl@^1.0.0: version "1.2.2" resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" + integrity sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA== dependencies: readable-stream "^2.3.5" safe-buffer "^5.1.1" @@ -1004,32 +1159,39 @@ bl@^1.0.0: block-stream@*: version "0.0.9" resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + integrity sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo= dependencies: inherits "~2.0.0" bluebird@^2.9.34: version "2.11.0" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1" + integrity sha1-U0uQM8AiyVecVro7Plpcqvu2UOE= bluebird@^3.4.6, bluebird@^3.5.0: version "3.5.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.2.tgz#1be0908e054a751754549c270489c1505d4ab15a" + integrity sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg== bn.js@4.11.6: version "4.11.6" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" + integrity sha1-UzRK2xRhehP26N0s4okF0cC6MhU= bn.js@=4.11.8, bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.3, bn.js@^4.11.6, bn.js@^4.4.0, bn.js@^4.8.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== bn.js@^2.0.3: version "2.2.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-2.2.0.tgz#12162bc2ae71fc40a5626c33438f3a875cd37625" + integrity sha1-EhYrwq5x/EClYmwzQ486h1zTdiU= body-parser@1.18.3, body-parser@^1.16.0: version "1.18.3" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" + integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= dependencies: bytes "3.0.0" content-type "~1.0.4" @@ -1045,6 +1207,7 @@ body-parser@1.18.3, body-parser@^1.16.0: borc@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/borc/-/borc-2.0.3.tgz#08845ea73a6d3211120928ee3929f8dc2de9f52e" + integrity sha512-2mfipKUXn7yLgwn8D5jZkJqd2ZyzqmYZQX/9d4On33oGNDLwxj5qQMst+nkKyEdaujQRFfrZCId+k8wehQVANg== dependencies: bignumber.js "^6.0.0" commander "^2.15.0" @@ -1054,6 +1217,7 @@ borc@^2.0.2: brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" @@ -1061,6 +1225,7 @@ brace-expansion@^1.1.7: braces@^1.8.2: version "1.8.5" resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= dependencies: expand-range "^1.8.1" preserve "^0.2.0" @@ -1069,6 +1234,7 @@ braces@^1.8.2: braces@^2.3.0, braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== dependencies: arr-flatten "^1.1.0" array-unique "^0.3.2" @@ -1084,18 +1250,22 @@ braces@^2.3.0, braces@^2.3.1: brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= browser-stdout@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" + integrity sha1-81HTKWnTL6XXpVZxVCY9korjvR8= browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.0.6: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== dependencies: buffer-xor "^1.0.3" cipher-base "^1.0.0" @@ -1107,6 +1277,7 @@ browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.0.6: browserify-cipher@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== dependencies: browserify-aes "^1.0.4" browserify-des "^1.0.0" @@ -1115,6 +1286,7 @@ browserify-cipher@^1.0.0: browserify-des@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== dependencies: cipher-base "^1.0.1" des.js "^1.0.0" @@ -1124,6 +1296,7 @@ browserify-des@^1.0.0: browserify-rsa@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= dependencies: bn.js "^4.1.0" randombytes "^2.0.1" @@ -1131,12 +1304,14 @@ browserify-rsa@^4.0.0: browserify-sha3@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/browserify-sha3/-/browserify-sha3-0.0.1.tgz#3ff34a3006ef15c0fb3567e541b91a2340123d11" + integrity sha1-P/NKMAbvFcD7NWflQbkaI0ASPRE= dependencies: js-sha3 "^0.3.1" browserify-sign@^4.0.0: version "4.0.4" resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" + integrity sha1-qk62jl17ZYuqa/alfmMMvXqT0pg= dependencies: bn.js "^4.1.1" browserify-rsa "^4.0.0" @@ -1149,12 +1324,14 @@ browserify-sign@^4.0.0: browserify-zlib@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== dependencies: pako "~1.0.5" browserslist@^3.2.6: version "3.2.8" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" + integrity sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ== dependencies: caniuse-lite "^1.0.30000844" electron-to-chromium "^1.3.47" @@ -1162,16 +1339,19 @@ browserslist@^3.2.6: bs58@=4.0.1, bs58@^4.0.0, bs58@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= dependencies: base-x "^3.0.2" bs58@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/bs58/-/bs58-2.0.1.tgz#55908d58f1982aba2008fa1bed8f91998a29bf8d" + integrity sha1-VZCNWPGYKrogCPob7Y+RmYopv40= bs58check@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== dependencies: bs58 "^4.0.0" create-hash "^1.1.0" @@ -1180,14 +1360,17 @@ bs58check@^2.1.2: bson@^1.0.4: version "1.1.0" resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.0.tgz#bee57d1fb6a87713471af4e32bcae36de814b5b0" + integrity sha512-9Aeai9TacfNtWXOYarkFJRW2CWo+dRon+fuLZYJmvLV3+MiUp0bEI6IAZfXEIg7/Pl/7IWlLaDnhzTsD81etQA== buffer-alloc-unsafe@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" + integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== buffer-alloc@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" + integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== dependencies: buffer-alloc-unsafe "^1.1.0" buffer-fill "^1.0.0" @@ -1195,30 +1378,37 @@ buffer-alloc@^1.2.0: buffer-compare@=1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-compare/-/buffer-compare-1.1.1.tgz#5be7be853af89198d1f4ddc090d1d66a48aef596" + integrity sha1-W+e+hTr4kZjR9N3AkNHWakiu9ZY= buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= buffer-fill@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" + integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== buffer-to-arraybuffer@^0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz#6064a40fa76eb43c723aba9ef8f6e1216d10511a" + integrity sha1-YGSkD6dutDxyOrqe+PbhIW0QURo= buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= buffer@^3.0.1: version "3.6.0" resolved "https://registry.yarnpkg.com/buffer/-/buffer-3.6.0.tgz#a72c936f77b96bf52f5f7e7b467180628551defb" + integrity sha1-pyyTb3e5a/UvX357RnGAYoVR3vs= dependencies: base64-js "0.0.8" ieee754 "^1.1.4" @@ -1227,6 +1417,7 @@ buffer@^3.0.1: buffer@^4.3.0, buffer@^4.9.0: version "4.9.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" + integrity sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg= dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" @@ -1235,6 +1426,7 @@ buffer@^4.3.0, buffer@^4.9.0: buffer@^5.0.5: version "5.2.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" + integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg== dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" @@ -1242,18 +1434,22 @@ buffer@^5.0.5: builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" + integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= cache-base@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== dependencies: collection-visit "^1.0.0" component-emitter "^1.2.1" @@ -1268,28 +1464,34 @@ cache-base@^1.0.1: caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= dependencies: callsites "^0.2.0" callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + integrity sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk= camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo= camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= caminte@0.3.7: version "0.3.7" resolved "https://registry.yarnpkg.com/caminte/-/caminte-0.3.7.tgz#ec1ec0457664a0f092643b7c646c457d5cd6f693" + integrity sha1-7B7ARXZkoPCSZDt8ZGxFfVzW9pM= dependencies: bluebird "^3.4.6" uuid "^3.0.1" @@ -1297,14 +1499,17 @@ caminte@0.3.7: caniuse-lite@^1.0.30000844: version "1.0.30000890" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000890.tgz#86a18ffcc65d79ec6a437e985761b8bf1c4efeaf" + integrity sha512-4NI3s4Y6ROm+SgZN5sLUG4k7nVWQnedis3c/RWkynV5G6cHSY7+a8fwFyn2yoBDE3E6VswhTNNwR3PvzGqlTkg== caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= center-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + integrity sha1-qg0yYptu6XIgBBHL1EYckHvCt60= dependencies: align-text "^0.1.3" lazy-cache "^1.0.3" @@ -1312,6 +1517,7 @@ center-align@^0.1.1: chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= dependencies: ansi-styles "^2.2.1" escape-string-regexp "^1.0.2" @@ -1322,6 +1528,7 @@ chalk@^1.1.3: chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" @@ -1330,16 +1537,19 @@ chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1: chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" + integrity sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I= checkpoint-store@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/checkpoint-store/-/checkpoint-store-1.1.0.tgz#04e4cb516b91433893581e6d4601a78e9552ea06" + integrity sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY= dependencies: functional-red-black-tree "^1.0.1" chokidar@^1.6.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= dependencies: anymatch "^1.3.0" async-each "^1.0.0" @@ -1355,6 +1565,7 @@ chokidar@^1.6.0: chokidar@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" + integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== dependencies: anymatch "^2.0.0" async-each "^1.0.0" @@ -1374,10 +1585,12 @@ chokidar@^2.0.2: chownr@^1.0.1: version "1.1.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" + integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" @@ -1385,10 +1598,12 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: circular-json@^0.3.1: version "0.3.3" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== dependencies: arr-union "^3.1.0" define-property "^0.2.5" @@ -1398,6 +1613,7 @@ class-utils@^0.3.5: cli-color@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-1.3.0.tgz#cd2ec212efbd1a0eeb5b017f17d4e2d15e91420f" + integrity sha512-XmbLr8MzgOup/sPHF4nOZerCOcL7rD7vKWpEl0axUsMAY+AEimOhYva1ksskWqkLGY/bjR9h7Cfbr+RrJRfmTQ== dependencies: ansi-regex "^2.1.1" d "1" @@ -1409,16 +1625,19 @@ cli-color@^1.2.0: cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= dependencies: restore-cursor "^2.0.0" cli-width@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + integrity sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE= dependencies: center-align "^0.1.1" right-align "^0.1.1" @@ -1427,6 +1646,7 @@ cliui@^2.1.0: cliui@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= dependencies: string-width "^1.0.1" strip-ansi "^3.0.1" @@ -1435,6 +1655,7 @@ cliui@^3.2.0: cliui@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== dependencies: string-width "^2.1.1" strip-ansi "^4.0.0" @@ -1443,18 +1664,22 @@ cliui@^4.0.0: clone@2.x, clone@^2.0.0: version "2.1.2" resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= coinstring@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/coinstring/-/coinstring-2.3.0.tgz#cdb63363a961502404a25afb82c2e26d5ff627a4" + integrity sha1-zbYzY6lhUCQEolr7gsLibV/2J6Q= dependencies: bs58 "^2.0.1" create-hash "^1.1.1" @@ -1462,6 +1687,7 @@ coinstring@^2.0.0: collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= dependencies: map-visit "^1.0.0" object-visit "^1.0.0" @@ -1469,70 +1695,85 @@ collection-visit@^1.0.0: color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: color-name "1.1.3" color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= colors@1.0.x: version "1.0.3" resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" + integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= colors@^1.1.2: version "1.3.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.2.tgz#2df8ff573dfbf255af562f8ce7181d6b971a359b" + integrity sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ== combined-stream@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" + integrity sha1-cj599ugBrFYTETp+RFqbactjKBg= dependencies: delayed-stream "~1.0.0" combined-stream@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== dependencies: delayed-stream "~1.0.0" commander@2.11.0: version "2.11.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + integrity sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ== commander@2.15.1: version "2.15.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== commander@^2.11.0, commander@^2.14.1, commander@^2.15.0, commander@^2.8.1, commander@^2.9.0: version "2.19.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" + integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== commander@~2.17.1: version "2.17.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" + integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== commander@~2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4" + integrity sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ= dependencies: graceful-readlink ">= 1.0.0" compare-versions@^3.0.1: version "3.4.0" resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.4.0.tgz#e0747df5c9cb7f054d6d3dc3e1dbc444f9e92b26" + integrity sha512-tK69D7oNXXqUW3ZNo/z7NXTEz22TCF0pTE+YF9cxvaAM9XnkLo1fV621xCLrRR6aevJlKxExkss0vWqUCUpqdg== component-emitter@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= concat-stream@^1.6.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== dependencies: buffer-from "^1.0.0" inherits "^2.0.3" @@ -1542,62 +1783,76 @@ concat-stream@^1.6.0: console-browserify@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + integrity sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA= dependencies: date-now "^0.1.4" console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= content-disposition@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" + integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ= content-type@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== convert-source-map@^1.5.1: version "1.6.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== dependencies: safe-buffer "~5.1.1" cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= cookie@0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= cookiejar@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.2.tgz#dd8a235530752f988f9a0844f3fc589e3111125c" + integrity sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA== copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= core-js@^2.4.0, core-js@^2.5.0: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" + integrity sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= cors@^2.8.1: version "2.8.4" resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.4.tgz#2bd381f2eb201020105cd50ea59da63090694686" + integrity sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY= dependencies: object-assign "^4" vary "^1" @@ -1605,6 +1860,7 @@ cors@^2.8.1: coveralls@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.2.tgz#f5a0bcd90ca4e64e088b710fa8dda640aea4884f" + integrity sha512-Tv0LKe/MkBOilH2v7WBiTBdudg2ChfGbdXafc/s330djpF3zKOmuehTeRwjXWc7pzfj9FrDUTA7tEx6Div8NFw== dependencies: growl "~> 1.10.0" js-yaml "^3.11.0" @@ -1616,6 +1872,7 @@ coveralls@^3.0.1: create-ecdh@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" + integrity sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw== dependencies: bn.js "^4.1.0" elliptic "^6.0.0" @@ -1623,6 +1880,7 @@ create-ecdh@^4.0.0: create-hash@^1.1.0, create-hash@^1.1.1, create-hash@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== dependencies: cipher-base "^1.0.1" inherits "^2.0.1" @@ -1633,6 +1891,7 @@ create-hash@^1.1.0, create-hash@^1.1.1, create-hash@^1.1.2: create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: version "1.1.7" resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== dependencies: cipher-base "^1.0.3" create-hash "^1.1.0" @@ -1644,6 +1903,7 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: cron-parser@^2.4.0: version "2.6.0" resolved "https://registry.yarnpkg.com/cron-parser/-/cron-parser-2.6.0.tgz#ae2514ceda9ccb540256e201bdd23ae814e03674" + integrity sha512-KGfDDTjBIx85MnVYcdhLccoJH/7jcYW+5Z/t3Wsg2QlJhmmjf+97z+9sQftS71lopOYYapjEKEvmWaCsym5Z4g== dependencies: is-nan "^1.2.1" moment-timezone "^0.5.0" @@ -1651,6 +1911,7 @@ cron-parser@^2.4.0: cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= dependencies: lru-cache "^4.0.1" shebang-command "^1.2.0" @@ -1659,6 +1920,7 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0: crypto-browserify@3.12.0, crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== dependencies: browserify-cipher "^1.0.0" browserify-sign "^4.0.0" @@ -1675,84 +1937,115 @@ crypto-browserify@3.12.0, crypto-browserify@^3.11.0: crypto-js@^3.1.4, crypto-js@^3.1.5: version "3.1.8" resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.1.8.tgz#715f070bf6014f2ae992a98b3929258b713f08d5" + integrity sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU= crypto-js@^3.1.9-1: version "3.1.9-1" resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.1.9-1.tgz#fda19e761fc077e01ffbfdc6e9fdfc59e8806cd8" + integrity sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg= crypto-random-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" + integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= csextends@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/csextends/-/csextends-1.2.0.tgz#6374b210984b54d4495f29c99d3dd069b80543e5" + integrity sha512-S/8k1bDTJIwuGgQYmsRoE+8P+ohV32WhQ0l4zqrc0XDdxOhjQQD7/wTZwCzoZX53jSX3V/qwjT+OkPTxWQcmjg== cycle@1.0.x: version "1.0.3" resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2" + integrity sha1-IegLK+hYD5i0aPN5QwZisEbDStI= d@1: version "1.0.0" resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" + integrity sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8= dependencies: es5-ext "^0.10.9" dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= dependencies: assert-plus "^1.0.0" +date-extended@~0.0.3: + version "0.0.6" + resolved "https://registry.yarnpkg.com/date-extended/-/date-extended-0.0.6.tgz#23802d57dd1bf7818813fe0c32e851a86da267c9" + integrity sha1-I4AtV90b94GIE/4MMuhRqG2iZ8k= + dependencies: + array-extended "~0.0.3" + extended "~0.0.3" + is-extended "~0.0.3" + date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= death@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/death/-/death-1.1.0.tgz#01aa9c401edd92750514470b8266390c66c67318" + integrity sha1-AaqcQB7dknUFFEcLgmY5DGbGcxg= debug@*: version "4.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" + integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== dependencies: ms "^2.1.1" debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" debug@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== dependencies: ms "2.0.0" debug@^3.0.1, debug@^3.1.0: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== dependencies: ms "^2.1.1" decamelize@^1.0.0, decamelize@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +declare.js@~0.0.4: + version "0.0.8" + resolved "https://registry.yarnpkg.com/declare.js/-/declare.js-0.0.8.tgz#0478adff9564c004f51df73d8bc134019d28dcde" + integrity sha1-BHit/5VkwAT1Hfc9i8E0AZ0o3N4= decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= decompress-response@^3.2.0, decompress-response@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= dependencies: mimic-response "^1.0.0" decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/decompress-tar/-/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1" + integrity sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ== dependencies: file-type "^5.2.0" is-stream "^1.1.0" @@ -1761,6 +2054,7 @@ decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: decompress-tarbz2@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz#3082a5b880ea4043816349f378b56c516be1a39b" + integrity sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A== dependencies: decompress-tar "^4.1.0" file-type "^6.1.0" @@ -1771,6 +2065,7 @@ decompress-tarbz2@^4.0.0: decompress-targz@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/decompress-targz/-/decompress-targz-4.1.1.tgz#c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee" + integrity sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w== dependencies: decompress-tar "^4.1.1" file-type "^5.2.0" @@ -1779,6 +2074,7 @@ decompress-targz@^4.0.0: decompress-unzip@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/decompress-unzip/-/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69" + integrity sha1-3qrM39FK6vhVePczroIQ+bSEj2k= dependencies: file-type "^3.8.0" get-stream "^2.2.0" @@ -1788,6 +2084,7 @@ decompress-unzip@^4.0.1: decompress@^4.0.0: version "4.2.0" resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.0.tgz#7aedd85427e5a92dacfe55674a7c505e96d01f9d" + integrity sha1-eu3YVCflqS2s/lVnSnxQXpbQH50= dependencies: decompress-tar "^4.0.0" decompress-tarbz2 "^4.0.0" @@ -1801,52 +2098,57 @@ decompress@^4.0.0: deep-assign@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/deep-assign/-/deep-assign-2.0.0.tgz#ebe06b1f07f08dae597620e3dd1622f371a1c572" + integrity sha1-6+BrHwfwja5ZdiDj3RYi83GhxXI= dependencies: is-obj "^1.0.0" -deep-equal@~0.2.1: - version "0.2.2" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-0.2.2.tgz#84b745896f34c684e98f2ce0e42abaf43bba017d" - deep-equal@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= deferred-leveldown@~1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz#3acd2e0b75d1669924bc0a4b642851131173e1eb" + integrity sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA== dependencies: abstract-leveldown "~2.6.0" define-properties@^1.1.1, define-properties@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== dependencies: object-keys "^1.0.12" define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= dependencies: is-descriptor "^0.1.0" define-property@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= dependencies: is-descriptor "^1.0.0" define-property@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== dependencies: is-descriptor "^1.0.2" isobject "^3.0.1" @@ -1854,10 +2156,12 @@ define-property@^2.0.2: defined@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= del@^2.0.2: version "2.2.2" resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + integrity sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag= dependencies: globby "^5.0.0" is-path-cwd "^1.0.0" @@ -1870,22 +2174,27 @@ del@^2.0.2: delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= delimit-stream@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/delimit-stream/-/delimit-stream-0.1.0.tgz#9b8319477c0e5f8aeb3ce357ae305fc25ea1cd2b" + integrity sha1-m4MZR3wOX4rrPONXrjBfwl6hzSs= depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= des.js@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + integrity sha1-wHTS4qpqipoH29YfmhXCzYPsjsw= dependencies: inherits "^2.0.1" minimalistic-assert "^1.0.0" @@ -1893,28 +2202,34 @@ des.js@^1.0.0: destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= dependencies: repeating "^2.0.0" detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= diff@3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" + integrity sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww== diff@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== dependencies: bn.js "^4.1.0" miller-rabin "^4.0.0" @@ -1923,6 +2238,7 @@ diffie-hellman@^5.0.0: doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= dependencies: esutils "^2.0.2" isarray "^1.0.0" @@ -1930,20 +2246,24 @@ doctrine@1.5.0: doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== dependencies: esutils "^2.0.2" dom-walk@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" + integrity sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg= domain-browser@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== drbg.js@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/drbg.js/-/drbg.js-1.0.1.tgz#3e36b6c42b37043823cdbc332d58f31e2445480b" + integrity sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs= dependencies: browserify-aes "^1.0.6" create-hash "^1.1.2" @@ -1952,16 +2272,19 @@ drbg.js@^1.0.1: duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= eachr@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/eachr/-/eachr-2.0.4.tgz#466f7caa10708f610509e32c807aafe57fc122bf" + integrity sha1-Rm98qhBwj2EFCeMsgHqv5X/BIr8= dependencies: typechecker "^2.0.8" ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= dependencies: jsbn "~0.1.0" safer-buffer "^2.1.0" @@ -1969,10 +2292,12 @@ ecc-jsbn@~0.1.1: editions@^1.1.1, editions@^1.3.3, editions@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/editions/-/editions-1.3.4.tgz#3662cb592347c3168eb8e498a0ff73271d67f50b" + integrity sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg== editions@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/editions/-/editions-2.0.2.tgz#54fdac6fb24b0a1a72ffc1ba0126c10602c3e0bd" + integrity sha512-0B8aSTWUu9+JW99zHoeogavCi+lkE5l35FK0OKe0pCobixJYoeof3ZujtqYzSsU2MskhRadY5V9oWUuyG4aJ3A== dependencies: errlop "^1.0.2" semver "^5.5.0" @@ -1980,14 +2305,17 @@ editions@^2.0.2: ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.3.47: version "1.3.78" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.78.tgz#ecb72b5b166ba6598efb384461d63cad74678ebf" + integrity sha512-p4D/5iX08c3LNep5bWn/X3dFmec1K9le6O43lgRsO/vYKBTH2smWDMDfkGlPtERFcLVkI8xdKW5EokBZODh1xg== elliptic@6.3.3: version "6.3.3" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.3.tgz#5482d9646d54bcb89fd7d994fc9e2e9568876e3f" + integrity sha1-VILZZG1UvLif19mU/J4ulWiHbj8= dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -1997,6 +2325,7 @@ elliptic@6.3.3: elliptic@=6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" + integrity sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8= dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -2009,6 +2338,7 @@ elliptic@=6.4.0: elliptic@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-3.1.0.tgz#c21682ef762769b56a74201609105da11d5f60cc" + integrity sha1-whaC73YnabVqdCAWCRBdoR1fYMw= dependencies: bn.js "^2.0.3" brorand "^1.0.1" @@ -2018,6 +2348,7 @@ elliptic@^3.1.0: elliptic@^6.0.0, elliptic@^6.2.3, elliptic@^6.4.0: version "6.4.1" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a" + integrity sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ== dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -2030,26 +2361,31 @@ elliptic@^6.0.0, elliptic@^6.2.3, elliptic@^6.4.0: emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" + integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= encoding@^0.1.11: version "0.1.12" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" + integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s= dependencies: iconv-lite "~0.4.13" end-of-stream@^1.0.0: version "1.4.1" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== dependencies: once "^1.4.0" enhanced-resolve@^3.4.0: version "3.4.1" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz#0421e339fd71419b3da13d129b3979040230476e" + integrity sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24= dependencies: graceful-fs "^4.1.2" memory-fs "^0.4.0" @@ -2059,28 +2395,33 @@ enhanced-resolve@^3.4.0: eol@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/eol/-/eol-0.9.1.tgz#f701912f504074be35c6117a5c4ade49cd547acd" + integrity sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg== errlop@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/errlop/-/errlop-1.0.3.tgz#dba29c90cf832c3d2ce469fe515d7e5eef2c6676" + integrity sha512-5VTnt0yikY4LlQEfCXVSqfE6oLj1HVM4zVSvAKMnoYjL/zrb6nqiLowZS4XlG7xENfyj7lpYWvT+wfSCr6dtlA== dependencies: editions "^1.3.4" errno@^0.1.3, errno@~0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== dependencies: prr "~1.0.1" error-ex@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== dependencies: is-arrayish "^0.2.1" es-abstract@^1.5.0: version "1.12.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" + integrity sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA== dependencies: es-to-primitive "^1.1.1" function-bind "^1.1.1" @@ -2091,6 +2432,7 @@ es-abstract@^1.5.0: es-to-primitive@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" + integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== dependencies: is-callable "^1.1.4" is-date-object "^1.0.1" @@ -2099,6 +2441,7 @@ es-to-primitive@^1.1.1: es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.45, es5-ext@^0.10.46, es5-ext@^0.10.9, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: version "0.10.46" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.46.tgz#efd99f67c5a7ec789baa3daa7f79870388f7f572" + integrity sha512-24XxRvJXNFwEMpJb3nOkiRJKRoupmjYmOPVlI65Qy2SrtxwOTB+g6ODjBKOtwEHbYrhWRty9xxOWLNdClT2djw== dependencies: es6-iterator "~2.0.3" es6-symbol "~3.1.1" @@ -2107,6 +2450,7 @@ es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.45, es5-ext@^0.10.46, es5-ext@ es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.1, es6-iterator@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= dependencies: d "1" es5-ext "^0.10.35" @@ -2115,6 +2459,7 @@ es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.1, es6-iterator@~2.0 es6-map@^0.1.3: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" + integrity sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA= dependencies: d "1" es5-ext "~0.10.14" @@ -2126,6 +2471,7 @@ es6-map@^0.1.3: es6-set@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" + integrity sha1-0rPsXU2ADO2BjbU40ol02wpzzLE= dependencies: d "1" es5-ext "~0.10.14" @@ -2136,6 +2482,7 @@ es6-set@~0.1.5: es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" + integrity sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc= dependencies: d "1" es5-ext "~0.10.14" @@ -2143,6 +2490,7 @@ es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: es6-weak-map@^2.0.1, es6-weak-map@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" + integrity sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8= dependencies: d "1" es5-ext "^0.10.14" @@ -2152,14 +2500,17 @@ es6-weak-map@^2.0.1, es6-weak-map@^2.0.2: escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= escodegen@1.8.x: version "1.8.1" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" + integrity sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg= dependencies: esprima "^2.7.1" estraverse "^1.9.1" @@ -2171,6 +2522,7 @@ escodegen@1.8.x: escope@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" + integrity sha1-4Bl16BJ4GhY6ba392AOY3GTIicM= dependencies: es6-map "^0.1.3" es6-weak-map "^2.0.1" @@ -2180,10 +2532,12 @@ escope@^3.6.0: eslint-config-standard@^11.0.0: version "11.0.0" resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz#87ee0d3c9d95382dc761958cbb23da9eea31e0ba" + integrity sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw== eslint-import-resolver-node@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" + integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== dependencies: debug "^2.6.9" resolve "^1.5.0" @@ -2191,6 +2545,7 @@ eslint-import-resolver-node@^0.3.1: eslint-module-utils@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746" + integrity sha1-snA2LNiLGkitMIl2zn+lTphBF0Y= dependencies: debug "^2.6.8" pkg-dir "^1.0.0" @@ -2198,6 +2553,7 @@ eslint-module-utils@^2.2.0: eslint-plugin-import@^2.10.0: version "2.14.0" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8" + integrity sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g== dependencies: contains-path "^0.1.0" debug "^2.6.8" @@ -2213,6 +2569,7 @@ eslint-plugin-import@^2.10.0: eslint-plugin-node@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz#bf19642298064379315d7a4b2a75937376fa05e4" + integrity sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw== dependencies: ignore "^3.3.6" minimatch "^3.0.4" @@ -2222,14 +2579,17 @@ eslint-plugin-node@^6.0.1: eslint-plugin-promise@^3.7.0: version "3.8.0" resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.8.0.tgz#65ebf27a845e3c1e9d6f6a5622ddd3801694b621" + integrity sha512-JiFL9UFR15NKpHyGii1ZcvmtIqa3UTwiDAGb8atSffe43qJ3+1czVGN6UtkklpcJ2DVnqvTMzEKRaJdBkAL2aQ== eslint-plugin-standard@^3.0.1: version "3.1.0" resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.1.0.tgz#2a9e21259ba4c47c02d53b2d0c9135d4b1022d47" + integrity sha512-fVcdyuKRr0EZ4fjWl3c+gp1BANFJD1+RaWa2UPYfMZ6jCtp5RG00kSaXnK/dE5sYzt4kaWJ9qdxqUfc0d9kX0w== eslint-scope@^3.7.1: version "3.7.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.3.tgz#bb507200d3d17f60247636160b4826284b108535" + integrity sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA== dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" @@ -2237,10 +2597,12 @@ eslint-scope@^3.7.1: eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== eslint@^4.19.1: version "4.19.1" resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" + integrity sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ== dependencies: ajv "^5.3.0" babel-code-frame "^6.22.0" @@ -2284,6 +2646,7 @@ eslint@^4.19.1: espree@^3.5.4: version "3.5.4" resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" + integrity sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A== dependencies: acorn "^5.5.0" acorn-jsx "^3.0.0" @@ -2291,42 +2654,51 @@ espree@^3.5.4: esprima@2.7.x, esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== dependencies: estraverse "^4.0.0" esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== dependencies: estraverse "^4.1.0" estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" + integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q= estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= eth-block-tracker@^2.2.2: version "2.3.1" resolved "https://registry.yarnpkg.com/eth-block-tracker/-/eth-block-tracker-2.3.1.tgz#ab6d177e5b50128fa06d7ae9e0489c7484bac95e" + integrity sha512-NamWuMBIl8kmkJFVj8WzGatySTzQPQag4Xr677yFxdVtIxACFbL/dQowk0MzEqIKk93U1TwY3MjVU6mOcwZnKA== dependencies: async-eventemitter ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c eth-query "^2.1.0" @@ -2340,6 +2712,7 @@ eth-block-tracker@^2.2.2: eth-lib@0.1.27, eth-lib@^0.1.26: version "0.1.27" resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.1.27.tgz#f0b0fd144f865d2d6bf8257a40004f2e75ca1dd6" + integrity sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA== dependencies: bn.js "^4.11.6" elliptic "^6.4.0" @@ -2352,6 +2725,7 @@ eth-lib@0.1.27, eth-lib@^0.1.26: eth-lib@0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.7.tgz#2f93f17b1e23aec3759cd4a3fe20c1286a3fc1ca" + integrity sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco= dependencies: bn.js "^4.11.6" elliptic "^6.4.0" @@ -2360,6 +2734,7 @@ eth-lib@0.2.7: eth-lightwallet@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/eth-lightwallet/-/eth-lightwallet-3.0.1.tgz#297022932aa568f4e4eb0873bff257f5e5b78709" + integrity sha512-79vVCETy+4l1b6wuOWwjqPW3Bom5ZK46BgkUNwaXhiMG1rrMRHjpjYEWMqH0JHeCzOzB4HBIFz7eK1/4s6w5nA== dependencies: bitcore-lib "^0.15.0" bitcore-mnemonic "^1.5.0" @@ -2376,6 +2751,7 @@ eth-lightwallet@^3.0.1: eth-query@^2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/eth-query/-/eth-query-2.1.2.tgz#d6741d9000106b51510c72db92d6365456a6da5e" + integrity sha1-1nQdkAAQa1FRDHLbktY2VFam2l4= dependencies: json-rpc-random-id "^1.0.0" xtend "^4.0.1" @@ -2383,6 +2759,7 @@ eth-query@^2.1.0: eth-sig-util@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-1.4.2.tgz#8d958202c7edbaae839707fba6f09ff327606210" + integrity sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA= dependencies: ethereumjs-abi "git+https://github.com/ethereumjs/ethereumjs-abi.git" ethereumjs-util "^5.1.1" @@ -2390,6 +2767,7 @@ eth-sig-util@^1.4.2: ethereum-bridge@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/ethereum-bridge/-/ethereum-bridge-0.6.1.tgz#53c93ed7c0e21752a91e5f089a5997e1d6fea228" + integrity sha512-yDTivI85618BoLI71yNRzW6iVcVN2rjnviCIzs0QOCOENj4XpYQhMDGhdqDi8XWDdzTd0Ja/Canuuh3vfE2IcA== dependencies: async "^2.4.1" borc "^2.0.2" @@ -2420,14 +2798,17 @@ ethereum-bridge@^0.6.1: ethereum-common@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.2.0.tgz#13bf966131cce1eeade62a1b434249bb4cb120ca" + integrity sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA== ethereum-common@^0.0.18: version "0.0.18" resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f" + integrity sha1-L9w1dvIykDNYl26znaeDIT/5Uj8= ethereumjs-abi@0.6.4: version "0.6.4" resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.4.tgz#9ba1bb056492d00c27279f6eccd4d58275912c1a" + integrity sha1-m6G7BWSS0AwnJ59uzNTVgnWRLBo= dependencies: bn.js "^4.10.0" ethereumjs-util "^4.3.0" @@ -2442,6 +2823,7 @@ ethereumjs-abi@^0.6.5, "ethereumjs-abi@git+https://github.com/ethereumjs/ethereu ethereumjs-account@^2.0.3: version "2.0.5" resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz#eeafc62de544cb07b0ee44b10f572c9c49e00a84" + integrity sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA== dependencies: ethereumjs-util "^5.0.0" rlp "^2.0.0" @@ -2450,6 +2832,7 @@ ethereumjs-account@^2.0.3: ethereumjs-block@^1.2.2, ethereumjs-block@~1.7.0: version "1.7.1" resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz#78b88e6cc56de29a6b4884ee75379b6860333c3f" + integrity sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg== dependencies: async "^2.0.1" ethereum-common "0.2.0" @@ -2460,22 +2843,26 @@ ethereumjs-block@^1.2.2, ethereumjs-block@~1.7.0: ethereumjs-common@~0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-0.4.1.tgz#27690a24a817b058cc3a2aedef9392e8d7d63984" + integrity sha512-ywYGsOeGCsMNWso5Y4GhjWI24FJv9FK7+VyVKiQgXg8ZRDPXJ7F/kJ1CnjtkjTvDF4e0yqU+FWswlqR3bmZQ9Q== ethereumjs-testrpc-sc@6.1.6: version "6.1.6" resolved "https://registry.yarnpkg.com/ethereumjs-testrpc-sc/-/ethereumjs-testrpc-sc-6.1.6.tgz#290595380b5182814564d4aa38f35b7788aab070" + integrity sha512-iv2qiGBFgk9mn5Nq2enX8dG5WQ7Lk+FCqpnxfPfH4Ns8KLPwttmNOy264nh3SXDJJvcQwz/XnlLteDQVILotbg== dependencies: source-map-support "^0.5.3" ethereumjs-testrpc@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/ethereumjs-testrpc/-/ethereumjs-testrpc-6.0.3.tgz#7a0b87bf3670f92f607f98fa6a78801d9741b124" + integrity sha512-lAxxsxDKK69Wuwqym2K49VpXtBvLEsXr1sryNG4AkvL5DomMdeCBbu3D87UEevKenLHBiT8GTjARwN6Yj039gA== dependencies: webpack "^3.0.0" ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.1, ethereumjs-tx@^1.3.3: version "1.3.7" resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz#88323a2d875b10549b8347e09f4862b546f3d89a" + integrity sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA== dependencies: ethereum-common "^0.0.18" ethereumjs-util "^5.0.0" @@ -2483,6 +2870,7 @@ ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.1, ethereumjs-tx@ ethereumjs-util@^4.3.0: version "4.5.0" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz#3e9428b317eebda3d7260d854fddda954b1f1bc6" + integrity sha1-PpQosxfuvaPXJg2FT93alUsfG8Y= dependencies: bn.js "^4.8.0" create-hash "^1.1.2" @@ -2493,6 +2881,7 @@ ethereumjs-util@^4.3.0: ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.3, ethereumjs-util@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz#3e0c0d1741471acf1036052d048623dee54ad642" + integrity sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA== dependencies: bn.js "^4.11.0" create-hash "^1.1.2" @@ -2505,6 +2894,7 @@ ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereum ethereumjs-vm@^2.0.2: version "2.4.0" resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-2.4.0.tgz#244f1e35f2755e537a13546111d1a4c159d34b13" + integrity sha512-MJ4lCWa5c6LhahhhvoDKW+YGjK00ZQn0RHHLh4L+WaH1k6Qv7/q3uTluew6sJGNCZdlO0yYMDXYW9qyxLHKlgQ== dependencies: async "^2.1.2" async-eventemitter "^0.2.2" @@ -2521,6 +2911,7 @@ ethereumjs-vm@^2.0.2: ethereumjs-wallet@^0.6.0: version "0.6.2" resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.2.tgz#67244b6af3e8113b53d709124b25477b64aeccda" + integrity sha512-DHEKPV9lYORM7dL8602dkb+AgdfzCYz2lxpdYQoD3OwG355LLDuivW9rGuLpDMCry/ORyBYV6n+QCo/71SwACg== dependencies: aes-js "^3.1.1" bs58check "^2.1.2" @@ -2534,6 +2925,7 @@ ethereumjs-wallet@^0.6.0: ethers@^3.0.15: version "3.0.29" resolved "https://registry.yarnpkg.com/ethers/-/ethers-3.0.29.tgz#ce8139955b4ed44456eb6764b089bb117c86775d" + integrity sha512-OGyA5pW5xFC5o/ZV5MfIoVp/EdA1QMg2bMJFf7Kznsz8m7IzzbgsPHTCjzSfKQDs/XDphGyRcA7A6bkIeJL4gw== dependencies: aes-js "3.0.0" bn.js "^4.4.0" @@ -2549,6 +2941,7 @@ ethers@^3.0.15: ethjs-abi@0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/ethjs-abi/-/ethjs-abi-0.1.8.tgz#cd288583ed628cdfadaf8adefa3ba1dbcbca6c18" + integrity sha1-zSiFg+1ijN+tr4re+juh28vKbBg= dependencies: bn.js "4.11.6" js-sha3 "0.5.5" @@ -2557,6 +2950,7 @@ ethjs-abi@0.1.8: ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" + integrity sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk= dependencies: bn.js "4.11.6" number-to-bn "1.7.0" @@ -2564,6 +2958,7 @@ ethjs-unit@0.1.6: ethjs-util@^0.1.3: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" + integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== dependencies: is-hex-prefixed "1.0.0" strip-hex-prefix "1.0.0" @@ -2571,6 +2966,7 @@ ethjs-util@^0.1.3: event-emitter@^0.3.5, event-emitter@~0.3.5: version "0.3.5" resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + integrity sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk= dependencies: d "1" es5-ext "~0.10.14" @@ -2578,18 +2974,22 @@ event-emitter@^0.3.5, event-emitter@~0.3.5: eventemitter3@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.1.1.tgz#47786bdaa087caf7b1b75e73abc5c7d540158cd0" + integrity sha1-R3hr2qCHyvext15zq8XH1UAVjNA= events@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" + integrity sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ= events@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88" + integrity sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA== evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== dependencies: md5.js "^1.3.4" safe-buffer "^5.1.1" @@ -2597,6 +2997,7 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" @@ -2609,12 +3010,14 @@ execa@^0.7.0: expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= dependencies: is-posix-bracket "^0.1.0" expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= dependencies: debug "^2.3.3" define-property "^0.2.5" @@ -2627,12 +3030,14 @@ expand-brackets@^2.1.4: expand-range@^1.8.1: version "1.8.2" resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= dependencies: fill-range "^2.1.0" express@^4.14.0: version "4.16.4" resolved "https://registry.yarnpkg.com/express/-/express-4.16.4.tgz#fddef61926109e24c515ea97fd2f1bdbf62df12e" + integrity sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg== dependencies: accepts "~1.3.5" array-flatten "1.1.1" @@ -2668,12 +3073,14 @@ express@^4.14.0: extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= dependencies: is-extendable "^0.1.0" extend-shallow@^3.0.0, extend-shallow@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= dependencies: assign-symbols "^1.0.0" is-extendable "^1.0.1" @@ -2681,16 +3088,33 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extended@0.0.6, extended@~0.0.3: + version "0.0.6" + resolved "https://registry.yarnpkg.com/extended/-/extended-0.0.6.tgz#7fb8bf7b9dae397586e48570acfd642c78e50669" + integrity sha1-f7i/e52uOXWG5IVwrP1kLHjlBmk= + dependencies: + extender "~0.0.5" + +extender@~0.0.5: + version "0.0.10" + resolved "https://registry.yarnpkg.com/extender/-/extender-0.0.10.tgz#589c07482be61a1460b6d81f9c24aa67e8f324cd" + integrity sha1-WJwHSCvmGhRgttgfnCSqZ+jzJM0= + dependencies: + declare.js "~0.0.4" extendr@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/extendr/-/extendr-2.1.0.tgz#301aa0bbea565f4d2dc8f570f2a22611a8527b56" + integrity sha1-MBqgu+pWX00tyPVw8qImEahSe1Y= dependencies: typechecker "~2.0.1" external-editor@^2.0.4: version "2.2.0" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" + integrity sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A== dependencies: chardet "^0.4.0" iconv-lite "^0.4.17" @@ -2699,12 +3123,14 @@ external-editor@^2.0.4: extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= dependencies: is-extglob "^1.0.0" extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== dependencies: array-unique "^0.3.2" define-property "^1.0.0" @@ -2718,64 +3144,87 @@ extglob@^2.0.4: extract-opts@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/extract-opts/-/extract-opts-2.2.0.tgz#1fa28eba7352c6db480f885ceb71a46810be6d7d" + integrity sha1-H6KOunNSxttID4hc63GkaBC+bX0= dependencies: typechecker "~2.0.1" extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= extsprintf@^1.2.0: version "1.4.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= eyes@0.1.x: version "0.1.8" resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" + integrity sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A= fake-merkle-patricia-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz#4b8c3acfb520afadf9860b1f14cd8ce3402cddd3" + integrity sha1-S4w6z7Ugr635hgsfFM2M40As3dM= dependencies: checkpoint-store "^1.1.0" +fast-csv@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/fast-csv/-/fast-csv-2.4.1.tgz#bd7dd268391f729367b59445b8dd0ad026881b26" + integrity sha1-vX3SaDkfcpNntZRFuN0K0CaIGyY= + dependencies: + extended "0.0.6" + is-extended "0.0.10" + object-extended "0.0.7" + string-extended "0.0.8" + fast-deep-equal@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" + integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= fast-deep-equal@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fd-slicer@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" + integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= dependencies: pend "~1.2.0" fetch-ponyfill@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz#ae3ce5f732c645eab87e4ae8793414709b239893" + integrity sha1-rjzl9zLGReq4fkroeTQUcJsjmJM= dependencies: node-fetch "~1.7.1" figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= dependencies: escape-string-regexp "^1.0.5" file-entry-cache@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= dependencies: flat-cache "^1.2.1" object-assign "^4.0.1" @@ -2783,22 +3232,27 @@ file-entry-cache@^2.0.0: file-type@^3.8.0: version "3.9.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" + integrity sha1-JXoHg4TR24CHvESdEH1SpSZyuek= file-type@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6" + integrity sha1-LdvqfHP/42No365J3DOMBYwritY= file-type@^6.1.0: version "6.2.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919" + integrity sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg== filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= fill-range@^2.1.0: version "2.2.4" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== dependencies: is-number "^2.1.0" isobject "^2.0.0" @@ -2809,6 +3263,7 @@ fill-range@^2.1.0: fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= dependencies: extend-shallow "^2.0.1" is-number "^3.0.0" @@ -2818,6 +3273,7 @@ fill-range@^4.0.0: finalhandler@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" + integrity sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg== dependencies: debug "2.6.9" encodeurl "~1.0.2" @@ -2830,6 +3286,7 @@ finalhandler@1.1.1: find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= dependencies: path-exists "^2.0.0" pinkie-promise "^2.0.0" @@ -2837,12 +3294,14 @@ find-up@^1.0.0: find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= dependencies: locate-path "^2.0.0" flat-cache@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" + integrity sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE= dependencies: circular-json "^0.3.1" del "^2.0.2" @@ -2852,26 +3311,31 @@ flat-cache@^1.2.1: for-each@^0.3.2, for-each@~0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== dependencies: is-callable "^1.1.3" for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= for-own@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= dependencies: for-in "^1.0.1" forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= form-data@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" + integrity sha1-SXBJi+YEwgwAXU9cI67NIda0kJk= dependencies: asynckit "^0.4.0" combined-stream "1.0.6" @@ -2880,24 +3344,29 @@ form-data@~2.3.2: forwarded@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" + integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= dependencies: map-cache "^0.2.2" fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" + integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== fs-extra@^0.30.0: version "0.30.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" + integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= dependencies: graceful-fs "^4.1.2" jsonfile "^2.1.0" @@ -2908,6 +3377,7 @@ fs-extra@^0.30.0: fs-extra@^2.0.0, fs-extra@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-2.1.2.tgz#046c70163cef9aad46b0e4a7fa467fb22d71de35" + integrity sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU= dependencies: graceful-fs "^4.1.2" jsonfile "^2.1.0" @@ -2915,6 +3385,7 @@ fs-extra@^2.0.0, fs-extra@^2.1.2: fs-extra@^4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" + integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== dependencies: graceful-fs "^4.1.2" jsonfile "^4.0.0" @@ -2923,6 +3394,7 @@ fs-extra@^4.0.2: fs-extra@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd" + integrity sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ== dependencies: graceful-fs "^4.1.2" jsonfile "^4.0.0" @@ -2931,12 +3403,14 @@ fs-extra@^5.0.0: fs-minipass@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== dependencies: minipass "^2.2.1" fs-promise@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/fs-promise/-/fs-promise-2.0.3.tgz#f64e4f854bcf689aa8bddcba268916db3db46854" + integrity sha1-9k5PhUvPaJqovdy6JokW2z20aFQ= dependencies: any-promise "^1.3.0" fs-extra "^2.0.0" @@ -2946,14 +3420,17 @@ fs-promise@^2.0.0: fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fs@0.0.1-security: version "0.0.1-security" resolved "https://registry.yarnpkg.com/fs/-/fs-0.0.1-security.tgz#8a7bd37186b6dddf3813f23858b57ecaaf5e41d4" + integrity sha1-invTcYa23d84E/I4WLV+yq9eQdQ= fsevents@^1.0.0, fsevents@^1.2.2: version "1.2.4" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + integrity sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg== dependencies: nan "^2.9.2" node-pre-gyp "^0.10.0" @@ -2961,6 +3438,7 @@ fsevents@^1.0.0, fsevents@^1.2.2: fstream@^1.0.2, fstream@^1.0.8: version "1.0.11" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" + integrity sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE= dependencies: graceful-fs "^4.1.2" inherits "~2.0.0" @@ -2970,20 +3448,24 @@ fstream@^1.0.2, fstream@^1.0.8: function-bind@^1.0.2, function-bind@^1.1.1, function-bind@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= ganache-cli@^6.1.8: version "6.1.8" resolved "https://registry.yarnpkg.com/ganache-cli/-/ganache-cli-6.1.8.tgz#49a8a331683a9652183f82ef1378d17e1814fcd3" + integrity sha512-yXzteu4SIgUL31mnpm9j+x6dpHUw0p/nsRVkcySKq0w+1vDxH9jMErP1QhZAJuTVE6ni4nfvGSNkaQx5cD3jfg== dependencies: source-map-support "^0.5.3" gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -2997,10 +3479,12 @@ gauge@~2.7.3: get-caller-file@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== get-stream@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" + integrity sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4= dependencies: object-assign "^4.0.1" pinkie-promise "^2.0.0" @@ -3008,20 +3492,24 @@ get-stream@^2.2.0: get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= dependencies: assert-plus "^1.0.0" glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= dependencies: glob-parent "^2.0.0" is-glob "^2.0.0" @@ -3029,12 +3517,14 @@ glob-base@^0.3.0: glob-parent@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= dependencies: is-glob "^2.0.0" glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= dependencies: is-glob "^3.1.0" path-dirname "^1.0.0" @@ -3042,6 +3532,7 @@ glob-parent@^3.1.0: glob@7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -3053,6 +3544,7 @@ glob@7.1.2: glob@^5.0.15: version "5.0.15" resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= dependencies: inflight "^1.0.4" inherits "2" @@ -3063,6 +3555,7 @@ glob@^5.0.15: glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.2: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -3074,6 +3567,7 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.2: glob@~6.0.4: version "6.0.4" resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" + integrity sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI= dependencies: inflight "^1.0.4" inherits "2" @@ -3084,6 +3578,7 @@ glob@~6.0.4: global@~4.3.0: version "4.3.2" resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" + integrity sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8= dependencies: min-document "^2.19.0" process "~0.5.1" @@ -3091,14 +3586,17 @@ global@~4.3.0: globals@^11.0.1: version "11.8.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.8.0.tgz#c1ef45ee9bed6badf0663c5cb90e8d1adec1321d" + integrity sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA== globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== globby@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + integrity sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0= dependencies: array-union "^1.0.1" arrify "^1.0.0" @@ -3110,6 +3608,7 @@ globby@^5.0.0: got@7.1.0, got@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" + integrity sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw== dependencies: decompress-response "^3.2.0" duplexer3 "^0.1.4" @@ -3129,22 +3628,27 @@ got@7.1.0, got@^7.1.0: graceful-fs@*, graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= "graceful-readlink@>= 1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" + integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU= growl@1.10.3: version "1.10.3" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" + integrity sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q== growl@1.10.5, "growl@~> 1.10.0": version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== handlebars@^4.0.1: version "4.0.12" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5" + integrity sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA== dependencies: async "^2.5.0" optimist "^0.6.1" @@ -3155,10 +3659,12 @@ handlebars@^4.0.1: har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= har-validator@~5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" + integrity sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA== dependencies: ajv "^5.3.0" har-schema "^2.0.0" @@ -3166,42 +3672,51 @@ har-validator@~5.1.0: has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= dependencies: ansi-regex "^2.0.0" has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= has-symbol-support-x@^1.4.1: version "1.4.2" resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" + integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== has-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= has-to-string-tag-x@^1.2.0: version "1.4.1" resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" + integrity sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw== dependencies: has-symbol-support-x "^1.4.1" has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= dependencies: get-value "^2.0.3" has-values "^0.1.4" @@ -3210,6 +3725,7 @@ has-value@^0.3.1: has-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= dependencies: get-value "^2.0.6" has-values "^1.0.0" @@ -3218,10 +3734,12 @@ has-value@^1.0.0: has-values@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= has-values@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= dependencies: is-number "^3.0.0" kind-of "^4.0.0" @@ -3229,12 +3747,14 @@ has-values@^1.0.0: has@^1.0.1, has@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: function-bind "^1.1.1" hash-base@^3.0.0: version "3.0.4" resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" + integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" @@ -3242,6 +3762,7 @@ hash-base@^3.0.0: hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.5" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.5.tgz#e38ab4b85dfb1e0c40fe9265c0e9b54854c23812" + integrity sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA== dependencies: inherits "^2.0.3" minimalistic-assert "^1.0.1" @@ -3249,6 +3770,7 @@ hash.js@^1.0.0, hash.js@^1.0.3: hdkey@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/hdkey/-/hdkey-1.1.0.tgz#e74e7b01d2c47f797fa65d1d839adb7a44639f29" + integrity sha512-E7aU8pNlWUJbXGjTz/+lKf1LkMcA3hUrC5ZleeizrmLSd++kvf8mSOe3q8CmBDA9j4hdfXO5iY6hGiTUCOV2jQ== dependencies: coinstring "^2.0.0" safe-buffer "^5.1.1" @@ -3257,10 +3779,12 @@ hdkey@^1.0.0: he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= dependencies: hash.js "^1.0.3" minimalistic-assert "^1.0.0" @@ -3269,6 +3793,7 @@ hmac-drbg@^1.0.0: home-or-tmp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.1" @@ -3276,10 +3801,12 @@ home-or-tmp@^2.0.0: hosted-git-info@^2.1.4: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: version "1.6.3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" + integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= dependencies: depd "~1.1.2" inherits "2.0.3" @@ -3289,10 +3816,12 @@ http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: http-https@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b" + integrity sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs= http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= dependencies: assert-plus "^1.0.0" jsprim "^1.2.2" @@ -3301,10 +3830,12 @@ http-signature@~1.2.0: https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= i18n@^0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/i18n/-/i18n-0.8.3.tgz#2d8cf1c24722602c2041d01ba6ae5eaa51388f0e" + integrity sha1-LYzxwkciYCwgQdAbpq5eqlE4jw4= dependencies: debug "*" make-plural "^3.0.3" @@ -3313,39 +3844,41 @@ i18n@^0.8.3: mustache "*" sprintf-js ">=1.0.3" -i@0.3.x: - version "0.3.6" - resolved "https://registry.yarnpkg.com/i/-/i-0.3.6.tgz#d96c92732076f072711b6b10fd7d4f65ad8ee23d" - iconv-lite@0.4.23: version "0.4.23" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== dependencies: safer-buffer ">= 2.1.2 < 3" iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" ieee754@^1.1.4, ieee754@^1.1.8: version "1.1.12" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b" + integrity sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA== ignore-walk@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== dependencies: minimatch "^3.0.4" ignore@^3.3.3, ignore@^3.3.6: version "3.3.10" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== ignorefs@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/ignorefs/-/ignorefs-1.2.0.tgz#da59fb858976e4a5e43702ccd1f282fdbc9e5756" + integrity sha1-2ln7hYl25KXkNwLM0fKC/byeV1Y= dependencies: editions "^1.3.3" ignorepatterns "^1.1.0" @@ -3353,22 +3886,27 @@ ignorefs@^1.0.0: ignorepatterns@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/ignorepatterns/-/ignorepatterns-1.1.0.tgz#ac8f436f2239b5dfb66d5f0d3a904a87ac67cc5e" + integrity sha1-rI9DbyI5td+2bV8NOpBKh6xnzF4= immediate@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c" + integrity sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw= imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= indexof@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" @@ -3376,18 +3914,22 @@ inflight@^1.0.4: inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= inherits@2.0.1, inherits@=2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== inquirer@^3.0.6: version "3.3.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" + integrity sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ== dependencies: ansi-escapes "^3.0.0" chalk "^2.0.0" @@ -3407,76 +3949,91 @@ inquirer@^3.0.6: interpret@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" + integrity sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ= invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== dependencies: loose-envify "^1.0.0" invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= ipaddr.js@1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.8.0.tgz#eaa33d6ddd7ace8f7f6fe0c9ca0440e706738b1e" + integrity sha1-6qM9bd16zo9/b+DJygRA5wZzix4= is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= dependencies: kind-of "^3.0.2" is-accessor-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== dependencies: kind-of "^6.0.0" is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= is-binary-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= dependencies: binary-extensions "^1.0.0" is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== is-builtin-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74= dependencies: builtin-modules "^1.0.0" is-callable@^1.1.3, is-callable@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= dependencies: kind-of "^3.0.2" is-data-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== dependencies: kind-of "^6.0.0" is-date-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== dependencies: is-accessor-descriptor "^0.1.6" is-data-descriptor "^0.1.4" @@ -3485,6 +4042,7 @@ is-descriptor@^0.1.0: is-descriptor@^1.0.0, is-descriptor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== dependencies: is-accessor-descriptor "^1.0.0" is-data-descriptor "^1.0.0" @@ -3493,210 +4051,261 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-dotfile@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= is-equal-shallow@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= dependencies: is-primitive "^2.0.0" is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= is-extendable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== dependencies: is-plain-object "^2.0.4" +is-extended@0.0.10, is-extended@~0.0.3, is-extended@~0.0.8: + version "0.0.10" + resolved "https://registry.yarnpkg.com/is-extended/-/is-extended-0.0.10.tgz#244e140df75bb1c9a3106f412ff182fb534a6d62" + integrity sha1-JE4UDfdbscmjEG9BL/GC+1NKbWI= + dependencies: + extended "~0.0.3" + is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-finite@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= dependencies: number-is-nan "^1.0.0" is-fn@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fn/-/is-fn-1.0.0.tgz#9543d5de7bcf5b08a22ec8a20bae6e286d510d8c" + integrity sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw= is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= dependencies: number-is-nan "^1.0.0" is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= is-function@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" + integrity sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU= is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= dependencies: is-extglob "^1.0.0" is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= dependencies: is-extglob "^2.1.0" is-glob@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= dependencies: is-extglob "^2.1.1" is-hex-prefixed@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" + integrity sha1-fY035q135dEnFIkTxXPggtd39VQ= is-nan@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.2.1.tgz#9faf65b6fb6db24b7f5c0628475ea71f988401e2" + integrity sha1-n69ltvttskt/XAYoR16nH5iEAeI= dependencies: define-properties "^1.1.1" is-natural-number@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" + integrity sha1-q5124dtM7VHjXeDHLr7PCfc0zeg= is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= dependencies: kind-of "^3.0.2" is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= dependencies: kind-of "^3.0.2" is-number@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== is-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= is-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" + integrity sha1-iVJojF7C/9awPsyF52ngKQMINHA= is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= is-path-in-cwd@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" + integrity sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ== dependencies: is-path-inside "^1.0.0" is-path-inside@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= dependencies: path-is-inside "^1.0.1" is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: isobject "^3.0.1" is-posix-bracket@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= is-promise@^2.1, is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= is-regex@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= dependencies: has "^1.0.1" is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== is-retry-allowed@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" + integrity sha1-EaBgVotnM5REAz0BJaYaINVk+zQ= is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= is-symbol@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" + integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== dependencies: has-symbols "^1.0.0" is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= dependencies: isarray "1.0.0" isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= isomorphic-fetch@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" + integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk= dependencies: node-fetch "^1.0.1" whatwg-fetch ">=0.10.0" @@ -3704,10 +4313,12 @@ isomorphic-fetch@^2.2.0: isstream@0.1.x, isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= istanbul@^0.4.5: version "0.4.5" resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" + integrity sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs= dependencies: abbrev "1.0.x" async "1.x" @@ -3727,6 +4338,7 @@ istanbul@^0.4.5: isurl@^1.0.0-alpha5: version "1.0.0" resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" + integrity sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w== dependencies: has-to-string-tag-x "^1.2.0" is-object "^1.0.1" @@ -3734,30 +4346,37 @@ isurl@^1.0.0-alpha5: js-sha3@0.5.5: version "0.5.5" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.5.tgz#baf0c0e8c54ad5903447df96ade7a4a1bca79a4a" + integrity sha1-uvDA6MVK1ZA0R9+Wreekobynmko= js-sha3@0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" + integrity sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc= js-sha3@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.3.1.tgz#86122802142f0828502a0d1dee1d95e253bb0243" + integrity sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM= js-string-escape@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef" + integrity sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8= "js-tokens@^3.0.0 || ^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= js-yaml@3.x, js-yaml@^3.11.0, js-yaml@^3.9.1: version "3.12.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -3765,22 +4384,27 @@ js-yaml@3.x, js-yaml@^3.11.0, js-yaml@^3.9.1: jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= json-loader@^0.5.4: version "0.5.7" resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" + integrity sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w== json-rpc-engine@^3.6.0: version "3.8.0" resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz#9d4ff447241792e1d0a232f6ef927302bb0c62a9" + integrity sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA== dependencies: async "^2.0.1" babel-preset-env "^1.7.0" @@ -3792,68 +4416,82 @@ json-rpc-engine@^3.6.0: json-rpc-error@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/json-rpc-error/-/json-rpc-error-2.0.0.tgz#a7af9c202838b5e905c7250e547f1aff77258a02" + integrity sha1-p6+cICg4tekFxyUOVH8a/3cligI= dependencies: inherits "^2.0.1" json-rpc-random-id@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz#ba49d96aded1444dbb8da3d203748acbbcdec8c8" + integrity sha1-uknZat7RRE27jaPSA3SKy7zeyMg= json-schema-traverse@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + integrity sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8= dependencies: jsonify "~0.0.0" json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= json-text-sequence@^0.1: version "0.1.1" resolved "https://registry.yarnpkg.com/json-text-sequence/-/json-text-sequence-0.1.1.tgz#a72f217dc4afc4629fff5feb304dc1bd51a2f3d2" + integrity sha1-py8hfcSvxGKf/1/rME3BvVGi89I= dependencies: delimit-stream "0.1.0" json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= optionalDependencies: graceful-fs "^4.1.6" jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= optionalDependencies: graceful-fs "^4.1.6" jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= dependencies: assert-plus "1.0.0" extsprintf "1.3.0" @@ -3863,6 +4501,7 @@ jsprim@^1.2.2: keccak@^1.0.2: version "1.4.0" resolved "https://registry.yarnpkg.com/keccak/-/keccak-1.4.0.tgz#572f8a6dbee8e7b3aa421550f9e6408ca2186f80" + integrity sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw== dependencies: bindings "^1.2.1" inherits "^2.0.3" @@ -3872,6 +4511,7 @@ keccak@^1.0.2: keccakjs@^0.2.0, keccakjs@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/keccakjs/-/keccakjs-0.2.1.tgz#1d633af907ef305bbf9f2fa616d56c44561dfa4d" + integrity sha1-HWM6+QfvMFu/ny+mFtVsRFYd+k0= dependencies: browserify-sha3 "^0.0.1" sha3 "^1.1.0" @@ -3879,62 +4519,74 @@ keccakjs@^0.2.0, keccakjs@^0.2.1: kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= dependencies: is-buffer "^1.1.5" kind-of@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= dependencies: is-buffer "^1.1.5" kind-of@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== klaw@^1.0.0: version "1.3.1" resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= optionalDependencies: graceful-fs "^4.1.9" lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= lcid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= dependencies: invert-kv "^1.0.0" lcov-parse@^0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" + integrity sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM= level-codec@~7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-7.0.1.tgz#341f22f907ce0f16763f24bddd681e395a0fb8a7" + integrity sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ== level-errors@^1.0.3: version "1.1.2" resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.1.2.tgz#4399c2f3d3ab87d0625f7e3676e2d807deff404d" + integrity sha512-Sw/IJwWbPKF5Ai4Wz60B52yj0zYeqzObLh8k1Tk88jVmD51cJSKWSYpRyhVIvFzZdvsPqlH5wfhp/yxdsaQH4w== dependencies: errno "~0.1.1" level-errors@~1.0.3: version "1.0.5" resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.0.5.tgz#83dbfb12f0b8a2516bdc9a31c4876038e227b859" + integrity sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig== dependencies: errno "~0.1.1" level-iterator-stream@~1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz#e43b78b1a8143e6fa97a4f485eb8ea530352f2ed" + integrity sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0= dependencies: inherits "^2.0.1" level-errors "^1.0.3" @@ -3944,6 +4596,7 @@ level-iterator-stream@~1.3.0: level-ws@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-0.0.0.tgz#372e512177924a00424b0b43aef2bb42496d228b" + integrity sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos= dependencies: readable-stream "~1.0.15" xtend "~2.1.1" @@ -3951,6 +4604,7 @@ level-ws@0.0.0: levelup@^1.2.1: version "1.3.9" resolved "https://registry.yarnpkg.com/levelup/-/levelup-1.3.9.tgz#2dbcae845b2bb2b6bea84df334c475533bbd82ab" + integrity sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ== dependencies: deferred-leveldown "~1.2.1" level-codec "~7.0.0" @@ -3963,6 +4617,7 @@ levelup@^1.2.1: levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= dependencies: prelude-ls "~1.1.2" type-check "~0.3.2" @@ -3970,6 +4625,7 @@ levn@^0.3.0, levn@~0.3.0: load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" @@ -3980,6 +4636,7 @@ load-json-file@^1.0.0: load-json-file@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" @@ -3989,10 +4646,12 @@ load-json-file@^2.0.0: loader-runner@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.1.tgz#026f12fe7c3115992896ac02ba022ba92971b979" + integrity sha512-By6ZFY7ETWOc9RFaAIb23IjJVcM4dvJC/N57nmdz9RSkMXvAXGI7SyVlAw3v8vjtDRlqThgVDVmTnr9fqMlxkw== loader-utils@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd" + integrity sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0= dependencies: big.js "^3.1.3" emojis-list "^2.0.0" @@ -4001,6 +4660,7 @@ loader-utils@^1.1.0: locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= dependencies: p-locate "^2.0.0" path-exists "^3.0.0" @@ -4008,44 +4668,54 @@ locate-path@^2.0.0: lodash.assign@^4.0.3, lodash.assign@^4.0.6: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" + integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= lodash@4.x, lodash@^4.13.1, lodash@^4.14.2, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== lodash@=4.17.4: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + integrity sha1-eCA6TRwyiuHYbcpkYONptX9AVa4= log-driver@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" + integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== long-timeout@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/long-timeout/-/long-timeout-0.1.1.tgz#9721d788b47e0bcb5a24c2e2bee1a0da55dab514" + integrity sha1-lyHXiLR+C8taJMLivuGg2lXatRQ= longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + integrity sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc= loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: js-tokens "^3.0.0 || ^4.0.0" lowercase-keys@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== lru-cache@^4.0.1: version "4.1.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" + integrity sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA== dependencies: pseudomap "^1.0.2" yallist "^2.1.2" @@ -4053,48 +4723,57 @@ lru-cache@^4.0.1: lru-queue@0.1: version "0.1.0" resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" + integrity sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM= dependencies: es5-ext "~0.10.2" ltgt@~2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" + integrity sha1-81ypHEk/e3PaDgdJUwTxezH4fuU= make-dir@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" + integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== dependencies: pify "^3.0.0" make-plural@^3.0.3, make-plural@~3.0.3: version "3.0.6" resolved "https://registry.yarnpkg.com/make-plural/-/make-plural-3.0.6.tgz#2033a03bac290b8f3bb91258f65b9df7e8b01ca7" + integrity sha1-IDOgO6wpC487uRJY9lud9+iwHKc= optionalDependencies: minimist "^1.2.0" map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= map-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= dependencies: object-visit "^1.0.0" math-interval-parser@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/math-interval-parser/-/math-interval-parser-1.1.0.tgz#dbeda5b06b3249973c6df6170fde2386f0afd893" + integrity sha1-2+2lsGsySZc8bfYXD94jhvCv2JM= dependencies: xregexp "^2.0.0" math-random@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" + integrity sha1-izqsWIuKZuSXXjzepn97sylgH6w= md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== dependencies: hash-base "^3.0.0" inherits "^2.0.1" @@ -4103,16 +4782,19 @@ md5.js@^1.3.4: media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= mem@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= dependencies: mimic-fn "^1.0.0" memdown@^1.0.0: version "1.4.1" resolved "https://registry.yarnpkg.com/memdown/-/memdown-1.4.1.tgz#b4e4e192174664ffbae41361aa500f3119efe215" + integrity sha1-tOThkhdGZP+65BNhqlAPMRnv4hU= dependencies: abstract-leveldown "~2.7.1" functional-red-black-tree "^1.0.1" @@ -4124,6 +4806,7 @@ memdown@^1.0.0: memoizee@^0.4.14: version "0.4.14" resolved "https://registry.yarnpkg.com/memoizee/-/memoizee-0.4.14.tgz#07a00f204699f9a95c2d9e77218271c7cd610d57" + integrity sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg== dependencies: d "1" es5-ext "^0.10.45" @@ -4137,6 +4820,7 @@ memoizee@^0.4.14: memory-fs@^0.4.0, memory-fs@~0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" + integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= dependencies: errno "^0.1.3" readable-stream "^2.0.1" @@ -4144,14 +4828,17 @@ memory-fs@^0.4.0, memory-fs@~0.4.1: memorystream@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= merkle-patricia-tree@^2.1.2: version "2.3.2" resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz#982ca1b5a0fde00eed2f6aeed1f9152860b8208a" + integrity sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g== dependencies: async "^1.4.2" ethereumjs-util "^5.0.0" @@ -4165,6 +4852,7 @@ merkle-patricia-tree@^2.1.2: messageformat@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/messageformat/-/messageformat-0.3.1.tgz#e58fff8245e9b3971799e5b43db58b3e9417f5a2" + integrity sha1-5Y//gkXps5cXmeW0PbWLPpQX9aI= dependencies: async "~1.5.2" glob "~6.0.4" @@ -4175,10 +4863,12 @@ messageformat@^0.3.1: methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= micromatch@^2.1.5: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= dependencies: arr-diff "^2.0.0" array-unique "^0.2.1" @@ -4197,6 +4887,7 @@ micromatch@^2.1.5: micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -4215,6 +4906,7 @@ micromatch@^3.1.10, micromatch@^3.1.4: miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== dependencies: bn.js "^4.0.0" brorand "^1.0.1" @@ -4222,60 +4914,73 @@ miller-rabin@^4.0.0: mime-db@~1.36.0: version "1.36.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" + integrity sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw== mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.18, mime-types@~2.1.19: version "2.1.20" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" + integrity sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A== dependencies: mime-db "~1.36.0" mime@1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" + integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ== mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== mimic-response@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== min-document@^2.19.0: version "2.19.0" resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" + integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU= dependencies: dom-walk "^0.1.0" minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= "minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= minimist@^1.2.0, minimist@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= minimist@~0.0.1: version "0.0.10" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= minipass@^2.2.1, minipass@^2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.4.tgz#4768d7605ed6194d6d576169b9e12ef71e9d9957" + integrity sha512-mlouk1OHlaUE8Odt1drMtG1bAJA4ZA6B/ehysgV0LUIrDHdKgo1KorZq3pK0b/7Z7LJIQ12MNM6aC+Tn6lUZ5w== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" @@ -4283,12 +4988,14 @@ minipass@^2.2.1, minipass@^2.3.3: minizlib@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.1.tgz#6734acc045a46e61d596a43bb9d9cd326e19cc42" + integrity sha512-TrfjCjk4jLhcJyGMYymBH6oTXcWjYbUAXTHDbtnWHjZC25h0cdajHuPE1zxb4DVmu8crfh+HwH/WMuyLG0nHBg== dependencies: minipass "^2.2.1" mixin-deep@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" @@ -4296,18 +5003,21 @@ mixin-deep@^1.2.0: mkdirp-promise@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" + integrity sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE= dependencies: mkdirp "*" -mkdirp@*, mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@0.x.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +mkdirp@*, mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" mocha@^4.0.1, mocha@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.1.0.tgz#7d86cfbcf35cb829e2754c32e17355ec05338794" + integrity sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA== dependencies: browser-stdout "1.3.0" commander "2.11.0" @@ -4323,6 +5033,7 @@ mocha@^4.0.1, mocha@^4.1.0: mocha@^5.0.1: version "5.2.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" + integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== dependencies: browser-stdout "1.3.1" commander "2.15.1" @@ -4339,32 +5050,39 @@ mocha@^5.0.1: mock-fs@^4.1.0: version "4.7.0" resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.7.0.tgz#9f17e219cacb8094f4010e0a8c38589e2b33c299" + integrity sha512-WlQNtUlzMRpvLHf8dqeUmNqfdPjGY29KrJF50Ldb4AcL+vQeR8QH3wQcFMgrhTwb1gHjZn9xggho+84tBskLgA== moment-timezone@^0.5.0: version "0.5.21" resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.21.tgz#3cba247d84492174dbf71de2a9848fa13207b845" + integrity sha512-j96bAh4otsgj3lKydm3K7kdtA3iKf2m6MY2iSYCzCm5a1zmHo1g+aK3068dDEeocLZQIS9kU8bsdQHLqEvgW0A== dependencies: moment ">= 2.9.0" "moment@>= 2.9.0", moment@^2.22.2: version "2.22.2" resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66" + integrity sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y= mout@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/mout/-/mout-0.11.1.tgz#ba3611df5f0e5b1ffbfd01166b8f02d1f5fa2b99" + integrity sha1-ujYR318OWx/7/QEWa48C0fX6K5k= ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= ms@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== multihashes@^0.4.5: version "0.4.14" resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-0.4.14.tgz#774db9a161f81a8a27dc60788f91248e020f5244" + integrity sha512-V/g/EIN6nALXfS/xHUAgtfPP3mn3sPIF/i9beuGKf25QXS2QZYCpeVJbDPEannkz32B2fihzCe2D/KMrbcmefg== dependencies: bs58 "^4.0.1" varint "^5.0.0" @@ -4372,18 +5090,22 @@ multihashes@^0.4.5: mustache@*: version "3.0.0" resolved "https://registry.yarnpkg.com/mustache/-/mustache-3.0.0.tgz#3de22dd9ba38152f7355399a953dd4528c403338" + integrity sha512-bhBDkK/PioIbtQzRIbGUGypvc3MC4c389QnJt8KDIEJ666OidRPoXAQAHPivikfS3JkMEaWoPvcDL7YrQxtSwg== mustache@^2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/mustache/-/mustache-2.3.2.tgz#a6d4d9c3f91d13359ab889a812954f9230a3d0c5" + integrity sha512-KpMNwdQsYz3O/SBS1qJ/o3sqUJ5wSb8gb0pul8CO0S56b9Y2ALm8zCfsjPXsqGFfoNBkDwZuZIAjhsZI03gYVQ== -mute-stream@0.0.7, mute-stream@~0.0.4: +mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= mz@^2.6.0: version "2.7.0" resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" + integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== dependencies: any-promise "^1.0.0" object-assign "^4.0.1" @@ -4392,18 +5114,22 @@ mz@^2.6.0: nan@2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" + integrity sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA== nan@^2.0.8, nan@^2.2.1, nan@^2.3.3, nan@^2.9.2: version "2.11.1" resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.1.tgz#90e22bccb8ca57ea4cd37cc83d3819b52eea6766" + integrity sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA== nano-json-stream-parser@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" + integrity sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18= nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -4420,14 +5146,12 @@ nanomatch@^1.2.9: natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - -ncp@1.0.x: - version "1.0.1" - resolved "http://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz#d15367e5cb87432ba117d2bf80fdf45aecfb4246" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= needle@^2.2.1: version "2.2.4" resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" + integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== dependencies: debug "^2.1.2" iconv-lite "^0.4.4" @@ -4436,22 +5160,27 @@ needle@^2.2.1: negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" + integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= neo-async@^2.5.0: version "2.5.2" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.2.tgz#489105ce7bc54e709d736b195f82135048c50fcc" + integrity sha512-vdqTKI9GBIYcAEbFAcpKPErKINfPF5zIuz3/niBfq8WUZjpT2tytLlFVrBgWdOtqI4uaA/Rb6No0hux39XXDuw== next-tick@1: version "1.0.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" + integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= node-async-loop@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/node-async-loop/-/node-async-loop-1.2.2.tgz#c5870299bf6477b780c88b431aa5b37733f55a3d" + integrity sha1-xYcCmb9kd7eAyItDGqWzdzP1Wj0= node-cache@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/node-cache/-/node-cache-4.2.0.tgz#48ac796a874e762582692004a376d26dfa875811" + integrity sha512-obRu6/f7S024ysheAjoYFEEBqqDWv4LOMNJEuO8vMeEw2AT4z+NCzO4hlc2lhI4vATzbCQv6kke9FVdx0RbCOw== dependencies: clone "2.x" lodash "4.x" @@ -4459,6 +5188,7 @@ node-cache@^4.1.1: node-fetch@^1.0.1, node-fetch@~1.7.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== dependencies: encoding "^0.1.11" is-stream "^1.0.1" @@ -4466,6 +5196,7 @@ node-fetch@^1.0.1, node-fetch@~1.7.1: node-libs-browser@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.1.0.tgz#5f94263d404f6e44767d726901fff05478d600df" + integrity sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg== dependencies: assert "^1.1.1" browserify-zlib "^0.2.0" @@ -4494,6 +5225,7 @@ node-libs-browser@^2.0.0: node-pre-gyp@^0.10.0: version "0.10.3" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== dependencies: detect-libc "^1.0.2" mkdirp "^0.5.1" @@ -4509,6 +5241,7 @@ node-pre-gyp@^0.10.0: node-schedule@^1.2.3: version "1.3.0" resolved "https://registry.yarnpkg.com/node-schedule/-/node-schedule-1.3.0.tgz#e7a7e816a7f2550d5b170bd106e765db28bdf030" + integrity sha512-NNwO9SUPjBwFmPh3vXiPVEhJLn4uqYmZYvJV358SRGM06BR4UoIqxJpeJwDDXB6atULsgQA97MfD1zMd5xsu+A== dependencies: cron-parser "^2.4.0" long-timeout "0.1.1" @@ -4517,12 +5250,14 @@ node-schedule@^1.2.3: nopt@3.x, nopt@~3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= dependencies: abbrev "1" nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= dependencies: abbrev "1" osenv "^0.1.4" @@ -4530,6 +5265,7 @@ nopt@^4.0.1: normalize-package-data@^2.3.2: version "2.4.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw== dependencies: hosted-git-info "^2.1.4" is-builtin-module "^1.0.0" @@ -4539,16 +5275,19 @@ normalize-package-data@^2.3.2: normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= dependencies: remove-trailing-separator "^1.0.1" npm-bundled@^1.0.1: version "1.0.5" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" + integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== npm-packlist@^1.1.6: version "1.1.12" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.12.tgz#22bde2ebc12e72ca482abd67afc51eb49377243a" + integrity sha512-WJKFOVMeAlsU/pjXuqVdzU0WfgtIBCupkEVwn+1Y0ERAbUfWw8R4GjgVbaKnUjRoD2FoQbHOCbOyT5Mbs9Lw4g== dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" @@ -4556,12 +5295,14 @@ npm-packlist@^1.1.6: npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= dependencies: path-key "^2.0.0" npmlog@^4.0.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== dependencies: are-we-there-yet "~1.1.2" console-control-strings "~1.1.0" @@ -4571,10 +5312,12 @@ npmlog@^4.0.2: number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= number-to-bn@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" + integrity sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA= dependencies: bn.js "4.11.6" strip-hex-prefix "1.0.0" @@ -4582,40 +5325,57 @@ number-to-bn@1.7.0: oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== object-assign@^4, object-assign@^4.0.0, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= dependencies: copy-descriptor "^0.1.0" define-property "^0.2.5" kind-of "^3.0.3" +object-extended@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/object-extended/-/object-extended-0.0.7.tgz#84fd23f56b15582aeb3e88b05cb55d2432d68a33" + integrity sha1-hP0j9WsVWCrrPoiwXLVdJDLWijM= + dependencies: + array-extended "~0.0.4" + extended "~0.0.3" + is-extended "~0.0.3" + object-inspect@~1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" + integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== object-keys@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" + integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== object-keys@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" + integrity sha1-KKaq50KN0sOpLz2V8hM13SBOAzY= object-visit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= dependencies: isobject "^3.0.0" object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= dependencies: for-own "^0.1.4" is-extendable "^0.1.1" @@ -4623,40 +5383,47 @@ object.omit@^2.0.0: object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= dependencies: isobject "^3.0.1" oboe@2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.3.tgz#2b4865dbd46be81225713f4e9bfe4bcf4f680a4f" + integrity sha1-K0hl29Rr6BIlcT9Om/5Lz09oCk8= dependencies: http-https "^1.0.0" on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= dependencies: ee-first "1.1.1" once@1.x, once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" onetime@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= dependencies: mimic-fn "^1.0.0" openzeppelin-solidity@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/openzeppelin-solidity/-/openzeppelin-solidity-1.10.0.tgz#d77eee6653f5958d051318a61ba0b436f92216c0" + integrity sha512-igkrumQQ2lrN2zjeQV4Dnb0GpTBj1fzMcd8HPyBUqwI0hhuscX/HzXiqKT6gFQl1j9Wy/ppVVs9fqL/foF7Gmg== optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= dependencies: minimist "~0.0.1" wordwrap "~0.0.2" @@ -4664,6 +5431,7 @@ optimist@^0.6.1: optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= dependencies: deep-is "~0.1.3" fast-levenshtein "~2.0.4" @@ -4675,24 +5443,29 @@ optionator@^0.8.1, optionator@^0.8.2: original-require@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/original-require/-/original-require-1.0.1.tgz#0f130471584cd33511c5ec38c8d59213f9ac5e20" + integrity sha1-DxMEcVhM0zURxew4yNWSE/msXiA= os-browserify@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= os-locale@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= dependencies: lcid "^1.0.0" os-locale@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== dependencies: execa "^0.7.0" lcid "^1.0.0" @@ -4701,10 +5474,12 @@ os-locale@^2.0.0: os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= osenv@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" @@ -4712,40 +5487,48 @@ osenv@^0.1.4: p-cancelable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" + integrity sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw== p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== dependencies: p-try "^1.0.0" p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= dependencies: p-limit "^1.1.0" p-timeout@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" + integrity sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y= dependencies: p-finally "^1.0.0" p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= pako@~1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" + integrity sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg== parse-asn1@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.1.tgz#f6bf293818332bd0dab54efb16087724745e6ca8" + integrity sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw== dependencies: asn1.js "^4.0.0" browserify-aes "^1.0.0" @@ -4756,6 +5539,7 @@ parse-asn1@^5.0.0: parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= dependencies: glob-base "^0.3.0" is-dotfile "^1.0.0" @@ -4765,6 +5549,7 @@ parse-glob@^3.0.4: parse-headers@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.1.tgz#6ae83a7aa25a9d9b700acc28698cd1f1ed7e9536" + integrity sha1-aug6eqJanZtwCswoaYzR8e1+lTY= dependencies: for-each "^0.3.2" trim "0.0.1" @@ -4772,58 +5557,71 @@ parse-headers@^2.0.0: parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= dependencies: error-ex "^1.2.0" parseurl@~1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" + integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= path-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" + integrity sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo= path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= dependencies: pinkie-promise "^2.0.0" path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= path-key@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= path-parse@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= dependencies: graceful-fs "^4.1.2" pify "^2.0.0" @@ -4832,12 +5630,14 @@ path-type@^1.0.0: path-type@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= dependencies: pify "^2.0.0" pbkdf2@^3.0.3: version "3.0.17" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" + integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== dependencies: create-hash "^1.1.2" create-hmac "^1.1.4" @@ -4848,116 +5648,119 @@ pbkdf2@^3.0.3: pegjs@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/pegjs/-/pegjs-0.10.0.tgz#cf8bafae6eddff4b5a7efb185269eaaf4610ddbd" + integrity sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0= pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" + integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= dependencies: pinkie "^2.0.0" pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= pkg-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= dependencies: find-up "^1.0.0" -pkginfo@0.3.x: - version "0.3.1" - resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21" - -pkginfo@0.x.x: - version "0.4.1" - resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff" - pluralize@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= pragma-singleton@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/pragma-singleton/-/pragma-singleton-1.0.3.tgz#6894317bb8d47157e59de2a4a009db7e6f63e30e" + integrity sha1-aJQxe7jUcVflneKkoAnbfm9j4w4= prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= prettier@^1.14.3: version "1.14.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895" + integrity sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg== private@^0.1.6, private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== process-nextick-args@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= process@~0.5.1: version "0.5.2" resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" + integrity sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8= progress@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" + integrity sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8= promise-to-callback@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/promise-to-callback/-/promise-to-callback-1.0.0.tgz#5d2a749010bfb67d963598fcd3960746a68feef7" + integrity sha1-XSp0kBC/tn2WNZj805YHRqaP7vc= dependencies: is-fn "^1.0.0" set-immediate-shim "^1.0.1" -prompt@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prompt/-/prompt-1.0.0.tgz#8e57123c396ab988897fb327fd3aedc3e735e4fe" - dependencies: - colors "^1.1.2" - pkginfo "0.x.x" - read "1.0.x" - revalidator "0.1.x" - utile "0.3.x" - winston "2.1.x" - prop-types@^15.6.2: version "15.6.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102" + integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ== dependencies: loose-envify "^1.3.1" object-assign "^4.1.1" @@ -4965,6 +5768,7 @@ prop-types@^15.6.2: proxy-addr@~2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.4.tgz#ecfc733bf22ff8c6f407fa275327b9ab67e48b93" + integrity sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA== dependencies: forwarded "~0.1.2" ipaddr.js "1.8.0" @@ -4972,18 +5776,22 @@ proxy-addr@~2.0.4: prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= psl@^1.1.24: version "1.1.29" resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" + integrity sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ== public-encrypt@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== dependencies: bn.js "^4.1.0" browserify-rsa "^4.0.0" @@ -4995,22 +5803,27 @@ public-encrypt@^4.0.0: punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= punycode@^1.2.4, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== qs@6.5.2, qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== query-string@^5.0.1: version "5.1.1" resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" + integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== dependencies: decode-uri-component "^0.2.0" object-assign "^4.1.0" @@ -5019,14 +5832,17 @@ query-string@^5.0.1: querystring-es3@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= querystring@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= randomatic@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.0.tgz#36f2ca708e9e567f5ed2ec01949026d50aa10116" + integrity sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ== dependencies: is-number "^4.0.0" kind-of "^6.0.0" @@ -5035,12 +5851,14 @@ randomatic@^3.0.0: randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: version "2.0.6" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80" + integrity sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A== dependencies: safe-buffer "^5.1.0" randomfill@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== dependencies: randombytes "^2.0.5" safe-buffer "^5.1.0" @@ -5048,14 +5866,17 @@ randomfill@^1.0.3: randomhex@0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/randomhex/-/randomhex-0.1.5.tgz#baceef982329091400f2a2912c6cd02f1094f585" + integrity sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU= range-parser@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" + integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= raw-body@2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" + integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== dependencies: bytes "3.0.0" http-errors "1.6.3" @@ -5065,6 +5886,7 @@ raw-body@2.3.3: rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== dependencies: deep-extend "^0.6.0" ini "~1.3.0" @@ -5074,6 +5896,7 @@ rc@^1.2.7: react-dom@^16.2.0: version "16.5.2" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.5.2.tgz#b69ee47aa20bab5327b2b9d7c1fe2a30f2cfa9d7" + integrity sha512-RC8LDw8feuZOHVgzEf7f+cxBr/DnKdqp56VU0lAs1f4UfKc4cU8wU4fTq/mgnvynLQo8OtlPC19NUFh/zjZPuA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -5083,6 +5906,7 @@ react-dom@^16.2.0: react@^16.2.0: version "16.5.2" resolved "https://registry.yarnpkg.com/react/-/react-16.5.2.tgz#19f6b444ed139baa45609eee6dc3d318b3895d42" + integrity sha512-FDCSVd3DjVTmbEAjUNX6FgfAmQ+ypJfHUsqUJOYNCBUp1h8lqmtC+0mXJ+JjsWx4KAVTkk1vKd1hLQPvEviSuw== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -5092,6 +5916,7 @@ react@^16.2.0: read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= dependencies: find-up "^1.0.0" read-pkg "^1.0.0" @@ -5099,6 +5924,7 @@ read-pkg-up@^1.0.1: read-pkg-up@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= dependencies: find-up "^2.0.0" read-pkg "^2.0.0" @@ -5106,6 +5932,7 @@ read-pkg-up@^2.0.0: read-pkg@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= dependencies: load-json-file "^1.0.0" normalize-package-data "^2.3.2" @@ -5114,20 +5941,16 @@ read-pkg@^1.0.0: read-pkg@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= dependencies: load-json-file "^2.0.0" normalize-package-data "^2.3.2" path-type "^2.0.0" -read@1.0.x: - version "1.0.7" - resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" - dependencies: - mute-stream "~0.0.4" - readable-stream@^1.0.33: version "1.1.14" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= dependencies: core-util-is "~1.0.0" inherits "~2.0.1" @@ -5137,6 +5960,7 @@ readable-stream@^1.0.33: readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@^2.2.9, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -5149,6 +5973,7 @@ readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable readable-stream@~1.0.15: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= dependencies: core-util-is "~1.0.0" inherits "~2.0.1" @@ -5158,6 +5983,7 @@ readable-stream@~1.0.15: readdirp@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== dependencies: graceful-fs "^4.1.11" micromatch "^3.1.10" @@ -5166,28 +5992,34 @@ readdirp@^2.0.0: readline-sync@^1.4.9: version "1.4.9" resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.9.tgz#3eda8e65f23cd2a17e61301b1f0003396af5ecda" + integrity sha1-PtqOZfI80qF+YTAbHwADOWr17No= rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= dependencies: resolve "^1.1.6" regenerate@^1.2.1: version "1.4.0" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" + integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== regenerator-runtime@^0.10.5: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= regenerator-runtime@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== regenerator-transform@^0.10.0: version "0.10.1" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + integrity sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q== dependencies: babel-runtime "^6.18.0" babel-types "^6.19.0" @@ -5196,12 +6028,14 @@ regenerator-transform@^0.10.0: regex-cache@^0.4.2: version "0.4.4" resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== dependencies: is-equal-shallow "^0.1.3" regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== dependencies: extend-shallow "^3.0.2" safe-regex "^1.1.0" @@ -5209,10 +6043,12 @@ regex-not@^1.0.0, regex-not@^1.0.2: regexpp@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" + integrity sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw== regexpu-core@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + integrity sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA= dependencies: regenerate "^1.2.1" regjsgen "^0.2.0" @@ -5221,52 +6057,62 @@ regexpu-core@^2.0.0: regjsgen@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + integrity sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc= regjsparser@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + integrity sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw= dependencies: jsesc "~0.5.0" remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= repeat-element@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== repeat-string@^1.5.2, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= dependencies: is-finite "^1.0.0" req-cwd@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/req-cwd/-/req-cwd-1.0.1.tgz#0d73aeae9266e697a78f7976019677e76acf0fff" + integrity sha1-DXOurpJm5penj3l2AZZ352rPD/8= dependencies: req-from "^1.0.1" req-from@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/req-from/-/req-from-1.0.1.tgz#bf81da5147947d32d13b947dc12a58ad4587350e" + integrity sha1-v4HaUUeUfTLRO5R9wSpYrUWHNQ4= dependencies: resolve-from "^2.0.0" request-promise-core@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + integrity sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY= dependencies: lodash "^4.13.1" request-promise@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.2.tgz#d1ea46d654a6ee4f8ee6a4fea1018c22911904b4" + integrity sha1-0epG1lSm7k+O5qT+oQGMIpEZBLQ= dependencies: bluebird "^3.5.0" request-promise-core "1.1.1" @@ -5276,6 +6122,7 @@ request-promise@^4.2.2: request@^2.67.0, request@^2.79.0, request@^2.81.0, request@^2.85.0, request@^2.88.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== dependencies: aws-sign2 "~0.7.0" aws4 "^1.8.0" @@ -5301,18 +6148,22 @@ request@^2.67.0, request@^2.79.0, request@^2.81.0, request@^2.85.0, request@^2.8 require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= require-from-string@^1.1.0: version "1.2.1" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" + integrity sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg= require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= dependencies: caller-path "^0.1.0" resolve-from "^1.0.0" @@ -5320,34 +6171,41 @@ require-uncached@^1.0.3: resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= resolve-from@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" + integrity sha1-lICrIOlP+h2egKgEx+oUdhGWa1c= resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= resolve@1.1.x: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= resolve@^1.1.6, resolve@^1.3.3, resolve@^1.5.0, resolve@^1.6.0: version "1.8.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" + integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== dependencies: path-parse "^1.0.5" resolve@~1.7.1: version "1.7.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3" + integrity sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw== dependencies: path-parse "^1.0.5" restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= dependencies: onetime "^2.0.0" signal-exit "^3.0.2" @@ -5355,32 +6213,33 @@ restore-cursor@^2.0.0: resumer@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" + integrity sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k= dependencies: through "~2.3.4" ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - -revalidator@0.1.x: - version "0.1.8" - resolved "https://registry.yarnpkg.com/revalidator/-/revalidator-0.1.8.tgz#fece61bfa0c1b52a206bd6b18198184bdd523a3b" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + integrity sha1-YTObci/mo1FWiSENJOFMlhSGE+8= dependencies: align-text "^0.1.1" -rimraf@2, rimraf@2.x.x, rimraf@^2.2.8, rimraf@^2.6.1: +rimraf@2, rimraf@^2.2.8, rimraf@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== dependencies: glob "^7.0.5" ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== dependencies: hash-base "^3.0.0" inherits "^2.0.1" @@ -5388,66 +6247,79 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: rlp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.1.0.tgz#e4f9886d5a982174f314543831e36e1a658460f9" + integrity sha512-93U7IKH5j7nmXFVg19MeNBGzQW5uXW1pmCuKY8veeKIhYTE32C2d0mOegfiIAfXcHOKJjjPlJisn8iHDF5AezA== dependencies: safe-buffer "^5.1.1" run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= dependencies: is-promise "^2.1.0" rustbn.js@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" + integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== rx-lite-aggregates@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" + integrity sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74= dependencies: rx-lite "*" rx-lite@*, rx-lite@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" + integrity sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ= safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== safe-event-emitter@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz#5b692ef22329ed8f69fdce607e50ca734f6f20af" + integrity sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg== dependencies: events "^3.0.0" safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= dependencies: ret "~0.1.10" safe@^0.4.5: version "0.4.6" resolved "https://registry.yarnpkg.com/safe/-/safe-0.4.6.tgz#1d5580cf2635c5cb940ea48fb5081ae3c25b1be1" + integrity sha1-HVWAzyY1xcuUDqSPtQga48JbG+E= safefs@^3.1.2: version "3.2.2" resolved "https://registry.yarnpkg.com/safefs/-/safefs-3.2.2.tgz#8170c1444d7038e08caea05a374fae2fa349e15c" + integrity sha1-gXDBRE1wOOCMrqBaN0+uL6NJ4Vw= dependencies: graceful-fs "*" "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== scandirectory@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/scandirectory/-/scandirectory-2.5.0.tgz#6ce03f54a090b668e3cbedbf20edf9e310593e72" + integrity sha1-bOA/VKCQtmjjy+2/IO354xBZPnI= dependencies: ignorefs "^1.0.0" safefs "^3.1.2" @@ -5456,20 +6328,24 @@ scandirectory@^2.5.0: schedule@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/schedule/-/schedule-0.5.0.tgz#c128fffa0b402488b08b55ae74bb9df55cc29cc8" + integrity sha512-HUcJicG5Ou8xfR//c2rPT0lPIRR09vVvN81T9fqfVgBmhERUbDEQoYKjpBxbueJnCPpSu2ujXzOnRQt6x9o/jw== dependencies: object-assign "^4.1.1" scrypt-async@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/scrypt-async/-/scrypt-async-1.3.1.tgz#a11fd6fac981b4b823ee01dee0221169500ddae9" + integrity sha1-oR/W+smBtLgj7gHe4CIRaVAN2uk= scrypt-js@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.3.tgz#bb0040be03043da9a012a2cea9fc9f852cfc87d4" + integrity sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q= scrypt.js@0.2.0, scrypt.js@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/scrypt.js/-/scrypt.js-0.2.0.tgz#af8d1465b71e9990110bedfc593b9479e03a8ada" + integrity sha1-r40UZbcemZARC+38WTuUeeA6ito= dependencies: scrypt "^6.0.2" scryptsy "^1.2.1" @@ -5477,18 +6353,21 @@ scrypt.js@0.2.0, scrypt.js@^0.2.0: scrypt@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/scrypt/-/scrypt-6.0.3.tgz#04e014a5682b53fa50c2d5cce167d719c06d870d" + integrity sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0= dependencies: nan "^2.0.8" scryptsy@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-1.2.1.tgz#a3225fa4b2524f802700761e2855bdf3b2d92163" + integrity sha1-oyJfpLJST4AnAHYeKFW987LZIWM= dependencies: pbkdf2 "^3.0.3" secp256k1@^3.0.1: version "3.5.2" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.5.2.tgz#f95f952057310722184fe9c914e6b71281f2f2ae" + integrity sha512-iin3kojdybY6NArd+UFsoTuapOF7bnJNf2UbcWXaY3z+E1sJDipl60vtzB5hbO/uquBu7z0fd4VC4Irp+xoFVQ== dependencies: bindings "^1.2.1" bip66 "^1.1.3" @@ -5502,24 +6381,29 @@ secp256k1@^3.0.1: seek-bzip@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc" + integrity sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w= dependencies: commander "~2.8.1" semaphore@>=1.0.1, semaphore@^1.0.3: version "1.1.0" resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa" + integrity sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA== "semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== semver@~5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" + integrity sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg== send@0.16.2: version "0.16.2" resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" + integrity sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw== dependencies: debug "2.6.9" depd "~1.1.2" @@ -5538,6 +6422,7 @@ send@0.16.2: serve-static@1.13.2: version "1.13.2" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" + integrity sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" @@ -5547,6 +6432,7 @@ serve-static@1.13.2: servify@^0.1.12: version "0.1.12" resolved "https://registry.yarnpkg.com/servify/-/servify-0.1.12.tgz#142ab7bee1f1d033b66d0707086085b17c06db95" + integrity sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw== dependencies: body-parser "^1.16.0" cors "^2.8.1" @@ -5557,14 +6443,17 @@ servify@^0.1.12: set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= set-immediate-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + integrity sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E= set-value@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -5574,6 +6463,7 @@ set-value@^0.4.3: set-value@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -5583,18 +6473,22 @@ set-value@^2.0.0: setimmediate@1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" + integrity sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48= setimmediate@^1.0.4, setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= setprototypeof@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" + integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" @@ -5602,30 +6496,35 @@ sha.js@^2.4.0, sha.js@^2.4.8: sha3@^1.1.0: version "1.2.2" resolved "https://registry.yarnpkg.com/sha3/-/sha3-1.2.2.tgz#a66c5098de4c25bc88336ec8b4817d005bca7ba9" + integrity sha1-pmxQmN5MJbyIM27ItIF9AFvKe6k= dependencies: nan "2.10.0" shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= dependencies: shebang-regex "^1.0.0" shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= shelljs@^0.7.4: version "0.7.8" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" + integrity sha1-3svPh0sNHl+3LhSxZKloMEjprLM= dependencies: glob "^7.0.0" interpret "^1.0.0" rechoir "^0.6.2" -shelljs@^0.8.1: +shelljs@^0.8.1, shelljs@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.2.tgz#345b7df7763f4c2340d584abb532c5f752ca9e35" + integrity sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ== dependencies: glob "^7.0.0" interpret "^1.0.0" @@ -5634,14 +6533,17 @@ shelljs@^0.8.1: signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= simple-concat@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" + integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY= simple-get@^2.7.0: version "2.8.1" resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d" + integrity sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw== dependencies: decompress-response "^3.3.0" once "^1.3.1" @@ -5650,16 +6552,19 @@ simple-get@^2.7.0: slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= slice-ansi@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== dependencies: is-fullwidth-code-point "^2.0.0" snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== dependencies: define-property "^1.0.0" isobject "^3.0.0" @@ -5668,12 +6573,14 @@ snapdragon-node@^2.0.1: snapdragon-util@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== dependencies: kind-of "^3.2.0" snapdragon@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== dependencies: base "^0.11.1" debug "^2.2.0" @@ -5687,18 +6594,22 @@ snapdragon@^0.8.1: sol-digger@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/sol-digger/-/sol-digger-0.0.2.tgz#406c4a9d31e269e7f88eb1c2ea101318e5e09025" + integrity sha1-QGxKnTHiaef4jrHC6hATGOXgkCU= sol-explore@1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/sol-explore/-/sol-explore-1.6.1.tgz#b59f073c69fe332560d5a10c32ba8ca7f2986cfb" + integrity sha1-tZ8HPGn+MyVg1aEMMrqMp/KYbPs= sol-explore@^1.6.2: version "1.6.2" resolved "https://registry.yarnpkg.com/sol-explore/-/sol-explore-1.6.2.tgz#43ae8c419fd3ac056a05f8a9d1fb1022cd41ecc2" + integrity sha1-Q66MQZ/TrAVqBfip0fsQIs1B7MI= sol-merger@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/sol-merger/-/sol-merger-0.1.2.tgz#1f12500f42d427dc0ec8e4c113392acd8a6f62d9" + integrity sha512-12Z84jxeb5VFlQOGS38HOiTrHYohU07oQ5wHOcFJmcRRbaL5kWN7IcldMO1QdW8kONyKdj0xhukzLlN5m5ix4w== dependencies: bluebird "^3.5.0" cli-color "^1.2.0" @@ -5710,6 +6621,7 @@ sol-merger@^0.1.2: solc@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.24.tgz#354f14b269b38cbaa82a47d1ff151723502b954e" + integrity sha512-2xd7Cf1HeVwrIb6Bu1cwY2/TaLRodrppCq3l7rhLimFQgmxptXhTC3+/wesVLpB09F1A2kZgvbMOgH7wvhFnBQ== dependencies: fs-extra "^0.30.0" memorystream "^0.3.1" @@ -5720,6 +6632,7 @@ solc@0.4.24: solc@^0.4.19, solc@^0.4.2, solc@^0.4.24: version "0.4.25" resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.25.tgz#06b8321f7112d95b4b903639b1138a4d292f5faa" + integrity sha512-jU1YygRVy6zatgXrLY2rRm7HW1d7a8CkkEgNJwvH2VLpWhMFsMdWcJn6kUqZwcSz/Vm+w89dy7Z/aB5p6AFTrg== dependencies: fs-extra "^0.30.0" memorystream "^0.3.1" @@ -5730,6 +6643,7 @@ solc@^0.4.19, solc@^0.4.2, solc@^0.4.24: solidity-coverage@^0.5.11: version "0.5.11" resolved "https://registry.yarnpkg.com/solidity-coverage/-/solidity-coverage-0.5.11.tgz#1ee45f6d98b75a615aadb8f9aa7db4a2b32258e7" + integrity sha512-qikdsSi6+9XbfvwA0aI7HUVpF9fIFNqRWTw23M89GMDY+b6Gj0wWU9IngJS0fimoZIAdEp3bfChxvpfVcrUesg== dependencies: death "^1.1.0" ethereumjs-testrpc-sc "6.1.6" @@ -5745,6 +6659,7 @@ solidity-coverage@^0.5.11: solidity-docgen@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/solidity-docgen/-/solidity-docgen-0.1.0.tgz#f3a56ff074e8c7d832af3a3d462c3b5abf0f64cb" + integrity sha512-F7ufNWmlP5c5hIi66Ijv9tc+HNosyO7ijWq6pRtyBR1WqyJBH/0DJkD6QZI8HkE8p6LEXiPKxGBWbAeVT9Nu9g== dependencies: commander "^2.14.1" lodash "^4.17.5" @@ -5757,6 +6672,7 @@ solidity-docgen@^0.1.0: solidity-parser-sc@0.4.11: version "0.4.11" resolved "https://registry.yarnpkg.com/solidity-parser-sc/-/solidity-parser-sc-0.4.11.tgz#86734c9205537007f4d6201b57176e41696ee607" + integrity sha512-1kV5iC7m3CtMDfmHaVNwz2saSGQVIuF16rIxU417Al38MVCWHMQQ5vT6cmLsNwDe60S74auobWij9vNawSeOyw== dependencies: mocha "^4.1.0" pegjs "^0.10.0" @@ -5765,10 +6681,12 @@ solidity-parser-sc@0.4.11: solium-plugin-security@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/solium-plugin-security/-/solium-plugin-security-0.1.1.tgz#2a87bcf8f8c3abf7d198e292e4ac080284e3f3f6" + integrity sha512-kpLirBwIq4mhxk0Y/nn5cQ6qdJTI+U1LO3gpoNIcqNaW+sI058moXBe2UiHs+9wvF9IzYD49jcKhFTxcR9u9SQ== solium@^1.1.6: version "1.1.8" resolved "https://registry.yarnpkg.com/solium/-/solium-1.1.8.tgz#35d30a15c572a233ce8a90226d6cfccb762fadb7" + integrity sha512-fn0lusM6of14CytIDDHK73SGjn6NsVTaCVJjaKCKJyqKhT00rH/hDtvnIeZ2ZTD9z/xaXd4Js2brW3az6AV9RA== dependencies: ajv "^5.2.2" chokidar "^1.6.0" @@ -5786,6 +6704,7 @@ solium@^1.1.6: solparse@2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/solparse/-/solparse-2.2.5.tgz#72709c867cd6bfc50ec2325f4b81d2b3ea365d99" + integrity sha512-t7tvtR6KU6QfPYLMv1nlCh9DA8HYIu5tbjHpKu0fhGFZ1NuSp0KKDHfFHv07g6v1xgcuUY3rVqNFjZt5b9+5qA== dependencies: mocha "^4.0.1" pegjs "^0.10.0" @@ -5794,14 +6713,17 @@ solparse@2.2.5: sorted-array-functions@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/sorted-array-functions/-/sorted-array-functions-1.2.0.tgz#43265b21d6e985b7df31621b1c11cc68d8efc7c3" + integrity sha512-sWpjPhIZJtqO77GN+LD8dDsDKcWZ9GCOJNqKzi1tvtjGIzwfoyuRH8S0psunmc6Z5P+qfDqztSbwYR5X/e1UTg== source-list-map@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" + integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== source-map-resolve@^0.5.0: version "0.5.2" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== dependencies: atob "^2.1.1" decode-uri-component "^0.2.0" @@ -5812,12 +6734,14 @@ source-map-resolve@^0.5.0: source-map-support@^0.4.15: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== dependencies: source-map "^0.5.6" source-map-support@^0.5.3: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -5825,24 +6749,29 @@ source-map-support@^0.5.3: source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== source-map@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" + integrity sha1-2rc/vPwrqBm03gO9b26qSBZLP50= dependencies: amdefine ">=0.0.4" spdx-correct@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.2.tgz#19bb409e91b47b1ad54159243f7312a858db3c2e" + integrity sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids "^3.0.0" @@ -5850,10 +6779,12 @@ spdx-correct@^3.0.0: spdx-exceptions@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== spdx-expression-parse@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== dependencies: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0" @@ -5861,24 +6792,29 @@ spdx-expression-parse@^3.0.0: spdx-license-ids@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz#e2a303236cac54b04031fa7a5a79c7e701df852f" + integrity sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== dependencies: extend-shallow "^3.0.0" sprintf-js@>=1.0.3: version "1.1.1" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.1.tgz#36be78320afe5801f6cea3ee78b6e5aab940ea0c" + integrity sha1-Nr54Mgr+WAH2zqPueLblqrlA6gw= sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sshpk@^1.7.0: version "1.15.1" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.15.1.tgz#b79a089a732e346c6e0714830f36285cd38191a2" + integrity sha512-mSdgNUaidk+dRU5MhYtN9zebdzF2iG0cNPWy8HG+W8y+fT1JnSkh0fzzpjOa0L7P8i1Rscz38t0h4gPcKz43xA== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -5893,10 +6829,12 @@ sshpk@^1.7.0: stack-trace@0.0.x: version "0.0.10" resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" + integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= dependencies: define-property "^0.2.5" object-copy "^0.1.0" @@ -5904,22 +6842,27 @@ static-extend@^0.1.1: "statuses@>= 1.4.0 < 2": version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= statuses@~1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" + integrity sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew== stdio@^0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/stdio/-/stdio-0.2.7.tgz#a1c57da10fe1cfaa0c3bf683c9d0743d1b660839" + integrity sha1-ocV9oQ/hz6oMO/aDydB0PRtmCDk= stealthy-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= stream-browserify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" + integrity sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds= dependencies: inherits "~2.0.1" readable-stream "^2.0.2" @@ -5927,6 +6870,7 @@ stream-browserify@^2.0.1: stream-http@^2.7.2: version "2.8.3" resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" + integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== dependencies: builtin-status-codes "^3.0.0" inherits "^2.0.1" @@ -5937,10 +6881,22 @@ stream-http@^2.7.2: strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= + +string-extended@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/string-extended/-/string-extended-0.0.8.tgz#741957dff487b0272a79eec5a44f239ee6f17ccd" + integrity sha1-dBlX3/SHsCcqee7FpE8jnubxfM0= + dependencies: + array-extended "~0.0.5" + date-extended "~0.0.3" + extended "~0.0.3" + is-extended "~0.0.3" string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= dependencies: code-point-at "^1.0.0" is-fullwidth-code-point "^1.0.0" @@ -5949,6 +6905,7 @@ string-width@^1.0.1: "string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== dependencies: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" @@ -5956,6 +6913,7 @@ string-width@^1.0.1: string.prototype.trim@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" + integrity sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo= dependencies: define-properties "^1.1.2" es-abstract "^1.5.0" @@ -5964,92 +6922,109 @@ string.prototype.trim@~1.1.2: string_decoder@^1.0.0, string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== dependencies: safe-buffer "~5.1.0" string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= dependencies: ansi-regex "^2.0.0" strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= dependencies: ansi-regex "^3.0.0" strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= dependencies: is-utf8 "^0.2.0" strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= strip-dirs@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5" + integrity sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g== dependencies: is-natural-number "^4.0.1" strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= strip-hex-prefix@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" + integrity sha1-DF8VX+8RUTczd96du1iNoFUA428= dependencies: is-hex-prefixed "1.0.0" strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= supports-color@4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" + integrity sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ== dependencies: has-flag "^2.0.0" supports-color@5.4.0: version "5.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== dependencies: has-flag "^3.0.0" supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= supports-color@^3.1.0: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= dependencies: has-flag "^1.0.0" supports-color@^4.2.1: version "4.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" + integrity sha1-vnoN5ITexcXN34s9WRJQRJEvY1s= dependencies: has-flag "^2.0.0" supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" swarm-js@0.1.37: version "0.1.37" resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.37.tgz#27d485317a340bbeec40292af783cc10acfa4663" + integrity sha512-G8gi5fcXP/2upwiuOShJ258sIufBVztekgobr3cVgYXObZwJ5AXLqZn52AI+/ffft29pJexF9WNdUxjlkVehoQ== dependencies: bluebird "^3.5.0" buffer "^5.0.5" @@ -6068,6 +7043,7 @@ swarm-js@0.1.37: table@4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" + integrity sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA== dependencies: ajv "^5.2.3" ajv-keywords "^2.1.0" @@ -6079,10 +7055,12 @@ table@4.0.2: tapable@^0.2.7: version "0.2.8" resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" + integrity sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI= tape@^4.4.0, tape@^4.6.3: version "4.9.1" resolved "https://registry.yarnpkg.com/tape/-/tape-4.9.1.tgz#1173d7337e040c76fbf42ec86fcabedc9b3805c9" + integrity sha512-6fKIXknLpoe/Jp4rzHKFPpJUHDHDqn8jus99IfPnHIjyz78HYlefTGD3b5EkbQzuLfaEvmfPK3IolLgq2xT3kw== dependencies: deep-equal "~1.0.1" defined "~1.0.0" @@ -6101,6 +7079,7 @@ tape@^4.4.0, tape@^4.6.3: tar-stream@^1.5.2: version "1.6.2" resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" + integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A== dependencies: bl "^1.0.0" buffer-alloc "^1.2.0" @@ -6113,6 +7092,7 @@ tar-stream@^1.5.2: tar.gz@^1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/tar.gz/-/tar.gz-1.0.7.tgz#577ef2c595faaa73452ef0415fed41113212257b" + integrity sha512-uhGatJvds/3diZrETqMj4RxBR779LKlIE74SsMcn5JProZsfs9j0QBwWO1RW+IWNJxS2x8Zzra1+AW6OQHWphg== dependencies: bluebird "^2.9.34" commander "^2.8.1" @@ -6123,6 +7103,7 @@ tar.gz@^1.0.5: tar@^2.1.1: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + integrity sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE= dependencies: block-stream "*" fstream "^1.0.2" @@ -6131,6 +7112,7 @@ tar@^2.1.1: tar@^4: version "4.4.6" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b" + integrity sha512-tMkTnh9EdzxyfW+6GK6fCahagXsnYk6kE6S9Gr9pjVdys769+laCTbodXDhPAjzVtEBazRgP0gYqOjnk9dQzLg== dependencies: chownr "^1.0.1" fs-minipass "^1.2.5" @@ -6143,6 +7125,7 @@ tar@^4: taskgroup@^4.0.5, taskgroup@^4.2.0: version "4.3.1" resolved "https://registry.yarnpkg.com/taskgroup/-/taskgroup-4.3.1.tgz#7de193febd768273c457730497024d512c27915a" + integrity sha1-feGT/r12gnPEV3MElwJNUSwnkVo= dependencies: ambi "^2.2.0" csextends "^1.0.3" @@ -6150,36 +7133,43 @@ taskgroup@^4.0.5, taskgroup@^4.2.0: text-table@^0.2.0, text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= thenify-all@^1.0.0, thenify-all@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= dependencies: thenify ">= 3.1.0 < 4" "thenify@>= 3.1.0 < 4": version "3.3.0" resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.0.tgz#e69e38a1babe969b0108207978b9f62b88604839" + integrity sha1-5p44obq+lpsBCCB5eLn2K4hgSDk= dependencies: any-promise "^1.0.0" through@^2.3.6, through@~2.3.4, through@~2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= timed-out@^4.0.0, timed-out@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= timers-browserify@^2.0.4: version "2.0.10" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" + integrity sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg== dependencies: setimmediate "^1.0.4" timers-ext@^0.1.5: version "0.1.7" resolved "https://registry.yarnpkg.com/timers-ext/-/timers-ext-0.1.7.tgz#6f57ad8578e07a3fb9f91d9387d65647555e25c6" + integrity sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ== dependencies: es5-ext "~0.10.46" next-tick "1" @@ -6187,6 +7177,7 @@ timers-ext@^0.1.5: tingodb@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/tingodb/-/tingodb-0.6.1.tgz#f63336259af7dfa6c90dfe2556a0dfb0d4eede59" + integrity sha1-9jM2JZr336bJDf4lVqDfsNTu3lk= dependencies: lodash "^4.17.5" safe "^0.4.5" @@ -6197,30 +7188,36 @@ tingodb@^0.6.1: tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== dependencies: os-tmpdir "~1.0.2" to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= to-buffer@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" + integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= dependencies: kind-of "^3.0.2" to-regex-range@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= dependencies: is-number "^3.0.0" repeat-string "^1.6.1" @@ -6228,6 +7225,7 @@ to-regex-range@^2.1.0: to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== dependencies: define-property "^2.0.2" extend-shallow "^3.0.2" @@ -6237,6 +7235,7 @@ to-regex@^3.0.1, to-regex@^3.0.2: tough-cookie@>=2.3.3, tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== dependencies: psl "^1.1.24" punycode "^1.4.1" @@ -6244,22 +7243,27 @@ tough-cookie@>=2.3.3, tough-cookie@~2.4.3: tree-kill@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" + integrity sha512-DlX6dR0lOIRDFxI0mjL9IYg6OTncLm/Zt+JiBhE5OlFcAR8yc9S7FFXU9so0oda47frdM/JFsk7UjNt9vscKcg== trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= trim@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" + integrity sha1-WFhUf2spB1fulczMZm+1AITEYN0= truffle-blockchain-utils@^0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/truffle-blockchain-utils/-/truffle-blockchain-utils-0.0.5.tgz#a4e5c064dadd69f782a137f3d276d21095da7a47" + integrity sha1-pOXAZNrdafeCoTfz0nbSEJXaekc= truffle-contract-schema@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/truffle-contract-schema/-/truffle-contract-schema-2.0.1.tgz#9bf821d32e26e674ba15eb5d40f96b10b1c9d568" + integrity sha1-m/gh0y4m5nS6FetdQPlrELHJ1Wg= dependencies: ajv "^5.1.1" crypto-js "^3.1.9-1" @@ -6268,6 +7272,7 @@ truffle-contract-schema@^2.0.1: truffle-contract@^3.0.4: version "3.0.6" resolved "https://registry.yarnpkg.com/truffle-contract/-/truffle-contract-3.0.6.tgz#2ef6fc32d7faafa9f4aed8e50001a9fdea342192" + integrity sha1-Lvb8Mtf6r6n0rtjlAAGp/eo0IZI= dependencies: ethjs-abi "0.1.8" truffle-blockchain-utils "^0.0.5" @@ -6278,10 +7283,12 @@ truffle-contract@^3.0.4: truffle-error@^0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/truffle-error/-/truffle-error-0.0.3.tgz#4bf55242e14deee1c7194932709182deff2c97ca" + integrity sha1-S/VSQuFN7uHHGUkycJGC3v8sl8o= truffle-hdwallet-provider-privkey@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/truffle-hdwallet-provider-privkey/-/truffle-hdwallet-provider-privkey-0.1.0.tgz#9417047a74ad37d923df926154b6486ffb57f6c9" + integrity sha512-Vj04yr2d9qLRZspoHztbE/YQnVaoFb90JNZHtggRUm+JFm/NOiSJHLVI63+3mtUIuQ04EuKZ7Df8JQw0Ni7IeA== dependencies: ethereumjs-tx "^1.3.3" ethereumjs-wallet "^0.6.0" @@ -6291,6 +7298,7 @@ truffle-hdwallet-provider-privkey@^0.1.0: truffle-wallet-provider@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/truffle-wallet-provider/-/truffle-wallet-provider-0.0.5.tgz#db59ce6fa1c558766011137509a94dfca8d1408e" + integrity sha1-21nOb6HFWHZgERN1CalN/KjRQI4= dependencies: ethereumjs-wallet "^0.6.0" web3 "^0.18.2" @@ -6299,6 +7307,7 @@ truffle-wallet-provider@0.0.5: truffle@^4.1.13: version "4.1.14" resolved "https://registry.yarnpkg.com/truffle/-/truffle-4.1.14.tgz#8d2c298e29abf9b1e486e44ff9faca6d34bb9030" + integrity sha512-e7tTLvKP3bN9dE7MagfWyFjy4ZgoEGbeujECy1me1ENBzbj/aO/+45gs72qsL3+3IkCNNcWNOJjjrm8BYZZNNg== dependencies: mocha "^4.1.0" original-require "1.0.1" @@ -6307,30 +7316,36 @@ truffle@^4.1.13: tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" + integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= dependencies: safe-buffer "^5.0.1" tweetnacl@0.13.2: version "0.13.2" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.13.2.tgz#453161770469d45cd266c36404e2bc99a8fa9944" + integrity sha1-RTFhdwRp1FzSZsNkBOK8maj6mUQ= tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= dependencies: prelude-ls "~1.1.2" type-is@~1.6.16: version "1.6.16" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" + integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== dependencies: media-typer "0.3.0" mime-types "~2.1.18" @@ -6338,30 +7353,36 @@ type-is@~1.6.16: typechecker@^2.0.8: version "2.1.0" resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-2.1.0.tgz#d1c2093a54ff8a19f58cff877eeaa54f2242d383" + integrity sha1-0cIJOlT/ihn1jP+HfuqlTyJC04M= typechecker@^4.3.0: version "4.6.0" resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-4.6.0.tgz#d245d9c2df21147d5e2a942fff170b68ece73c87" + integrity sha512-83OrXpyP3LNr7aRbLkt2nkjE/d7q8su8/uRvrKxCpswqVCVGOgyaKpaz8/MTjQqBYe4eLNuJ44pNakFZKqyPMA== dependencies: editions "^2.0.2" typechecker@~2.0.1: version "2.0.8" resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-2.0.8.tgz#e83da84bb64c584ccb345838576c40b0337db82e" + integrity sha1-6D2oS7ZMWEzLNFg4V2xAsDN9uC4= typedarray-to-buffer@^3.1.2: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== dependencies: is-typedarray "^1.0.0" typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= uglify-js@^2.8.29: version "2.8.29" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + integrity sha1-KcVzMUgFe7Th913zW3qcty5qWd0= dependencies: source-map "~0.5.1" yargs "~3.10.0" @@ -6371,6 +7392,7 @@ uglify-js@^2.8.29: uglify-js@^3.1.4: version "3.4.9" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3" + integrity sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q== dependencies: commander "~2.17.1" source-map "~0.6.1" @@ -6378,10 +7400,12 @@ uglify-js@^3.1.4: uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + integrity sha1-bgkk1r2mta/jSeOabWMoUKD4grc= uglifyjs-webpack-plugin@^0.4.6: version "0.4.6" resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309" + integrity sha1-uVH0q7a9YX5m9j64kUmOORdj4wk= dependencies: source-map "^0.5.6" uglify-js "^2.8.29" @@ -6390,10 +7414,12 @@ uglifyjs-webpack-plugin@^0.4.6: ultron@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" + integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== unbzip2-stream@^1.0.9: version "1.3.1" resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.3.1.tgz#7854da51622a7e63624221196357803b552966a1" + integrity sha512-fIZnvdjblYs7Cru/xC6tCPVhz7JkYcVQQkePwMLyQELzYTds2Xn8QefPVnvdVhhZqubxNA1cASXEH5wcK0Bucw== dependencies: buffer "^3.0.1" through "^2.3.6" @@ -6401,14 +7427,17 @@ unbzip2-stream@^1.0.9: underscore@1.8.3: version "1.8.3" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" + integrity sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI= underscore@^1.8.3: version "1.9.1" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" + integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== union-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= dependencies: arr-union "^3.1.0" get-value "^2.0.6" @@ -6418,18 +7447,22 @@ union-value@^1.0.0: universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== unorm@^1.3.3: version "1.4.1" resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.4.1.tgz#364200d5f13646ca8bcd44490271335614792300" + integrity sha1-NkIA1fE2RsqLzURJAnEzVhR5IwA= unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= dependencies: has-value "^0.3.1" isobject "^3.0.0" @@ -6437,34 +7470,41 @@ unset-value@^1.0.0: upath@^1.0.5: version "1.1.0" resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" + integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== dependencies: punycode "^2.1.0" urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= url-parse-lax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= dependencies: prepend-http "^1.0.1" url-set-query@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" + integrity sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk= url-to-options@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" + integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k= url@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= dependencies: punycode "1.3.2" querystring "0.2.0" @@ -6472,65 +7512,66 @@ url@^0.11.0: use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== utf8@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/utf8/-/utf8-2.1.1.tgz#2e01db02f7d8d0944f77104f1609eb0c304cf768" + integrity sha1-LgHbAvfY0JRPdxBPFgnrDDBM92g= utf8@^2.1.1, utf8@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/utf8/-/utf8-2.1.2.tgz#1fa0d9270e9be850d9b05027f63519bf46457d96" + integrity sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY= utf8@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" + integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= util@0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= dependencies: inherits "2.0.1" util@^0.10.3: version "0.10.4" resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" + integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== dependencies: inherits "2.0.3" -utile@0.3.x: - version "0.3.0" - resolved "https://registry.yarnpkg.com/utile/-/utile-0.3.0.tgz#1352c340eb820e4d8ddba039a4fbfaa32ed4ef3a" - dependencies: - async "~0.9.0" - deep-equal "~0.2.1" - i "0.3.x" - mkdirp "0.x.x" - ncp "1.0.x" - rimraf "2.x.x" - utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= uuid@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" + integrity sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w= uuid@^3.0.1, uuid@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== valid-url@^1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200" + integrity sha1-HBRHm0DxOXp1eC8RXkCGRHQzogA= validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== dependencies: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" @@ -6538,14 +7579,17 @@ validate-npm-package-license@^3.0.1: varint@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.0.tgz#d826b89f7490732fabc0c0ed693ed475dcb29ebf" + integrity sha1-2Ca4n3SQcy+rwMDtaT7Uddyynr8= vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= dependencies: assert-plus "^1.0.0" core-util-is "1.0.2" @@ -6554,12 +7598,14 @@ verror@1.10.0: vm-browserify@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" + integrity sha1-XX6kW7755Kb/ZflUOOCofDV9WnM= dependencies: indexof "0.0.1" watchpack@^1.4.0: version "1.6.0" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" + integrity sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA== dependencies: chokidar "^2.0.2" graceful-fs "^4.1.2" @@ -6568,6 +7614,7 @@ watchpack@^1.4.0: watchr@~2.4.13: version "2.4.13" resolved "https://registry.yarnpkg.com/watchr/-/watchr-2.4.13.tgz#d74847bb4d6f90f61fe2c74f9f68662aa0e07601" + integrity sha1-10hHu01vkPYf4sdPn2hmKqDgdgE= dependencies: eachr "^2.0.2" extendr "^2.1.0" @@ -6581,6 +7628,7 @@ watchr@~2.4.13: web3-bzz@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.0.0-beta.34.tgz#068d37777ab65e5c60f8ec8b9a50cfe45277929c" + integrity sha1-Bo03d3q2Xlxg+OyLmlDP5FJ3kpw= dependencies: got "7.1.0" swarm-js "0.1.37" @@ -6589,6 +7637,7 @@ web3-bzz@1.0.0-beta.34: web3-core-helpers@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.34.tgz#b168da00d3e19e156bc15ae203203dd4dfee2d03" + integrity sha1-sWjaANPhnhVrwVriAyA91N/uLQM= dependencies: underscore "1.8.3" web3-eth-iban "1.0.0-beta.34" @@ -6597,6 +7646,7 @@ web3-core-helpers@1.0.0-beta.34: web3-core-method@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.0.0-beta.34.tgz#ec163c8a2c490fa02a7ec15559fa7307fc7cc6dd" + integrity sha1-7BY8iixJD6AqfsFVWfpzB/x8xt0= dependencies: underscore "1.8.3" web3-core-helpers "1.0.0-beta.34" @@ -6607,6 +7657,7 @@ web3-core-method@1.0.0-beta.34: web3-core-promievent@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.34.tgz#a4f4fa6784bb293e82c60960ae5b56a94cd03edc" + integrity sha1-pPT6Z4S7KT6CxglgrltWqUzQPtw= dependencies: any-promise "1.3.0" eventemitter3 "1.1.1" @@ -6614,6 +7665,7 @@ web3-core-promievent@1.0.0-beta.34: web3-core-requestmanager@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.34.tgz#01f8f6cf2ae6b6f0b70c38bae1ef741b5bab215c" + integrity sha1-Afj2zyrmtvC3DDi64e90G1urIVw= dependencies: underscore "1.8.3" web3-core-helpers "1.0.0-beta.34" @@ -6624,6 +7676,7 @@ web3-core-requestmanager@1.0.0-beta.34: web3-core-subscriptions@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.34.tgz#9fed144033f221c3cf21060302ffdaf5ef2de2de" + integrity sha1-n+0UQDPyIcPPIQYDAv/a9e8t4t4= dependencies: eventemitter3 "1.1.1" underscore "1.8.3" @@ -6632,6 +7685,7 @@ web3-core-subscriptions@1.0.0-beta.34: web3-core@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.0.0-beta.34.tgz#121be8555e9fb00d2c5d05ddd3381d0c9e46987e" + integrity sha1-EhvoVV6fsA0sXQXd0zgdDJ5GmH4= dependencies: web3-core-helpers "1.0.0-beta.34" web3-core-method "1.0.0-beta.34" @@ -6641,6 +7695,7 @@ web3-core@1.0.0-beta.34: web3-eth-abi@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.34.tgz#034533e3aa2f7e59ff31793eaea685c0ed5af67a" + integrity sha1-A0Uz46ovfln/MXk+rqaFwO1a9no= dependencies: bn.js "4.11.6" underscore "1.8.3" @@ -6650,6 +7705,7 @@ web3-eth-abi@1.0.0-beta.34: web3-eth-accounts@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.34.tgz#e09142eeecc797ac3459b75e9b23946d3695f333" + integrity sha1-4JFC7uzHl6w0WbdemyOUbTaV8zM= dependencies: any-promise "1.3.0" crypto-browserify "3.12.0" @@ -6665,6 +7721,7 @@ web3-eth-accounts@1.0.0-beta.34: web3-eth-contract@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.34.tgz#9dbb38fae7643a808427a20180470ec7415c91e6" + integrity sha1-nbs4+udkOoCEJ6IBgEcOx0FckeY= dependencies: underscore "1.8.3" web3-core "1.0.0-beta.34" @@ -6678,6 +7735,7 @@ web3-eth-contract@1.0.0-beta.34: web3-eth-iban@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.34.tgz#9af458605867ccf74ea979aaf326b38ba6a5ba0c" + integrity sha1-mvRYYFhnzPdOqXmq8yazi6alugw= dependencies: bn.js "4.11.6" web3-utils "1.0.0-beta.34" @@ -6685,6 +7743,7 @@ web3-eth-iban@1.0.0-beta.34: web3-eth-personal@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.34.tgz#9afba167342ebde5420bcd5895c3f6c34388f205" + integrity sha1-mvuhZzQuveVCC81YlcP2w0OI8gU= dependencies: web3-core "1.0.0-beta.34" web3-core-helpers "1.0.0-beta.34" @@ -6695,6 +7754,7 @@ web3-eth-personal@1.0.0-beta.34: web3-eth@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.0.0-beta.34.tgz#74086000850c6fe6f535ef49837d6d4bb6113268" + integrity sha1-dAhgAIUMb+b1Ne9Jg31tS7YRMmg= dependencies: underscore "1.8.3" web3-core "1.0.0-beta.34" @@ -6712,6 +7772,7 @@ web3-eth@1.0.0-beta.34: web3-net@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.0.0-beta.34.tgz#427cea2f431881449c8e38d523290f173f9ff63d" + integrity sha1-QnzqL0MYgUScjjjVIykPFz+f9j0= dependencies: web3-core "1.0.0-beta.34" web3-core-method "1.0.0-beta.34" @@ -6720,6 +7781,7 @@ web3-net@1.0.0-beta.34: web3-provider-engine@^13.6.4: version "13.8.0" resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-13.8.0.tgz#4c7c1ad2af5f1fe10343b8a65495879a2f9c00df" + integrity sha512-fZXhX5VWwWpoFfrfocslyg6P7cN3YWPG/ASaevNfeO80R+nzgoPUBXcWQekSGSsNDkeRTis4aMmpmofYf1TNtQ== dependencies: async "^2.5.0" clone "^2.0.0" @@ -6744,6 +7806,7 @@ web3-provider-engine@^13.6.4: web3-provider-engine@^8.4.0: version "8.6.1" resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-8.6.1.tgz#4d86e19e30caaf97df351511ec0f60136e5b30eb" + integrity sha1-TYbhnjDKr5ffNRUR7A9gE25bMOs= dependencies: async "^2.1.2" clone "^2.0.0" @@ -6763,6 +7826,7 @@ web3-provider-engine@^8.4.0: web3-providers-http@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.0.0-beta.34.tgz#e561b52bbb43766282007d40285bfe3550c27e7a" + integrity sha1-5WG1K7tDdmKCAH1AKFv+NVDCfno= dependencies: web3-core-helpers "1.0.0-beta.34" xhr2 "0.1.4" @@ -6770,6 +7834,7 @@ web3-providers-http@1.0.0-beta.34: web3-providers-ipc@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.34.tgz#a1b77f1a306d73649a9c039052e40cb71328d00a" + integrity sha1-obd/GjBtc2SanAOQUuQMtxMo0Ao= dependencies: oboe "2.1.3" underscore "1.8.3" @@ -6778,6 +7843,7 @@ web3-providers-ipc@1.0.0-beta.34: web3-providers-ws@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.34.tgz#7de70f1b83f2de36476772156becfef6e3516eb3" + integrity sha1-fecPG4Py3jZHZ3IVa+z+9uNRbrM= dependencies: underscore "1.8.3" web3-core-helpers "1.0.0-beta.34" @@ -6786,6 +7852,7 @@ web3-providers-ws@1.0.0-beta.34: web3-shh@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.0.0-beta.34.tgz#975061d71eaec42ccee576f7bd8f70f03844afe0" + integrity sha1-l1Bh1x6uxCzO5Xb3vY9w8DhEr+A= dependencies: web3-core "1.0.0-beta.34" web3-core-method "1.0.0-beta.34" @@ -6795,6 +7862,7 @@ web3-shh@1.0.0-beta.34: web3-utils@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.0.0-beta.34.tgz#9411fc39aaef39ca4e06169f762297d9ff020970" + integrity sha1-lBH8OarvOcpOBhafdiKX2f8CCXA= dependencies: bn.js "4.11.6" eth-lib "0.1.27" @@ -6807,6 +7875,7 @@ web3-utils@1.0.0-beta.34: web3@0.19.1: version "0.19.1" resolved "https://registry.yarnpkg.com/web3/-/web3-0.19.1.tgz#e763d5b1107c4bc24abd4f8cbee1ba3659e6eb31" + integrity sha1-52PVsRB8S8JKvU+MvuG6Nlnm6zE= dependencies: bignumber.js "^4.0.2" crypto-js "^3.1.4" @@ -6817,6 +7886,7 @@ web3@0.19.1: web3@0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.2.tgz#c54dac5fc0e377399c04c1a6ecbb12e4513278d6" + integrity sha1-xU2sX8DjdzmcBMGm7LsS5FEyeNY= dependencies: bignumber.js "git+https://github.com/frozeman/bignumber.js-nolookahead.git" crypto-js "^3.1.4" @@ -6827,6 +7897,7 @@ web3@0.20.2: web3@0.20.6: version "0.20.6" resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.6.tgz#3e97306ae024fb24e10a3d75c884302562215120" + integrity sha1-PpcwauAk+yThCj11yIQwJWIhUSA= dependencies: bignumber.js "git+https://github.com/frozeman/bignumber.js-nolookahead.git" crypto-js "^3.1.4" @@ -6837,6 +7908,7 @@ web3@0.20.6: web3@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3/-/web3-1.0.0-beta.34.tgz#347e561b784098cb5563315f490479a1d91f2ab1" + integrity sha1-NH5WG3hAmMtVYzFfSQR5odkfKrE= dependencies: web3-bzz "1.0.0-beta.34" web3-core "1.0.0-beta.34" @@ -6849,6 +7921,7 @@ web3@1.0.0-beta.34: web3@^0.16.0: version "0.16.0" resolved "https://registry.yarnpkg.com/web3/-/web3-0.16.0.tgz#a4554175cd462943035b1f1d39432f741c6b6019" + integrity sha1-pFVBdc1GKUMDWx8dOUMvdBxrYBk= dependencies: bignumber.js "git+https://github.com/debris/bignumber.js#master" crypto-js "^3.1.4" @@ -6858,6 +7931,7 @@ web3@^0.16.0: web3@^0.18.2, web3@^0.18.4: version "0.18.4" resolved "https://registry.yarnpkg.com/web3/-/web3-0.18.4.tgz#81ec1784145491f2eaa8955b31c06049e07c5e7d" + integrity sha1-gewXhBRUkfLqqJVbMcBgSeB8Xn0= dependencies: bignumber.js "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" crypto-js "^3.1.4" @@ -6868,6 +7942,7 @@ web3@^0.18.2, web3@^0.18.4: web3@^0.20.5: version "0.20.7" resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.7.tgz#1605e6d81399ed6f85a471a4f3da0c8be57df2f7" + integrity sha512-VU6/DSUX93d1fCzBz7WP/SGCQizO1rKZi4Px9j/3yRyfssHyFcZamMw2/sj4E8TlfMXONvZLoforR8B4bRoyTQ== dependencies: bignumber.js "git+https://github.com/frozeman/bignumber.js-nolookahead.git" crypto-js "^3.1.4" @@ -6878,6 +7953,7 @@ web3@^0.20.5: webpack-sources@^1.0.1: version "1.3.0" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" + integrity sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA== dependencies: source-list-map "^2.0.0" source-map "~0.6.1" @@ -6885,6 +7961,7 @@ webpack-sources@^1.0.1: webpack@^3.0.0: version "3.12.0" resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.12.0.tgz#3f9e34360370602fcf639e97939db486f4ec0d74" + integrity sha512-Sw7MdIIOv/nkzPzee4o0EdvCuPmxT98+vVpIvwtcwcF1Q4SDSNp92vwcKc4REe7NItH9f1S4ra9FuQ7yuYZ8bQ== dependencies: acorn "^5.0.0" acorn-dynamic-import "^2.0.0" @@ -6921,50 +7998,46 @@ webpack@^3.0.0: whatwg-fetch@>=0.10.0: version "3.0.0" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" + integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= which@^1.1.1, which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" wide-align@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== dependencies: string-width "^1.0.2 || 2" window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + integrity sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0= window-size@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" - -winston@2.1.x: - version "2.1.1" - resolved "http://registry.npmjs.org/winston/-/winston-2.1.1.tgz#3c9349d196207fd1bdff9d4bc43ef72510e3a12e" - dependencies: - async "~1.0.0" - colors "1.0.x" - cycle "1.0.x" - eyes "0.1.x" - isstream "0.1.x" - pkginfo "0.3.x" - stack-trace "0.0.x" + integrity sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU= winston@^2.3.1: version "2.4.4" resolved "https://registry.yarnpkg.com/winston/-/winston-2.4.4.tgz#a01e4d1d0a103cf4eada6fc1f886b3110d71c34b" + integrity sha512-NBo2Pepn4hK4V01UfcWcDlmiVTs7VTB1h7bgnB0rgP146bYhMxX0ypCz3lBOfNxCO4Zuek7yeT+y/zM1OfMw4Q== dependencies: async "~1.0.0" colors "1.0.x" @@ -6976,18 +8049,22 @@ winston@^2.3.1: wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + integrity sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8= wordwrap@^1.0.0, wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= dependencies: string-width "^1.0.1" strip-ansi "^3.0.1" @@ -6995,16 +8072,19 @@ wrap-ansi@^2.0.0: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= dependencies: mkdirp "^0.5.1" ws@^3.0.0: version "3.3.3" resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" + integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== dependencies: async-limiter "~1.0.0" safe-buffer "~5.1.0" @@ -7013,12 +8093,14 @@ ws@^3.0.0: xhr-request-promise@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.2.tgz#343c44d1ee7726b8648069682d0f840c83b4261d" + integrity sha1-NDxE0e53JrhkgGloLQ+EDIO0Jh0= dependencies: xhr-request "^1.0.1" xhr-request@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/xhr-request/-/xhr-request-1.1.0.tgz#f4a7c1868b9f198723444d82dcae317643f2e2ed" + integrity sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA== dependencies: buffer-to-arraybuffer "^0.0.5" object-assign "^4.1.1" @@ -7031,16 +8113,19 @@ xhr-request@^1.0.1: xhr2-cookies@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz#7d77449d0999197f155cb73b23df72505ed89d48" + integrity sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg= dependencies: cookiejar "^2.1.1" xhr2@*, xhr2@0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.1.4.tgz#7f87658847716db5026323812f818cadab387a5f" + integrity sha1-f4dliEdxbbUCYyOBL4GMras4el8= xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: version "2.5.0" resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.5.0.tgz#bed8d1676d5ca36108667692b74b316c496e49dd" + integrity sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ== dependencies: global "~4.3.0" is-function "^1.0.1" @@ -7050,40 +8135,49 @@ xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: xmlhttprequest@*, xmlhttprequest@1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" + integrity sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw= xregexp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" + integrity sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM= xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= xtend@~2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" + integrity sha1-bv7MKk2tjmlixJAbM3znuoe10os= dependencies: object-keys "~0.4.0" y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= yaeti@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" + integrity sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc= yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= yallist@^3.0.0, yallist@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" + integrity sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k= yargs-parser@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" + integrity sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ= dependencies: camelcase "^3.0.0" lodash.assign "^4.0.6" @@ -7091,24 +8185,28 @@ yargs-parser@^2.4.1: yargs-parser@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" + integrity sha1-jQrELxbqVd69MyyvTEA4s+P139k= dependencies: camelcase "^4.1.0" yargs-parser@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.1.0.tgz#f1376a33b6629a5d063782944da732631e966950" + integrity sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ== dependencies: camelcase "^4.1.0" yargs-parser@^9.0.2: version "9.0.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= dependencies: camelcase "^4.1.0" yargs@^10.0.3: version "10.1.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.1.2.tgz#454d074c2b16a51a43e2fb7807e4f9de69ccb5c5" + integrity sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig== dependencies: cliui "^4.0.0" decamelize "^1.1.1" @@ -7126,6 +8224,7 @@ yargs@^10.0.3: yargs@^11.0.0: version "11.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" + integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== dependencies: cliui "^4.0.0" decamelize "^1.1.1" @@ -7143,6 +8242,7 @@ yargs@^11.0.0: yargs@^4.6.0, yargs@^4.7.1: version "4.8.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" + integrity sha1-wMQpJMpKqmsObaFznfshZDn53cA= dependencies: cliui "^3.2.0" decamelize "^1.1.1" @@ -7162,6 +8262,7 @@ yargs@^4.6.0, yargs@^4.7.1: yargs@^8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" + integrity sha1-YpmpBVsc78lp/355wdkY3Osiw2A= dependencies: camelcase "^4.1.0" cliui "^3.2.0" @@ -7180,6 +8281,7 @@ yargs@^8.0.2: yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + integrity sha1-9+572FfdfB0tOMDnTvvWgdFDH9E= dependencies: camelcase "^1.0.2" cliui "^2.1.0" @@ -7189,6 +8291,7 @@ yargs@~3.10.0: yauzl@^2.4.2: version "2.10.0" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" + integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= dependencies: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" From bcfe5a034bba2326734283479ded189ea7e5b82b Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 27 Nov 2018 14:16:41 -0300 Subject: [PATCH 093/139] MATM CLI support --- CLI/commands/helpers/contract_abis.js | 44 +++--- CLI/commands/transfer_manager.js | 202 +++++++++++++++++++++++--- 2 files changed, 206 insertions(+), 40 deletions(-) diff --git a/CLI/commands/helpers/contract_abis.js b/CLI/commands/helpers/contract_abis.js index 38f063aec..70e9430e8 100644 --- a/CLI/commands/helpers/contract_abis.js +++ b/CLI/commands/helpers/contract_abis.js @@ -7,7 +7,7 @@ let stoInterfaceABI; let cappedSTOABI; let usdTieredSTOABI; let generalTransferManagerABI; -let stvrTransferManagerABI; +let manualApprovalTransferManagerABI; let generalPermissionManagerABI; let polyTokenABI; let cappedSTOFactoryABI; @@ -19,27 +19,27 @@ let ownableABI; let moduleFactoryABI; try { - polymathRegistryABI = JSON.parse(require('fs').readFileSync('./build/contracts/PolymathRegistry.json').toString()).abi; - securityTokenRegistryABI = JSON.parse(require('fs').readFileSync('./build/contracts/SecurityTokenRegistry.json').toString()).abi; - featureRegistryABI = JSON.parse(require('fs').readFileSync('./build/contracts/FeatureRegistry.json').toString()).abi; - moduleRegistryABI = JSON.parse(require('fs').readFileSync('./build/contracts/ModuleRegistry.json').toString()).abi; - securityTokenABI = JSON.parse(require('fs').readFileSync('./build/contracts/SecurityToken.json').toString()).abi; - stoInterfaceABI = JSON.parse(require('fs').readFileSync('./build/contracts/ISTO.json').toString()).abi; - cappedSTOABI = JSON.parse(require('fs').readFileSync('./build/contracts/CappedSTO.json').toString()).abi; - usdTieredSTOABI = JSON.parse(require('fs').readFileSync('./build/contracts/USDTieredSTO.json').toString()).abi; - generalTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/GeneralTransferManager.json').toString()).abi; - stvrTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/SingleTradeVolumeRestrictionTM.json').toString()).abi; + polymathRegistryABI = JSON.parse(require('fs').readFileSync('./build/contracts/PolymathRegistry.json').toString()).abi; + securityTokenRegistryABI = JSON.parse(require('fs').readFileSync('./build/contracts/SecurityTokenRegistry.json').toString()).abi; + featureRegistryABI = JSON.parse(require('fs').readFileSync('./build/contracts/FeatureRegistry.json').toString()).abi; + moduleRegistryABI = JSON.parse(require('fs').readFileSync('./build/contracts/ModuleRegistry.json').toString()).abi; + securityTokenABI = JSON.parse(require('fs').readFileSync('./build/contracts/SecurityToken.json').toString()).abi; + stoInterfaceABI = JSON.parse(require('fs').readFileSync('./build/contracts/ISTO.json').toString()).abi; + cappedSTOABI = JSON.parse(require('fs').readFileSync('./build/contracts/CappedSTO.json').toString()).abi; + usdTieredSTOABI = JSON.parse(require('fs').readFileSync('./build/contracts/USDTieredSTO.json').toString()).abi; + generalTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/GeneralTransferManager.json').toString()).abi; + manualApprovalTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/ManualApprovalTransferManager.json').toString()).abi; generalPermissionManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/GeneralPermissionManager.json').toString()).abi; - polyTokenABI = JSON.parse(require('fs').readFileSync('./build/contracts/PolyTokenFaucet.json').toString()).abi; - cappedSTOFactoryABI = JSON.parse(require('fs').readFileSync('./build/contracts/CappedSTOFactory.json').toString()).abi; - usdTieredSTOFactoryABI = JSON.parse(require('fs').readFileSync('./build/contracts/USDTieredSTOFactory.json').toString()).abi; - erc20DividendCheckpointABI = JSON.parse(require('fs').readFileSync('./build/contracts/ERC20DividendCheckpoint.json').toString()).abi; - etherDividendCheckpointABI = JSON.parse(require('fs').readFileSync('./build/contracts/EtherDividendCheckpoint.json').toString()).abi; - moduleInterfaceABI = JSON.parse(require('fs').readFileSync('./build/contracts/IModule.json').toString()).abi; - ownableABI = JSON.parse(require('fs').readFileSync('./build/contracts/Ownable.json').toString()).abi; - moduleFactoryABI = JSON.parse(require('fs').readFileSync('./build/contracts/ModuleFactory.json').toString()).abi; + polyTokenABI = JSON.parse(require('fs').readFileSync('./build/contracts/PolyTokenFaucet.json').toString()).abi; + cappedSTOFactoryABI = JSON.parse(require('fs').readFileSync('./build/contracts/CappedSTOFactory.json').toString()).abi; + usdTieredSTOFactoryABI = JSON.parse(require('fs').readFileSync('./build/contracts/USDTieredSTOFactory.json').toString()).abi; + erc20DividendCheckpointABI = JSON.parse(require('fs').readFileSync('./build/contracts/ERC20DividendCheckpoint.json').toString()).abi; + etherDividendCheckpointABI = JSON.parse(require('fs').readFileSync('./build/contracts/EtherDividendCheckpoint.json').toString()).abi; + moduleInterfaceABI = JSON.parse(require('fs').readFileSync('./build/contracts/IModule.json').toString()).abi; + ownableABI = JSON.parse(require('fs').readFileSync('./build/contracts/Ownable.json').toString()).abi; + moduleFactoryABI = JSON.parse(require('fs').readFileSync('./build/contracts/ModuleFactory.json').toString()).abi; } catch (err) { - console.log('\x1b[31m%s\x1b[0m',"Couldn't find contracts' artifacts. Make sure you ran truffle compile first"); + console.log('\x1b[31m%s\x1b[0m', "Couldn't find contracts' artifacts. Make sure you ran truffle compile first"); throw err; } @@ -71,8 +71,8 @@ module.exports = { generalTransferManager: function () { return generalTransferManagerABI; }, - singleTradeVolumeRestrictionTM: function() { - return stvrTransferManagerABI; + manualApprovalTransferManager: function () { + return manualApprovalTransferManagerABI; }, generalPermissionManager: function () { return generalPermissionManagerABI; diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 6725f3529..e4a62891a 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -1,5 +1,6 @@ var readlineSync = require('readline-sync'); var chalk = require('chalk'); +var moment = require('moment'); var common = require('./common/common_functions'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); @@ -188,12 +189,9 @@ async function configExistingModules(tmModules) { await generalTransferManager(); break; case 'ManualApprovalTransferManager': - //await manualApprovalTransferManager(); - console.log(chalk.red(` - ********************************* - This option is not yet available. - *********************************` - )); + currentTransferManager = new web3.eth.Contract(abis.manualApprovalTransferManager(), tmModules[index].address); + currentTransferManager.setProvider(web3.currentProvider); + await manualApprovalTransferManager(); break; case 'PercentageTransferManager': //await percentageTransferManager(); @@ -228,20 +226,13 @@ async function configExistingModules(tmModules) { } async function addTransferManagerModule() { - let options = ['GeneralTransferManager'/*, 'ManualApprovalTransferManager', 'PercentageTransferManager', + let options = ['GeneralTransferManager', 'ManualApprovalTransferManager'/*, 'PercentageTransferManager', 'CountTransferManager', 'SingleTradeVolumeRestrictionTM', 'LookupVolumeRestrictionTM'*/]; let index = readlineSync.keyInSelect(options, 'Which Transfer Manager module do you want to add? ', { cancel: 'Return' }); if (index != -1 && readlineSync.keyInYNStrict(`Are you sure you want to add ${options[index]} module?`)) { let bytes = web3.utils.fromAscii('', 16); switch (options[index]) { - case 'ManualApprovalTransferManager': - console.log(chalk.red(` - ********************************* - This option is not yet available. - *********************************` - )); - break; case 'PercentageTransferManager': console.log(chalk.red(` ********************************* @@ -357,9 +348,9 @@ async function generalTransferManager() { options.push('Allow all burn transfers'); } - let index = readlineSync.keyInSelect(options, 'What do you want to do?'); + let index = readlineSync.keyInSelect(options, 'What do you want to do?', { cancel: 'Return' }); let optionSelected = options[index]; - console.log('Selected:', index != -1 ? optionSelected : 'Cancel', '\n'); + console.log('Selected:', index != -1 ? optionSelected : 'Return', '\n'); switch (optionSelected) { case 'Modify whitelist': let investor = readlineSync.question('Enter the address to whitelist: ', { @@ -477,6 +468,181 @@ async function generalTransferManager() { } } +async function manualApprovalTransferManager() { + console.log(chalk.blue(`Manual Approval Transfer Manager at ${currentTransferManager.options.address}`), '\n'); + + let options = ['Check manual approval', 'Add manual approval', 'Revoke manual approval', + 'Check manual blocking', 'Add manual blocking', 'Revoke manual blocking']; + + let index = readlineSync.keyInSelect(options, 'What do you want to do?', { cancel: 'Return' }); + let optionSelected = options[index]; + console.log('Selected:', index != -1 ? optionSelected : 'Return', '\n'); + let from; + let to; + switch (optionSelected) { + case 'Check manual approval': + from = readlineSync.question('Enter the address from which transfers would be approved: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + to = readlineSync.question('Enter the address to which transfers would be approved: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + console.log(); + let manualApproval = await getManualApproval(from, to); + if (manualApproval) { + console.log(`Manual approval found!`); + console.log(`Allowance: ${web3.utils.fromWei(manualApproval.allowance)}`); + console.log(`Expiry time: ${moment.unix(manualApproval.expiryTime).format('MMMM Do YYYY, HH:mm:ss')};`) + } else { + console.log(chalk.yellow(`There are no manual approvals from ${from} to ${to}.`)); + } + break; + case 'Add manual approval': + from = readlineSync.question('Enter the address from which transfers will be approved: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + to = readlineSync.question('Enter the address to which transfers will be approved: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + if (!await getManualApproval(from, to)) { + let allowance = readlineSync.question('Enter the amount of tokens which will be approved: '); + let oneHourFromNow = Math.floor(Date.now() / 1000 + 3600); + let expiryTime = readlineSync.questionInt(`Enter the time (Unix Epoch time) until which the transfer is allowed (1 hour from now = ${oneHourFromNow}): `, { defaultInput: oneHourFromNow }); + let addManualApprovalAction = currentTransferManager.methods.addManualApproval(from, to, web3.utils.toWei(allowance), expiryTime); + let addManualApprovalReceipt = await common.sendTransaction(addManualApprovalAction); + let addManualApprovalEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, addManualApprovalReceipt.logs, 'AddManualApproval'); + console.log(chalk.green(`Manual approval has been added successfully!`)); + } else { + console.log(chalk.red(`A manual approval already exists from ${from} to ${to}. Revoke it first if you want to add a new one.`)); + } + break; + case 'Revoke manual approval': + from = readlineSync.question('Enter the address from which transfers were approved: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + to = readlineSync.question('Enter the address to which transfers were approved: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + if (await getManualApproval(from, to)) { + let revokeManualApprovalAction = currentTransferManager.methods.revokeManualApproval(from, to); + let revokeManualApprovalReceipt = await common.sendTransaction(revokeManualApprovalAction); + let revokeManualApprovalEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, revokeManualApprovalReceipt.logs, 'RevokeManualApproval'); + console.log(chalk.green(`Manual approval has been revoked successfully!`)); + } else { + console.log(chalk.red(`Manual approval from ${from} to ${to} does not exist.`)); + } + break; + case 'Check manual blocking': + from = readlineSync.question('Enter the address from which transfers would be blocked: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + to = readlineSync.question('Enter the address to which transfers would be blocked: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + console.log(); + let manualBlocking = await getManualBlocking(from, to); + if (manualBlocking) { + console.log(`Manual blocking found!`); + console.log(`Expiry time: ${moment.unix(manualBlocking).format('MMMM Do YYYY, HH:mm:ss')};`) + } else { + console.log(chalk.yellow(`There are no manual blockings from ${from} to ${to}.`)); + } + break; + case 'Add manual blocking': + from = readlineSync.question('Enter the address from which transfers will be blocked: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + to = readlineSync.question('Enter the address to which transfers will be blocked: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + if (!await getManualBlocking(from, to)) { + let oneHourFromNow = Math.floor(Date.now() / 1000 + 3600); + let expiryTime = readlineSync.questionInt(`Enter the time (Unix Epoch time) until which the transfer is blocked (1 hour from now = ${oneHourFromNow}): `, { defaultInput: oneHourFromNow }); + let addManualBlockingAction = currentTransferManager.methods.addManualBlocking(from, to, expiryTime); + let addManualBlockingReceipt = await common.sendTransaction(addManualBlockingAction); + let addManualBlockingEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, addManualBlockingReceipt.logs, 'AddManualBlocking'); + console.log(chalk.green(`Manual blocking has been added successfully!`)); + } else { + console.log(chalk.red(`A manual blocking already exists from ${from} to ${to}. Revoke it first if you want to add a new one.`)); + } + break; + case 'Revoke manual blocking': + from = readlineSync.question('Enter the address from which transfers were blocked: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + to = readlineSync.question('Enter the address to which transfers were blocked: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + if (await getManualBlocking(from, to)) { + let revokeManualBlockingAction = currentTransferManager.methods.revokeManualBlocking(from, to); + let revokeManualBlockingReceipt = await common.sendTransaction(revokeManualBlockingAction); + let revokeManualBlockingEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, revokeManualBlockingReceipt.logs, 'RevokeManualBlocking'); + console.log(chalk.green(`Manual blocking has been revoked successfully!`)); + } else { + console.log(chalk.red(`Manual blocking from ${from} to ${to} does not exist.`)); + } + break; + } +} + +async function getManualApproval(_from, _to) { + let result = null; + + let manualApproval = await currentTransferManager.methods.manualApprovals(_from, _to).call(); + if (manualApproval.expiryTime !== "0") { + result = manualApproval; + } + + return result; +} + +async function getManualBlocking(_from, _to) { + let result = null; + + let manualBlocking = await currentTransferManager.methods.manualBlockings(_from, _to).call(); + if (manualBlocking !== "0") { + result = manualBlocking; + } + + return result; +} + async function singleTradeVolumeRestrictionTM() { console.log(chalk.blue(`Single Trade Volume Restriction Transfer Manager at ${currentTransferManager.options.address}`)); console.log(); @@ -511,9 +677,9 @@ async function singleTradeVolumeRestrictionTM() { 'Set tokens transfer limit per account', 'Remove tokens transfer limit per account'); } - let index = readlineSync.keyInSelect(options, 'What do you want to do?'); + let index = readlineSync.keyInSelect(options, 'What do you want to do?', { cancel: 'Return' }); let optionSelected = options[index]; - console.log('Selected:', index != -1 ? optionSelected : 'Cancel', '\n'); + console.log('Selected:', index != -1 ? optionSelected : 'Return', '\n'); switch (optionSelected) { case 'Allow primary issuance': case 'Disallow primary issuance': From cc933303d580c53f4bcf1209c94e8801393fd9fc Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 28 Nov 2018 11:32:32 +0530 Subject: [PATCH 094/139] Rate changed --- contracts/modules/STO/CappedSTO.sol | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/contracts/modules/STO/CappedSTO.sol b/contracts/modules/STO/CappedSTO.sol index 60373ae37..0d79d285c 100644 --- a/contracts/modules/STO/CappedSTO.sol +++ b/contracts/modules/STO/CappedSTO.sol @@ -13,7 +13,8 @@ contract CappedSTO is ISTO, ReentrancyGuard { // Determine whether users can invest on behalf of a beneficiary bool public allowBeneficialInvestments = false; - // How many token units a buyer gets per wei / base unit of POLY + // How many token units multiplied by 10^18 a buyer gets per wei / base unit of POLY + // If rate is 10^18, buyer will get 1 token unit for every wei / base unit of poly. uint256 public rate; //How many tokens this STO will be allowed to sell to investors uint256 public cap; @@ -49,7 +50,7 @@ contract CappedSTO is ISTO, ReentrancyGuard { * @param _startTime Unix timestamp at which offering get started * @param _endTime Unix timestamp at which offering get ended * @param _cap Maximum No. of tokens for sale - * @param _rate Token units a buyer gets per wei / base unit of POLY + * @param _rate Token units multiplied by 10^18 a buyer gets per wei / base unit of POLY * @param _fundRaiseTypes Type of currency used to collect the funds * @param _fundsReceiver Ethereum account address to hold the funds */ @@ -154,6 +155,7 @@ contract CappedSTO is ISTO, ReentrancyGuard { * @return Unixtimestamp at which offering gets start. * @return Unixtimestamp at which offering ends. * @return Number of tokens this STO will be allowed to sell to investors. + * @return Token units multiplied by 10^18 a buyer gets per wei / base unit of POLY * @return Amount of funds raised * @return Number of individual investors this STO have. * @return Amount of tokens get sold. @@ -259,8 +261,10 @@ contract CappedSTO is ISTO, ReentrancyGuard { * @param _investedAmount Value in wei to be converted into tokens * @return Number of tokens that can be purchased with the specified _investedAmount */ - function _getTokenAmount(uint256 _investedAmount) internal view returns (uint256) { - return _investedAmount.mul(rate); + function _getTokenAmount(uint256 _investedAmount) internal view returns (uint256 tokenAmount) { + tokenAmount = _investedAmount.mul(rate); + tokenAmount = tokenAmount.div(uint256(10) ** 18); + return tokenAmount; } /** From 39c38f0056361eb1af299722af5e7d2fa499f842 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 28 Nov 2018 11:32:47 +0530 Subject: [PATCH 095/139] changelog updated --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db3d8dcde..dc15e692e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. [__2.1.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __13-09-18__ +# CappedSTO 2.0.1 +* `rate` is now accepted as multiplied by 10^18 to allow settting higher price than 1ETH/POLY per token. + # USDTieredSTO 2.0.1 * Added `buyTokensView` and `getTokensMintedByTier` to USDTSTO. * Added `getSTODetails` to USDTSTO. From 236cd179fbd68706a80e77b0900f43c0da35d987 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 28 Nov 2018 11:36:59 +0530 Subject: [PATCH 096/139] Updated tests for rate changes --- test/b_capped_sto.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/b_capped_sto.js b/test/b_capped_sto.js index fce1ee5e5..539d91b26 100644 --- a/test/b_capped_sto.js +++ b/test/b_capped_sto.js @@ -86,7 +86,7 @@ contract("CappedSTO", accounts => { let startTime_ETH2; let endTime_ETH2; const cap = web3.utils.toWei("10000"); - const rate = 1000; + const rate = web3.utils.toWei("1000"); const E_fundRaiseType = 0; const address_zero = "0x0000000000000000000000000000000000000000"; @@ -97,7 +97,7 @@ contract("CappedSTO", accounts => { let blockNo; const P_cap = web3.utils.toWei("50000"); const P_fundRaiseType = 1; - const P_rate = 5; + const P_rate = web3.utils.toWei("5"); const cappedSTOSetupCost = web3.utils.toWei("20000", "ether"); const maxCost = cappedSTOSetupCost; const STOParameters = ["uint256", "uint256", "uint256", "uint256", "uint8[]", "address"]; @@ -298,7 +298,7 @@ contract("CappedSTO", accounts => { assert.equal(await I_CappedSTO_Array_ETH[0].startTime.call(), startTime_ETH1, "STO Configuration doesn't set as expected"); assert.equal(await I_CappedSTO_Array_ETH[0].endTime.call(), endTime_ETH1, "STO Configuration doesn't set as expected"); assert.equal((await I_CappedSTO_Array_ETH[0].cap.call()).toNumber(), cap, "STO Configuration doesn't set as expected"); - assert.equal(await I_CappedSTO_Array_ETH[0].rate.call(), rate, "STO Configuration doesn't set as expected"); + assert.equal((await I_CappedSTO_Array_ETH[0].rate.call()).toNumber(), rate, "STO Configuration doesn't set as expected"); assert.equal( await I_CappedSTO_Array_ETH[0].fundRaiseTypes.call(E_fundRaiseType), true, @@ -554,7 +554,7 @@ contract("CappedSTO", accounts => { assert.equal(await I_CappedSTO_Array_ETH[1].startTime.call(), startTime_ETH2, "STO Configuration doesn't set as expected"); assert.equal(await I_CappedSTO_Array_ETH[1].endTime.call(), endTime_ETH2, "STO Configuration doesn't set as expected"); assert.equal((await I_CappedSTO_Array_ETH[1].cap.call()).toNumber(), cap, "STO Configuration doesn't set as expected"); - assert.equal(await I_CappedSTO_Array_ETH[1].rate.call(), rate, "STO Configuration doesn't set as expected"); + assert.equal((await I_CappedSTO_Array_ETH[1].rate.call()).toNumber(), rate, "STO Configuration doesn't set as expected"); assert.equal( await I_CappedSTO_Array_ETH[1].fundRaiseTypes.call(E_fundRaiseType), true, @@ -993,8 +993,8 @@ contract("CappedSTO", accounts => { it("Should successfully invest in second STO", async () => { const polyToInvest = 1000; - const stToReceive = polyToInvest * P_rate; - + const stToReceive = (polyToInvest * P_rate)/Math.pow(10, 18); + await I_PolyToken.getTokens(polyToInvest * Math.pow(10, 18), account_investor3); let tx = await I_GeneralTransferManager.modifyWhitelist(account_investor3, P_fromTime, P_toTime, P_expiryTime, true, { From 3cb2ce258fecca500ad09203e38538bc64a84115 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 28 Nov 2018 11:57:33 +0530 Subject: [PATCH 097/139] Issuance test fixed --- test/i_Issuance.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/i_Issuance.js b/test/i_Issuance.js index ac1fcdd37..5cef65baf 100644 --- a/test/i_Issuance.js +++ b/test/i_Issuance.js @@ -72,7 +72,7 @@ contract("Issuance", accounts => { //let startTime; // Start time will be 5000 seconds more than the latest time //let endTime; // Add 30 days more const cap = web3.utils.toWei("10000"); - const rate = 1000; + const rate = web3.utils.toWei("1000"); const fundRaiseType = [0]; const cappedSTOSetupCost = web3.utils.toWei("20000", "ether"); const maxCost = cappedSTOSetupCost; From f62f9f782f69c931213a01d4c42234cd9d425e4a Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 28 Nov 2018 12:39:29 +0530 Subject: [PATCH 098/139] test cases updated --- test/o_security_token.js | 2 +- test/r_concurrent_STO.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/o_security_token.js b/test/o_security_token.js index 52521181e..f475f6ab8 100644 --- a/test/o_security_token.js +++ b/test/o_security_token.js @@ -93,7 +93,7 @@ contract("SecurityToken", accounts => { let startTime; let endTime; const cap = web3.utils.toWei("10000"); - const rate = 1000; + const rate = web3.utils.toWei("1000"); const fundRaiseType = [0]; const cappedSTOSetupCost = web3.utils.toWei("20000", "ether"); const maxCost = cappedSTOSetupCost; diff --git a/test/r_concurrent_STO.js b/test/r_concurrent_STO.js index 7912658a4..cfe2767af 100644 --- a/test/r_concurrent_STO.js +++ b/test/r_concurrent_STO.js @@ -176,7 +176,7 @@ contract("Concurrent STO", accounts => { const startTime = latestTime() + duration.days(1); const endTime = latestTime() + duration.days(90); const cap = web3.utils.toWei("10000"); - const rate = 1000; + const rate = web3.utils.toWei("1000"); const fundRaiseType = [0]; const budget = 0; const maxCost = STOSetupCost; From f3b58fb883b3204547b9fb6c6e8fd97ca1a1a6a1 Mon Sep 17 00:00:00 2001 From: Satyam Agrawal Date: Tue, 27 Nov 2018 03:48:41 +0530 Subject: [PATCH 099/139] resolve conflicts in changelog --- CHANGELOG.md | 11 ++++++++--- .../ManualApprovalTransferManagerFactory.sol | 2 +- test/j_manual_approval_transfer_manager.js | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db3d8dcde..224ba8304 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,10 +13,15 @@ All notable changes to this project will be documented in this file. * Added `getTokensSoldByTier` to return sold (not minted during finalisation) tokens in each tier to USDTSTO. * Removed individual mappings for tier data removed in UDSTSTO. +## Manual Approval TransferManager +* Removed `0x0` check for the `_from` address to `ManualApprovalTransferManager`. This allows for the Issuer/Transfer Agent to approve a one-off mint of tokens that otherwise would not be possible. +* Changed the version of `ManualApprovalTransferManagerFactory` from `1.0.0` to `2.0.1`. + ##Changed * `getAllModulesAndPermsFromTypes()` does not take securityToken address as a parameter anymore. + -# v1.5.0 +# v1.5.0 - Release Candidate [__1.5.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __15-08-18__ @@ -53,13 +58,13 @@ All notable changes to this project will be documented in this file. * All permissions are denied if no permission manager is active. * Generalize the STO varaible names and added them in `ISTO.sol` to use the common standard in all STOs. * Generalize the event when any new token get registered with the polymath ecosystem. `LogNewSecurityToken` should emit _ticker, _name, _securityTokenAddress, _owner, _addedAt, _registrant respectively. #230 -* Change the function name of `withdraPoly` to `withdrawERC20` and make the function generalize to extract tokens from the ST contract. parmeters are contract address and the value need to extract from the securityToken. +* Change the function name of `withdraPoly` to `withdrawERC20` and make the function generalize to extract tokens from the ST contract. parmeters are contract address and the value need to extract from the securityToken. ## Removed * Removed investors list pruning * Remove `swarmHash` from the `registerTicker(), addCustomTicker(), generateSecurityToken(), addCustomSecurityToken()` functions of TickerRegistry.sol and SecurityTokenRegistry.sol. #230 * Remove `Log` prefix from all the event present in the ecosystem. -* Removed `addTagByModuleType` & `removeTagsByModuleType` from MR. +* Removed `addTagByModuleType` & `removeTagsByModuleType` from MR. ====== diff --git a/contracts/modules/TransferManager/ManualApprovalTransferManagerFactory.sol b/contracts/modules/TransferManager/ManualApprovalTransferManagerFactory.sol index f634b33e9..9c5513ee7 100644 --- a/contracts/modules/TransferManager/ManualApprovalTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/ManualApprovalTransferManagerFactory.sol @@ -18,7 +18,7 @@ contract ManualApprovalTransferManagerFactory is ModuleFactory { constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost) { - version = "1.0.0"; + version = "2.0.1"; name = "ManualApprovalTransferManager"; title = "Manual Approval Transfer Manager"; description = "Manage transfers using single approvals / blocking"; diff --git a/test/j_manual_approval_transfer_manager.js b/test/j_manual_approval_transfer_manager.js index 0461f287a..5779a1c13 100644 --- a/test/j_manual_approval_transfer_manager.js +++ b/test/j_manual_approval_transfer_manager.js @@ -541,7 +541,7 @@ contract("ManualApprovalTransferManager", accounts => { "Allows an issuer to set manual approvals or blocks for specific pairs of addresses and amounts. Init function takes no parameters.", "Wrong Module added" ); - assert.equal(await I_ManualApprovalTransferManagerFactory.version.call(), "1.0.0"); + assert.equal(await I_ManualApprovalTransferManagerFactory.version.call(), "2.0.1"); }); it("Should get the tags of the factory", async () => { From ce812a400aaccf6f775c657c9bf2762398b7c227 Mon Sep 17 00:00:00 2001 From: Pablo Ruiz Date: Tue, 27 Nov 2018 09:35:20 -0300 Subject: [PATCH 100/139] resolve conflicts in readme --- CHANGELOG.md | 9 ++++---- README.md | 62 +++++++++++++++++++++++++++++++++------------------- 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 224ba8304..f5a59aecf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,11 @@ # Changelog All notable changes to this project will be documented in this file. -# v2.1.0 - Release Candidate +# v2.1.0 - Release Candidate [__2.1.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __13-09-18__ -# USDTieredSTO 2.0.1 +## USDTieredSTO 2.0.1 * Added `buyTokensView` and `getTokensMintedByTier` to USDTSTO. * Added `getSTODetails` to USDTSTO. * Added an Array of Tiers that will hold data about every tier in USDTSTO. @@ -15,9 +15,10 @@ All notable changes to this project will be documented in this file. ## Manual Approval TransferManager * Removed `0x0` check for the `_from` address to `ManualApprovalTransferManager`. This allows for the Issuer/Transfer Agent to approve a one-off mint of tokens that otherwise would not be possible. -* Changed the version of `ManualApprovalTransferManagerFactory` from `1.0.0` to `2.0.1`. +* Changed the version of `ManualApprovalTransferManagerFactory` from `1.0.0` to `2.0.1`. +* Deployed 2.0.1 `ManualApprovalTransferManagerFactory` to address 0x6af2afad53cb334e62b90ddbdcf3a086f654c298 -##Changed +## Changed * `getAllModulesAndPermsFromTypes()` does not take securityToken address as a parameter anymore. diff --git a/README.md b/README.md index 64ff0d251..540b226da 100644 --- a/README.md +++ b/README.md @@ -204,17 +204,29 @@ node CLI/polymath-cli dividends_manager | Contract | Address | | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| TickerRegistry: | [0xc31714e6759a1ee26db1d06af1ed276340cd4233](https://etherscan.io/address/0xc31714e6759a1ee26db1d06af1ed276340cd4233) | -| SecurityTokenRegistry: | [0xef58491224958d978facf55d2120c55a24516b98](https://etherscan.io/address/0xef58491224958d978facf55d2120c55a24516b98) | -| ModuleRegistry: | [0x31d85fffd7e38bd42d2ae0409ac149e3ef0fd92c](https://etherscan.io/address/0x31d85fffd7e38bd42d2ae0409ac149e3ef0fd92c) | -| Polymath Registry: | [0x06595656b93ce14834f0d22b7bbda4382d5ab510](https://etherscan.io/address/0x06595656b93ce14834f0d22b7bbda4382d5ab510) | -| CappedSTOFactory: | [0x2aa1b133f464ac08f66c2f702581d014e4603d31](https://etherscan.io/address/0x2aa1b133f464ac08f66c2f702581d014e4603d31) | -| EthDividendsCheckpointFactory: | [0x0da7ed8789348ac40937cf6ae8ff521eee43816c](https://etherscan.io/address/0x0da7ed8789348ac40937cf6ae8ff521eee43816c) | -| ERC20 Dividends Checkpoint Factory: | [0x6950096964b7adae34d5a3d1792fe73afbe9ddbc](https://etherscan.io/address/0x6950096964b7adae34d5a3d1792fe73afbe9ddbc) | -| General Permission Manager Factory: | [0xeba0348e243f2de2f1687060f9c795ac279c66af](https://etherscan.io/address/0xeba0348e243f2de2f1687060f9c795ac279c66af) | -| Count Transfer Manager Factory: | [0xa662a05647a8e713be1bed193c094805d20471ff](https://etherscan.io/address/0xa662a05647a8e713be1bed193c094805d20471ff) | -| Percentage Transfer Manager Factory: | [0x3870ee581a0528d24a6216311fcfa78f95a00593](https://etherscan.io/address/0x3870ee581a0528d24a6216311fcfa78f95a00593) | - +| SecurityTokenRegistry (Proxy): | [0x240f9f86b1465bf1b8eb29bc88cbf65573dfdd97](https://etherscan.io/address/0x240f9f86b1465bf1b8eb29bc88cbf65573dfdd97) | +| ModuleRegistry (Proxy): | [0x4566d68ea96fc2213f2446f0dd0f482146cee96d](https://etherscan.io/address/0x4566d68ea96fc2213f2446f0dd0f482146cee96d) | +| Polymath Registry: | [0xdfabf3e4793cd30affb47ab6fa4cf4eef26bbc27](https://etherscan.io/address/0xdfabf3e4793cd30affb47ab6fa4cf4eef26bbc27) | +| Feature Registry: | [0xa3eacb03622bf1513880892b7270d965f693ffb5](https://etherscan.io/address/0xa3eacb03622bf1513880892b7270d965f693ffb5) | +| ETHOracle: | [0x60055e9a93aae267da5a052e95846fa9469c0e7a](https://etherscan.io/address/0x60055e9a93aae267da5a052e95846fa9469c0e7a) | +| POLYOracle: | [0x52cb4616E191Ff664B0bff247469ce7b74579D1B](https://etherscan.io/address/0x52cb4616E191Ff664B0bff247469ce7b74579D1B) | +| General Transfer Manager Factory: | [0xdc95598ef2bbfdb66d02d5f3eea98ea39fbc8b26](https://etherscan.io/address/0xdc95598ef2bbfdb66d02d5f3eea98ea39fbc8b26) | +| General Permission Manager Factory: | [0xf0aa1856360277c60052d6095c5b787b01388cdd](https://etherscan.io/address/0xf0aa1856360277c60052d6095c5b787b01388cdd) | +| CappedSTOFactory: | [0x77d89663e8819023a87bfe2bc9baaa6922c0e57c](https://etherscan.io/address/0x77d89663e8819023a87bfe2bc9baaa6922c0e57c) | +| USDTieredSTO Factory: | [0x5a3a30bddae1f857a19b1aed93b5cdb3c3da809a](https://etherscan.io/address/0x5a3a30bddae1f857a19b1aed93b5cdb3c3da809a) | +| EthDividendsCheckpointFactory: | [0x968c74c52f15b2de323eca8c677f6c9266bfefd6](https://etherscan.io/address/0x968c74c52f15b2de323eca8c677f6c9266bfefd6) | +| ERC20 Dividends Checkpoint Factory: | [0x82f9f1ab41bacb1433c79492e54bf13bccd7f9ae](https://etherscan.io/address/0x82f9f1ab41bacb1433c79492e54bf13bccd7f9ae) | +| Count Transfer Manager Factory: | [0xd9fd7e34d6e2c47a69e02131cf8554d52c3445d5](https://etherscan.io/address/0xd9fd7e34d6e2c47a69e02131cf8554d52c3445d5) | +| Percentage Transfer Manager Factory: | [0xe6267a9c0a227d21c95b782b1bd32bb41fc3b43b](https://etherscan.io/address/0xe6267a9c0a227d21c95b782b1bd32bb41fc3b43b) | +| Manual Approval Transfer Manager Factory (2.0.1): | [0x6af2afad53cb334e62b90ddbdcf3a086f654c298](https://etherscan.io/address/0xe6267a9c0a227d21c95b782b1bd32bb41fc3b43b) | +New SecurityTokenRegistry (2.0.1): 0x538136ed73011a766bf0a126a27300c3a7a2e6a6 +(fixed bug with getTickersByOwner()) + +New ModuleRegistry (2.0.1): 0xbc18f144ccf87f2d98e6fa0661799fcdc3170119 +(fixed bug with missing transferOwnership function) + +New ManualApprovalTransferManager 0x6af2afad53cb334e62b90ddbdcf3a086f654c298 +(Fixed 0x0 from bug) ## KOVAN @@ -222,17 +234,23 @@ node CLI/polymath-cli dividends_manager | Contract | Address | | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| TickerRegistry: | [0xc9af1d88fe48c8a6aa8677a29a89b0a6ae78f5a8](https://kovan.etherscan.io/address/0xc9af1d88fe48c8a6aa8677a29a89b0a6ae78f5a8) | -| SecurityTokenRegistry: | [0xced6e4ec2ac5425743bf4edf4d4e476120b8fc72](https://kovan.etherscan.io/address/0xced6e4ec2ac5425743bf4edf4d4e476120b8fc72) | -| ModuleRegistry: | [0x961913dcbe2f36176bf25774337f3277796820eb](https://kovan.etherscan.io/address/0x961913dcbe2f36176bf25774337f3277796820eb) | -| Polymath Registry: | [0x05a6519e49e34239f78167abf293d94dae61b299](https://kovan.etherscan.io/address/0x05a6519e49e34239f78167abf293d94dae61b299) | -| CappedSTOFactory: | [0xde4f3cfb6b214e60c4e69e6dfc95ede3c4e3d709](https://kovan.etherscan.io/address/0xde4f3cfb6b214e60c4e69e6dfc95ede3c4e3d709) | -| EthDividendsCheckpointFactory: | [0x870a07d45b0f4c5653fc29a4cb0697a01e0224b1](https://kovan.etherscan.io/address/0x870a07d45b0f4c5653fc29a4cb0697a01e0224b1) | -| ERC20 Dividends Checkpoint Factory: | [0x7e823f5df6ed1bb6cc005c692febc6aedf3b8889](https://kovan.etherscan.io/address/0x7e823f5df6ed1bb6cc005c692febc6aedf3b8889) | -| General Permission Manager Factory: | [0x6f5fec2934a34d2e2374042cca6505f1c87ef79b](https://kovan.etherscan.io/address/0x6f5fec2934a34d2e2374042cca6505f1c87ef79b) | -| Count Transfer Manager Factory: | [0xb540b6fa752a91c7e7834523172309e543a99a06](https://kovan.etherscan.io/address/0xb540b6fa752a91c7e7834523172309e543a99a06) | -| Percentage Transfer Manager Factory: | [0xfe908f07e6db57aa6bbd8374e59aac86b60374b0](https://kovan.etherscan.io/address/0xfe908f07e6db57aa6bbd8374e59aac86b60374b0) | - +| SecurityTokenRegistry (Proxy): | [0xbefb81114d532bddddc724af20c3516fa75f0afb](https://kovan.etherscan.io/address/0xbefb81114d532bddddc724af20c3516fa75f0afb) | +| ModuleRegistry (Proxy): | [0x0fac8d8cce224eead73c1187df96570aa80a568b](https://kovan.etherscan.io/address/0x0fac8d8cce224eead73c1187df96570aa80a568b) | +| Polymath Registry: | [0x9903e7b5acfe5fa9713771a8d861eb1df8cd7046](https://kovan.etherscan.io/address/0x9903e7b5acfe5fa9713771a8d861eb1df8cd7046) | +| Feature Registry: | [0xa8f85006fdacb3d59ffae564c05433f0c949e911](https://kovan.etherscan.io/address/0xa8f85006fdacb3d59ffae564c05433f0c949e911) | +| ETHOracle: | [0xCE5551FC9d43E9D2CC255139169FC889352405C8](https://kovan.etherscan.io/address/0xCE5551FC9d43E9D2CC255139169FC889352405C8) | +| POLYOracle: | [0x461d98EF2A0c7Ac1416EF065840fF5d4C946206C](https://kovan.etherscan.io/address/0x461d98EF2A0c7Ac1416EF065840fF5d4C946206C) | +| General Transfer Manager Factory: | [0xfe7e2bb6c200d5222c82d0f8fecca5f8fe4ab8ce](https://kovan.etherscan.io/address/0xfe7e2bb6c200d5222c82d0f8fecca5f8fe4ab8ce) | +| General Permission Manager Factory: | [0xde5eaa8d73f43fc5e7badb203f03ecae2b29bd92](https://kovan.etherscan.io/address/0xde5eaa8d73f43fc5e7badb203f03ecae2b29bd92) | +| CappedSTOFactory: | [0xe14d7dd044cc6cfe37548b6791416c59f19bfc0d](https://kovan.etherscan.io/address/0xe14d7dd044cc6cfe37548b6791416c59f19bfc0d) | +| USDTieredSTO Factory: | [0xf9f0bb9f868d411dd9a9511a79d172449e3c15f5](https://kovan.etherscan.io/address/0xf9f0bb9f868d411dd9a9511a79d172449e3c15f5) | +| EthDividendsCheckpointFactory: | [0x2861425ba5abbf50089c473b28f6c40a8ea5262a](https://kovan.etherscan.io/address/0x2861425ba5abbf50089c473b28f6c40a8ea5262a) | +| ERC20 Dividends Checkpoint Factory: | [0xbf9495550417feaacc43f86d2244581b6d688431](https://kovan.etherscan.io/address/0xbf9495550417feaacc43f86d2244581b6d688431) | +| Count Transfer Manager Factory: | [0x3c3c1f40ae2bdca82b90541b2cfbd41caa941c0e](https://kovan.etherscan.io/address/0x3c3c1f40ae2bdca82b90541b2cfbd41caa941c0e) | +| Percentage Transfer Manager Factory: | [0x8cd00c3914b2967a8b79815037f51c76874236b8](https://kovan.etherscan.io/address/0x8cd00c3914b2967a8b79815037f51c76874236b8) | +| Manual Approval Transfer Manager Factory: | [0x9faa79e2ccf0eb49aa6ebde1795ad2e951ce78f8](https://kovan.etherscan.io/address/0x9faa79e2ccf0eb49aa6ebde1795ad2e951ce78f8) | +New ManualApprovalTransferManager 0x9faa79e2ccf0eb49aa6ebde1795ad2e951ce78f8 +(Fixed 0x0 from bug) ## Package version requirements for your machine: From 8a079129bc6a8c50445366c2b7afa59627e9d09e Mon Sep 17 00:00:00 2001 From: Pablo Ruiz Date: Tue, 27 Nov 2018 10:39:45 -0300 Subject: [PATCH 101/139] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 540b226da..9caa44f67 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,8 @@ node CLI/polymath-cli dividends_manager | Count Transfer Manager Factory: | [0xd9fd7e34d6e2c47a69e02131cf8554d52c3445d5](https://etherscan.io/address/0xd9fd7e34d6e2c47a69e02131cf8554d52c3445d5) | | Percentage Transfer Manager Factory: | [0xe6267a9c0a227d21c95b782b1bd32bb41fc3b43b](https://etherscan.io/address/0xe6267a9c0a227d21c95b782b1bd32bb41fc3b43b) | | Manual Approval Transfer Manager Factory (2.0.1): | [0x6af2afad53cb334e62b90ddbdcf3a086f654c298](https://etherscan.io/address/0xe6267a9c0a227d21c95b782b1bd32bb41fc3b43b) | + + New SecurityTokenRegistry (2.0.1): 0x538136ed73011a766bf0a126a27300c3a7a2e6a6 (fixed bug with getTickersByOwner()) @@ -249,6 +251,8 @@ New ManualApprovalTransferManager 0x6af2afad53cb334e62b90ddbdcf3a086f654c298 | Count Transfer Manager Factory: | [0x3c3c1f40ae2bdca82b90541b2cfbd41caa941c0e](https://kovan.etherscan.io/address/0x3c3c1f40ae2bdca82b90541b2cfbd41caa941c0e) | | Percentage Transfer Manager Factory: | [0x8cd00c3914b2967a8b79815037f51c76874236b8](https://kovan.etherscan.io/address/0x8cd00c3914b2967a8b79815037f51c76874236b8) | | Manual Approval Transfer Manager Factory: | [0x9faa79e2ccf0eb49aa6ebde1795ad2e951ce78f8](https://kovan.etherscan.io/address/0x9faa79e2ccf0eb49aa6ebde1795ad2e951ce78f8) | + + New ManualApprovalTransferManager 0x9faa79e2ccf0eb49aa6ebde1795ad2e951ce78f8 (Fixed 0x0 from bug) From 0f86d9d921f158533d3ca9dcd1f5d5a0c761833d Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 28 Nov 2018 09:47:35 -0300 Subject: [PATCH 102/139] Minor fixes --- CLI/commands/sto_manager.js | 166 +++++++++++++++++----------------- CLI/commands/token_manager.js | 66 +++++++------- 2 files changed, 116 insertions(+), 116 deletions(-) diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index 9fcfd54dd..d0fd1c3ea 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -39,16 +39,16 @@ async function executeApp() { } options.push('Add new STO module'); - let index = readlineSync.keyInSelect(options, 'What do you want to do?', {cancel: 'Exit'}); + let index = readlineSync.keyInSelect(options, 'What do you want to do?', { cancel: 'Exit' }); let optionSelected = index != -1 ? options[index] : 'Exit'; console.log('Selected:', optionSelected, '\n'); switch (optionSelected) { case 'Show existing STO information': - let stoToShow = selectExistingSTO(nonArchivedModules, true); + let stoToShow = selectExistingSTO(nonArchivedModules, true); await showSTO(stoToShow.name, stoToShow.module); break; case 'Modify existing STO': - let stoToModify = selectExistingSTO(nonArchivedModules); + let stoToModify = selectExistingSTO(nonArchivedModules); await modifySTO(stoToModify.name, stoToModify.module); break; case 'Add new STO module': @@ -67,7 +67,7 @@ function selectExistingSTO(stoModules, showPaused) { filteredModules = stoModules.filter(m => !m.paused); } let options = filteredModules.map(m => `${m.name} at ${m.address}`); - let index = readlineSync.keyInSelect(options, 'Select a module: ', {cancel: false}); + let index = readlineSync.keyInSelect(options, 'Select a module: ', { cancel: false }); console.log('Selected:', options[index], '\n'); let selectedName = filteredModules[index].name; let stoABI; @@ -81,7 +81,7 @@ function selectExistingSTO(stoModules, showPaused) { } let stoModule = new web3.eth.Contract(stoABI, filteredModules[index].address); - return {name: selectedName, module: stoModule}; + return { name: selectedName, module: stoModule }; } async function showSTO(selectedSTO, currentSTO) { @@ -156,14 +156,14 @@ async function cappedSTO_launch(stoConfig) { return; } else { let transferAction = polyToken.methods.transfer(securityToken._address, transferAmount); - let receipt = await common.sendTransaction(transferAction, {factor: 2}); + let receipt = await common.sendTransaction(transferAction, { factor: 2 }); let event = common.getEventFromLogs(polyToken._jsonInterface, receipt.logs, 'Transfer'); console.log(`Number of POLY sent: ${web3.utils.fromWei(new web3.utils.BN(event._value))}`) } } let oneMinuteFromNow = new web3.utils.BN((Math.floor(Date.now() / 1000) + 60)); - let oneMonthFromNow = new web3.utils.BN((Math.floor(Date.now()/1000)+ (30 * 24 * 60 * 60))); + let oneMonthFromNow = new web3.utils.BN((Math.floor(Date.now() / 1000) + (30 * 24 * 60 * 60))); let cappedSTOconfig = {}; let useConfigFile = typeof stoConfig !== 'undefined'; @@ -172,7 +172,7 @@ async function cappedSTO_launch(stoConfig) { if (cappedSTOconfig.cap == "") cappedSTOconfig.cap = 500000; cappedSTOconfig.raiseType = readlineSync.question('Enter' + chalk.green(` P `) + 'for POLY raise or leave empty for Ether raise (E): '); - if (cappedSTOconfig.raiseType.toUpperCase() == 'P' ) { + if (cappedSTOconfig.raiseType.toUpperCase() == 'P') { cappedSTOconfig.raiseType = [gbl.constants.FUND_RAISE_TYPES.POLY]; } else { cappedSTOconfig.raiseType = [gbl.constants.FUND_RAISE_TYPES.ETH]; @@ -185,7 +185,7 @@ async function cappedSTO_launch(stoConfig) { if (cappedSTOconfig.wallet == "") cappedSTOconfig.wallet = Issuer.address; cappedSTOconfig.startTime = readlineSync.question('Enter the start time for the STO (Unix Epoch time)\n(1 minutes from now = ' + oneMinuteFromNow + ' ): '); - + cappedSTOconfig.endTime = readlineSync.question('Enter the end time for the STO (Unix Epoch time)\n(1 month from now = ' + oneMonthFromNow + ' ): '); } else { cappedSTOconfig = stoConfig; @@ -196,13 +196,13 @@ async function cappedSTO_launch(stoConfig) { let cappedSTOABI = abis.cappedSTO(); let configureFunction = cappedSTOABI.find(o => o.name === 'configure' && o.type === 'function'); - let bytesSTO = web3.eth.abi.encodeFunctionCall( configureFunction, - [ cappedSTOconfig.startTime, - cappedSTOconfig.endTime, - web3.utils.toWei(cappedSTOconfig.cap.toString()), - cappedSTOconfig.rate, - cappedSTOconfig.raiseType, - cappedSTOconfig.wallet ] + let bytesSTO = web3.eth.abi.encodeFunctionCall(configureFunction, + [cappedSTOconfig.startTime, + cappedSTOconfig.endTime, + web3.utils.toWei(cappedSTOconfig.cap.toString()), + cappedSTOconfig.rate, + cappedSTOconfig.raiseType, + cappedSTOconfig.wallet] ); let addModuleAction = securityToken.methods.addModule(cappedSTOFactoryAddress, bytesSTO, stoFee, 0); @@ -229,7 +229,7 @@ async function cappedSTO_status(currentSTO) { let displayInvestorCount = await currentSTO.methods.investorCount().call(); let displayTokenSymbol = await securityToken.methods.symbol().call(); - let now = Math.floor(Date.now()/1000); + let now = Math.floor(Date.now() / 1000); let timeTitle; let timeRemaining; @@ -270,7 +270,7 @@ async function cappedSTO_status(currentSTO) { function fundingConfigUSDTieredSTO() { let funding = {}; - let selectedFunding = readlineSync.question('Enter' + chalk.green(` P `) + 'for POLY raise,' + chalk.green(` D `) + 'for DAI raise,' + chalk.green(` E `) + 'for Ether raise or any combination of them (i.e.'+ chalk.green(` PED `) + 'for all): ').toUpperCase(); + let selectedFunding = readlineSync.question('Enter' + chalk.green(` P `) + 'for POLY raise,' + chalk.green(` D `) + 'for DAI raise,' + chalk.green(` E `) + 'for Ether raise or any combination of them (i.e.' + chalk.green(` PED `) + 'for all): ').toUpperCase(); funding.raiseType = []; if (selectedFunding.includes('E')) { @@ -293,7 +293,7 @@ function addressesConfigUSDTieredSTO(usdTokenRaise) { let addresses = {}; addresses.wallet = readlineSync.question('Enter the address that will receive the funds from the STO (' + Issuer.address + '): ', { - limit: function(input) { + limit: function (input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address", @@ -302,7 +302,7 @@ function addressesConfigUSDTieredSTO(usdTokenRaise) { if (addresses.wallet == "") addresses.wallet = Issuer.address; addresses.reserveWallet = readlineSync.question('Enter the address that will receive remaining tokens in the case the cap is not met (' + Issuer.address + '): ', { - limit: function(input) { + limit: function (input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address", @@ -312,7 +312,7 @@ function addressesConfigUSDTieredSTO(usdTokenRaise) { if (usdTokenRaise) { addresses.usdToken = readlineSync.question('Enter the address of the USD Token or stable coin (' + usdToken.options.address + '): ', { - limit: function(input) { + limit: function (input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address", @@ -321,7 +321,7 @@ function addressesConfigUSDTieredSTO(usdTokenRaise) { if (addresses.usdToken == "") addresses.usdToken = usdToken.options.address; } else { addresses.usdToken = '0x0000000000000000000000000000000000000000'; - } + } return addresses; } @@ -330,13 +330,13 @@ function tiersConfigUSDTieredSTO(polyRaise) { let tiers = {}; let defaultTiers = 3; - tiers.tiers = readlineSync.questionInt(`Enter the number of tiers for the STO? (${defaultTiers}): `, { - limit: function(input) { - return input > 0; + tiers.tiers = parseInt(readlineSync.question(`Enter the number of tiers for the STO? (${defaultTiers}): `, { + limit: function (input) { + return parseInt(input) > 0; }, limitMessage: 'Must be greater than zero', defaultInput: defaultTiers - }); + })); let defaultTokensPerTier = [190000000, 100000000, 200000000]; let defaultRatePerTier = ['0.05', '0.10', '0.15']; @@ -347,33 +347,33 @@ function tiersConfigUSDTieredSTO(polyRaise) { tiers.tokensPerTierDiscountPoly = []; tiers.ratePerTierDiscountPoly = []; for (let i = 0; i < tiers.tiers; i++) { - tiers.tokensPerTier[i] = readlineSync.question(`How many tokens do you plan to sell on tier No. ${i+1}? (${defaultTokensPerTier[i]}): `, { - limit: function(input) { + tiers.tokensPerTier[i] = readlineSync.question(`How many tokens do you plan to sell on tier No. ${i + 1}? (${defaultTokensPerTier[i]}): `, { + limit: function (input) { return parseFloat(input) > 0; }, limitMessage: 'Must be greater than zero', defaultInput: defaultTokensPerTier[i] }); - tiers.ratePerTier[i] = readlineSync.question(`What is the USD per token rate for tier No. ${i+1}? (${defaultRatePerTier[i]}): `, { - limit: function(input) { + tiers.ratePerTier[i] = readlineSync.question(`What is the USD per token rate for tier No. ${i + 1}? (${defaultRatePerTier[i]}): `, { + limit: function (input) { return parseFloat(input) > 0; }, limitMessage: 'Must be greater than zero', defaultInput: defaultRatePerTier[i] }); - if (polyRaise && readlineSync.keyInYNStrict(`Do you plan to have a discounted rate for POLY investments for tier No. ${i+1}? `)) { - tiers.tokensPerTierDiscountPoly[i] = readlineSync.question(`How many of those tokens do you plan to sell at discounted rate on tier No. ${i+1}? (${defaultTokensPerTierDiscountPoly[i]}): `, { - limit: function(input) { + if (polyRaise && readlineSync.keyInYNStrict(`Do you plan to have a discounted rate for POLY investments for tier No. ${i + 1}? `)) { + tiers.tokensPerTierDiscountPoly[i] = readlineSync.question(`How many of those tokens do you plan to sell at discounted rate on tier No. ${i + 1}? (${defaultTokensPerTierDiscountPoly[i]}): `, { + limit: function (input) { return parseFloat(input) < parseFloat(tiers.tokensPerTier[i]); }, limitMessage: 'Must be less than the No. of tokens of the tier', defaultInput: defaultTokensPerTierDiscountPoly[i] }); - tiers.ratePerTierDiscountPoly[i] = readlineSync.question(`What is the discounted rate for tier No. ${i+1}? (${defaultRatePerTierDiscountPoly[i]}): `, { - limit: function(input) { + tiers.ratePerTierDiscountPoly[i] = readlineSync.question(`What is the discounted rate for tier No. ${i + 1}? (${defaultRatePerTierDiscountPoly[i]}): `, { + limit: function (input) { return parseFloat(input) < parseFloat(tiers.ratePerTier[i]); }, limitMessage: 'Must be less than the rate of the tier', @@ -393,7 +393,7 @@ function limitsConfigUSDTieredSTO() { let defaultMinimumInvestment = 5; limits.minimumInvestmentUSD = readlineSync.question(`What is the minimum investment in USD? (${defaultMinimumInvestment}): `, { - limit: function(input) { + limit: function (input) { return parseFloat(input) > 0; }, limitMessage: "Must be greater than zero", @@ -402,7 +402,7 @@ function limitsConfigUSDTieredSTO() { let nonAccreditedLimit = 2500; limits.nonAccreditedLimitUSD = readlineSync.question(`What is the default limit for non accredited investors in USD? (${nonAccreditedLimit}): `, { - limit: function(input) { + limit: function (input) { return parseFloat(input) >= parseFloat(limits.minimumInvestmentUSD); }, limitMessage: "Must be greater than minimum investment", @@ -417,13 +417,13 @@ function timesConfigUSDTieredSTO(stoConfig) { let oneMinuteFromNow = Math.floor(Date.now() / 1000) + 60; if (typeof stoConfig === 'undefined') { - times.startTime = readlineSync.questionInt('Enter the start time for the STO (Unix Epoch time)\n(1 minutes from now = ' + oneMinuteFromNow + ' ): ', { - limit: function(input) { - return input > Math.floor(Date.now() / 1000); + times.startTime = parseInt(readlineSync.question('Enter the start time for the STO (Unix Epoch time)\n(1 minutes from now = ' + oneMinuteFromNow + ' ): ', { + limit: function (input) { + return parseInt(input) > Math.floor(Date.now() / 1000); }, limitMessage: "Must be a future time", defaultInput: oneMinuteFromNow - }); + })); } else { times.startTime = stoConfig.times.startTime; } @@ -431,13 +431,13 @@ function timesConfigUSDTieredSTO(stoConfig) { let oneMonthFromNow = Math.floor(Date.now() / 1000) + (30 * 24 * 60 * 60); if (typeof stoConfig === 'undefined') { - times.endTime = readlineSync.questionInt('Enter the end time for the STO (Unix Epoch time)\n(1 month from now = ' + oneMonthFromNow + ' ): ', { - limit: function(input) { - return input > times.startTime; + times.endTime = parseInt(readlineSync.question('Enter the end time for the STO (Unix Epoch time)\n(1 month from now = ' + oneMonthFromNow + ' ): ', { + limit: function (input) { + return parseInt(input) > times.startTime; }, limitMessage: "Must be greater than Start Time", defaultInput: oneMonthFromNow - }); + })); } else { times.endTime = stoConfig.times.startTime; } @@ -466,7 +466,7 @@ async function usdTieredSTO_launch(stoConfig) { return; } else { let transferAction = polyToken.methods.transfer(securityToken._address, transferAmount); - let receipt = await common.sendTransaction(transferAction, {factor: 2}); + let receipt = await common.sendTransaction(transferAction, { factor: 2 }); let event = common.getEventFromLogs(polyToken._jsonInterface, receipt.logs, 'Transfer'); console.log(`Number of POLY sent: ${web3.utils.fromWei(new web3.utils.BN(event._value))}`) } @@ -481,19 +481,19 @@ async function usdTieredSTO_launch(stoConfig) { let usdTieredSTOABI = abis.usdTieredSTO(); let configureFunction = usdTieredSTOABI.find(o => o.name === 'configure' && o.type === 'function'); - let bytesSTO = web3.eth.abi.encodeFunctionCall( configureFunction, - [ times.startTime, - times.endTime, - tiers.ratePerTier.map(r => web3.utils.toWei(r.toString())), - tiers.ratePerTierDiscountPoly.map(rd => web3.utils.toWei(rd.toString())), - tiers.tokensPerTier.map(t => web3.utils.toWei(t.toString())), - tiers.tokensPerTierDiscountPoly.map(td => web3.utils.toWei(td.toString())), - web3.utils.toWei(limits.nonAccreditedLimitUSD.toString()), - web3.utils.toWei(limits.minimumInvestmentUSD.toString()), - funding.raiseType, - addresses.wallet, - addresses.reserveWallet, - addresses.usdToken ] + let bytesSTO = web3.eth.abi.encodeFunctionCall(configureFunction, + [times.startTime, + times.endTime, + tiers.ratePerTier.map(r => web3.utils.toWei(r.toString())), + tiers.ratePerTierDiscountPoly.map(rd => web3.utils.toWei(rd.toString())), + tiers.tokensPerTier.map(t => web3.utils.toWei(t.toString())), + tiers.tokensPerTierDiscountPoly.map(td => web3.utils.toWei(td.toString())), + web3.utils.toWei(limits.nonAccreditedLimitUSD.toString()), + web3.utils.toWei(limits.minimumInvestmentUSD.toString()), + funding.raiseType, + addresses.wallet, + addresses.reserveWallet, + addresses.usdToken] ); let addModuleAction = securityToken.methods.addModule(usdTieredSTOFactoryAddress, bytesSTO, stoFee, 0); @@ -525,7 +525,7 @@ async function usdTieredSTO_status(currentSTO) { let raiseTypes = []; for (const fundType in gbl.constants.FUND_RAISE_TYPES) { if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES[fundType]).call()) { - raiseTypes.push(fundType); + raiseTypes.push(fundType); } } @@ -559,14 +559,14 @@ async function usdTieredSTO_status(currentSTO) { } displayTiers += ` - - Tier ${t+1}: + - Tier ${t + 1}: Tokens: ${web3.utils.fromWei(tokensPerTierTotal)} ${displayTokenSymbol} Rate: ${web3.utils.fromWei(ratePerTier)} USD per Token` - + displayDiscountTokens; + + displayDiscountTokens; - displayMintedPerTier += ` - - Tokens minted in Tier ${t+1}: ${web3.utils.fromWei(mintedPerTierTotal)} ${displayTokenSymbol}` - + displayMintedPerTierPerType; + displayMintedPerTier += ` + - Tokens minted in Tier ${t + 1}: ${web3.utils.fromWei(mintedPerTierTotal)} ${displayTokenSymbol}` + + displayMintedPerTierPerType; } let displayFundsRaisedUSD = web3.utils.fromWei(await currentSTO.methods.fundsRaisedUSD().call()); @@ -581,13 +581,13 @@ async function usdTieredSTO_status(currentSTO) { let walletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(gbl.constants.FUND_RAISE_TYPES[type], balance).call()); displayWalletBalancePerType += ` Balance ${type}:\t\t ${walletBalance} ${type} (${walletBalanceUSD} USD)`; - + balance = await getBalance(displayReserveWallet, gbl.constants.FUND_RAISE_TYPES[type]); let reserveWalletBalance = web3.utils.fromWei(balance); let reserveWalletBalanceUSD = web3.utils.fromWei(await currentSTO.methods.convertToUSD(gbl.constants.FUND_RAISE_TYPES[type], balance).call()); displayReserveWalletBalancePerType += ` Balance ${type}:\t\t ${reserveWalletBalance} ${type} (${reserveWalletBalanceUSD} USD)`; - + let fundsRaised = web3.utils.fromWei(await currentSTO.methods.fundsRaised(gbl.constants.FUND_RAISE_TYPES[type]).call()); displayFundsRaisedPerType += ` ${type}:\t\t\t ${fundsRaised} ${type}`; @@ -602,7 +602,7 @@ async function usdTieredSTO_status(currentSTO) { let displayRaiseType = raiseTypes.join(' - '); - let now = Math.floor(Date.now()/1000); + let now = Math.floor(Date.now() / 1000); let timeTitle; let timeRemaining; if (now < displayStartTime) { @@ -622,24 +622,24 @@ async function usdTieredSTO_status(currentSTO) { - End Time: ${new Date(displayEndTime * 1000)} - Raise Type: ${displayRaiseType} - Tiers: ${tiersLength}` - + displayTiers + ` + + displayTiers + ` - Minimum Investment: ${displayMinimumInvestmentUSD} USD - Non Accredited Limit: ${displayNonAccreditedLimitUSD} USD - Wallet: ${displayWallet}` - + displayWalletBalancePerType + ` + + displayWalletBalancePerType + ` - Reserve Wallet: ${displayReserveWallet}` - + displayReserveWalletBalancePerType + ` + + displayReserveWalletBalancePerType + ` --------------------------------------------------------------- - ${timeTitle} ${timeRemaining} - Is Finalized: ${displayIsFinalized} - Tokens Sold: ${displayTokensSold} ${displayTokenSymbol}` - + displayTokensSoldPerType + ` + + displayTokensSoldPerType + ` - Current Tier: ${displayCurrentTier}` - + displayMintedPerTier + ` + + displayMintedPerTier + ` - Investor count: ${displayInvestorCount} - Funds Raised` - + displayFundsRaisedPerType + ` + + displayFundsRaisedPerType + ` USD: ${displayFundsRaisedUSD} USD `); @@ -815,7 +815,7 @@ async function initialize(_tokenSymbol) { tokenSymbol = _tokenSymbol; } let securityTokenAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call(); - if (securityTokenAddress == '0x0000000000000000000000000000000000000000') { + if (securityTokenAddress == '0x0000000000000000000000000000000000000000') { console.log(chalk.red(`Selected Security Token ${tokenSymbol} does not exist.`)); process.exit(0); } @@ -833,7 +833,7 @@ function welcome() { console.log("Issuer Account: " + Issuer.address + "\n"); } -async function setup(){ +async function setup() { try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); let securityTokenRegistryABI = abis.securityTokenRegistry(); @@ -851,25 +851,25 @@ async function setup(){ usdToken.setProvider(web3.currentProvider); } catch (err) { console.log(err) - console.log('\x1b[31m%s\x1b[0m',"There was a problem getting the contracts. Make sure they are deployed to the selected network."); + console.log('\x1b[31m%s\x1b[0m', "There was a problem getting the contracts. Make sure they are deployed to the selected network."); process.exit(0); } } async function selectToken() { let result = null; - + let userTokens = await securityTokenRegistry.methods.getTokensByOwner(Issuer.address).call(); let tokenDataArray = await Promise.all(userTokens.map(async function (t) { let tokenData = await securityTokenRegistry.methods.getSecurityTokenData(t).call(); - return {symbol: tokenData[0], address: t}; + return { symbol: tokenData[0], address: t }; })); let options = tokenDataArray.map(function (t) { return `${t.symbol} - Deployed at ${t.address}`; }); options.push('Enter token symbol manually'); - let index = readlineSync.keyInSelect(options, 'Select a token:', {cancel: 'Exit'}); + let index = readlineSync.keyInSelect(options, 'Select a token:', { cancel: 'Exit' }); switch (options[index]) { case 'Enter token symbol manually': result = readlineSync.question('Enter the token symbol: '); @@ -881,16 +881,16 @@ async function selectToken() { result = tokenDataArray[index].symbol; break; } - + return result; } module.exports = { - executeApp: async function(_tokenSymbol) { + executeApp: async function (_tokenSymbol) { await initialize(_tokenSymbol); return executeApp(); }, - addSTOModule: async function(_tokenSymbol, stoConfig) { + addSTOModule: async function (_tokenSymbol, stoConfig) { await initialize(_tokenSymbol); return addSTOModule(stoConfig) } diff --git a/CLI/commands/token_manager.js b/CLI/commands/token_manager.js index 47361cb12..6faa7ba34 100644 --- a/CLI/commands/token_manager.js +++ b/CLI/commands/token_manager.js @@ -17,7 +17,7 @@ let featureRegistry; let securityToken; let allModules; -let tokenSymbol +let tokenSymbol async function setup() { try { @@ -63,7 +63,7 @@ async function displayTokenData() { let displayTransferFrozen = await securityToken.methods.transfersFrozen().call(); let displayMintingFrozen = await securityToken.methods.mintingFrozen().call(); let displayUserTokens = await securityToken.methods.balanceOf(Issuer.address).call(); - + console.log(` *************** Security Token Information **************** - Address: ${securityToken.options.address} @@ -137,7 +137,7 @@ async function selectAction() { } else { options.push('Freeze transfers'); } - + let isMintingFrozen = await securityToken.methods.mintingFrozen().call(); if (!isMintingFrozen) { let isFreezeMintingAllowed = await featureRegistry.methods.getFeatureStatus('freezeMintingAllowed').call(); @@ -147,7 +147,7 @@ async function selectAction() { } options.push('Create a checkpoint', 'List investors') - + let currentCheckpointId = await securityToken.methods.currentCheckpointId().call(); if (currentCheckpointId > 0) { options.push('List investors at checkpoint') @@ -159,7 +159,7 @@ async function selectAction() { options.push('Manage modules', 'Withdraw tokens from contract'); - let index = readlineSync.keyInSelect(options, 'What do you want to do?', {cancel: 'Exit'}); + let index = readlineSync.keyInSelect(options, 'What do you want to do?', { cancel: 'Exit' }); let selected = index == -1 ? 'Exit' : options[index]; console.log('Selected:', selected); switch (selected) { @@ -187,9 +187,9 @@ async function selectAction() { await listInvestors(); break; case 'List investors at checkpoint': - let checkpointId = readlineSync.questionInt('Enter the id of the checkpoint: ', { + let checkpointId = readlineSync.question('Enter the id of the checkpoint: ', { limit: function (input) { - return input > 0 && input <= currentCheckpointId; + return parseInt(input) > 0 && parseInt(input) <= parseInt(currentCheckpointId); }, limitMessage: `Must be greater than 0 and less than ${currentCheckpointId}` }); @@ -275,22 +275,22 @@ async function listInvestorsAtCheckpoint(checkpointId) { } else { console.log(chalk.yellow(`There are no investors at checkpoint ${checkpointId}`)); } - + } async function mintTokens() { let options = ['Modify whitelist', 'Mint tokens to a single address', `Modify whitelist and mint tokens using data from 'whitelist_data.csv' and 'multi_mint_data.csv'`]; - let index = readlineSync.keyInSelect(options, 'What do you want to do?', {cancel: 'Return'}); + let index = readlineSync.keyInSelect(options, 'What do you want to do?', { cancel: 'Return' }); let selected = index == -1 ? 'Return' : options[index]; console.log('Selected:', selected); switch (selected) { case 'Modify whitelist': let investor = readlineSync.question('Enter the address to whitelist: ', { - limit: function(input) { + limit: function (input) { return web3.utils.isAddress(input); }, limitMessage: "Must be a valid address" - }); + }); let fromTime = readlineSync.questionInt('Enter the time (Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens: '); let toTime = readlineSync.questionInt('Enter the time (Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others: '); let expiryTime = readlineSync.questionInt('Enter the time till investors KYC will be validated (after that investor need to do re-KYC): '); @@ -354,7 +354,7 @@ async function withdrawFromContract(erc20address, value) { async function listModuleOptions() { let options = ['Add a module'] - + let unpausedModules = allModules.filter(m => m.paused == false); if (unpausedModules.length > 0) { options.push('Pause a module'); @@ -379,7 +379,7 @@ async function listModuleOptions() { options.push('Remove a module', 'Change module budget'); } - let index = readlineSync.keyInSelect(options, chalk.yellow('What do you want to do?'), {cancel: 'Return'}); + let index = readlineSync.keyInSelect(options, chalk.yellow('What do you want to do?'), { cancel: 'Return' }); let selected = index == -1 ? 'Exit' : options[index]; console.log('Selected:', selected); switch (selected) { @@ -403,14 +403,14 @@ async function listModuleOptions() { break; case 'Change module budget': await changeBudget(allModules); - break; + break; } } // Modules a actions async function addModule() { let options = ['Permission Manager', 'Transfer Manager', 'Security Token Offering', 'Dividends', 'Burn']; - let index = readlineSync.keyInSelect(options, 'What type of module whould you like to add?', {cancel: 'Return'}); + let index = readlineSync.keyInSelect(options, 'What type of module whould you like to add?', { cancel: 'Return' }); switch (options[index]) { case 'Permission Manager': console.log(chalk.red(` @@ -446,7 +446,7 @@ async function pauseModule(modules) { let options = modules.map(m => `${m.name} (${m.address})`); let index = readlineSync.keyInSelect(options, 'Which module whould you like to pause?'); if (index != -1) { - console.log("\nSelected:",options[index]); + console.log("\nSelected:", options[index]); let moduleABI; if (modules[index].type == gbl.constants.MODULES_TYPES.STO) { moduleABI = abis.ISTO(); @@ -467,7 +467,7 @@ async function unpauseModule(modules) { let options = modules.map(m => `${m.name} (${m.address})`); let index = readlineSync.keyInSelect(options, 'Which module whould you like to pause?'); if (index != -1) { - console.log("\nSelected: ",options[index]); + console.log("\nSelected: ", options[index]); let moduleABI; if (modules[index].type == gbl.constants.MODULES_TYPES.STO) { moduleABI = abis.ISTO(); @@ -488,9 +488,9 @@ async function archiveModule(modules) { let options = modules.map(m => `${m.name} (${m.address})`); let index = readlineSync.keyInSelect(options, 'Which module would you like to archive?'); if (index != -1) { - console.log("\nSelected: ",options[index]); + console.log("\nSelected: ", options[index]); let archiveModuleAction = securityToken.methods.archiveModule(modules[index].address); - await common.sendTransaction(archiveModuleAction, {factor: 2}); + await common.sendTransaction(archiveModuleAction, { factor: 2 }); console.log(chalk.green(`${modules[index].name} has been archived successfully!`)); } } @@ -499,9 +499,9 @@ async function unarchiveModule(modules) { let options = modules.map(m => `${m.name} (${m.address})`); let index = readlineSync.keyInSelect(options, 'Which module whould you like to unarchive?'); if (index != -1) { - console.log("\nSelected: ",options[index]); + console.log("\nSelected: ", options[index]); let unarchiveModuleAction = securityToken.methods.unarchiveModule(modules[index].address); - await common.sendTransaction(unarchiveModuleAction, {factor: 2}); + await common.sendTransaction(unarchiveModuleAction, { factor: 2 }); console.log(chalk.green(`${modules[index].name} has been unarchived successfully!`)); } } @@ -510,9 +510,9 @@ async function removeModule(modules) { let options = modules.map(m => `${m.name} (${m.address})`); let index = readlineSync.keyInSelect(options, 'Which module whould you like to remove?'); if (index != -1) { - console.log("\nSelected: ",options[index]); + console.log("\nSelected: ", options[index]); let removeModuleAction = securityToken.methods.removeModule(modules[index].address); - await common.sendTransaction(removeModuleAction, {factor: 2}); + await common.sendTransaction(removeModuleAction, { factor: 2 }); console.log(chalk.green(`${modules[index].name} has been removed successfully!`)); } } @@ -521,8 +521,8 @@ async function changeBudget() { let options = modules.map(m => `${m.name} (${m.address})`); let index = readlineSync.keyInSelect(options, 'Which module whould you like to remove?'); if (index != -1) { - console.log("\nSelected: ",options[index]); - let increase = 0 == readlineSync.keyInSelect(['Increase', 'Decrease'], `Do you want to increase or decrease budget?`, {cancel: false}); + console.log("\nSelected: ", options[index]); + let increase = 0 == readlineSync.keyInSelect(['Increase', 'Decrease'], `Do you want to increase or decrease budget?`, { cancel: false }); let amount = readlineSync.question(`Enter the amount of POLY to change in allowance`); let changeModuleBudgetAction = securityToken.methods.changeModuleBudget(modules[index].address, web3.utils.toWei(amount), increase); await common.sendTransaction(changeModuleBudgetAction); @@ -532,7 +532,7 @@ async function changeBudget() { // Helpers async function showUserInfo(_user) { - console.log(` + console.log(` ******************** User Information ********************* - Address: ${_user} - POLY balance: ${web3.utils.fromWei(await polyToken.methods.balanceOf(_user).call())} @@ -568,7 +568,7 @@ async function getAllModules() { pausedTemp = await contractTemp.methods.paused().call(); } modules.push(new ModuleInfo(type, nameTemp, details[1], details[2], details[3], pausedTemp)); - } catch(error) { + } catch (error) { console.log(error); console.log(chalk.red(` ************************* @@ -590,7 +590,7 @@ async function initialize(_tokenSymbol) { tokenSymbol = _tokenSymbol; } let securityTokenAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call(); - if (securityTokenAddress == '0x0000000000000000000000000000000000000000') { + if (securityTokenAddress == '0x0000000000000000000000000000000000000000') { console.log(chalk.red(`Selected Security Token ${tokenSymbol} does not exist.`)); process.exit(0); } @@ -610,18 +610,18 @@ function welcome() { async function selectToken() { let result = null; - + let userTokens = await securityTokenRegistry.methods.getTokensByOwner(Issuer.address).call(); let tokenDataArray = await Promise.all(userTokens.map(async function (t) { let tokenData = await securityTokenRegistry.methods.getSecurityTokenData(t).call(); - return {symbol: tokenData[0], address: t}; + return { symbol: tokenData[0], address: t }; })); let options = tokenDataArray.map(function (t) { return `${t.symbol} - Deployed at ${t.address}`; }); options.push('Enter token symbol manually'); - let index = readlineSync.keyInSelect(options, 'Select a token:', {cancel: 'Exit'}); + let index = readlineSync.keyInSelect(options, 'Select a token:', { cancel: 'Exit' }); switch (options[index]) { case 'Enter token symbol manually': result = readlineSync.question('Enter the token symbol: '); @@ -633,12 +633,12 @@ async function selectToken() { result = tokenDataArray[index].symbol; break; } - + return result; } module.exports = { - executeApp: async function(_tokenSymbol) { + executeApp: async function (_tokenSymbol) { await initialize(_tokenSymbol) return executeApp(); } From 9335b27e162f9386154e050898186f5e381e3e7e Mon Sep 17 00:00:00 2001 From: satyam Date: Wed, 28 Nov 2018 19:55:47 +0530 Subject: [PATCH 103/139] minor fix in readme to reset the MATM --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9caa44f67..8c5ae0a4e 100644 --- a/README.md +++ b/README.md @@ -218,7 +218,7 @@ node CLI/polymath-cli dividends_manager | ERC20 Dividends Checkpoint Factory: | [0x82f9f1ab41bacb1433c79492e54bf13bccd7f9ae](https://etherscan.io/address/0x82f9f1ab41bacb1433c79492e54bf13bccd7f9ae) | | Count Transfer Manager Factory: | [0xd9fd7e34d6e2c47a69e02131cf8554d52c3445d5](https://etherscan.io/address/0xd9fd7e34d6e2c47a69e02131cf8554d52c3445d5) | | Percentage Transfer Manager Factory: | [0xe6267a9c0a227d21c95b782b1bd32bb41fc3b43b](https://etherscan.io/address/0xe6267a9c0a227d21c95b782b1bd32bb41fc3b43b) | -| Manual Approval Transfer Manager Factory (2.0.1): | [0x6af2afad53cb334e62b90ddbdcf3a086f654c298](https://etherscan.io/address/0xe6267a9c0a227d21c95b782b1bd32bb41fc3b43b) | +| Manual Approval Transfer Manager Factory (2.0.1): | [0x6af2afad53cb334e62b90ddbdcf3a086f654c298](https://etherscan.io/address/0x6af2afad53cb334e62b90ddbdcf3a086f654c298) | New SecurityTokenRegistry (2.0.1): 0x538136ed73011a766bf0a126a27300c3a7a2e6a6 From 17f10154cb8058617ccad792302738a827774b4c Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 28 Nov 2018 21:37:13 +0530 Subject: [PATCH 104/139] Updated comments --- contracts/modules/STO/CappedSTO.sol | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/contracts/modules/STO/CappedSTO.sol b/contracts/modules/STO/CappedSTO.sol index 0d79d285c..d85fcb3da 100644 --- a/contracts/modules/STO/CappedSTO.sol +++ b/contracts/modules/STO/CappedSTO.sol @@ -13,10 +13,11 @@ contract CappedSTO is ISTO, ReentrancyGuard { // Determine whether users can invest on behalf of a beneficiary bool public allowBeneficialInvestments = false; - // How many token units multiplied by 10^18 a buyer gets per wei / base unit of POLY + // How many token units a buyer gets (multiplied by 10^18) per wei / base unit of POLY // If rate is 10^18, buyer will get 1 token unit for every wei / base unit of poly. uint256 public rate; - //How many tokens this STO will be allowed to sell to investors + //How many token base units this STO will be allowed to sell to investors + // 1 full token = 10^decimals_of_token base units uint256 public cap; mapping (address => uint256) public investors; @@ -49,8 +50,8 @@ contract CappedSTO is ISTO, ReentrancyGuard { * @notice Function used to intialize the contract variables * @param _startTime Unix timestamp at which offering get started * @param _endTime Unix timestamp at which offering get ended - * @param _cap Maximum No. of tokens for sale - * @param _rate Token units multiplied by 10^18 a buyer gets per wei / base unit of POLY + * @param _cap Maximum No. of token base units for sale + * @param _rate Token units a buyer gets multiplied by 10^18 per wei / base unit of POLY * @param _fundRaiseTypes Type of currency used to collect the funds * @param _fundsReceiver Ethereum account address to hold the funds */ @@ -154,8 +155,8 @@ contract CappedSTO is ISTO, ReentrancyGuard { * @notice Return the STO details * @return Unixtimestamp at which offering gets start. * @return Unixtimestamp at which offering ends. - * @return Number of tokens this STO will be allowed to sell to investors. - * @return Token units multiplied by 10^18 a buyer gets per wei / base unit of POLY + * @return Number of token base units this STO will be allowed to sell to investors. + * @return Token units a buyer gets(multiplied by 10^18) per wei / base unit of POLY * @return Amount of funds raised * @return Number of individual investors this STO have. * @return Amount of tokens get sold. From dde0a91f847fee0a1ee2213e2b1b7b77e47471f6 Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 28 Nov 2018 14:37:51 -0300 Subject: [PATCH 105/139] Allow to add TM modules from token_manager --- CLI/commands/token_manager.js | 6 ++---- CLI/commands/transfer_manager.js | 4 ++++ CLI/polymath-cli.js | 32 ++++++++++++++++---------------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/CLI/commands/token_manager.js b/CLI/commands/token_manager.js index 6faa7ba34..eaa70b09a 100644 --- a/CLI/commands/token_manager.js +++ b/CLI/commands/token_manager.js @@ -4,6 +4,7 @@ const chalk = require('chalk'); const whitelist = require('./whitelist'); const multimint = require('./multi_mint'); const stoManager = require('./sto_manager'); +const transferManager = require('./transfer_manager'); const common = require('./common/common_functions'); const gbl = require('./common/global'); @@ -419,10 +420,7 @@ async function addModule() { *********************************`)); break; case 'Transfer Manager': - console.log(chalk.red(` - ********************************* - This option is not yet available. - *********************************`)); + await transferManager.addTransferManagerModule(tokenSymbol) break; case 'Security Token Offering': await stoManager.addSTOModule(tokenSymbol) diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index e4a62891a..083c95e14 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -948,5 +948,9 @@ module.exports = { executeApp: async function (_tokenSymbol) { await initialize(_tokenSymbol); return executeApp(); + }, + addTransferManagerModule: async function (_tokenSymbol) { + await initialize(_tokenSymbol); + return addTransferManagerModule() } } \ No newline at end of file diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index f154b5f8a..79b9c4c70 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -35,7 +35,7 @@ program .option('-d, --details
', 'Off-chain details of the token') .option('-D, --divisible
', 'If token is divisible or not [true]', /^(true|false)/) .description('Wizard-like script that will guide technical users in the creation and deployment of an ST-20 token') - .action(async function(cmd) { + .action(async function (cmd) { await gbl.initialize(program.remoteNode); await st20generator.executeApp(cmd.ticker, cmd.transferOwnership, cmd.tokenName, cmd.details, cmd.divisible); }); @@ -46,7 +46,7 @@ program .option('-t, --securityToken ', 'Selects a ST to manage modules') .option('-l, --launch ', 'Uses configuration file to configure and launch a STO') .description('Wizard-like script that will guide technical users in the creation of an STO') - .action(async function(cmd) { + .action(async function (cmd) { await gbl.initialize(program.remoteNode); if (cmd.launch) { let config = yaml.safeLoad(fs.readFileSync(`${__dirname}/${cmd.launch}`, 'utf8')); @@ -60,7 +60,7 @@ program .command('faucet [beneficiary] [amount]') .alias('f') .description('Poly faucet for local private netwtorks') - .action(async function(beneficiary, amount) { + .action(async function (beneficiary, amount) { await gbl.initialize(program.remoteNode); await faucet.executeApp(beneficiary, amount); }); @@ -69,7 +69,7 @@ program .command('investor_portal [investor] [privateKey] [symbol] [currency] [amount]') .alias('i') .description('Participate in any STO you have been whitelisted for') - .action(async function(investor, privateKey, symbol, currency, amount) { + .action(async function (investor, privateKey, symbol, currency, amount) { await gbl.initialize(program.remoteNode); await investor_portal.executeApp(investor, privateKey, symbol, currency, amount); }); @@ -79,7 +79,7 @@ program .alias('stm') .option('-t, --securityToken ', 'Selects a ST to manage') .description('Manage your Security Tokens, mint tokens, add modules and change config') - .action(async function(cmd) { + .action(async function (cmd) { await gbl.initialize(program.remoteNode); await token_manager.executeApp(cmd.securityToken); }); @@ -88,7 +88,7 @@ program .command('multi_mint [batchSize]') .alias('mi') .description('Distribute tokens to previously whitelisted investors') - .action(async function(tokenSymbol, batchSize) { + .action(async function (tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); await multimint.executeApp(tokenSymbol, batchSize); }); @@ -97,7 +97,7 @@ program .command('transfer ') .alias('t') .description('Transfer ST tokens to another account') - .action(async function(tokenSymbol, transferTo, transferAmount) { + .action(async function (tokenSymbol, transferTo, transferAmount) { await gbl.initialize(program.remoteNode); await transfer.executeApp(tokenSymbol, transferTo, transferAmount); }); @@ -106,7 +106,7 @@ program .command('transfer_ownership ') .alias('to') .description('Transfer Ownership of an own contract to another account') - .action(async function(contractAddress, transferTo) { + .action(async function (contractAddress, transferTo) { await gbl.initialize(program.remoteNode); await transfer_ownership.executeApp(contractAddress, transferTo); }); @@ -115,7 +115,7 @@ program .command('whitelist [batchSize]') .alias('w') .description('Mass-update a whitelist of allowed/known investors') - .action(async function(tokenSymbol, batchSize) { + .action(async function (tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); await whitelist.executeApp(tokenSymbol, batchSize); }); @@ -124,7 +124,7 @@ program .command('dividends_manager [dividendsType]') .alias('dm') .description('Runs dividends_manager') - .action(async function(dividendsType) { + .action(async function (dividendsType) { await gbl.initialize(program.remoteNode); await dividends_manager.executeApp(dividendsType); }); @@ -134,7 +134,7 @@ program .alias('tm') .option('-t, --securityToken ', 'Selects a ST to manage transfer modules') .description('Runs transfer_manager') - .action(async function(cmd) { + .action(async function (cmd) { await gbl.initialize(program.remoteNode); await transfer_manager.executeApp(cmd.securityToken); }); @@ -143,7 +143,7 @@ program .command('contract_manager') .alias('cm') .description('Runs contract_manager') - .action(async function() { + .action(async function () { await gbl.initialize(program.remoteNode); await contract_manager.executeApp(); }); @@ -152,7 +152,7 @@ program .command('accredit [batchSize]') .alias('a') .description('Runs accredit') - .action(async function(tokenSymbol, batchSize) { + .action(async function (tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); await accredit.executeApp(tokenSymbol, batchSize); }); @@ -161,7 +161,7 @@ program .command('nonAccreditedLimit [batchSize]') .alias('nal') .description('Runs changeNonAccreditedLimit') - .action(async function(tokenSymbol, batchSize) { + .action(async function (tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); await changeNonAccreditedLimit.executeApp(tokenSymbol, batchSize); }); @@ -170,7 +170,7 @@ program .command('strMigrator [toStrAddress] [fromTrAddress] [fromStrAddress]') .alias('str') .description('Runs STR Migrator') - .action(async function(toStrAddress, fromTrAddress, fromStrAddress) { + .action(async function (toStrAddress, fromTrAddress, fromStrAddress) { await gbl.initialize(program.remoteNode); await strMigrator.executeApp(toStrAddress, fromTrAddress, fromStrAddress); }); @@ -179,7 +179,7 @@ program .command('permission_manager') .alias('pm') .description('Runs permission_manager') - .action(async function() { + .action(async function () { await gbl.initialize(program.remoteNode); await permission_manager.executeApp(); }); From 9105172b8335034261ece564717514317e7d2ac8 Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 28 Nov 2018 14:43:00 -0300 Subject: [PATCH 106/139] Whitelist from csv fix --- CLI/commands/transfer_manager.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 083c95e14..004bc603a 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -5,6 +5,7 @@ var common = require('./common/common_functions'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); var gbl = require('./common/global'); +var whitelist = require('./whitelist'); // App flow let tokenSymbol; @@ -373,7 +374,7 @@ async function generalTransferManager() { case 'Modify whitelist from CSV': console.log(chalk.yellow(`Data is going to be read from 'data/whitelist_data.csv'. Be sure this file is updated!`)); if (readlineSync.keyInYNStrict(`Do you want to continue?`)) { - shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${network}`); + await whitelist.executeApp(tokenSymbl); } break; /* From 7064effab2fd74eb7a6c5021e263c0d6c49795cb Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 28 Nov 2018 14:44:06 -0300 Subject: [PATCH 107/139] Deleted network variable --- CLI/commands/transfer_manager.js | 1 - 1 file changed, 1 deletion(-) diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 004bc603a..44ae64ca1 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -11,7 +11,6 @@ var whitelist = require('./whitelist'); let tokenSymbol; let securityToken; let securityTokenRegistry; -let network; let currentTransferManager; async function executeApp() { From 09424e0b35f95d8a2fe961adc2b9c4ccfc9e370e Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 28 Nov 2018 15:28:23 -0300 Subject: [PATCH 108/139] CLI - Fix at removing modules --- CLI/commands/token_manager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CLI/commands/token_manager.js b/CLI/commands/token_manager.js index 6faa7ba34..98d13fd3d 100644 --- a/CLI/commands/token_manager.js +++ b/CLI/commands/token_manager.js @@ -372,11 +372,11 @@ async function listModuleOptions() { let archivedModules = allModules.filter(m => m.archived); if (archivedModules.length > 0) { - options.push('Unarchive a module'); + options.push('Unarchive a module', 'Remove a module'); } if (allModules.length > 0) { - options.push('Remove a module', 'Change module budget'); + options.push('Change module budget'); } let index = readlineSync.keyInSelect(options, chalk.yellow('What do you want to do?'), { cancel: 'Return' }); @@ -399,7 +399,7 @@ async function listModuleOptions() { await unarchiveModule(archivedModules); break; case 'Remove a module': - await removeModule(allModules); + await removeModule(archivedModules); break; case 'Change module budget': await changeBudget(allModules); From 51392544d8b5976ffb724e7f7a8d845b7db74d81 Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 28 Nov 2018 15:54:34 -0300 Subject: [PATCH 109/139] CLI - Fix on exit at token selection --- CLI/commands/sto_manager.js | 3 ++- CLI/commands/token_manager.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index d0fd1c3ea..d70c0ca81 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -870,7 +870,8 @@ async function selectToken() { options.push('Enter token symbol manually'); let index = readlineSync.keyInSelect(options, 'Select a token:', { cancel: 'Exit' }); - switch (options[index]) { + let selected = index != -1 ? options[index] : 'Exit'; + switch (selected) { case 'Enter token symbol manually': result = readlineSync.question('Enter the token symbol: '); break; diff --git a/CLI/commands/token_manager.js b/CLI/commands/token_manager.js index 98d13fd3d..fe9590f1f 100644 --- a/CLI/commands/token_manager.js +++ b/CLI/commands/token_manager.js @@ -622,7 +622,8 @@ async function selectToken() { options.push('Enter token symbol manually'); let index = readlineSync.keyInSelect(options, 'Select a token:', { cancel: 'Exit' }); - switch (options[index]) { + let selected = index != -1 ? options[index] : 'Exit'; + switch (selected) { case 'Enter token symbol manually': result = readlineSync.question('Enter the token symbol: '); break; From 81054dcf0fef34fdb6df6db2bf7c8e4291a88bae Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 28 Nov 2018 16:39:15 -0300 Subject: [PATCH 110/139] CLI - Support for not integer rates on CappedSTO --- CLI/commands/investor_portal.js | 93 ++++++++++++++++----------------- CLI/commands/sto_manager.js | 6 +-- 2 files changed, 48 insertions(+), 51 deletions(-) diff --git a/CLI/commands/investor_portal.js b/CLI/commands/investor_portal.js index 1ced21ce0..cdfa66828 100644 --- a/CLI/commands/investor_portal.js +++ b/CLI/commands/investor_portal.js @@ -9,8 +9,6 @@ var gbl = require('./common/global'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); -const STO_KEY = 3; - let securityTokenRegistry; let securityToken; let selectedSTO; @@ -50,7 +48,7 @@ async function executeApp(investorAddress, investorPrivKey, symbol, currency, am } } if (investorAddress != "") { - User = { address: investorAddress, privateKey: investorPrivKey}; + User = { address: investorAddress, privateKey: investorPrivKey }; } else { User = Issuer; } @@ -111,7 +109,7 @@ async function inputSymbol(symbol) { if (STSymbol == "") process.exit(); STAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(STSymbol).call(); - if (STAddress == "0x0000000000000000000000000000000000000000"){ + if (STAddress == "0x0000000000000000000000000000000000000000") { console.log(`Token symbol provided is not a registered Security Token. Please enter another symbol.`); } else { let securityTokenABI = abis.securityToken(); @@ -123,12 +121,12 @@ async function inputSymbol(symbol) { let generalTransferManagerABI = abis.generalTransferManager(); generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, gtmModule[0]); - let stoModules = await securityToken.methods.getModulesByType(STO_KEY).call(); + let stoModules = await securityToken.methods.getModulesByType(gbl.constants.MODULES_TYPES.STO).call(); if (stoModules.length == 0) { console.log(chalk.red(`There is no STO module attached to the ${STSymbol.toUpperCase()} Token. No further actions can be taken.`)); process.exit(0); } else { - STOAddress = stoModules[0]; + STOAddress = stoModules[0]; let stoModuleData = await securityToken.methods.getModule(STOAddress).call(); selectedSTO = web3.utils.toAscii(stoModuleData[0]).replace(/\u0000/g, ''); let interfaceSTOABI = abis.stoInterface(); @@ -187,19 +185,19 @@ async function showCappedSTOInfo() { } } - let now = Math.floor(Date.now()/1000); + let now = Math.floor(Date.now() / 1000); - await generalTransferManager.methods.whitelist(User.address).call({}, function(error, result){ + await generalTransferManager.methods.whitelist(User.address).call({}, function (error, result) { displayCanBuy = result.canBuyFromSTO; displayValidKYC = parseInt(result.expiryTime) > now; }); let timeTitle; let timeRemaining; - if(now < displayStartTime){ + if (now < displayStartTime) { timeTitle = "STO starts in: "; timeRemaining = displayStartTime - now; - }else{ + } else { timeTitle = "Time remaining:"; timeRemaining = displayEndTime - now; } @@ -213,7 +211,7 @@ async function showCappedSTOInfo() { - Start Time: ${new Date(displayStartTime * 1000)} - End Time: ${new Date(displayEndTime * 1000)} - Raise Type: ${displayRaiseType} - - Rate: 1 ${displayRaiseType} = ${displayRate} ${STSymbol.toUpperCase()} + - Rate: 1 ${displayRaiseType} = ${web3.utils.fromWei(displayRate)} ${STSymbol.toUpperCase()} --------------------------------------------------------------- - ${timeTitle} ${timeRemaining} - Funds raised: ${web3.utils.fromWei(displayFundsRaised)} ${displayRaiseType} @@ -222,7 +220,7 @@ async function showCappedSTOInfo() { - Investor count: ${displayInvestorCount} `); - if(!displayCanBuy) { + if (!displayCanBuy) { console.log(chalk.red(`Your address is not approved to participate in this token sale.\n`)); process.exit(0); } else if (!displayValidKYC) { @@ -237,8 +235,7 @@ async function showCappedSTOInfo() { } } -async function showUserInfoForUSDTieredSTO() -{ +async function showUserInfoForUSDTieredSTO() { for (const fundType in gbl.constants.FUND_RAISE_TYPES) { if (await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES[fundType]).call()) { let displayInvestorInvested = web3.utils.fromWei(await currentSTO.methods.investorInvested(User.address, gbl.constants.FUND_RAISE_TYPES[fundType]).call()); @@ -249,15 +246,15 @@ async function showUserInfoForUSDTieredSTO() let displayInvestorInvestedUSD = web3.utils.fromWei(await currentSTO.methods.investorInvestedUSD(User.address).call()); console.log(` - Invested in USD: ${displayInvestorInvestedUSD} USD`); - await generalTransferManager.methods.whitelist(User.address).call({}, function(error, result){ + await generalTransferManager.methods.whitelist(User.address).call({}, function (error, result) { displayCanBuy = result.canBuyFromSTO; - displayValidKYC = parseInt(result.expiryTime) > Math.floor(Date.now()/1000); + displayValidKYC = parseInt(result.expiryTime) > Math.floor(Date.now() / 1000); }); - console.log(` - Whitelisted: ${(displayCanBuy)? 'YES' : 'NO'}`); - console.log(` - Valid KYC: ${(displayValidKYC)? 'YES' : 'NO'}`); + console.log(` - Whitelisted: ${(displayCanBuy) ? 'YES' : 'NO'}`); + console.log(` - Valid KYC: ${(displayValidKYC) ? 'YES' : 'NO'}`); let displayIsUserAccredited = await currentSTO.methods.accredited(User.address).call(); - console.log(` - Accredited: ${(displayIsUserAccredited)? "YES" : "NO"}`) + console.log(` - Accredited: ${(displayIsUserAccredited) ? "YES" : "NO"}`) if (!await currentSTO.methods.accredited(User.address).call()) { let displayOverrideNonAccreditedLimitUSD = web3.utils.fromWei(await currentSTO.methods.nonAccreditedLimitUSDOverride(User.address).call()) @@ -310,7 +307,7 @@ async function showUSDTieredSTOInfo() { displayDiscountMinted = `(${web3.utils.fromWei(mintedPerTierDiscountPoly)} ${displayTokenSymbol} at discounted rate)`; } - + let mintedPerTier = mintedPerTierPerRaiseType[gbl.constants.FUND_RAISE_TYPES[type]]; displayMintedPerTierPerType += ` @@ -318,14 +315,14 @@ async function showUSDTieredSTOInfo() { } displayTiers += ` - - Tier ${t+1}: + - Tier ${t + 1}: Tokens: ${web3.utils.fromWei(tokensPerTierTotal)} ${displayTokenSymbol} Rate: ${web3.utils.fromWei(ratePerTier)} USD per Token` - + displayDiscountTokens; + + displayDiscountTokens; - displayMintedPerTier += ` - - Tokens minted in Tier ${t+1}: ${web3.utils.fromWei(mintedPerTierTotal)} ${displayTokenSymbol}` - + displayMintedPerTierPerType; + displayMintedPerTier += ` + - Tokens minted in Tier ${t + 1}: ${web3.utils.fromWei(mintedPerTierTotal)} ${displayTokenSymbol}` + + displayMintedPerTierPerType; } let displayFundsRaisedUSD = web3.utils.fromWei(await currentSTO.methods.fundsRaisedUSD().call()); @@ -347,7 +344,7 @@ async function showUSDTieredSTOInfo() { let displayRaiseType = raiseTypes.join(' - '); - let now = Math.floor(Date.now()/1000); + let now = Math.floor(Date.now() / 1000); let timeTitle; let timeRemaining; if (now < displayStartTime) { @@ -366,18 +363,18 @@ async function showUSDTieredSTOInfo() { - End Time: ${new Date(displayEndTime * 1000)} - Raise Type: ${displayRaiseType} - Tiers: ${tiersLength}` - + displayTiers + ` + + displayTiers + ` - Minimum Investment: ${displayMinimumInvestmentUSD} USD - Default NonAccredited Limit: ${displayNonAccreditedLimitUSD} USD ----------------------------------------------------------------------- - ${timeTitle} ${timeRemaining} - Tokens Sold: ${displayTokensSold} ${displayTokenSymbol}` - + displayTokensSoldPerType + ` + + displayTokensSoldPerType + ` - Current Tier: ${displayCurrentTier}` - + displayMintedPerTier + ` + + displayMintedPerTier + ` - Investor count: ${displayInvestorCount} - Funds Raised` - + displayFundsRaisedPerType + ` + + displayFundsRaisedPerType + ` USD: ${displayFundsRaisedUSD} USD `); @@ -411,7 +408,7 @@ async function investCappedSTO(currency, amount) { } if (amt == "") process.exit(); - let rate = await currentSTO.methods.rate().call(); + let rate = web3.utils.fromWei(await currentSTO.methods.rate().call()); let cost = new BigNumber(amt).div(rate); console.log(`This investment will cost ${cost} ${raiseTypes[0]}`); @@ -422,11 +419,11 @@ async function investCappedSTO(currency, amount) { let allowance = await polyToken.methods.allowance(STOAddress, User.address).call(); if (allowance < costWei) { let approveAction = polyToken.methods.approve(STOAddress, costWei); - await common.sendTransaction(approveAction, {from: User}); + await common.sendTransaction(approveAction, { from: User }); } let actionBuyTokensWithPoly = currentSTO.methods.buyTokensWithPoly(costWei); - let receipt = await common.sendTransaction(actionBuyTokensWithPoly, {from: User}); - logTokensPurchasedCappedSTO(receipt); + let receipt = await common.sendTransaction(actionBuyTokensWithPoly, { from: User }); + logTokensPurchasedCappedSTO(receipt, 'POLY'); } else { console.log(chalk.red(`Not enough balance to Buy tokens, Require ${cost} POLY but have ${userBalance} POLY.`)); console.log(chalk.red(`Please purchase a smaller amount of tokens or access the POLY faucet to get the POLY to complete this txn.`)); @@ -434,8 +431,8 @@ async function investCappedSTO(currency, amount) { } } else { let actionBuyTokens = currentSTO.methods.buyTokens(User.address); - let receipt = await common.sendTransaction(actionBuyTokens, {from: User, value: costWei}); - logTokensPurchasedCappedSTO(receipt); + let receipt = await common.sendTransaction(actionBuyTokens, { from: User, value: costWei }); + logTokensPurchasedCappedSTO(receipt, 'ETH'); } await showTokenInfo(); } @@ -456,7 +453,7 @@ async function investUsdTieredSTO(currency, amount) { console.log(chalk.green(` Current ${type} price:\t\t ${displayPrice} USD`)); } if (raiseTypes.length > 1) { - let index = readlineSync.keyInSelect(raiseTypes, 'Choose one of the allowed raise types: ', {cancel: false}); + let index = readlineSync.keyInSelect(raiseTypes, 'Choose one of the allowed raise types: ', { cancel: false }); raiseType = raiseTypes[index]; } else { raiseType = raiseTypes[0]; @@ -470,7 +467,7 @@ async function investUsdTieredSTO(currency, amount) { let minimumInvestmentUSD = await currentSTO.methods.minimumInvestmentUSD().call(); let minimumInvestmentRaiseType = await currentSTO.methods.convertFromUSD(gbl.constants.FUND_RAISE_TYPES[raiseType], minimumInvestmentUSD).call(); cost = readlineSync.question(chalk.yellow(`Enter the amount of ${raiseType} you would like to invest or press 'Enter' to exit: `), { - limit: function(input) { + limit: function (input) { return investorInvestedUSD != 0 || parseInt(input) > parseInt(web3.utils.fromWei(minimumInvestmentRaiseType)); }, limitMessage: `Amount must be greater than minimum investment (${web3.utils.fromWei(minimumInvestmentRaiseType)} ${raiseType} = ${web3.utils.fromWei(minimumInvestmentUSD)} USD)` @@ -496,10 +493,10 @@ async function investUsdTieredSTO(currency, amount) { let allowance = await polyToken.methods.allowance(STOAddress, User.address).call(); if (allowance < costWei) { let approveAction = polyToken.methods.approve(STOAddress, costWei); - await common.sendTransaction(approveAction, {from: User}); + await common.sendTransaction(approveAction, { from: User }); } let actionBuyWithPoly = currentSTO.methods.buyWithPOLYRateLimited(User.address, costWei, minTokenToBuy); - let receipt = await common.sendTransaction(actionBuyWithPoly, {from: User, factor: 2}); + let receipt = await common.sendTransaction(actionBuyWithPoly, { from: User, factor: 2 }); logTokensPurchasedUSDTieredSTO(receipt); } else { console.log(chalk.red(`Not enough balance to Buy tokens, Require ${cost} POLY but have ${userBalance} POLY.`)); @@ -512,19 +509,19 @@ async function investUsdTieredSTO(currency, amount) { let allowance = await usdToken.methods.allowance(STOAddress, User.address).call(); if (allowance < costWei) { let approveAction = usdToken.methods.approve(STOAddress, costWei); - await common.sendTransaction(approveAction, {from: User}); + await common.sendTransaction(approveAction, { from: User }); } let actionBuyWithUSD = currentSTO.methods.buyWithUSDRateLimited(User.address, costWei, minTokenToBuy); - let receipt = await common.sendTransaction(actionBuyWithUSD, {from: User, factor: 1.5}); + let receipt = await common.sendTransaction(actionBuyWithUSD, { from: User, factor: 1.5 }); logTokensPurchasedUSDTieredSTO(receipt); } else { console.log(chalk.red(`Not enough balance to Buy tokens, Require ${cost} DAI but have ${userBalance} DAI.`)); console.log(chalk.red(`Please purchase a smaller amount of tokens.`)); process.exit(); - } + } } else { let actionBuyWithETH = currentSTO.methods.buyWithETHRateLimited(User.address, minTokenToBuy); - let receipt = await common.sendTransaction(actionBuyWithETH, {from: User, value: costWei}); + let receipt = await common.sendTransaction(actionBuyWithETH, { from: User, value: costWei }); logTokensPurchasedUSDTieredSTO(receipt); } @@ -554,7 +551,7 @@ function logTokensPurchasedUSDTieredSTO(receipt) { }; } -function logTokensPurchasedCappedSTO(receipt) { +function logTokensPurchasedCappedSTO(receipt, displayRaiseType) { console.log(chalk.green(`Congratulations! The token purchase was successfully completed.`)); let events = common.getMultipleEventsFromLogs(currentSTO._jsonInterface, receipt.logs, 'TokenPurchase'); for (event of events) { @@ -567,7 +564,7 @@ function logTokensPurchasedCappedSTO(receipt) { } module.exports = { - executeApp: async function(investorAddress, investorPrivKey, symbol, currency, amount) { - return executeApp(investorAddress, investorPrivKey, symbol, currency, amount); - } + executeApp: async function (investorAddress, investorPrivKey, symbol, currency, amount) { + return executeApp(investorAddress, investorPrivKey, symbol, currency, amount); + } } diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index d70c0ca81..e9b44c907 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -200,7 +200,7 @@ async function cappedSTO_launch(stoConfig) { [cappedSTOconfig.startTime, cappedSTOconfig.endTime, web3.utils.toWei(cappedSTOconfig.cap.toString()), - cappedSTOconfig.rate, + web3.utils.toWei(cappedSTOconfig.rate.toString()), cappedSTOconfig.raiseType, cappedSTOconfig.wallet] ); @@ -219,7 +219,7 @@ async function cappedSTO_launch(stoConfig) { async function cappedSTO_status(currentSTO) { let displayStartTime = await currentSTO.methods.startTime().call(); let displayEndTime = await currentSTO.methods.endTime().call(); - let displayRate = await currentSTO.methods.rate().call(); + let displayRate = new web3.utils.BN(await currentSTO.methods.rate().call()); let displayCap = new web3.utils.BN(await currentSTO.methods.cap().call()); let displayWallet = await currentSTO.methods.wallet().call(); let displayRaiseType = await currentSTO.methods.fundRaiseTypes(gbl.constants.FUND_RAISE_TYPES.ETH).call() ? 'ETH' : 'POLY'; @@ -250,7 +250,7 @@ async function cappedSTO_status(currentSTO) { - Start Time: ${new Date(displayStartTime * 1000)} - End Time: ${new Date(displayEndTime * 1000)} - Raise Type: ${displayRaiseType} - - Rate: 1 ${displayRaiseType} = ${displayRate} ${displayTokenSymbol.toUpperCase()} + - Rate: 1 ${displayRaiseType} = ${web3.utils.fromWei(displayRate)} ${displayTokenSymbol.toUpperCase()} - Wallet: ${displayWallet} - Wallet Balance: ${displayWalletBalance} ${displayRaiseType} ----------------------------------------------- From 145fe5bfe51fded32140e3eea221c2f01278860c Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 28 Nov 2018 16:42:02 -0300 Subject: [PATCH 111/139] CLI - Minor fix --- CLI/commands/transfer_manager.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 44ae64ca1..3b65df2e8 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -929,7 +929,8 @@ async function selectToken() { options.push('Enter token symbol manually'); let index = readlineSync.keyInSelect(options, 'Select a token:', { cancel: 'Exit' }); - switch (options[index]) { + let selected = index != -1 ? options[index] : 'Exit'; + switch (selected) { case 'Enter token symbol manually': result = readlineSync.question('Enter the token symbol: '); break; From ffdf4e9ee1360a114f7172f16b8c23a5a3fce5df Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 29 Nov 2018 18:55:07 +0530 Subject: [PATCH 112/139] Update script fetch correct solc version --- scripts/docs.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/docs.sh b/scripts/docs.sh index db7aba417..205a6ceae 100755 --- a/scripts/docs.sh +++ b/scripts/docs.sh @@ -32,12 +32,20 @@ create_docs() { cd $WEBSITE_DIRECTORY fi + echo "Fetching solc binary" + curl -L -o solidity-ubuntu-trusty.zip https://github.com/ethereum/solidity/releases/download/v0.4.24/solidity-ubuntu-trusty.zip + unzip solidity-ubuntu-trusty.zip + CWD=$(pwd) + OLD_SOLC_PATH=$SOLC_PATH + export SOLC_PATH=$CWD/solc echo "Generating the API documentation in branch $latestTag" # Command to generate the documentation using the solidity-docgen migrate=$(SOLC_ARGS="openzeppelin-solidity="$CORE_ROUTE"/node_modules/openzeppelin-solidity" \ solidity-docgen -x external/oraclizeAPI.sol,mocks/MockPolyOracle.sol,oracles/PolyOracle.sol $CORE_ROUTE $CORE_ROUTE/contracts $CORE_ROUTE/polymath-developer-portal/) + export SOLC_PATH=$OLD_SOLC_PATH + echo "Successfully docs are generated..." echo "Installing npm dependencies..." From 63c6ddcb16d28d135b727fbee9e379b1a802c5c7 Mon Sep 17 00:00:00 2001 From: shuffledex Date: Thu, 29 Nov 2018 10:26:24 -0300 Subject: [PATCH 113/139] moving multi mint to token manager --- CLI/commands/multi_mint.js | 197 ---------------------------------- CLI/commands/token_manager.js | 192 ++++++++++++++++++++++++++++++++- 2 files changed, 190 insertions(+), 199 deletions(-) delete mode 100644 CLI/commands/multi_mint.js diff --git a/CLI/commands/multi_mint.js b/CLI/commands/multi_mint.js deleted file mode 100644 index 3147b2754..000000000 --- a/CLI/commands/multi_mint.js +++ /dev/null @@ -1,197 +0,0 @@ -var common = require('./common/common_functions'); -var csv_shared = require('./common/csv_shared'); -var abis = require('./helpers/contract_abis'); -var BigNumber = require('bignumber.js'); - -let distribData = new Array(); -let fullFileData = new Array(); -let badData = new Array(); -let affiliatesFailedArray = new Array(); -let affiliatesKYCInvalidArray = new Array(); - -let securityToken; -let tokenDivisible; - -async function startScript(tokenSymbol, batchSize) { - securityToken = await csv_shared.start(tokenSymbol, batchSize); - - let result_processing = await csv_shared.read('./CLI/data/multi_mint_data.csv', multimint_processing); - distribData = result_processing.distribData; - fullFileData = result_processing.fullFileData; - badData = result_processing.badData; - - tokenDivisible = await securityToken.methods.granularity().call() == 1; - - await saveInBlockchain(); - await finalResults(); -} - -function multimint_processing(csv_line) { - let isAddress = web3.utils.isAddress(csv_line[0]); - let validToken = isValidToken(csv_line[1]); - - if (isAddress && - validToken) { - return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), validToken)] - } else { - return [false, new Array(csv_line[0], csv_line[1])] - } -} - -function isValidToken(token) { - var tokenAmount = parseFloat(token); - if (tokenDivisible) { - return tokenAmount - } else { - if ((tokenAmount % 1 == 0)) { - return tokenAmount; - } - return false - } -} - -async function saveInBlockchain() { - let gtmModules = await securityToken.methods.getModulesByType(3).call(); - - if (gtmModules.length > 0) { - console.log("Minting of tokens is only allowed before the STO get attached"); - process.exit(0); - } - - console.log(` - ----------------------------------------- - ----- Mint the tokens to affiliates ----- - ----------------------------------------- - `); - - for (let i = 0; i < distribData.length; i++) { - try { - let affiliatesVerifiedArray = [], tokensVerifiedArray = []; - - // Splitting the user arrays to be organized by input - for (let j = 0; j < distribData[i].length; j++) { - let investorAccount = distribData[i][j][0]; - let tokenAmount = web3.utils.toWei((distribData[i][j][1]).toString(), "ether"); - let verifiedTransaction = await securityToken.methods.verifyTransfer("0x0000000000000000000000000000000000000000", investorAccount, tokenAmount, web3.utils.fromAscii('')).call(); - if (verifiedTransaction) { - affiliatesVerifiedArray.push(investorAccount); - tokensVerifiedArray.push(tokenAmount); - } else { - let gtmModule = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); - let generalTransferManager = new web3.eth.Contract(abis.generalTransferManager(), gtmModule[0]); - let validKYC = (await generalTransferManager.methods.whitelist(Issuer.address).call()).expiryTime > Math.floor(Date.now()/1000); - if (validKYC) { - affiliatesFailedArray.push(investorAccount); - } else { - affiliatesKYCInvalidArray.push(investorAccount); - } - } - } - - let mintMultiAction = await securityToken.methods.mintMulti(affiliatesVerifiedArray, tokensVerifiedArray); - let tx = await common.sendTransaction(mintMultiAction); - console.log(`Batch ${i} - Attempting to send the Minted tokens to affiliates accounts:\n\n`, affiliatesVerifiedArray, "\n\n"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Multi Mint transaction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); - - } catch (err) { - console.log("ERROR", err) - process.exit(0) - } - } - - return; -} - -async function finalResults() { - let totalInvestors = 0; - let updatedInvestors = 0; - let investorObjectLookup = {}; - let investorData_Events = new Array(); - - let event_data = await securityToken.getPastEvents('Minted', {fromBlock: 0, toBlock: 'latest'}, () => {}); - - for (var i = 0; i < event_data.length; i++) { - let combineArray = []; - - let investorAddress_Event = event_data[i].returnValues._to; - let amount_Event = event_data[i].returnValues._value; - let blockNumber = event_data[i].blockNumber; - - combineArray.push(investorAddress_Event); - combineArray.push(amount_Event); - combineArray.push(blockNumber); - - investorData_Events.push(combineArray) - - // We have already recorded it, so this is an update to our object - if (investorObjectLookup.hasOwnProperty(investorAddress_Event)) { - // The block number form the event we are checking is bigger, so we gotta replace it - if (investorObjectLookup[investorAddress_Event].recordedBlockNumber < blockNumber) { - investorObjectLookup[investorAddress_Event] = {amount: amount_Event, recordedBlockNumber: blockNumber}; - updatedInvestors += 1; - } - } else { - investorObjectLookup[investorAddress_Event] = {amount: amount_Event, recordedBlockNumber: blockNumber}; - totalInvestors += 1; - } - } - - let investorAddress_Events = Object.keys(investorObjectLookup) - - console.log(`******************** EVENT LOGS ANALYSIS COMPLETE ********************\n`); - console.log(`A total of ${totalInvestors} affiliated investors get the token\n`); - console.log(`This script in total sent ${fullFileData.length - badData.length - affiliatesFailedArray.length - affiliatesKYCInvalidArray.length} new investors and updated investors to the blockchain.\n`); - console.log(`There were ${badData.length} bad entries that didnt get sent to the blockchain in the script.\n`); - console.log(`There were ${affiliatesKYCInvalidArray.length} accounts with invalid KYC.\n`); - console.log(`There were ${affiliatesFailedArray.length} accounts that didn't get sent to the blockchain as they would fail.\n`); - console.log("************************************************************************************************"); - console.log("OBJECT WITH EVERY USER AND THEIR MINTED TOKEN: \n\n", investorObjectLookup) - console.log("************************************************************************************************"); - console.log("LIST OF ALL INVESTORS WHO GOT THE MINTED TOKENS: \n\n", investorAddress_Events) - - let missingDistribs = [], failedVerificationDistribs = [], invalidKYCDistribs = []; - for (let l = 0; l < fullFileData.length; l++) { - if (affiliatesKYCInvalidArray.includes(fullFileData[l][0])) { - invalidKYCDistribs.push(fullFileData[l]); - } else if (affiliatesFailedArray.includes(fullFileData[l][0])) { - failedVerificationDistribs.push(fullFileData[l]); - } else if (!investorObjectLookup.hasOwnProperty(fullFileData[l][0])) { - missingDistribs.push(fullFileData[l]); - } - } - - if (invalidKYCDistribs.length > 0) { - console.log("**************************************************************************************************************************"); - console.log("The following data arrays have an invalid KYC. Please review if these accounts are whitelisted and their KYC is not expired\n"); - console.log(invalidKYCDistribs); - console.log("**************************************************************************************************************************"); - } - if (failedVerificationDistribs.length > 0) { - console.log("*********************************************************************************************************"); - console.log("-- The following data arrays failed at verifyTransfer. Please review if these accounts are whitelisted --\n"); - console.log(failedVerificationDistribs); - console.log("*********************************************************************************************************"); - } - if (missingDistribs.length > 0) { - console.log("******************************************************************************************"); - console.log("-- No Minted event was found for the following data arrays. Please review them manually --\n"); - console.log(missingDistribs); - console.log("******************************************************************************************"); - } - if (missingDistribs.length == 0 && - failedVerificationDistribs.length == 0 && - invalidKYCDistribs.length == 0) { - console.log("\n**************************************************************************************************************************"); - console.log("All accounts passed through from the CSV were successfully get the tokens, because we were able to read them all from events"); - console.log("****************************************************************************************************************************"); - } - -} - -module.exports = { - executeApp: async (tokenSymbol, batchSize) => { - return startScript(tokenSymbol, batchSize); - } -} \ No newline at end of file diff --git a/CLI/commands/token_manager.js b/CLI/commands/token_manager.js index 6faa7ba34..0bbdad729 100644 --- a/CLI/commands/token_manager.js +++ b/CLI/commands/token_manager.js @@ -2,10 +2,11 @@ const readlineSync = require('readline-sync'); const chalk = require('chalk'); const whitelist = require('./whitelist'); -const multimint = require('./multi_mint'); const stoManager = require('./sto_manager'); const common = require('./common/common_functions'); const gbl = require('./common/global'); +const csv_shared = require('./common/csv_shared'); +const BigNumber = require('bignumber.js'); // Load contract artifacts const contracts = require('./helpers/contract_addresses'); @@ -15,10 +16,19 @@ let securityTokenRegistry; let polyToken; let featureRegistry; let securityToken; +let tokenDivisible; let allModules; let tokenSymbol +/* CSV data control */ +let distribData = new Array(); +let fullFileData = new Array(); +let badData = new Array(); +let affiliatesFailedArray = new Array(); +let affiliatesKYCInvalidArray = new Array(); +/* End CSV data control */ + async function setup() { try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); @@ -340,11 +350,189 @@ async function multi_mint_tokens() { console.log(chalk.green(`\nCongratulations! All the affiliates get succssfully whitelisted, Now its time to Mint the tokens\n`)); console.log(chalk.red(`WARNING: `) + `Please make sure all the addresses that get whitelisted are only eligible to hold or get Security token\n`); - await multimint.executeApp(tokenSymbol, 75); + await startCSV(tokenSymbol, 75) console.log(chalk.green(`\nCongratulations! Tokens get successfully Minted and transferred to token holders`)); } /// +async function startCSV(tokenSymbol, batchSize) { + securityToken = await csv_shared.start(tokenSymbol, batchSize); + + let result_processing = await csv_shared.read('./CLI/data/multi_mint_data.csv', multimint_processing); + distribData = result_processing.distribData; + fullFileData = result_processing.fullFileData; + badData = result_processing.badData; + + tokenDivisible = await securityToken.methods.granularity().call() == 1; + + await saveInBlockchain(); + await finalResults(); +} + +function multimint_processing(csv_line) { + let isAddress = web3.utils.isAddress(csv_line[0]); + let validToken = isValidToken(csv_line[1]); + + if (isAddress && + validToken) { + return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), validToken)] + } else { + return [false, new Array(csv_line[0], csv_line[1])] + } +} + +function isValidToken(token) { + var tokenAmount = parseFloat(token); + if (tokenDivisible) { + return tokenAmount + } else { + if ((tokenAmount % 1 == 0)) { + return tokenAmount; + } + return false + } +} + +async function saveInBlockchain() { + let gtmModules = await securityToken.methods.getModulesByType(3).call(); + + if (gtmModules.length > 0) { + console.log("Minting of tokens is only allowed before the STO get attached"); + process.exit(0); + } + + console.log(` + ----------------------------------------- + ----- Mint the tokens to affiliates ----- + ----------------------------------------- + `); + + for (let i = 0; i < distribData.length; i++) { + try { + let affiliatesVerifiedArray = [], tokensVerifiedArray = []; + + // Splitting the user arrays to be organized by input + for (let j = 0; j < distribData[i].length; j++) { + let investorAccount = distribData[i][j][0]; + let tokenAmount = web3.utils.toWei((distribData[i][j][1]).toString(), "ether"); + let verifiedTransaction = await securityToken.methods.verifyTransfer("0x0000000000000000000000000000000000000000", investorAccount, tokenAmount, web3.utils.fromAscii('')).call(); + if (verifiedTransaction) { + affiliatesVerifiedArray.push(investorAccount); + tokensVerifiedArray.push(tokenAmount); + } else { + let gtmModule = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); + let generalTransferManager = new web3.eth.Contract(abis.generalTransferManager(), gtmModule[0]); + let validKYC = (await generalTransferManager.methods.whitelist(Issuer.address).call()).expiryTime > Math.floor(Date.now()/1000); + if (validKYC) { + affiliatesFailedArray.push(investorAccount); + } else { + affiliatesKYCInvalidArray.push(investorAccount); + } + } + } + + let mintMultiAction = await securityToken.methods.mintMulti(affiliatesVerifiedArray, tokensVerifiedArray); + let tx = await common.sendTransaction(mintMultiAction); + console.log(`Batch ${i} - Attempting to send the Minted tokens to affiliates accounts:\n\n`, affiliatesVerifiedArray, "\n\n"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); + console.log("Multi Mint transaction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); + + } catch (err) { + console.log("ERROR", err) + process.exit(0) + } + } + + return; +} + +async function finalResults() { + let totalInvestors = 0; + let updatedInvestors = 0; + let investorObjectLookup = {}; + let investorData_Events = new Array(); + + let event_data = await securityToken.getPastEvents('Minted', {fromBlock: 0, toBlock: 'latest'}, () => {}); + + for (var i = 0; i < event_data.length; i++) { + let combineArray = []; + + let investorAddress_Event = event_data[i].returnValues._to; + let amount_Event = event_data[i].returnValues._value; + let blockNumber = event_data[i].blockNumber; + + combineArray.push(investorAddress_Event); + combineArray.push(amount_Event); + combineArray.push(blockNumber); + + investorData_Events.push(combineArray) + + // We have already recorded it, so this is an update to our object + if (investorObjectLookup.hasOwnProperty(investorAddress_Event)) { + // The block number form the event we are checking is bigger, so we gotta replace it + if (investorObjectLookup[investorAddress_Event].recordedBlockNumber < blockNumber) { + investorObjectLookup[investorAddress_Event] = {amount: amount_Event, recordedBlockNumber: blockNumber}; + updatedInvestors += 1; + } + } else { + investorObjectLookup[investorAddress_Event] = {amount: amount_Event, recordedBlockNumber: blockNumber}; + totalInvestors += 1; + } + } + + let investorAddress_Events = Object.keys(investorObjectLookup) + + console.log(`******************** EVENT LOGS ANALYSIS COMPLETE ********************\n`); + console.log(`A total of ${totalInvestors} affiliated investors get the token\n`); + console.log(`This script in total sent ${fullFileData.length - badData.length - affiliatesFailedArray.length - affiliatesKYCInvalidArray.length} new investors and updated investors to the blockchain.\n`); + console.log(`There were ${badData.length} bad entries that didnt get sent to the blockchain in the script.\n`); + console.log(`There were ${affiliatesKYCInvalidArray.length} accounts with invalid KYC.\n`); + console.log(`There were ${affiliatesFailedArray.length} accounts that didn't get sent to the blockchain as they would fail.\n`); + console.log("************************************************************************************************"); + console.log("OBJECT WITH EVERY USER AND THEIR MINTED TOKEN: \n\n", investorObjectLookup) + console.log("************************************************************************************************"); + console.log("LIST OF ALL INVESTORS WHO GOT THE MINTED TOKENS: \n\n", investorAddress_Events) + + let missingDistribs = [], failedVerificationDistribs = [], invalidKYCDistribs = []; + for (let l = 0; l < fullFileData.length; l++) { + if (affiliatesKYCInvalidArray.includes(fullFileData[l][0])) { + invalidKYCDistribs.push(fullFileData[l]); + } else if (affiliatesFailedArray.includes(fullFileData[l][0])) { + failedVerificationDistribs.push(fullFileData[l]); + } else if (!investorObjectLookup.hasOwnProperty(fullFileData[l][0])) { + missingDistribs.push(fullFileData[l]); + } + } + + if (invalidKYCDistribs.length > 0) { + console.log("**************************************************************************************************************************"); + console.log("The following data arrays have an invalid KYC. Please review if these accounts are whitelisted and their KYC is not expired\n"); + console.log(invalidKYCDistribs); + console.log("**************************************************************************************************************************"); + } + if (failedVerificationDistribs.length > 0) { + console.log("*********************************************************************************************************"); + console.log("-- The following data arrays failed at verifyTransfer. Please review if these accounts are whitelisted --\n"); + console.log(failedVerificationDistribs); + console.log("*********************************************************************************************************"); + } + if (missingDistribs.length > 0) { + console.log("******************************************************************************************"); + console.log("-- No Minted event was found for the following data arrays. Please review them manually --\n"); + console.log(missingDistribs); + console.log("******************************************************************************************"); + } + if (missingDistribs.length == 0 && + failedVerificationDistribs.length == 0 && + invalidKYCDistribs.length == 0) { + console.log("\n**************************************************************************************************************************"); + console.log("All accounts passed through from the CSV were successfully get the tokens, because we were able to read them all from events"); + console.log("****************************************************************************************************************************"); + } + +} + async function withdrawFromContract(erc20address, value) { let withdrawAction = securityToken.methods.withdrawERC20(erc20address, value); await common.sendTransaction(withdrawAction); From 78292847be7ea82085e56ad2df24314f5c32a63c Mon Sep 17 00:00:00 2001 From: shuffledex Date: Thu, 29 Nov 2018 11:37:27 -0300 Subject: [PATCH 114/139] replace multi mint to token manager method in cli menu --- CLI/commands/token_manager.js | 3 +++ CLI/polymath-cli.js | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CLI/commands/token_manager.js b/CLI/commands/token_manager.js index 0bbdad729..265605b98 100644 --- a/CLI/commands/token_manager.js +++ b/CLI/commands/token_manager.js @@ -829,5 +829,8 @@ module.exports = { executeApp: async function (_tokenSymbol) { await initialize(_tokenSymbol) return executeApp(); + }, + startCSV: async function (tokenSymbol, batchSize) { + return startCSV(tokenSymbol, batchSize); } } diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 29bea752d..aff3aa4c5 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -7,7 +7,6 @@ var st20generator = require('./commands/ST20Generator'); var sto_manager = require('./commands/sto_manager'); var transfer = require('./commands/transfer'); var whitelist = require('./commands/whitelist'); -var multimint = require('./commands/multi_mint'); var accredit = require('./commands/accredit'); var changeNonAccreditedLimit = require('./commands/changeNonAccreditedLimit'); var transfer_ownership = require('./commands/transfer_ownership'); @@ -90,7 +89,7 @@ program .description('Distribute tokens to previously whitelisted investors') .action(async function(tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); - await multimint.executeApp(tokenSymbol, batchSize); + await token_manager.startCSV(tokenSymbol, batchSize); }); program From 0a3adf2df24122f0180955d329f8682c0068a822 Mon Sep 17 00:00:00 2001 From: shuffledex Date: Thu, 29 Nov 2018 13:45:57 -0300 Subject: [PATCH 115/139] moving accredit to sto manager file --- CLI/commands/accredit.js | 94 ------------------------------------- CLI/commands/sto_manager.js | 92 +++++++++++++++++++++++++++++++++++- CLI/polymath-cli.js | 3 +- 3 files changed, 91 insertions(+), 98 deletions(-) delete mode 100644 CLI/commands/accredit.js diff --git a/CLI/commands/accredit.js b/CLI/commands/accredit.js deleted file mode 100644 index cc550af2e..000000000 --- a/CLI/commands/accredit.js +++ /dev/null @@ -1,94 +0,0 @@ -var common = require('./common/common_functions'); -var csv_shared = require('./common/csv_shared'); -var abis = require('./helpers/contract_abis'); -var BigNumber = require('bignumber.js'); - -let distribData = new Array(); -let fullFileData = new Array(); -let badData = new Array(); - -let securityToken; - -async function startScript(tokenSymbol, batchSize) { - securityToken = await csv_shared.start(tokenSymbol, batchSize); - - let result_processing = await csv_shared.read('./CLI/data/accredited_data.csv', accredit_processing); - distribData = result_processing.distribData; - fullFileData = result_processing.fullFileData; - badData = result_processing.badData; - - await saveInBlockchain(); -}; - -function accredit_processing(csv_line) { - let isAddress = web3.utils.isAddress(csv_line[0]); - let isAccredited = (typeof JSON.parse(csv_line[1].toLowerCase())) == "boolean" ? JSON.parse(csv_line[1].toLowerCase()) : "not-valid"; - - if (isAddress && - (isAccredited != "not-valid")) { - return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), isAccredited)] - } else { - return [false, new Array(csv_line[0], isAccredited)] - } -} - -async function saveInBlockchain() { - let gtmModules; - try { - gtmModules = await securityToken.methods.getModulesByName(web3.utils.toHex('USDTieredSTO')).call(); - } catch (e) { - console.log("Please attach USDTieredSTO module before launch this action.", e) - process.exit(0) - } - - if (!gtmModules.length) { - console.log("Please attach USDTieredSTO module before launch this action.") - process.exit(0) - } - - let usdTieredSTO = new web3.eth.Contract(abis.usdTieredSTO(), gtmModules[0]); - - console.log(` - -------------------------------------------------------- - ----- Sending accreditation changes to blockchain ----- - -------------------------------------------------------- - `); - - for (let i = 0; i < distribData.length; i++) { - try { - - // Splitting the user arrays to be organized by input - for (let i = 0; i < distribData.length; i++) { - try { - let investorArray = [], isAccreditedArray = []; - - for (let j = 0; j < distribData[i].length; j++) { - investorArray.push(distribData[i][j][0]) - isAccreditedArray.push(distribData[i][j][1]) - } - - let changeAccreditedAction = await usdTieredSTO.methods.changeAccredited(investorArray, isAccreditedArray); - let tx = await common.sendTransaction(changeAccreditedAction); - console.log(`Batch ${i} - Attempting to change accredited accounts:\n\n`, investorArray, "\n\n"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Change accredited transaction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); - } catch (err) { - console.log("ERROR:", err); - } - } - - } catch (err) { - console.log("ERROR", err) - process.exit(0) - } - } - - return; -} - -module.exports = { - executeApp: async (tokenSymbol, batchSize) => { - return startScript(tokenSymbol, batchSize); - } -} \ No newline at end of file diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index d0fd1c3ea..974d57de4 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -1,11 +1,12 @@ const readlineSync = require('readline-sync'); const chalk = require('chalk'); -const accredit = require('./accredit'); const changeNonAccreditedLimit = require('./changeNonAccreditedLimit'); const contracts = require('./helpers/contract_addresses'); const abis = require('./helpers/contract_abis'); const common = require('./common/common_functions'); const gbl = require('./common/global'); +const csv_shared = require('./common/csv_shared'); +const BigNumber = require('bignumber.js'); /////////////////// // Crowdsale params @@ -18,6 +19,12 @@ let polyToken; let usdToken; let securityToken; +/* CSV variables */ +let distribData = new Array(); +let fullFileData = new Array(); +let badData = new Array(); +/* End CSV variables */ + async function executeApp() { let exit = false; while (!exit) { @@ -690,7 +697,7 @@ async function usdTieredSTO_configure(currentSTO) { await common.sendTransaction(changeAccreditedAction); break; case 2: - await accredit.executeApp(tokenSymbol, 75); + await startCSV(tokenSymbol, 75); break; case 3: let account = readlineSync.question('Enter the address to change non accredited limit: '); @@ -728,6 +735,84 @@ async function usdTieredSTO_configure(currentSTO) { } } +async function startCSV(tokenSymbol, batchSize) { + securityToken = await csv_shared.start(tokenSymbol, batchSize); + + let result_processing = await csv_shared.read('./CLI/data/accredited_data.csv', accredit_processing); + distribData = result_processing.distribData; + fullFileData = result_processing.fullFileData; + badData = result_processing.badData; + + await saveInBlockchain(); +} + +function accredit_processing(csv_line) { + let isAddress = web3.utils.isAddress(csv_line[0]); + let isAccredited = (typeof JSON.parse(csv_line[1].toLowerCase())) == "boolean" ? JSON.parse(csv_line[1].toLowerCase()) : "not-valid"; + + if (isAddress && + (isAccredited != "not-valid")) { + return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), isAccredited)] + } else { + return [false, new Array(csv_line[0], isAccredited)] + } +} + +async function saveInBlockchain() { + let gtmModules; + try { + gtmModules = await securityToken.methods.getModulesByName(web3.utils.toHex('USDTieredSTO')).call(); + } catch (e) { + console.log("Please attach USDTieredSTO module before launch this action.", e) + process.exit(0) + } + + if (!gtmModules.length) { + console.log("Please attach USDTieredSTO module before launch this action.") + process.exit(0) + } + + let usdTieredSTO = new web3.eth.Contract(abis.usdTieredSTO(), gtmModules[0]); + + console.log(` + -------------------------------------------------------- + ----- Sending accreditation changes to blockchain ----- + -------------------------------------------------------- + `); + + for (let i = 0; i < distribData.length; i++) { + try { + + // Splitting the user arrays to be organized by input + for (let i = 0; i < distribData.length; i++) { + try { + let investorArray = [], isAccreditedArray = []; + + for (let j = 0; j < distribData[i].length; j++) { + investorArray.push(distribData[i][j][0]) + isAccreditedArray.push(distribData[i][j][1]) + } + + let changeAccreditedAction = await usdTieredSTO.methods.changeAccredited(investorArray, isAccreditedArray); + let tx = await common.sendTransaction(changeAccreditedAction); + console.log(`Batch ${i} - Attempting to change accredited accounts:\n\n`, investorArray, "\n\n"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); + console.log("Change accredited transaction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); + } catch (err) { + console.log("ERROR:", err); + } + } + + } catch (err) { + console.log("ERROR", err) + process.exit(0) + } + } + + return; +} + async function modfifyTimes(currentSTO) { let times = timesConfigUSDTieredSTO(); let modifyTimesAction = currentSTO.methods.modifyTimes(times.startTime, times.endTime); @@ -893,5 +978,8 @@ module.exports = { addSTOModule: async function (_tokenSymbol, stoConfig) { await initialize(_tokenSymbol); return addSTOModule(stoConfig) + }, + startCSV: async function (tokenSymbol, batchSize) { + return startCSV(tokenSymbol, batchSize); } } \ No newline at end of file diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index aff3aa4c5..34d463bb9 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -7,7 +7,6 @@ var st20generator = require('./commands/ST20Generator'); var sto_manager = require('./commands/sto_manager'); var transfer = require('./commands/transfer'); var whitelist = require('./commands/whitelist'); -var accredit = require('./commands/accredit'); var changeNonAccreditedLimit = require('./commands/changeNonAccreditedLimit'); var transfer_ownership = require('./commands/transfer_ownership'); var dividends_manager = require('./commands/dividends_manager'); @@ -152,7 +151,7 @@ program .description('Runs accredit') .action(async function(tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); - await accredit.executeApp(tokenSymbol, batchSize); + await sto_manager.startCSV(tokenSymbol, batchSize) }); program From de2633d8c382b3cc403b5ae947bc464141719582 Mon Sep 17 00:00:00 2001 From: shuffledex Date: Thu, 29 Nov 2018 15:38:50 -0300 Subject: [PATCH 116/139] moving accreditable and nonAccreditable to STO manager --- CLI/commands/changeNonAccreditedLimit.js | 94 ---------------------- CLI/commands/sto_manager.js | 99 +++++++++++++++++++++--- CLI/polymath-cli.js | 5 +- 3 files changed, 92 insertions(+), 106 deletions(-) delete mode 100644 CLI/commands/changeNonAccreditedLimit.js diff --git a/CLI/commands/changeNonAccreditedLimit.js b/CLI/commands/changeNonAccreditedLimit.js deleted file mode 100644 index 029f2fc70..000000000 --- a/CLI/commands/changeNonAccreditedLimit.js +++ /dev/null @@ -1,94 +0,0 @@ -var common = require('./common/common_functions'); -var csv_shared = require('./common/csv_shared'); -var abis = require('./helpers/contract_abis'); -var BigNumber = require('bignumber.js'); - -let distribData = new Array(); -let fullFileData = new Array(); -let badData = new Array(); - -let securityToken; - -async function startScript(tokenSymbol, batchSize) { - securityToken = await csv_shared.start(tokenSymbol, batchSize); - - let result_processing = await csv_shared.read('./CLI/data/nonAccreditedLimits_data.csv', nonAccredited_processing); - distribData = result_processing.distribData; - fullFileData = result_processing.fullFileData; - badData = result_processing.badData; - - await saveInBlockchain(); -} - -function nonAccredited_processing(csv_line) { - let isAddress = web3.utils.isAddress(csv_line[0]); - let isNumber = !isNaN(csv_line[1]); - - if (isAddress && isNumber) { - return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), csv_line[1])] - } else { - return [false, new Array(csv_line[0], csv_line[1])] - } -} - -async function saveInBlockchain() { - let gtmModules; - try { - gtmModules = await securityToken.methods.getModulesByName(web3.utils.toHex('USDTieredSTO')).call(); - } catch (e) { - console.log("Please attach USDTieredSTO module before launch this action.", e) - process.exit(0) - } - - if (!gtmModules.length) { - console.log("Please attach USDTieredSTO module before launch this action.") - process.exit(0) - } - - let usdTieredSTO = new web3.eth.Contract(abis.usdTieredSTO(), gtmModules[0]); - - console.log(` - -------------------------------------------------------------- - ----- Sending non accredited limit changes to blockchain ----- - -------------------------------------------------------------- - `); - - for (let i = 0; i < distribData.length; i++) { - try { - - // Splitting the user arrays to be organized by input - for (let i = 0; i < distribData.length; i++) { - try { - let investorArray = [], limitArray = []; - - for (let j = 0; j < distribData[i].length; j++) { - investorArray.push(distribData[i][j][0]); - limitArray.push(web3.utils.toWei(distribData[i][j][1].toString())); - } - - let changeNonAccreditedLimitAction = await usdTieredSTO.methods.changeNonAccreditedLimit(investorArray, limitArray); - let tx = await common.sendTransaction(changeNonAccreditedLimitAction); - console.log(`Batch ${i} - Attempting to change non accredited limits to accounts:\n\n`, investorArray, "\n\n"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Change accredited transaction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString()), "Ether"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); - - } catch (err) { - console.log("ERROR:", err); - } - } - - } catch (err) { - console.log("ERROR", err) - process.exit(0) - } - } - - return; -} - -module.exports = { - executeApp: async (tokenSymbol, batchSize) => { - return startScript(tokenSymbol, batchSize); - } -} \ No newline at end of file diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index 974d57de4..8cd2baa5e 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -1,6 +1,5 @@ const readlineSync = require('readline-sync'); const chalk = require('chalk'); -const changeNonAccreditedLimit = require('./changeNonAccreditedLimit'); const contracts = require('./helpers/contract_addresses'); const abis = require('./helpers/contract_abis'); const common = require('./common/common_functions'); @@ -697,7 +696,7 @@ async function usdTieredSTO_configure(currentSTO) { await common.sendTransaction(changeAccreditedAction); break; case 2: - await startCSV(tokenSymbol, 75); + await startCSV(tokenSymbol, 75, 'accredited'); break; case 3: let account = readlineSync.question('Enter the address to change non accredited limit: '); @@ -709,7 +708,7 @@ async function usdTieredSTO_configure(currentSTO) { await common.sendTransaction(changeNonAccreditedLimitAction); break; case 4: - await changeNonAccreditedLimit.executeApp(tokenSymbol, 75); + await startCSV(tokenSymbol, 75, 'nonAccredited'); break; case 5: await modfifyTimes(currentSTO); @@ -735,15 +734,41 @@ async function usdTieredSTO_configure(currentSTO) { } } -async function startCSV(tokenSymbol, batchSize) { +async function startCSV(tokenSymbol, batchSize, accreditionType) { + let file, proccessing, saving; + + switch (accreditionType) { + case 'accredited': + file = './CLI/data/accredited_data.csv' + proccessing = accredit_processing + saving = saveInBlockchainAccredited + break; + case 'nonAccredited': + file = './CLI/data/nonAccreditedLimits_data.csv' + proccessing = nonAccredited_processing + saving = saveInBlockchainNonAccredited + break; + } + securityToken = await csv_shared.start(tokenSymbol, batchSize); - let result_processing = await csv_shared.read('./CLI/data/accredited_data.csv', accredit_processing); + let result_processing = await csv_shared.read(file, proccessing); distribData = result_processing.distribData; fullFileData = result_processing.fullFileData; badData = result_processing.badData; - await saveInBlockchain(); + await saving(); +} + +function nonAccredited_processing(csv_line) { + let isAddress = web3.utils.isAddress(csv_line[0]); + let isNumber = !isNaN(csv_line[1]); + + if (isAddress && isNumber) { + return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), csv_line[1])] + } else { + return [false, new Array(csv_line[0], csv_line[1])] + } } function accredit_processing(csv_line) { @@ -758,7 +783,7 @@ function accredit_processing(csv_line) { } } -async function saveInBlockchain() { +async function saveInBlockchainAccredited() { let gtmModules; try { gtmModules = await securityToken.methods.getModulesByName(web3.utils.toHex('USDTieredSTO')).call(); @@ -813,6 +838,62 @@ async function saveInBlockchain() { return; } +async function saveInBlockchainNonAccredited() { + let gtmModules; + try { + gtmModules = await securityToken.methods.getModulesByName(web3.utils.toHex('USDTieredSTO')).call(); + } catch (e) { + console.log("Please attach USDTieredSTO module before launch this action.", e) + process.exit(0) + } + + if (!gtmModules.length) { + console.log("Please attach USDTieredSTO module before launch this action.") + process.exit(0) + } + + let usdTieredSTO = new web3.eth.Contract(abis.usdTieredSTO(), gtmModules[0]); + + console.log(` + -------------------------------------------------------------- + ----- Sending non accredited limit changes to blockchain ----- + -------------------------------------------------------------- + `); + + for (let i = 0; i < distribData.length; i++) { + try { + + // Splitting the user arrays to be organized by input + for (let i = 0; i < distribData.length; i++) { + try { + let investorArray = [], limitArray = []; + + for (let j = 0; j < distribData[i].length; j++) { + investorArray.push(distribData[i][j][0]); + limitArray.push(web3.utils.toWei(distribData[i][j][1].toString())); + } + + let changeNonAccreditedLimitAction = await usdTieredSTO.methods.changeNonAccreditedLimit(investorArray, limitArray); + let tx = await common.sendTransaction(changeNonAccreditedLimitAction); + console.log(`Batch ${i} - Attempting to change non accredited limits to accounts:\n\n`, investorArray, "\n\n"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); + console.log("Change accredited transaction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString()), "Ether"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); + + } catch (err) { + console.log("ERROR:", err); + } + } + + } catch (err) { + console.log("ERROR", err) + process.exit(0) + } + } + + return; +} + async function modfifyTimes(currentSTO) { let times = timesConfigUSDTieredSTO(); let modifyTimesAction = currentSTO.methods.modifyTimes(times.startTime, times.endTime); @@ -979,7 +1060,7 @@ module.exports = { await initialize(_tokenSymbol); return addSTOModule(stoConfig) }, - startCSV: async function (tokenSymbol, batchSize) { - return startCSV(tokenSymbol, batchSize); + startCSV: async function (tokenSymbol, batchSize, accreditionType) { + return startCSV(tokenSymbol, batchSize, accreditionType); } } \ No newline at end of file diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 34d463bb9..c34a4569d 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -7,7 +7,6 @@ var st20generator = require('./commands/ST20Generator'); var sto_manager = require('./commands/sto_manager'); var transfer = require('./commands/transfer'); var whitelist = require('./commands/whitelist'); -var changeNonAccreditedLimit = require('./commands/changeNonAccreditedLimit'); var transfer_ownership = require('./commands/transfer_ownership'); var dividends_manager = require('./commands/dividends_manager'); var transfer_manager = require('./commands/transfer_manager'); @@ -151,7 +150,7 @@ program .description('Runs accredit') .action(async function(tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); - await sto_manager.startCSV(tokenSymbol, batchSize) + await sto_manager.startCSV(tokenSymbol, batchSize, 'accredited') }); program @@ -160,7 +159,7 @@ program .description('Runs changeNonAccreditedLimit') .action(async function(tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); - await changeNonAccreditedLimit.executeApp(tokenSymbol, batchSize); + await sto_manager.startCSV(tokenSymbol, batchSize, 'nonAccredited') }); program From 6694a068f55768e107e7691332259f34dd416724 Mon Sep 17 00:00:00 2001 From: Victor Date: Thu, 29 Nov 2018 15:57:18 -0300 Subject: [PATCH 117/139] Count transfer manager --- CLI/commands/helpers/contract_abis.js | 5 +++ CLI/commands/transfer_manager.js | 47 ++++++++++++++++++++++----- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/CLI/commands/helpers/contract_abis.js b/CLI/commands/helpers/contract_abis.js index f93f18ac7..0b186f590 100644 --- a/CLI/commands/helpers/contract_abis.js +++ b/CLI/commands/helpers/contract_abis.js @@ -8,6 +8,7 @@ let cappedSTOABI; let usdTieredSTOABI; let generalTransferManagerABI; let manualApprovalTransferManagerABI; +let countTransferManagerABI; let generalPermissionManagerABI; let polyTokenABI; let cappedSTOFactoryABI; @@ -31,6 +32,7 @@ try { usdTieredSTOABI = JSON.parse(require('fs').readFileSync('./build/contracts/USDTieredSTO.json').toString()).abi; generalTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/GeneralTransferManager.json').toString()).abi; manualApprovalTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/ManualApprovalTransferManager.json').toString()).abi; + countTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/CountTransferManager.json').toString()).abi; generalPermissionManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/GeneralPermissionManager.json').toString()).abi; polyTokenABI = JSON.parse(require('fs').readFileSync('./build/contracts/PolyTokenFaucet.json').toString()).abi; cappedSTOFactoryABI = JSON.parse(require('fs').readFileSync('./build/contracts/CappedSTOFactory.json').toString()).abi; @@ -78,6 +80,9 @@ module.exports = { manualApprovalTransferManager: function () { return manualApprovalTransferManagerABI; }, + countTransferManager: function () { + return countTransferManagerABI; + }, generalPermissionManager: function () { return generalPermissionManagerABI; }, diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 44ae64ca1..4fdd6286a 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -180,7 +180,7 @@ async function configExistingModules(tmModules) { let options = tmModules.map(m => `${m.name} at ${m.address}`); let index = readlineSync.keyInSelect(options, 'Which module do you want to config? ', { cancel: 'Return' }); console.log('Selected:', index != -1 ? options[index] : 'Return', '\n'); - let moduleNameSelected = tmModules[index].name; + let moduleNameSelected = index != -1 ? tmModules[index].name : 'Return'; switch (moduleNameSelected) { case 'GeneralTransferManager': @@ -202,7 +202,9 @@ async function configExistingModules(tmModules) { )); break; case 'CountTransferManager': - //await countTransferManager(); + currentTransferManager = new web3.eth.Contract(abis.countTransferManager(), tmModules[index].address); + currentTransferManager.setProvider(web3.currentProvider); + await countTransferManager(); break; case 'SingleTradeVolumeRestrictionTM': //currentTransferManager = new web3.eth.Contract(abis.singleTradeVolumeRestrictionTM(), tmModules[index].address); @@ -226,8 +228,14 @@ async function configExistingModules(tmModules) { } async function addTransferManagerModule() { - let options = ['GeneralTransferManager', 'ManualApprovalTransferManager'/*, 'PercentageTransferManager', -'CountTransferManager', 'SingleTradeVolumeRestrictionTM', 'LookupVolumeRestrictionTM'*/]; + let options = [ + 'GeneralTransferManager', + 'ManualApprovalTransferManager', + 'CountTransferManager', + //'PercentageTransferManager', + //'SingleTradeVolumeRestrictionTM', + //'LookupVolumeRestrictionTM'*/ + ]; let index = readlineSync.keyInSelect(options, 'Which Transfer Manager module do you want to add? ', { cancel: 'Return' }); if (index != -1 && readlineSync.keyInYNStrict(`Are you sure you want to add ${options[index]} module?`)) { @@ -241,11 +249,9 @@ async function addTransferManagerModule() { )); break; case 'CountTransferManager': - console.log(chalk.red(` - ********************************* - This option is not yet available. - *********************************` - )); + let maxHolderCount = readlineSync.question('Enter the maximum no. of holders the SecurityToken is allowed to have: '); + let configureCountTM = abis.countTransferManager().find(o => o.name === 'configure' && o.type === 'function'); + bytes = web3.eth.abi.encodeFunctionCall(configureCountTM, [maxHolderCount]); break; case 'SingleTradeVolumeRestrictionTM': /* @@ -643,6 +649,29 @@ async function getManualBlocking(_from, _to) { return result; } +async function countTransferManager() { + console.log(chalk.blue(`Count Transfer Manager at ${currentTransferManager.options.address}`), '\n'); + + // Show current data + let displayMaxHolderCount = await currentTransferManager.methods.maxHolderCount().call(); + + console.log(`- Max holder count: ${displayMaxHolderCount}`); + + let options = ['Change max holder count'] + let index = readlineSync.keyInSelect(options, 'What do you want to do?', { cancel: 'Return' }); + let optionSelected = options[index]; + console.log('Selected:', index != -1 ? optionSelected : 'Return', '\n'); + switch (optionSelected) { + case 'Change max holder count': + let maxHolderCount = readlineSync.question('Enter the maximum no. of holders the SecurityToken is allowed to have: '); + let changeHolderCountAction = currentTransferManager.methods.changeHolderCount(maxHolderCount); + let changeHolderCountReceipt = await common.sendTransaction(changeHolderCountAction); + let changeHolderCountEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeHolderCountReceipt.logs, 'ModifyHolderCount'); + console.log(chalk.green(`Max holder count has been set to ${changeHolderCountEvent._newHolderCount} sucessfully!`)); + break; + } +} + async function singleTradeVolumeRestrictionTM() { console.log(chalk.blue(`Single Trade Volume Restriction Transfer Manager at ${currentTransferManager.options.address}`)); console.log(); From 2c514b39c02fd19ab04209ff3543735782967cec Mon Sep 17 00:00:00 2001 From: Victor Date: Thu, 29 Nov 2018 17:15:05 -0300 Subject: [PATCH 118/139] Percentage transfer manager --- CLI/commands/helpers/contract_abis.js | 5 ++ CLI/commands/transfer_manager.js | 113 ++++++++++++++++++++++---- 2 files changed, 102 insertions(+), 16 deletions(-) diff --git a/CLI/commands/helpers/contract_abis.js b/CLI/commands/helpers/contract_abis.js index 0b186f590..8a551b70b 100644 --- a/CLI/commands/helpers/contract_abis.js +++ b/CLI/commands/helpers/contract_abis.js @@ -9,6 +9,7 @@ let usdTieredSTOABI; let generalTransferManagerABI; let manualApprovalTransferManagerABI; let countTransferManagerABI; +let percentageTransferManagerABI; let generalPermissionManagerABI; let polyTokenABI; let cappedSTOFactoryABI; @@ -33,6 +34,7 @@ try { generalTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/GeneralTransferManager.json').toString()).abi; manualApprovalTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/ManualApprovalTransferManager.json').toString()).abi; countTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/CountTransferManager.json').toString()).abi; + percentageTransferManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/PercentageTransferManager.json').toString()).abi; generalPermissionManagerABI = JSON.parse(require('fs').readFileSync('./build/contracts/GeneralPermissionManager.json').toString()).abi; polyTokenABI = JSON.parse(require('fs').readFileSync('./build/contracts/PolyTokenFaucet.json').toString()).abi; cappedSTOFactoryABI = JSON.parse(require('fs').readFileSync('./build/contracts/CappedSTOFactory.json').toString()).abi; @@ -83,6 +85,9 @@ module.exports = { countTransferManager: function () { return countTransferManagerABI; }, + percentageTransferManager: function () { + return percentageTransferManagerABI; + }, generalPermissionManager: function () { return generalPermissionManagerABI; }, diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 4fdd6286a..c3dc7253f 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -193,19 +193,16 @@ async function configExistingModules(tmModules) { currentTransferManager.setProvider(web3.currentProvider); await manualApprovalTransferManager(); break; - case 'PercentageTransferManager': - //await percentageTransferManager(); - console.log(chalk.red(` - ********************************* - This option is not yet available. - *********************************` - )); - break; case 'CountTransferManager': currentTransferManager = new web3.eth.Contract(abis.countTransferManager(), tmModules[index].address); currentTransferManager.setProvider(web3.currentProvider); await countTransferManager(); break; + case 'PercentageTransferManager': + currentTransferManager = new web3.eth.Contract(abis.percentageTransferManager(), tmModules[index].address); + currentTransferManager.setProvider(web3.currentProvider); + await percentageTransferManager(); + break; case 'SingleTradeVolumeRestrictionTM': //currentTransferManager = new web3.eth.Contract(abis.singleTradeVolumeRestrictionTM(), tmModules[index].address); //currentTransferManager.setProvider(web3.currentProvider); @@ -232,7 +229,7 @@ async function addTransferManagerModule() { 'GeneralTransferManager', 'ManualApprovalTransferManager', 'CountTransferManager', - //'PercentageTransferManager', + 'PercentageTransferManager', //'SingleTradeVolumeRestrictionTM', //'LookupVolumeRestrictionTM'*/ ]; @@ -241,18 +238,22 @@ async function addTransferManagerModule() { if (index != -1 && readlineSync.keyInYNStrict(`Are you sure you want to add ${options[index]} module?`)) { let bytes = web3.utils.fromAscii('', 16); switch (options[index]) { - case 'PercentageTransferManager': - console.log(chalk.red(` - ********************************* - This option is not yet available. - *********************************` - )); - break; case 'CountTransferManager': let maxHolderCount = readlineSync.question('Enter the maximum no. of holders the SecurityToken is allowed to have: '); let configureCountTM = abis.countTransferManager().find(o => o.name === 'configure' && o.type === 'function'); bytes = web3.eth.abi.encodeFunctionCall(configureCountTM, [maxHolderCount]); break; + case 'PercentageTransferManager': + let maxHolderPercentage = toWeiPercentage(readlineSync.question('Enter the maximum amount of tokens in percentage that an investor can hold: ', { + limit: function (input) { + return (parseInt(input) > 0 && parseInt(input) <= 100); + }, + limitMessage: "Must be greater than 0 and less than 100" + })); + let allowPercentagePrimaryIssuance = readlineSync.keyInYNStrict(`Do you want to ignore transactions which are part of the primary issuance? `); + let configurePercentageTM = abis.percentageTransferManager().find(o => o.name === 'configure' && o.type === 'function'); + bytes = web3.eth.abi.encodeFunctionCall(configurePercentageTM, [maxHolderPercentage, allowPercentagePrimaryIssuance]); + break; case 'SingleTradeVolumeRestrictionTM': /* let isTransferLimitInPercentage = !!readlineSync.keyInSelect(['In tokens', 'In percentage'], 'How do you want to set the transfer limit? ', {cancel: false}); @@ -672,6 +673,86 @@ async function countTransferManager() { } } +async function percentageTransferManager() { + console.log(chalk.blue(`Percentage Transfer Manager at ${currentTransferManager.options.address}`), '\n'); + + // Show current data + let displayMaxHolderPercentage = await currentTransferManager.methods.maxHolderPercentage().call(); + let displayAllowPrimaryIssuance = await currentTransferManager.methods.allowPrimaryIssuance().call(); + + console.log(`- Max holder percentage: ${fromWeiPercentage(displayMaxHolderPercentage)}%`); + console.log(`- Allow primary issuance: ${displayAllowPrimaryIssuance ? `YES` : `NO`}`); + + let options = ['Change max holder percentage', 'Check if investor is whitelisted', 'Modify whitelist', 'Modify whitelist from CSV']; + if (displayAllowPrimaryIssuance) { + options.push('Disallow primary issuance'); + } else { + options.push('Allow primary issuance'); + } + let index = readlineSync.keyInSelect(options, 'What do you want to do?', { cancel: 'Return' }); + let optionSelected = options[index]; + console.log('Selected:', index != -1 ? optionSelected : 'Return', '\n'); + switch (optionSelected) { + case 'Change max holder percentage': + let maxHolderPercentage = toWeiPercentage(readlineSync.question('Enter the maximum amount of tokens in percentage that an investor can hold: ', { + limit: function (input) { + return (parseInt(input) > 0 && parseInt(input) <= 100); + }, + limitMessage: "Must be greater than 0 and less than 100" + })); + let changeHolderPercentageAction = currentTransferManager.methods.changeHolderPercentage(maxHolderPercentage); + let changeHolderPercentageReceipt = await common.sendTransaction(changeHolderPercentageAction); + let changeHolderPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeHolderPercentageReceipt.logs, 'ModifyHolderPercentage'); + console.log(chalk.green(`Max holder percentage has been set to ${fromWeiPercentage(changeHolderPercentageEvent._newHolderPercentage)} successfully!`)); + break; + case 'Check if investor is whitelisted': + let investorToCheck = readlineSync.question('Enter the address of the investor: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let isWhitelisted = await currentTransferManager.methods.whitelist(investorToCheck).call(); + if (isWhitelisted) { + console.log(chalk.green(`${investorToCheck} is whitelisted!`)); + } else { + console.log(chalk.yellow(`${investorToCheck} is not whitelisted!`)); + } + break; + case 'Modify whitelist': + let valid = !!readlineSync.keyInSelect(['Remove investor from whitelist', 'Add investor to whitelist'], 'How do you want to do? ', { cancel: false }); + let investorToWhitelist = readlineSync.question('Enter the address of the investor: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let modifyWhitelistAction = currentTransferManager.methods.modifyWhitelist(investorToWhitelist, valid); + let modifyWhitelistReceipt = await common.sendTransaction(modifyWhitelistAction); + let modifyWhitelistEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, modifyWhitelistReceipt.logs, 'ModifyWhitelist'); + if (modifyWhitelistEvent._valid) { + console.log(chalk.green(`${modifyWhitelistEvent._investor} has been added to the whitelist sucessfully!`)); + } else { + console.log(chalk.green(`${modifyWhitelistEvent._investor} has been removed from the whitelist sucessfully!`)); + } + break; + case 'Modify whitelist from CSV': + break; + case 'Allow primary issuance': + case 'Disallow primary issuance': + let setAllowPrimaryIssuanceAction = currentTransferManager.methods.setAllowPrimaryIssuance(!displayAllowPrimaryIssuance); + let setAllowPrimaryIssuanceReceipt = await common.sendTransaction(setAllowPrimaryIssuanceAction); + let setAllowPrimaryIssuanceEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, setAllowPrimaryIssuanceReceipt.logs, 'SetAllowPrimaryIssuance'); + if (setAllowPrimaryIssuanceEvent._allowPrimaryIssuance) { + console.log(chalk.green(`Transactions which are part of the primary issuance will be ignored!`)); + } else { + console.log(chalk.green(`Transactions which are part of the primary issuance will NOT be ignored!`)); + } + break; + + } +} + async function singleTradeVolumeRestrictionTM() { console.log(chalk.blue(`Single Trade Volume Restriction Transfer Manager at ${currentTransferManager.options.address}`)); console.log(); From aea6509301ab35b45e5e71a0e7d2a26da5fde89e Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 30 Nov 2018 09:14:59 +0530 Subject: [PATCH 119/139] Added docs generation to CI --- .travis.yml | 2 ++ scripts/docs.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index caddfc523..fdadf2ed6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,10 @@ matrix: before_script: - truffle version - wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js + - wget -O node_modules/solidity-docgen/buffer-size/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js script: - npm run test + - npm run docs notifications: slack: secure: W4FZSabLrzF74f317hutolEHnlq2GBlQxU6b85L5XymrjgLEhlgE16c5Qz7Emoyt6le6PXL+sfG2ujJc3XYys/6hppgrHSAasuJnKCdQNpmMZ9BNyMs6WGkmB3enIf3K/FLXb26AQdwpQdIXuOeJUTf879u+YoiZV0eZH8d3+fsIOyovq9N6X5pKOpDM9iT8gGB4t7fie7xf51s+iUaHxyO9G7jDginZ4rBXHcU7mxCub9z+Z1H8+kCTnPWaF+KKVEXx4Z0nI3+urboD7E4OIP02LwrThQls2CppA3X0EoesTcdvj/HLErY/JvsXIFiFEEHZzB1Wi+k2TiOeLcYwEuHIVij+HPxxlJNX/j8uy01Uk8s4rd+0EhvfdKHJqUKqxH4YN2npcKfHEss7bU3y7dUinXQfYShW5ZewHdvc7pnnxBTfhvmdi64HdNrXAPq+s1rhciH7MmnU+tsm4lhrpr+FBuHzUMA9fOCr7b0SQytZEgWpiUls88gdbh3yG8TjyZxmZJGx09cwEP0q7VoH0UwFh7mIu5XmYdd5tWUhavTiO7YV8cUPn7MvwMsTltB3YBpF/fB26L7ka8zBhCsjm9prW6SVYU/dyO3m91VeZtO/zJFHRDA6Q58JGVW2rgzO39z193qC1EGRXqTie96VwAAtNg8+hRb+bI/CWDVzSPc= diff --git a/scripts/docs.sh b/scripts/docs.sh index 205a6ceae..7f631fd06 100755 --- a/scripts/docs.sh +++ b/scripts/docs.sh @@ -38,6 +38,7 @@ create_docs() { CWD=$(pwd) OLD_SOLC_PATH=$SOLC_PATH export SOLC_PATH=$CWD/solc + curl -o node_modules/solidity-docgen/buffer-size/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js echo "Generating the API documentation in branch $latestTag" # Command to generate the documentation using the solidity-docgen From b3767d6930535f72e98c8c511113638bdb0ce62a Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 30 Nov 2018 09:19:03 +0530 Subject: [PATCH 120/139] Path fix --- .travis.yml | 2 +- scripts/docs.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index fdadf2ed6..ce5467100 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ matrix: before_script: - truffle version - wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js - - wget -O node_modules/solidity-docgen/buffer-size/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js + - wget -O node_modules/solidity-docgen/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js script: - npm run test - npm run docs diff --git a/scripts/docs.sh b/scripts/docs.sh index 7f631fd06..2441f1e09 100755 --- a/scripts/docs.sh +++ b/scripts/docs.sh @@ -38,7 +38,7 @@ create_docs() { CWD=$(pwd) OLD_SOLC_PATH=$SOLC_PATH export SOLC_PATH=$CWD/solc - curl -o node_modules/solidity-docgen/buffer-size/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js + curl -o node_modules/solidity-docgen/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js echo "Generating the API documentation in branch $latestTag" # Command to generate the documentation using the solidity-docgen From 617dd73ee3a4295b244c83aa97ee2fa20ab30164 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 30 Nov 2018 09:48:51 +0530 Subject: [PATCH 121/139] script fix --- scripts/docs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/docs.sh b/scripts/docs.sh index 2441f1e09..af7f6e395 100755 --- a/scripts/docs.sh +++ b/scripts/docs.sh @@ -38,7 +38,7 @@ create_docs() { CWD=$(pwd) OLD_SOLC_PATH=$SOLC_PATH export SOLC_PATH=$CWD/solc - curl -o node_modules/solidity-docgen/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js + echo "Generating the API documentation in branch $latestTag" # Command to generate the documentation using the solidity-docgen From 89f5351aae258db657297c0535d4df3f9c90a18e Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 30 Nov 2018 10:19:31 +0530 Subject: [PATCH 122/139] Testing travis --- .travis.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index ce5467100..d2b49fea8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,13 +6,21 @@ cache: - node_modules matrix: fast_finish: true -before_script: - - truffle version - - wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js - - wget -O node_modules/solidity-docgen/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js -script: - - npm run test - - npm run docs + allow_failures: + - env: 'TASK=docs' +jobs: + include: + - stage: Tests and Coverage + install: yarn install + after_install: wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js + before_script: truffle version + script: npm run test + - stage: docs + env: 'TASK=docs' + before_install: sudo apt-get -y install build-essential libboost-all-dev libz3-dev + install: yarn install + after_install: wget -O node_modules/solidity-docgen/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js + script: npm run docs notifications: slack: secure: W4FZSabLrzF74f317hutolEHnlq2GBlQxU6b85L5XymrjgLEhlgE16c5Qz7Emoyt6le6PXL+sfG2ujJc3XYys/6hppgrHSAasuJnKCdQNpmMZ9BNyMs6WGkmB3enIf3K/FLXb26AQdwpQdIXuOeJUTf879u+YoiZV0eZH8d3+fsIOyovq9N6X5pKOpDM9iT8gGB4t7fie7xf51s+iUaHxyO9G7jDginZ4rBXHcU7mxCub9z+Z1H8+kCTnPWaF+KKVEXx4Z0nI3+urboD7E4OIP02LwrThQls2CppA3X0EoesTcdvj/HLErY/JvsXIFiFEEHZzB1Wi+k2TiOeLcYwEuHIVij+HPxxlJNX/j8uy01Uk8s4rd+0EhvfdKHJqUKqxH4YN2npcKfHEss7bU3y7dUinXQfYShW5ZewHdvc7pnnxBTfhvmdi64HdNrXAPq+s1rhciH7MmnU+tsm4lhrpr+FBuHzUMA9fOCr7b0SQytZEgWpiUls88gdbh3yG8TjyZxmZJGx09cwEP0q7VoH0UwFh7mIu5XmYdd5tWUhavTiO7YV8cUPn7MvwMsTltB3YBpF/fB26L7ka8zBhCsjm9prW6SVYU/dyO3m91VeZtO/zJFHRDA6Q58JGVW2rgzO39z193qC1EGRXqTie96VwAAtNg8+hRb+bI/CWDVzSPc= From 29b3ba68718e6bcbe0b7f2fb470fafc6cc8be010 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 30 Nov 2018 10:38:42 +0530 Subject: [PATCH 123/139] Testing travis --- .travis.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2b49fea8..93e7cf768 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,17 +10,18 @@ matrix: - env: 'TASK=docs' jobs: include: + - stage: Docs + env: 'TASK=docs' + before_install: sudo add-apt-repository universe + install: yarn install + after_install: sudo apt-get -y install build-essential libboost-all-dev libz3-dev + before_script: wget -O node_modules/solidity-docgen/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js + script: npm run docs - stage: Tests and Coverage install: yarn install after_install: wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js before_script: truffle version script: npm run test - - stage: docs - env: 'TASK=docs' - before_install: sudo apt-get -y install build-essential libboost-all-dev libz3-dev - install: yarn install - after_install: wget -O node_modules/solidity-docgen/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js - script: npm run docs notifications: slack: secure: W4FZSabLrzF74f317hutolEHnlq2GBlQxU6b85L5XymrjgLEhlgE16c5Qz7Emoyt6le6PXL+sfG2ujJc3XYys/6hppgrHSAasuJnKCdQNpmMZ9BNyMs6WGkmB3enIf3K/FLXb26AQdwpQdIXuOeJUTf879u+YoiZV0eZH8d3+fsIOyovq9N6X5pKOpDM9iT8gGB4t7fie7xf51s+iUaHxyO9G7jDginZ4rBXHcU7mxCub9z+Z1H8+kCTnPWaF+KKVEXx4Z0nI3+urboD7E4OIP02LwrThQls2CppA3X0EoesTcdvj/HLErY/JvsXIFiFEEHZzB1Wi+k2TiOeLcYwEuHIVij+HPxxlJNX/j8uy01Uk8s4rd+0EhvfdKHJqUKqxH4YN2npcKfHEss7bU3y7dUinXQfYShW5ZewHdvc7pnnxBTfhvmdi64HdNrXAPq+s1rhciH7MmnU+tsm4lhrpr+FBuHzUMA9fOCr7b0SQytZEgWpiUls88gdbh3yG8TjyZxmZJGx09cwEP0q7VoH0UwFh7mIu5XmYdd5tWUhavTiO7YV8cUPn7MvwMsTltB3YBpF/fB26L7ka8zBhCsjm9prW6SVYU/dyO3m91VeZtO/zJFHRDA6Q58JGVW2rgzO39z193qC1EGRXqTie96VwAAtNg8+hRb+bI/CWDVzSPc= From c2411dd89d2146b2ff605444813b4544ea52a256 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 30 Nov 2018 10:42:04 +0530 Subject: [PATCH 124/139] Testing travis --- .travis.yml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 93e7cf768..07104c831 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,24 +4,19 @@ node_js: cache: directories: - node_modules +before_install: + - sudo add-apt-repository ppa:ethereum/ethereum + - sudo apt-get -y update + - sudo apt-get -y install solc matrix: fast_finish: true - allow_failures: - - env: 'TASK=docs' -jobs: - include: - - stage: Docs - env: 'TASK=docs' - before_install: sudo add-apt-repository universe - install: yarn install - after_install: sudo apt-get -y install build-essential libboost-all-dev libz3-dev - before_script: wget -O node_modules/solidity-docgen/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js - script: npm run docs - - stage: Tests and Coverage - install: yarn install - after_install: wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js - before_script: truffle version - script: npm run test +before_script: + - truffle version + - wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js + - wget -O node_modules/solidity-docgen/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js +script: + - npm run docs + - npm run test notifications: slack: secure: W4FZSabLrzF74f317hutolEHnlq2GBlQxU6b85L5XymrjgLEhlgE16c5Qz7Emoyt6le6PXL+sfG2ujJc3XYys/6hppgrHSAasuJnKCdQNpmMZ9BNyMs6WGkmB3enIf3K/FLXb26AQdwpQdIXuOeJUTf879u+YoiZV0eZH8d3+fsIOyovq9N6X5pKOpDM9iT8gGB4t7fie7xf51s+iUaHxyO9G7jDginZ4rBXHcU7mxCub9z+Z1H8+kCTnPWaF+KKVEXx4Z0nI3+urboD7E4OIP02LwrThQls2CppA3X0EoesTcdvj/HLErY/JvsXIFiFEEHZzB1Wi+k2TiOeLcYwEuHIVij+HPxxlJNX/j8uy01Uk8s4rd+0EhvfdKHJqUKqxH4YN2npcKfHEss7bU3y7dUinXQfYShW5ZewHdvc7pnnxBTfhvmdi64HdNrXAPq+s1rhciH7MmnU+tsm4lhrpr+FBuHzUMA9fOCr7b0SQytZEgWpiUls88gdbh3yG8TjyZxmZJGx09cwEP0q7VoH0UwFh7mIu5XmYdd5tWUhavTiO7YV8cUPn7MvwMsTltB3YBpF/fB26L7ka8zBhCsjm9prW6SVYU/dyO3m91VeZtO/zJFHRDA6Q58JGVW2rgzO39z193qC1EGRXqTie96VwAAtNg8+hRb+bI/CWDVzSPc= From b7b3e367ac695a7ff98a6a11cd241ba1fc9a2440 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 30 Nov 2018 10:44:02 +0530 Subject: [PATCH 125/139] Testing travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 07104c831..f968febbe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ cache: directories: - node_modules before_install: - - sudo add-apt-repository ppa:ethereum/ethereum + - echo -ne '\n' | sudo add-apt-repository ppa:ethereum/ethereum - sudo apt-get -y update - sudo apt-get -y install solc matrix: From af54a213d7456e18a9222e28277deac3a31ab7f8 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 30 Nov 2018 10:51:56 +0530 Subject: [PATCH 126/139] Testing travis --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index f968febbe..3f1007b26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,8 @@ before_install: - echo -ne '\n' | sudo add-apt-repository ppa:ethereum/ethereum - sudo apt-get -y update - sudo apt-get -y install solc + - sudo apt-get -y install libz3 + - sudo apt-get -y install libz3-dev matrix: fast_finish: true before_script: From 0ec99e492eb703939551fbeb42e58280439528e8 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 30 Nov 2018 11:09:26 +0530 Subject: [PATCH 127/139] Testing travis --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3f1007b26..b2d942c96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,8 @@ cache: directories: - node_modules before_install: - - echo -ne '\n' | sudo add-apt-repository ppa:ethereum/ethereum - - sudo apt-get -y update - - sudo apt-get -y install solc - - sudo apt-get -y install libz3 + - echo -ne '\n' | sudo apt-add-repository -y ppa:hvr/z3 + - sudo apt-get -y update - sudo apt-get -y install libz3-dev matrix: fast_finish: true From 538f7aaaffc9b158dc25e2156a9a9ebdcdccd0f8 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 30 Nov 2018 11:17:20 +0530 Subject: [PATCH 128/139] Testing travis --- .travis.yml | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index b2d942c96..2265b2d88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,19 +4,24 @@ node_js: cache: directories: - node_modules -before_install: - - echo -ne '\n' | sudo apt-add-repository -y ppa:hvr/z3 - - sudo apt-get -y update - - sudo apt-get -y install libz3-dev matrix: fast_finish: true -before_script: - - truffle version - - wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js - - wget -O node_modules/solidity-docgen/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js -script: - - npm run docs - - npm run test + allow_failures: + - env: 'TASK=docs' +jobs: + include: + - stage: Tests and Coverage + after_install: wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js + before_script: truffle version + script: npm run test + - stage: Docs + env: 'TASK=docs' + before_install: + - echo -ne '\n' | sudo apt-add-repository -y ppa:hvr/z3 + - sudo apt-get -y update + - sudo apt-get -y install libz3-dev + before_script: wget -O node_modules/solidity-docgen/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js + script: npm run docs notifications: slack: - secure: W4FZSabLrzF74f317hutolEHnlq2GBlQxU6b85L5XymrjgLEhlgE16c5Qz7Emoyt6le6PXL+sfG2ujJc3XYys/6hppgrHSAasuJnKCdQNpmMZ9BNyMs6WGkmB3enIf3K/FLXb26AQdwpQdIXuOeJUTf879u+YoiZV0eZH8d3+fsIOyovq9N6X5pKOpDM9iT8gGB4t7fie7xf51s+iUaHxyO9G7jDginZ4rBXHcU7mxCub9z+Z1H8+kCTnPWaF+KKVEXx4Z0nI3+urboD7E4OIP02LwrThQls2CppA3X0EoesTcdvj/HLErY/JvsXIFiFEEHZzB1Wi+k2TiOeLcYwEuHIVij+HPxxlJNX/j8uy01Uk8s4rd+0EhvfdKHJqUKqxH4YN2npcKfHEss7bU3y7dUinXQfYShW5ZewHdvc7pnnxBTfhvmdi64HdNrXAPq+s1rhciH7MmnU+tsm4lhrpr+FBuHzUMA9fOCr7b0SQytZEgWpiUls88gdbh3yG8TjyZxmZJGx09cwEP0q7VoH0UwFh7mIu5XmYdd5tWUhavTiO7YV8cUPn7MvwMsTltB3YBpF/fB26L7ka8zBhCsjm9prW6SVYU/dyO3m91VeZtO/zJFHRDA6Q58JGVW2rgzO39z193qC1EGRXqTie96VwAAtNg8+hRb+bI/CWDVzSPc= + secure: W4FZSabLrzF74f317hutolEHnlq2GBlQxU6b85L5XymrjgLEhlgE16c5Qz7Emoyt6le6PXL+sfG2ujJc3XYys/6hppgrHSAasuJnKCdQNpmMZ9BNyMs6WGkmB3enIf3K/FLXb26AQdwpQdIXuOeJUTf879u+YoiZV0eZH8d3+fsIOyovq9N6X5pKOpDM9iT8gGB4t7fie7xf51s+iUaHxyO9G7jDginZ4rBXHcU7mxCub9z+Z1H8+kCTnPWaF+KKVEXx4Z0nI3+urboD7E4OIP02LwrThQls2CppA3X0EoesTcdvj/HLErY/JvsXIFiFEEHZzB1Wi+k2TiOeLcYwEuHIVij+HPxxlJNX/j8uy01Uk8s4rd+0EhvfdKHJqUKqxH4YN2npcKfHEss7bU3y7dUinXQfYShW5ZewHdvc7pnnxBTfhvmdi64HdNrXAPq+s1rhciH7MmnU+tsm4lhrpr+FBuHzUMA9fOCr7b0SQytZEgWpiUls88gdbh3yG8TjyZxmZJGx09cwEP0q7VoH0UwFh7mIu5XmYdd5tWUhavTiO7YV8cUPn7MvwMsTltB3YBpF/fB26L7ka8zBhCsjm9prW6SVYU/dyO3m91VeZtO/zJFHRDA6Q58JGVW2rgzO39z193qC1EGRXqTie96VwAAtNg8+hRb+bI/CWDVzSPc= \ No newline at end of file From 8b964c5fdb7347d9dd67799c0bdfdced756ff853 Mon Sep 17 00:00:00 2001 From: shuffledex Date: Fri, 30 Nov 2018 09:04:15 -0300 Subject: [PATCH 129/139] whitelist to transfer manager --- CLI/commands/sto_manager.js | 4 +- CLI/commands/token_manager.js | 3 +- CLI/commands/transfer_manager.js | 181 +++++++++++++++++++++++++++++- CLI/commands/whitelist.js | 182 ------------------------------- CLI/polymath-cli.js | 5 +- 5 files changed, 184 insertions(+), 191 deletions(-) delete mode 100644 CLI/commands/whitelist.js diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index 8cd2baa5e..898eb8b45 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -708,7 +708,7 @@ async function usdTieredSTO_configure(currentSTO) { await common.sendTransaction(changeNonAccreditedLimitAction); break; case 4: - await startCSV(tokenSymbol, 75, 'nonAccredited'); + await startCSV(tokenSymbol, 75, 'nonAccreditedLimit'); break; case 5: await modfifyTimes(currentSTO); @@ -743,7 +743,7 @@ async function startCSV(tokenSymbol, batchSize, accreditionType) { proccessing = accredit_processing saving = saveInBlockchainAccredited break; - case 'nonAccredited': + case 'nonAccreditedLimit': file = './CLI/data/nonAccreditedLimits_data.csv' proccessing = nonAccredited_processing saving = saveInBlockchainNonAccredited diff --git a/CLI/commands/token_manager.js b/CLI/commands/token_manager.js index a94c0cc1d..e8556450d 100644 --- a/CLI/commands/token_manager.js +++ b/CLI/commands/token_manager.js @@ -1,7 +1,6 @@ // Libraries for terminal prompts const readlineSync = require('readline-sync'); const chalk = require('chalk'); -const whitelist = require('./whitelist'); const stoManager = require('./sto_manager'); const transferManager = require('./transfer_manager'); const common = require('./common/common_functions'); @@ -347,7 +346,7 @@ async function mintToSingleAddress(_investor, _amount) { } async function multi_mint_tokens() { - await whitelist.executeApp(tokenSymbol, 75); + await transferManager.startCSV(tokenSymbol, 75); console.log(chalk.green(`\nCongratulations! All the affiliates get succssfully whitelisted, Now its time to Mint the tokens\n`)); console.log(chalk.red(`WARNING: `) + `Please make sure all the addresses that get whitelisted are only eligible to hold or get Security token\n`); diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 44ae64ca1..dc5aba389 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -5,13 +5,22 @@ var common = require('./common/common_functions'); var contracts = require('./helpers/contract_addresses'); var abis = require('./helpers/contract_abis'); var gbl = require('./common/global'); -var whitelist = require('./whitelist'); +var transferManager = require('./transfer_manager'); +var csv_shared = require('./common/csv_shared'); +var BigNumber = require('bignumber.js'); // App flow let tokenSymbol; let securityToken; let securityTokenRegistry; let currentTransferManager; +let generalTransferManager; + +/* CSV variables */ +let distribData = new Array(); +let fullFileData = new Array(); +let badData = new Array(); +/* End CSV variables */ async function executeApp() { let exit = false; @@ -373,7 +382,7 @@ async function generalTransferManager() { case 'Modify whitelist from CSV': console.log(chalk.yellow(`Data is going to be read from 'data/whitelist_data.csv'. Be sure this file is updated!`)); if (readlineSync.keyInYNStrict(`Do you want to continue?`)) { - await whitelist.executeApp(tokenSymbl); + await transferManager.startCSV(tokenSymbol); } break; /* @@ -468,6 +477,171 @@ async function generalTransferManager() { } } +async function startCSV(tokenSymbol, batchSize) { + securityToken = await csv_shared.start(tokenSymbol, batchSize); + + let result_processing = await csv_shared.read('./CLI/data/whitelist_data.csv', whitelist_processing); + distribData = result_processing.distribData; + fullFileData = result_processing.fullFileData; + badData = result_processing.badData; + + await saveInBlockchain(); + await finalResults(); +}; + +function whitelist_processing(csv_line) { + let isAddress = web3.utils.isAddress(csv_line[0]); + let sellValid = isValidDate(csv_line[1]) + let buyValid = isValidDate(csv_line[2]) + let kycExpiryDate = isValidDate(csv_line[3]) + let canBuyFromSTO = (typeof JSON.parse(csv_line[4].toLowerCase())) == "boolean" ? JSON.parse(csv_line[4].toLowerCase()) : "not-valid"; + + if (isAddress && + sellValid && + buyValid && + kycExpiryDate && + (canBuyFromSTO != "not-valid")) { + return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), sellValid, buyValid, kycExpiryDate, canBuyFromSTO)] + } else { + return [false, new Array(csv_line[0], sellValid, buyValid, kycExpiryDate, canBuyFromSTO)] + } +} + +function isValidDate(date) { + var matches = /^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/.exec(date); + if (matches == null) return false; + var d = matches[2]; + var m = matches[1] - 1; + var y = matches[3]; + var composedDate = new Date(y, m, d); + var timestampDate = composedDate.getTime() + + // For some reason these timestamps are being recorded +4 hours UTC + if (composedDate.getDate() == d && + composedDate.getMonth() == m && + composedDate.getFullYear() == y) { + return timestampDate / 1000 + } else { + return false + } +} + +async function saveInBlockchain() { + let gtmModules; + try { + gtmModules = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); + } catch (e) { + console.log("Please attach General Transfer module before launch this action.", e) + process.exit(0) + } + + generalTransferManager = new web3.eth.Contract(abis.generalTransferManager(), gtmModules[0]); + + console.log(` + ------------------------------------------------------- + ----- Sending buy/sell restrictions to blockchain ----- + ------------------------------------------------------- + `); + + for (let i = 0; i < distribData.length; i++) { + try { + let investorArray = [], fromTimesArray = [], toTimesArray = [], expiryTimeArray = [], canBuyFromSTOArray = []; + + // Splitting the user arrays to be organized by input + for (let j = 0; j < distribData[i].length; j++) { + investorArray.push(distribData[i][j][0]) + fromTimesArray.push(distribData[i][j][1]) + toTimesArray.push(distribData[i][j][2]) + expiryTimeArray.push(distribData[i][j][3]) + canBuyFromSTOArray.push(distribData[i][j][4]) + } + + let modifyWhitelistMultiAction = await generalTransferManager.methods.modifyWhitelistMulti(investorArray, fromTimesArray, toTimesArray, expiryTimeArray, canBuyFromSTOArray); + let tx = await common.sendTransaction(modifyWhitelistMultiAction); + console.log(`Batch ${i} - Attempting to modifyWhitelist accounts:\n\n`, investorArray, "\n\n"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); + console.log("Whitelist transaxction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); + console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); + + } catch (err) { + console.log("ERROR", err) + process.exit(0) + } + } + + return; +} + +async function finalResults() { + let totalInvestors = 0; + let updatedInvestors = 0; + let investorObjectLookup = {}; + let investorData_Events = new Array(); + let event_data = await generalTransferManager.getPastEvents('ModifyWhitelist', {fromBlock: 0, toBlock: 'latest'}, () => {}); + + for (var i = 0; i < event_data.length; i++) { + let combineArray = []; + + let investorAddress_Event = event_data[i].returnValues._investor + let fromTime_Event = event_data[i].returnValues._fromTime + let toTime_Event = event_data[i].returnValues._toTime + let expiryTime_Event = event_data[i].returnValues._expiryTime + let canBuyFromSTO_Event = event_data[i].returnValues._canBuyFromSTO + let blockNumber = event_data[i].blockNumber + + combineArray.push(investorAddress_Event); + combineArray.push(fromTime_Event); + combineArray.push(toTime_Event); + combineArray.push(expiryTime_Event); + combineArray.push(canBuyFromSTO_Event); + combineArray.push(blockNumber) + + investorData_Events.push(combineArray) + + // We have already recorded it, so this is an update to our object + if (investorObjectLookup.hasOwnProperty(investorAddress_Event)) { + // The block number form the event we are checking is bigger, so we gotta replace it + if (investorObjectLookup[investorAddress_Event].recordedBlockNumber < blockNumber) { + investorObjectLookup[investorAddress_Event] = {fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber}; + updatedInvestors += 1; + } + } else { + investorObjectLookup[investorAddress_Event] = {fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber}; + totalInvestors += 1; + } + } + + let investorAddress_Events = Object.keys(investorObjectLookup) + + console.log(`******************** EVENT LOGS ANALYSIS COMPLETE ********************\n`); + console.log(`A total of ${totalInvestors} investors have been whitelisted total, all time.\n`); + console.log(`This script in total sent ${fullFileData.length - badData.length} new investors and updated investors to the blockchain.\n`); + console.log(`There were ${badData.length} bad entries that didnt get sent to the blockchain in the script.\n`); + console.log("************************************************************************************************"); + console.log("OBJECT WITH EVERY USER AND THEIR UPDATED TIMES: \n\n", investorObjectLookup) + console.log("************************************************************************************************"); + console.log("LIST OF ALL INVESTORS WHITELISTED: \n\n", investorAddress_Events) + + let missingDistribs = []; + for (let l = 0; l < fullFileData.length; l++) { + if (!investorObjectLookup.hasOwnProperty(fullFileData[l][0])) { + missingDistribs.push(fullFileData[l]) + } + } + + if (missingDistribs.length > 0) { + console.log("************************************************************************************************"); + console.log("-- No LogModifyWhitelist event was found for the following data arrays. Please review them manually --") + console.log(missingDistribs) + console.log("************************************************************************************************"); + } else { + console.log("\n************************************************************************************************"); + console.log("All accounts passed through from the CSV were successfully whitelisted, because we were able to read them all from events") + console.log("************************************************************************************************"); + } + +} + async function manualApprovalTransferManager() { console.log(chalk.blue(`Manual Approval Transfer Manager at ${currentTransferManager.options.address}`), '\n'); @@ -952,5 +1126,8 @@ module.exports = { addTransferManagerModule: async function (_tokenSymbol) { await initialize(_tokenSymbol); return addTransferManagerModule() + }, + startCSV: async function (tokenSymbol, batchSize) { + return startCSV(tokenSymbol, batchSize); } } \ No newline at end of file diff --git a/CLI/commands/whitelist.js b/CLI/commands/whitelist.js deleted file mode 100644 index 7a5767611..000000000 --- a/CLI/commands/whitelist.js +++ /dev/null @@ -1,182 +0,0 @@ -var common = require('./common/common_functions'); -var csv_shared = require('./common/csv_shared'); -var abis = require('./helpers/contract_abis'); -var BigNumber = require('bignumber.js'); - -let distribData = new Array(); -let fullFileData = new Array(); -let badData = new Array(); - -let securityToken; -let generalTransferManager; - -async function startScript(tokenSymbol, batchSize) { - securityToken = await csv_shared.start(tokenSymbol, batchSize); - - let result_processing = await csv_shared.read('./CLI/data/whitelist_data.csv', whitelist_processing); - distribData = result_processing.distribData; - fullFileData = result_processing.fullFileData; - badData = result_processing.badData; - - await saveInBlockchain(); - await finalResults(); -}; - -function whitelist_processing(csv_line) { - let isAddress = web3.utils.isAddress(csv_line[0]); - let sellValid = isValidDate(csv_line[1]) - let buyValid = isValidDate(csv_line[2]) - let kycExpiryDate = isValidDate(csv_line[3]) - let canBuyFromSTO = (typeof JSON.parse(csv_line[4].toLowerCase())) == "boolean" ? JSON.parse(csv_line[4].toLowerCase()) : "not-valid"; - - if (isAddress && - sellValid && - buyValid && - kycExpiryDate && - (canBuyFromSTO != "not-valid")) { - return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), sellValid, buyValid, kycExpiryDate, canBuyFromSTO)] - } else { - return [false, new Array(csv_line[0], sellValid, buyValid, kycExpiryDate, canBuyFromSTO)] - } -} - -function isValidDate(date) { - var matches = /^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/.exec(date); - if (matches == null) return false; - var d = matches[2]; - var m = matches[1] - 1; - var y = matches[3]; - var composedDate = new Date(y, m, d); - var timestampDate = composedDate.getTime() - - // For some reason these timestamps are being recorded +4 hours UTC - if (composedDate.getDate() == d && - composedDate.getMonth() == m && - composedDate.getFullYear() == y) { - return timestampDate / 1000 - } else { - return false - } -} - -async function saveInBlockchain() { - let gtmModules; - try { - gtmModules = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); - } catch (e) { - console.log("Please attach General Transfer module before launch this action.", e) - process.exit(0) - } - - generalTransferManager = new web3.eth.Contract(abis.generalTransferManager(), gtmModules[0]); - - console.log(` - ------------------------------------------------------- - ----- Sending buy/sell restrictions to blockchain ----- - ------------------------------------------------------- - `); - - for (let i = 0; i < distribData.length; i++) { - try { - let investorArray = [], fromTimesArray = [], toTimesArray = [], expiryTimeArray = [], canBuyFromSTOArray = []; - - // Splitting the user arrays to be organized by input - for (let j = 0; j < distribData[i].length; j++) { - investorArray.push(distribData[i][j][0]) - fromTimesArray.push(distribData[i][j][1]) - toTimesArray.push(distribData[i][j][2]) - expiryTimeArray.push(distribData[i][j][3]) - canBuyFromSTOArray.push(distribData[i][j][4]) - } - - let modifyWhitelistMultiAction = await generalTransferManager.methods.modifyWhitelistMulti(investorArray, fromTimesArray, toTimesArray, expiryTimeArray, canBuyFromSTOArray); - let tx = await common.sendTransaction(modifyWhitelistMultiAction); - console.log(`Batch ${i} - Attempting to modifyWhitelist accounts:\n\n`, investorArray, "\n\n"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Whitelist transaxction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); - - } catch (err) { - console.log("ERROR", err) - process.exit(0) - } - } - - return; -} - -async function finalResults() { - let totalInvestors = 0; - let updatedInvestors = 0; - let investorObjectLookup = {}; - let investorData_Events = new Array(); - let event_data = await generalTransferManager.getPastEvents('ModifyWhitelist', {fromBlock: 0, toBlock: 'latest'}, () => {}); - - for (var i = 0; i < event_data.length; i++) { - let combineArray = []; - - let investorAddress_Event = event_data[i].returnValues._investor - let fromTime_Event = event_data[i].returnValues._fromTime - let toTime_Event = event_data[i].returnValues._toTime - let expiryTime_Event = event_data[i].returnValues._expiryTime - let canBuyFromSTO_Event = event_data[i].returnValues._canBuyFromSTO - let blockNumber = event_data[i].blockNumber - - combineArray.push(investorAddress_Event); - combineArray.push(fromTime_Event); - combineArray.push(toTime_Event); - combineArray.push(expiryTime_Event); - combineArray.push(canBuyFromSTO_Event); - combineArray.push(blockNumber) - - investorData_Events.push(combineArray) - - // We have already recorded it, so this is an update to our object - if (investorObjectLookup.hasOwnProperty(investorAddress_Event)) { - // The block number form the event we are checking is bigger, so we gotta replace it - if (investorObjectLookup[investorAddress_Event].recordedBlockNumber < blockNumber) { - investorObjectLookup[investorAddress_Event] = {fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber}; - updatedInvestors += 1; - } - } else { - investorObjectLookup[investorAddress_Event] = {fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber}; - totalInvestors += 1; - } - } - - let investorAddress_Events = Object.keys(investorObjectLookup) - - console.log(`******************** EVENT LOGS ANALYSIS COMPLETE ********************\n`); - console.log(`A total of ${totalInvestors} investors have been whitelisted total, all time.\n`); - console.log(`This script in total sent ${fullFileData.length - badData.length} new investors and updated investors to the blockchain.\n`); - console.log(`There were ${badData.length} bad entries that didnt get sent to the blockchain in the script.\n`); - console.log("************************************************************************************************"); - console.log("OBJECT WITH EVERY USER AND THEIR UPDATED TIMES: \n\n", investorObjectLookup) - console.log("************************************************************************************************"); - console.log("LIST OF ALL INVESTORS WHITELISTED: \n\n", investorAddress_Events) - - let missingDistribs = []; - for (let l = 0; l < fullFileData.length; l++) { - if (!investorObjectLookup.hasOwnProperty(fullFileData[l][0])) { - missingDistribs.push(fullFileData[l]) - } - } - - if (missingDistribs.length > 0) { - console.log("************************************************************************************************"); - console.log("-- No LogModifyWhitelist event was found for the following data arrays. Please review them manually --") - console.log(missingDistribs) - console.log("************************************************************************************************"); - } else { - console.log("\n************************************************************************************************"); - console.log("All accounts passed through from the CSV were successfully whitelisted, because we were able to read them all from events") - console.log("************************************************************************************************"); - } - -} - -module.exports = { - executeApp: async (tokenSymbol, batchSize) => { - return startScript(tokenSymbol, batchSize); - } -} \ No newline at end of file diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index b422d5215..3e2494a3f 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -6,7 +6,6 @@ var token_manager = require('./commands/token_manager'); var st20generator = require('./commands/ST20Generator'); var sto_manager = require('./commands/sto_manager'); var transfer = require('./commands/transfer'); -var whitelist = require('./commands/whitelist'); var transfer_ownership = require('./commands/transfer_ownership'); var dividends_manager = require('./commands/dividends_manager'); var transfer_manager = require('./commands/transfer_manager'); @@ -114,7 +113,7 @@ program .description('Mass-update a whitelist of allowed/known investors') .action(async function (tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); - await whitelist.executeApp(tokenSymbol, batchSize); + await transfer_manager.startCSV(tokenSymbol, batchSize); }); program @@ -160,7 +159,7 @@ program .description('Runs changeNonAccreditedLimit') .action(async function (tokenSymbol, batchSize) { await gbl.initialize(program.remoteNode); - await sto_manager.startCSV(tokenSymbol, batchSize, 'nonAccredited') + await sto_manager.startCSV(tokenSymbol, batchSize, 'nonAccreditedLimit') }); program From 1ad53fc4dc94326e606c7132109afb3586c57712 Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 30 Nov 2018 20:22:26 -0300 Subject: [PATCH 130/139] CSV parser --- CLI/commands/helpers/csv.js | 42 +++++++++++++++++++++++++++++++++++++ CLI/commands/sto_manager.js | 28 ++++++++++++++++++------- CLI/package.json | 1 + CLI/yarn.lock | 5 +++++ 4 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 CLI/commands/helpers/csv.js diff --git a/CLI/commands/helpers/csv.js b/CLI/commands/helpers/csv.js new file mode 100644 index 000000000..560adb935 --- /dev/null +++ b/CLI/commands/helpers/csv.js @@ -0,0 +1,42 @@ +const csvParse = require('csv-parse/lib/sync'); +const fs = require('fs'); + +function _cast(obj) { + if (/^(\-|\+)?([1-9]+[0-9]*)$/.test(obj)) { // Int + obj = parseInt(obj); + } + else if (/^[+-]?([0-9]*[.])?[0-9]+$/.test(obj)) { // Float + obj = parseFloat(obj); + } + else if (/^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/.test(obj)) { // Datetime + var matches = /^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/.exec(obj); + var composedDate = new Date(matches[3], matches[1] - 1, matches[2]); + var timestampDate = composedDate.getTime(); + obj = timestampDate / 1000; + } + else if (obj.toLowerCase() === "true" || obj.toLowerCase() === "false") { // Boolean + obj = JSON.parse(obj.toLowerCase()); + } + return obj; +} + +function parse(_csvFilePath, _batchSize) { + // Read file + let input = fs.readFileSync(_csvFilePath); + // Parse csv + let data = csvParse(input, { cast: _cast }); + // Batches + let allBatches = []; + for (let index = 0; index < data.length; index += _batchSize) { + allBatches.push(data.slice(index, index + _batchSize)); + } + // Transform result + let result = []; + let columnsLenght = data[0].length; + for (let index = 0; index < columnsLenght; index++) { + result[index] = allBatches.map(batch => batch.map(record => record[index])); + } + return result; +} + +module.exports = parse; \ No newline at end of file diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index 898eb8b45..c77bb2485 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -5,6 +5,7 @@ const abis = require('./helpers/contract_abis'); const common = require('./common/common_functions'); const gbl = require('./common/global'); const csv_shared = require('./common/csv_shared'); +const csvParse = require('./helpers/csv'); const BigNumber = require('bignumber.js'); /////////////////// @@ -696,6 +697,17 @@ async function usdTieredSTO_configure(currentSTO) { await common.sendTransaction(changeAccreditedAction); break; case 2: + let batchSize = 75; + let csvFile = fs.readFileSync('./CLI/data/accredited_data.csv'); + let columns = ['address', 'accredited']; + let resultData = []; + let index = 0; + while (true) { + index++; + let data = csvParse(csvFile, { columns: columns, from_line: index, to_line: batchSize * index }); + resultData.push(data); + } + let accredit; await startCSV(tokenSymbol, 75, 'accredited'); break; case 3: @@ -736,7 +748,7 @@ async function usdTieredSTO_configure(currentSTO) { async function startCSV(tokenSymbol, batchSize, accreditionType) { let file, proccessing, saving; - + switch (accreditionType) { case 'accredited': file = './CLI/data/accredited_data.csv' @@ -756,7 +768,7 @@ async function startCSV(tokenSymbol, batchSize, accreditionType) { distribData = result_processing.distribData; fullFileData = result_processing.fullFileData; badData = result_processing.badData; - + await saving(); } @@ -812,12 +824,12 @@ async function saveInBlockchainAccredited() { for (let i = 0; i < distribData.length; i++) { try { let investorArray = [], isAccreditedArray = []; - + for (let j = 0; j < distribData[i].length; j++) { investorArray.push(distribData[i][j][0]) isAccreditedArray.push(distribData[i][j][1]) } - + let changeAccreditedAction = await usdTieredSTO.methods.changeAccredited(investorArray, isAccreditedArray); let tx = await common.sendTransaction(changeAccreditedAction); console.log(`Batch ${i} - Attempting to change accredited accounts:\n\n`, investorArray, "\n\n"); @@ -867,7 +879,7 @@ async function saveInBlockchainNonAccredited() { for (let i = 0; i < distribData.length; i++) { try { let investorArray = [], limitArray = []; - + for (let j = 0; j < distribData[i].length; j++) { investorArray.push(distribData[i][j][0]); limitArray.push(web3.utils.toWei(distribData[i][j][1].toString())); @@ -879,7 +891,7 @@ async function saveInBlockchainNonAccredited() { console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); console.log("Change accredited transaction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString()), "Ether"); console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); - + } catch (err) { console.log("ERROR:", err); } @@ -1063,4 +1075,6 @@ module.exports = { startCSV: async function (tokenSymbol, batchSize, accreditionType) { return startCSV(tokenSymbol, batchSize, accreditionType); } -} \ No newline at end of file +} + + diff --git a/CLI/package.json b/CLI/package.json index 95a391b45..64fb2a221 100644 --- a/CLI/package.json +++ b/CLI/package.json @@ -11,6 +11,7 @@ "dependencies": { "chalk": "^2.4.1", "commander": "^2.16.0", + "csv-parse": "^4.0.1", "ethers": "^4.0.7", "moment": "^2.22.2", "readline-sync": "^1.4.9", diff --git a/CLI/yarn.lock b/CLI/yarn.lock index 4d20bee11..51925f5ef 100644 --- a/CLI/yarn.lock +++ b/CLI/yarn.lock @@ -437,6 +437,11 @@ crypto-browserify@3.12.0: randombytes "^2.0.0" randomfill "^1.0.3" +csv-parse@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-4.0.1.tgz#4ad438352cbf12d5317d0fb9d588e53473293851" + integrity sha512-ehkwejEj05wwO7Q9JD+YSI6dNMIauHIroNU1RALrmRrqPoZIwRnfBtgq5GkU6i2RxZOJqjo3dtI1NrVSXvaimA== + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" From d0d51933ca9f56af2f38154d9eba266dc863a709 Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 30 Nov 2018 20:26:44 -0300 Subject: [PATCH 131/139] Data folder reorganization --- CLI/data/{ => Checkpoint}/dividendsExclusions_data.csv | 0 CLI/data/{ => ST}/multi_mint_data.csv | 0 CLI/data/{ => STO/USDTieredSTO}/accredited_data.csv | 0 CLI/data/{ => STO/USDTieredSTO}/nonAccreditedLimits_data.csv | 0 CLI/data/{ => STO}/capped_sto_data.yml | 0 CLI/data/{ => STO}/usd_tiered_sto_data.yml | 0 CLI/data/{ => Ticker}/ticker_data.csv | 0 CLI/data/{ => Transfer/GTM}/whitelist_data.csv | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename CLI/data/{ => Checkpoint}/dividendsExclusions_data.csv (100%) rename CLI/data/{ => ST}/multi_mint_data.csv (100%) rename CLI/data/{ => STO/USDTieredSTO}/accredited_data.csv (100%) rename CLI/data/{ => STO/USDTieredSTO}/nonAccreditedLimits_data.csv (100%) rename CLI/data/{ => STO}/capped_sto_data.yml (100%) rename CLI/data/{ => STO}/usd_tiered_sto_data.yml (100%) rename CLI/data/{ => Ticker}/ticker_data.csv (100%) rename CLI/data/{ => Transfer/GTM}/whitelist_data.csv (100%) diff --git a/CLI/data/dividendsExclusions_data.csv b/CLI/data/Checkpoint/dividendsExclusions_data.csv similarity index 100% rename from CLI/data/dividendsExclusions_data.csv rename to CLI/data/Checkpoint/dividendsExclusions_data.csv diff --git a/CLI/data/multi_mint_data.csv b/CLI/data/ST/multi_mint_data.csv similarity index 100% rename from CLI/data/multi_mint_data.csv rename to CLI/data/ST/multi_mint_data.csv diff --git a/CLI/data/accredited_data.csv b/CLI/data/STO/USDTieredSTO/accredited_data.csv similarity index 100% rename from CLI/data/accredited_data.csv rename to CLI/data/STO/USDTieredSTO/accredited_data.csv diff --git a/CLI/data/nonAccreditedLimits_data.csv b/CLI/data/STO/USDTieredSTO/nonAccreditedLimits_data.csv similarity index 100% rename from CLI/data/nonAccreditedLimits_data.csv rename to CLI/data/STO/USDTieredSTO/nonAccreditedLimits_data.csv diff --git a/CLI/data/capped_sto_data.yml b/CLI/data/STO/capped_sto_data.yml similarity index 100% rename from CLI/data/capped_sto_data.yml rename to CLI/data/STO/capped_sto_data.yml diff --git a/CLI/data/usd_tiered_sto_data.yml b/CLI/data/STO/usd_tiered_sto_data.yml similarity index 100% rename from CLI/data/usd_tiered_sto_data.yml rename to CLI/data/STO/usd_tiered_sto_data.yml diff --git a/CLI/data/ticker_data.csv b/CLI/data/Ticker/ticker_data.csv similarity index 100% rename from CLI/data/ticker_data.csv rename to CLI/data/Ticker/ticker_data.csv diff --git a/CLI/data/whitelist_data.csv b/CLI/data/Transfer/GTM/whitelist_data.csv similarity index 100% rename from CLI/data/whitelist_data.csv rename to CLI/data/Transfer/GTM/whitelist_data.csv From d47cc3270ce814f5543935828cae62bbef51c3ef Mon Sep 17 00:00:00 2001 From: Victor Date: Sun, 2 Dec 2018 14:47:01 -0300 Subject: [PATCH 132/139] Refactoring and improvements --- CLI/commands/common/common_functions.js | 51 ++++++++++++++++--------- CLI/commands/helpers/csv.js | 17 +++------ 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/CLI/commands/common/common_functions.js b/CLI/commands/common/common_functions.js index 0d21d06f3..a59b9ac21 100644 --- a/CLI/commands/common/common_functions.js +++ b/CLI/commands/common/common_functions.js @@ -42,7 +42,7 @@ function getFinalOptions(options) { async function getGasLimit(options, action) { let block = await web3.eth.getBlock("latest"); let networkGasLimit = block.gasLimit; - let gas = Math.round(options.factor * (await action.estimateGas({ from: options.from.address, value: options.value}))); + let gas = Math.round(options.factor * (await action.estimateGas({ from: options.from.address, value: options.value }))); return (gas > networkGasLimit) ? networkGasLimit : gas; } @@ -65,16 +65,16 @@ async function checkPermissions(action) { module.exports = { convertToDaysRemaining: function (timeRemaining) { var seconds = parseInt(timeRemaining, 10); - + var days = Math.floor(seconds / (3600 * 24)); - seconds -= days * 3600 * 24; - var hrs = Math.floor(seconds / 3600); - seconds -= hrs * 3600; + seconds -= days * 3600 * 24; + var hrs = Math.floor(seconds / 3600); + seconds -= hrs * 3600; var mnts = Math.floor(seconds / 60); - seconds -= mnts * 60; + seconds -= mnts * 60; return (days + " days, " + hrs + " Hrs, " + mnts + " Minutes, " + seconds + " Seconds"); }, - logAsciiBull: function() { + logAsciiBull: function () { console.log(` /######%%, /#( ##########%%%%%, ,%%%. % @@ -103,8 +103,8 @@ module.exports = { options = getFinalOptions(options); let gasLimit = await getGasLimit(options, action); - - console.log(chalk.black.bgYellowBright(`---- Transaction executed: ${action._method.name} - Gas limit provided: ${gasLimit} ----`)); + + console.log(chalk.black.bgYellowBright(`---- Transaction executed: ${action._method.name} - Gas limit provided: ${gasLimit} ----`)); let nonce = await web3.eth.getTransactionCount(options.from.address); let abi = action.encodeABI(); @@ -117,24 +117,24 @@ module.exports = { nonce: nonce, value: web3.utils.toHex(options.value) }; - + const transaction = new Tx(parameter); transaction.sign(Buffer.from(options.from.privateKey.replace('0x', ''), 'hex')); return await web3.eth.sendSignedTransaction('0x' + transaction.serialize().toString('hex')) - .on('transactionHash', function(hash){ - console.log(` + .on('transactionHash', function (hash) { + console.log(` Your transaction is being processed. Please wait... TxHash: ${hash}` - ); - }) - .on('receipt', function(receipt){ - console.log(` + ); + }) + .on('receipt', function (receipt) { + console.log(` Congratulations! The transaction was successfully completed. Gas used: ${receipt.gasUsed} - Gas spent: ${web3.utils.fromWei((new web3.utils.BN(options.gasPrice)).mul(new web3.utils.BN(receipt.gasUsed)))} Ether Review it on Etherscan. TxHash: ${receipt.transactionHash}\n` - ); - }); + ); + }); }, getEventFromLogs: function (jsonInterface, logs, eventName) { let eventJsonInterface = jsonInterface.find(o => o.name === eventName && o.type === 'event'); @@ -145,5 +145,20 @@ module.exports = { let eventJsonInterface = jsonInterface.find(o => o.name === eventName && o.type === 'event'); let filteredLogs = logs.filter(l => l.topics.includes(eventJsonInterface.signature)); return filteredLogs.map(l => web3.eth.abi.decodeLog(eventJsonInterface.inputs, l.data, l.topics.slice(1))); + }, + splitIntoBatches: function (data, batchSize) { + let allBatches = []; + for (let index = 0; index < data.length; index += batchSize) { + allBatches.push(data.slice(index, index + batchSize)); + } + return allBatches; + }, + transposeBatches: function (batches) { + let result = []; + let columns = batches[0][0].length; + for (let index = 0; index < columns; index++) { + result[index] = batches.map(batch => batch.map(record => record[index])); + } + return result; } }; diff --git a/CLI/commands/helpers/csv.js b/CLI/commands/helpers/csv.js index 560adb935..a36dcec15 100644 --- a/CLI/commands/helpers/csv.js +++ b/CLI/commands/helpers/csv.js @@ -1,5 +1,6 @@ const csvParse = require('csv-parse/lib/sync'); const fs = require('fs'); +const web3Utils = require('web3-utils'); function _cast(obj) { if (/^(\-|\+)?([1-9]+[0-9]*)$/.test(obj)) { // Int @@ -16,6 +17,8 @@ function _cast(obj) { } else if (obj.toLowerCase() === "true" || obj.toLowerCase() === "false") { // Boolean obj = JSON.parse(obj.toLowerCase()); + } else if (web3Utils.isAddress(obj)) { + obj = web3Utils.toChecksumAddress(obj); } return obj; } @@ -25,18 +28,8 @@ function parse(_csvFilePath, _batchSize) { let input = fs.readFileSync(_csvFilePath); // Parse csv let data = csvParse(input, { cast: _cast }); - // Batches - let allBatches = []; - for (let index = 0; index < data.length; index += _batchSize) { - allBatches.push(data.slice(index, index + _batchSize)); - } - // Transform result - let result = []; - let columnsLenght = data[0].length; - for (let index = 0; index < columnsLenght; index++) { - result[index] = allBatches.map(batch => batch.map(record => record[index])); - } - return result; + + return data; } module.exports = parse; \ No newline at end of file From 1fecc9a3941de0e47b9208a66ed50334a9d099eb Mon Sep 17 00:00:00 2001 From: Victor Date: Sun, 2 Dec 2018 15:18:31 -0300 Subject: [PATCH 133/139] STO manager refactoring for batch operations --- CLI/commands/common/constants.js | 15 +- CLI/commands/sto_manager.js | 238 ++++++++----------------------- CLI/polymath-cli.js | 18 --- 3 files changed, 66 insertions(+), 205 deletions(-) diff --git a/CLI/commands/common/constants.js b/CLI/commands/common/constants.js index c3e2b796c..bb9c8f69c 100644 --- a/CLI/commands/common/constants.js +++ b/CLI/commands/common/constants.js @@ -7,22 +7,22 @@ module.exports = Object.freeze({ BURN: 5 }, DURATION: { - seconds: function(val) { + seconds: function (val) { return val }, - minutes: function(val) { + minutes: function (val) { return val * this.seconds(60) }, - hours: function(val) { + hours: function (val) { return val * this.minutes(60) }, - days: function(val) { + days: function (val) { return val * this.hours(24) }, - weeks: function(val) { + weeks: function (val) { return val * this.days(7) }, - years: function(val) { + years: function (val) { return val * this.days(365) } }, @@ -30,5 +30,6 @@ module.exports = Object.freeze({ ETH: 0, POLY: 1, DAI: 2 - } + }, + DEFAULT_BATCH_SIZE: 75 }); \ No newline at end of file diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index c77bb2485..8e2a347f0 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -8,6 +8,11 @@ const csv_shared = require('./common/csv_shared'); const csvParse = require('./helpers/csv'); const BigNumber = require('bignumber.js'); +/////////////////// +// Constants +const ACCREDIT_DATA_CSV = './CLI/data/STO/USDTieredSTO/accredited_data.csv'; +const NON_ACCREDIT_LIMIT_DATA_CSV = './CLI/data/STO/USDTieredSTO/nonAccreditedLimits_data.csv' + /////////////////// // Crowdsale params let tokenSymbol; @@ -19,12 +24,6 @@ let polyToken; let usdToken; let securityToken; -/* CSV variables */ -let distribData = new Array(); -let fullFileData = new Array(); -let badData = new Array(); -/* End CSV variables */ - async function executeApp() { let exit = false; while (!exit) { @@ -697,18 +696,7 @@ async function usdTieredSTO_configure(currentSTO) { await common.sendTransaction(changeAccreditedAction); break; case 2: - let batchSize = 75; - let csvFile = fs.readFileSync('./CLI/data/accredited_data.csv'); - let columns = ['address', 'accredited']; - let resultData = []; - let index = 0; - while (true) { - index++; - let data = csvParse(csvFile, { columns: columns, from_line: index, to_line: batchSize * index }); - resultData.push(data); - } - let accredit; - await startCSV(tokenSymbol, 75, 'accredited'); + await changeAccreditedInBatch(currentSTO); break; case 3: let account = readlineSync.question('Enter the address to change non accredited limit: '); @@ -716,11 +704,10 @@ async function usdTieredSTO_configure(currentSTO) { let accounts = [account]; let limits = [web3.utils.toWei(limit)]; let changeNonAccreditedLimitAction = currentSTO.methods.changeNonAccreditedLimit(accounts, limits); - // 2 GAS? await common.sendTransaction(changeNonAccreditedLimitAction); break; case 4: - await startCSV(tokenSymbol, 75, 'nonAccreditedLimit'); + await changeNonAccreditedLimitsInBatch(currentSTO); break; case 5: await modfifyTimes(currentSTO); @@ -746,164 +733,60 @@ async function usdTieredSTO_configure(currentSTO) { } } -async function startCSV(tokenSymbol, batchSize, accreditionType) { - let file, proccessing, saving; - - switch (accreditionType) { - case 'accredited': - file = './CLI/data/accredited_data.csv' - proccessing = accredit_processing - saving = saveInBlockchainAccredited - break; - case 'nonAccreditedLimit': - file = './CLI/data/nonAccreditedLimits_data.csv' - proccessing = nonAccredited_processing - saving = saveInBlockchainNonAccredited - break; - } - - securityToken = await csv_shared.start(tokenSymbol, batchSize); - - let result_processing = await csv_shared.read(file, proccessing); - distribData = result_processing.distribData; - fullFileData = result_processing.fullFileData; - badData = result_processing.badData; - - await saving(); -} - -function nonAccredited_processing(csv_line) { - let isAddress = web3.utils.isAddress(csv_line[0]); - let isNumber = !isNaN(csv_line[1]); - - if (isAddress && isNumber) { - return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), csv_line[1])] - } else { - return [false, new Array(csv_line[0], csv_line[1])] - } -} - -function accredit_processing(csv_line) { - let isAddress = web3.utils.isAddress(csv_line[0]); - let isAccredited = (typeof JSON.parse(csv_line[1].toLowerCase())) == "boolean" ? JSON.parse(csv_line[1].toLowerCase()) : "not-valid"; - - if (isAddress && - (isAccredited != "not-valid")) { - return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), isAccredited)] - } else { - return [false, new Array(csv_line[0], isAccredited)] - } -} - -async function saveInBlockchainAccredited() { - let gtmModules; - try { - gtmModules = await securityToken.methods.getModulesByName(web3.utils.toHex('USDTieredSTO')).call(); - } catch (e) { - console.log("Please attach USDTieredSTO module before launch this action.", e) - process.exit(0) - } - - if (!gtmModules.length) { - console.log("Please attach USDTieredSTO module before launch this action.") - process.exit(0) - } - - let usdTieredSTO = new web3.eth.Contract(abis.usdTieredSTO(), gtmModules[0]); - - console.log(` - -------------------------------------------------------- - ----- Sending accreditation changes to blockchain ----- - -------------------------------------------------------- - `); - - for (let i = 0; i < distribData.length; i++) { - try { - - // Splitting the user arrays to be organized by input - for (let i = 0; i < distribData.length; i++) { - try { - let investorArray = [], isAccreditedArray = []; - - for (let j = 0; j < distribData[i].length; j++) { - investorArray.push(distribData[i][j][0]) - isAccreditedArray.push(distribData[i][j][1]) - } - - let changeAccreditedAction = await usdTieredSTO.methods.changeAccredited(investorArray, isAccreditedArray); - let tx = await common.sendTransaction(changeAccreditedAction); - console.log(`Batch ${i} - Attempting to change accredited accounts:\n\n`, investorArray, "\n\n"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Change accredited transaction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); - } catch (err) { - console.log("ERROR:", err); - } - } - - } catch (err) { - console.log("ERROR", err) - process.exit(0) - } +async function changeAccreditedInBatch(currentSTO) { + let csvFilePath = readlineSync.question(`Enter the path for csv data file (${ACCREDIT_DATA_CSV}): `, { + defaultInput: ACCREDIT_DATA_CSV + }); + let batchSize = readlineSync.question(`Enter the max number of records per transaction or batch size (${gbl.constants.DEFAULT_BATCH_SIZE}): `, { + limit: function (input) { + return parseInt(input) > 0; + }, + limitMessage: 'Must be greater than 0', + defaultInput: gbl.constants.DEFAULT_BATCH_SIZE + }); + let parsedData = csvParse(csvFilePath); + let validData = parsedData.filter(row => web3.utils.isAddress(row[0]) && typeof row[1] === 'boolean'); + let invalidRows = parsedData.filter(row => !validData.includes(row)); + if (invalidRows.length > 0) { + console.log(chalk.red(`The following lines from csv file are not valid: ${invalidRows.map(r => parsedData.indexOf(r) + 1).join(',')}`)); + } + let batches = common.splitIntoBatches(validData, batchSize); + let [investorArray, isAccreditedArray] = common.transposeBatches(batches); + for (let batch = 0; batch < batches.length; batch++) { + console.log(`Batch ${batch + 1} - Attempting to change accredited accounts:\n\n`, investorArray[batch], '\n'); + let action = await currentSTO.methods.changeAccredited(investorArray[batch], isAccreditedArray[batch]); + let receipt = await common.sendTransaction(action); + console.log(chalk.green('Change accredited transaction was successful.')); + console.log(`${receipt.gasUsed} gas used. Spent: ${web3.utils.fromWei((new web3.utils.BN(receipt.gasUsed)).mul(new web3.utils.BN(defaultGasPrice)))} ETH`); } - - return; } -async function saveInBlockchainNonAccredited() { - let gtmModules; - try { - gtmModules = await securityToken.methods.getModulesByName(web3.utils.toHex('USDTieredSTO')).call(); - } catch (e) { - console.log("Please attach USDTieredSTO module before launch this action.", e) - process.exit(0) - } - - if (!gtmModules.length) { - console.log("Please attach USDTieredSTO module before launch this action.") - process.exit(0) - } - - let usdTieredSTO = new web3.eth.Contract(abis.usdTieredSTO(), gtmModules[0]); - - console.log(` - -------------------------------------------------------------- - ----- Sending non accredited limit changes to blockchain ----- - -------------------------------------------------------------- - `); - - for (let i = 0; i < distribData.length; i++) { - try { - - // Splitting the user arrays to be organized by input - for (let i = 0; i < distribData.length; i++) { - try { - let investorArray = [], limitArray = []; - - for (let j = 0; j < distribData[i].length; j++) { - investorArray.push(distribData[i][j][0]); - limitArray.push(web3.utils.toWei(distribData[i][j][1].toString())); - } - - let changeNonAccreditedLimitAction = await usdTieredSTO.methods.changeNonAccreditedLimit(investorArray, limitArray); - let tx = await common.sendTransaction(changeNonAccreditedLimitAction); - console.log(`Batch ${i} - Attempting to change non accredited limits to accounts:\n\n`, investorArray, "\n\n"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Change accredited transaction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString()), "Ether"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); - - } catch (err) { - console.log("ERROR:", err); - } - } - - } catch (err) { - console.log("ERROR", err) - process.exit(0) - } +async function changeNonAccreditedLimitsInBatch(currentSTO) { + let csvFilePath = readlineSync.question(`Enter the path for csv data file (${NON_ACCREDIT_LIMIT_DATA_CSV}): `, { + defaultInput: NON_ACCREDIT_LIMIT_DATA_CSV + }); + let batchSize = readlineSync.question(`Enter the max number of records per transaction or batch size (${gbl.constants.DEFAULT_BATCH_SIZE}): `, { + limit: function (input) { + return parseInt(input) > 0; + }, + limitMessage: 'Must be greater than 0', + defaultInput: gbl.constants.DEFAULT_BATCH_SIZE + }); + let parsedData = csvParse(csvFilePath); + let validData = parsedData.filter(row => web3.utils.isAddress(row[0]) && !isNaN(row[1])); + let invalidRows = parsedData.filter(row => !validData.includes(row)); + if (invalidRows.length > 0) { + console.log(chalk.red(`The following lines from csv file are not valid: ${invalidRows.map(r => parsedData.indexOf(r) + 1).join(',')}`)); + } + let batches = common.splitIntoBatches(validData, batchSize); + let [investorArray, limitArray] = common.transposeBatches(batches); + for (let batch = 0; batch < batches.length; batch++) { + console.log(`Batch ${batch + 1} - Attempting to change accredited accounts:\n\n`, investorArray[batch], '\n'); + let action = await currentSTO.methods.changeNonAccreditedLimit(investorArray[batch], limitArray[batch]); + let receipt = await common.sendTransaction(action); + console.log(chalk.green('Change non accredited limits transaction was successful.')); + console.log(`${receipt.gasUsed} gas used. Spent: ${web3.utils.fromWei((new web3.utils.BN(receipt.gasUsed)).mul(new web3.utils.BN(defaultGasPrice)))} ETH`); } - - return; } async function modfifyTimes(currentSTO) { @@ -1071,10 +954,5 @@ module.exports = { addSTOModule: async function (_tokenSymbol, stoConfig) { await initialize(_tokenSymbol); return addSTOModule(stoConfig) - }, - startCSV: async function (tokenSymbol, batchSize, accreditionType) { - return startCSV(tokenSymbol, batchSize, accreditionType); } -} - - +} \ No newline at end of file diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 3e2494a3f..524c167cb 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -144,24 +144,6 @@ program await contract_manager.executeApp(); }); -program - .command('accredit [batchSize]') - .alias('a') - .description('Runs accredit') - .action(async function (tokenSymbol, batchSize) { - await gbl.initialize(program.remoteNode); - await sto_manager.startCSV(tokenSymbol, batchSize, 'accredited') - }); - -program - .command('nonAccreditedLimit [batchSize]') - .alias('nal') - .description('Runs changeNonAccreditedLimit') - .action(async function (tokenSymbol, batchSize) { - await gbl.initialize(program.remoteNode); - await sto_manager.startCSV(tokenSymbol, batchSize, 'nonAccreditedLimit') - }); - program .command('strMigrator [toStrAddress] [fromTrAddress] [fromStrAddress]') .alias('str') From dde9bf0c2bfddf8c9cd0fae7c8b2b382628ecc24 Mon Sep 17 00:00:00 2001 From: Victor Date: Sun, 2 Dec 2018 16:03:43 -0300 Subject: [PATCH 134/139] Transfer manager refactoring for batches --- CLI/commands/sto_manager.js | 2 - CLI/commands/transfer_manager.js | 293 +++++++++---------------------- CLI/polymath-cli.js | 9 - 3 files changed, 82 insertions(+), 222 deletions(-) diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index 8e2a347f0..d5bd58a4d 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -4,9 +4,7 @@ const contracts = require('./helpers/contract_addresses'); const abis = require('./helpers/contract_abis'); const common = require('./common/common_functions'); const gbl = require('./common/global'); -const csv_shared = require('./common/csv_shared'); const csvParse = require('./helpers/csv'); -const BigNumber = require('bignumber.js'); /////////////////// // Constants diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index dc5aba389..ca2f4ee06 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -1,26 +1,21 @@ -var readlineSync = require('readline-sync'); -var chalk = require('chalk'); -var moment = require('moment'); -var common = require('./common/common_functions'); -var contracts = require('./helpers/contract_addresses'); -var abis = require('./helpers/contract_abis'); -var gbl = require('./common/global'); -var transferManager = require('./transfer_manager'); -var csv_shared = require('./common/csv_shared'); -var BigNumber = require('bignumber.js'); +const readlineSync = require('readline-sync'); +const chalk = require('chalk'); +const moment = require('moment'); +const common = require('./common/common_functions'); +const contracts = require('./helpers/contract_addresses'); +const abis = require('./helpers/contract_abis'); +const gbl = require('./common/global'); +const csvParse = require('./helpers/csv'); + +/////////////////// +// Constants +const WHITELIST_DATA_CSV = './CLI/data/Transfer/GTM/whitelist_data.csv'; // App flow let tokenSymbol; let securityToken; let securityTokenRegistry; let currentTransferManager; -let generalTransferManager; - -/* CSV variables */ -let distribData = new Array(); -let fullFileData = new Array(); -let badData = new Array(); -/* End CSV variables */ async function executeApp() { let exit = false; @@ -334,7 +329,7 @@ async function generalTransferManager() { console.log(`- Allow all burn transfers: ${displayAllowAllBurnTransfers ? `YES` : `NO`}`); // ------------------ - let options = ['Modify whitelist', 'Modify whitelist from CSV', /*'Modify Whitelist Signed',*/ + let options = ['Check whitelist', 'Modify whitelist', 'Modify whitelist from CSV', /*'Modify Whitelist Signed',*/ `Change issuance address`, 'Change signing address']; if (displayAllowAllTransfers) { options.push('Disallow all transfers'); @@ -361,6 +356,19 @@ async function generalTransferManager() { let optionSelected = options[index]; console.log('Selected:', index != -1 ? optionSelected : 'Return', '\n'); switch (optionSelected) { + case 'Check whitelist': + let investorToCheck = readlineSync.question('Enter the address you want to check: ', { + limit: function (input) { + return web3.utils.isAddress(input); + }, + limitMessage: "Must be a valid address" + }); + let timeRestriction = await currentTransferManager.methods.whitelist(investorToCheck).call(); + console.log(`Sale lockup: ${moment.unix(timeRestriction.fromTime).format('MMMM Do YYYY, HH:mm:ss')}`); + console.log(`Buy lockup: ${moment.unix(timeRestriction.toTime).format('MMMM Do YYYY, HH:mm:ss')}`); + console.log(`KYC expiry time: ${moment.unix(timeRestriction.expiryTime).format('MMMM Do YYYY, HH:mm:ss')}`); + console.log(`Restricted investor: ${timeRestriction.canBuyFromSTO ? 'YES' : 'NO'} `); + break; case 'Modify whitelist': let investor = readlineSync.question('Enter the address to whitelist: ', { limit: function (input) { @@ -369,10 +377,10 @@ async function generalTransferManager() { limitMessage: "Must be a valid address" }); let now = Math.floor(Date.now() / 1000); - let fromTime = readlineSync.questionInt(`Enter the time (Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens (now = ${now}): `, { defaultInput: now }); - let toTime = readlineSync.questionInt(`Enter the time (Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others (now = ${now}): `, { defaultInput: now }); + let fromTime = readlineSync.questionInt(`Enter the time(Unix Epoch time) when the sale lockup period ends and the investor can freely sell his tokens(now = ${now}): `, { defaultInput: now }); + let toTime = readlineSync.questionInt(`Enter the time(Unix Epoch time) when the purchase lockup period ends and the investor can freely purchase tokens from others(now = ${now}): `, { defaultInput: now }); let oneHourFromNow = Math.floor(Date.now() / 1000 + 3600); - let expiryTime = readlineSync.questionInt(`Enter the time till investors KYC will be validated (after that investor need to do re-KYC) (1 hour from now = ${oneHourFromNow}): `, { defaultInput: oneHourFromNow }); + let expiryTime = readlineSync.questionInt(`Enter the time till investors KYC will be validated(after that investor need to do re - KYC) (1 hour from now = ${oneHourFromNow}): `, { defaultInput: oneHourFromNow }); let canBuyFromSTO = readlineSync.keyInYNStrict('Is the investor a restricted investor?'); let modifyWhitelistAction = currentTransferManager.methods.modifyWhitelist(investor, fromTime, toTime, expiryTime, canBuyFromSTO); let modifyWhitelistReceipt = await common.sendTransaction(modifyWhitelistAction); @@ -380,10 +388,7 @@ async function generalTransferManager() { console.log(chalk.green(`${modifyWhitelistEvent._investor} has been whitelisted sucessfully!`)); break; case 'Modify whitelist from CSV': - console.log(chalk.yellow(`Data is going to be read from 'data/whitelist_data.csv'. Be sure this file is updated!`)); - if (readlineSync.keyInYNStrict(`Do you want to continue?`)) { - await transferManager.startCSV(tokenSymbol); - } + await modifyWhitelistInBatch(); break; /* case 'Modify Whitelist Signed': @@ -403,7 +408,7 @@ async function generalTransferManager() { let modifyWhitelistSignedAction = currentTransferManager.methods.modifyWhitelistSigned(investorSigned, fromTimeSigned, toTimeSigned, expiryTimeSigned, canBuyFromSTOSigned); let modifyWhitelistSignedReceipt = await common.sendTransaction(Issuer, modifyWhitelistSignedAction, defaultGasPrice); let modifyWhitelistSignedEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, modifyWhitelistSignedReceipt.logs, 'ModifyWhitelist'); - console.log(chalk.green(`${modifyWhitelistSignedEvent._investor} has been whitelisted sucessfully!`)); + console.log(chalk.green(`${ modifyWhitelistSignedEvent._investor } has been whitelisted sucessfully!`)); break; */ case 'Change issuance address': @@ -477,173 +482,42 @@ async function generalTransferManager() { } } -async function startCSV(tokenSymbol, batchSize) { - securityToken = await csv_shared.start(tokenSymbol, batchSize); - - let result_processing = await csv_shared.read('./CLI/data/whitelist_data.csv', whitelist_processing); - distribData = result_processing.distribData; - fullFileData = result_processing.fullFileData; - badData = result_processing.badData; - - await saveInBlockchain(); - await finalResults(); -}; - -function whitelist_processing(csv_line) { - let isAddress = web3.utils.isAddress(csv_line[0]); - let sellValid = isValidDate(csv_line[1]) - let buyValid = isValidDate(csv_line[2]) - let kycExpiryDate = isValidDate(csv_line[3]) - let canBuyFromSTO = (typeof JSON.parse(csv_line[4].toLowerCase())) == "boolean" ? JSON.parse(csv_line[4].toLowerCase()) : "not-valid"; - - if (isAddress && - sellValid && - buyValid && - kycExpiryDate && - (canBuyFromSTO != "not-valid")) { - return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), sellValid, buyValid, kycExpiryDate, canBuyFromSTO)] - } else { - return [false, new Array(csv_line[0], sellValid, buyValid, kycExpiryDate, canBuyFromSTO)] - } -} - -function isValidDate(date) { - var matches = /^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/.exec(date); - if (matches == null) return false; - var d = matches[2]; - var m = matches[1] - 1; - var y = matches[3]; - var composedDate = new Date(y, m, d); - var timestampDate = composedDate.getTime() - - // For some reason these timestamps are being recorded +4 hours UTC - if (composedDate.getDate() == d && - composedDate.getMonth() == m && - composedDate.getFullYear() == y) { - return timestampDate / 1000 - } else { - return false - } -} - -async function saveInBlockchain() { - let gtmModules; - try { - gtmModules = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); - } catch (e) { - console.log("Please attach General Transfer module before launch this action.", e) - process.exit(0) - } - - generalTransferManager = new web3.eth.Contract(abis.generalTransferManager(), gtmModules[0]); - - console.log(` - ------------------------------------------------------- - ----- Sending buy/sell restrictions to blockchain ----- - ------------------------------------------------------- - `); - - for (let i = 0; i < distribData.length; i++) { - try { - let investorArray = [], fromTimesArray = [], toTimesArray = [], expiryTimeArray = [], canBuyFromSTOArray = []; - - // Splitting the user arrays to be organized by input - for (let j = 0; j < distribData[i].length; j++) { - investorArray.push(distribData[i][j][0]) - fromTimesArray.push(distribData[i][j][1]) - toTimesArray.push(distribData[i][j][2]) - expiryTimeArray.push(distribData[i][j][3]) - canBuyFromSTOArray.push(distribData[i][j][4]) - } - - let modifyWhitelistMultiAction = await generalTransferManager.methods.modifyWhitelistMulti(investorArray, fromTimesArray, toTimesArray, expiryTimeArray, canBuyFromSTOArray); - let tx = await common.sendTransaction(modifyWhitelistMultiAction); - console.log(`Batch ${i} - Attempting to modifyWhitelist accounts:\n\n`, investorArray, "\n\n"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Whitelist transaxction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); - - } catch (err) { - console.log("ERROR", err) - process.exit(0) - } - } - - return; -} - -async function finalResults() { - let totalInvestors = 0; - let updatedInvestors = 0; - let investorObjectLookup = {}; - let investorData_Events = new Array(); - let event_data = await generalTransferManager.getPastEvents('ModifyWhitelist', {fromBlock: 0, toBlock: 'latest'}, () => {}); - - for (var i = 0; i < event_data.length; i++) { - let combineArray = []; - - let investorAddress_Event = event_data[i].returnValues._investor - let fromTime_Event = event_data[i].returnValues._fromTime - let toTime_Event = event_data[i].returnValues._toTime - let expiryTime_Event = event_data[i].returnValues._expiryTime - let canBuyFromSTO_Event = event_data[i].returnValues._canBuyFromSTO - let blockNumber = event_data[i].blockNumber - - combineArray.push(investorAddress_Event); - combineArray.push(fromTime_Event); - combineArray.push(toTime_Event); - combineArray.push(expiryTime_Event); - combineArray.push(canBuyFromSTO_Event); - combineArray.push(blockNumber) - - investorData_Events.push(combineArray) - - // We have already recorded it, so this is an update to our object - if (investorObjectLookup.hasOwnProperty(investorAddress_Event)) { - // The block number form the event we are checking is bigger, so we gotta replace it - if (investorObjectLookup[investorAddress_Event].recordedBlockNumber < blockNumber) { - investorObjectLookup[investorAddress_Event] = {fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber}; - updatedInvestors += 1; - } - } else { - investorObjectLookup[investorAddress_Event] = {fromTime: fromTime_Event, toTime: toTime_Event, expiryTime: expiryTime_Event, canBuyFromSTO: canBuyFromSTO_Event, recordedBlockNumber: blockNumber}; - totalInvestors += 1; - } - } - - let investorAddress_Events = Object.keys(investorObjectLookup) - - console.log(`******************** EVENT LOGS ANALYSIS COMPLETE ********************\n`); - console.log(`A total of ${totalInvestors} investors have been whitelisted total, all time.\n`); - console.log(`This script in total sent ${fullFileData.length - badData.length} new investors and updated investors to the blockchain.\n`); - console.log(`There were ${badData.length} bad entries that didnt get sent to the blockchain in the script.\n`); - console.log("************************************************************************************************"); - console.log("OBJECT WITH EVERY USER AND THEIR UPDATED TIMES: \n\n", investorObjectLookup) - console.log("************************************************************************************************"); - console.log("LIST OF ALL INVESTORS WHITELISTED: \n\n", investorAddress_Events) - - let missingDistribs = []; - for (let l = 0; l < fullFileData.length; l++) { - if (!investorObjectLookup.hasOwnProperty(fullFileData[l][0])) { - missingDistribs.push(fullFileData[l]) - } +async function modifyWhitelistInBatch() { + let csvFilePath = readlineSync.question(`Enter the path for csv data file(${WHITELIST_DATA_CSV}): `, { + defaultInput: WHITELIST_DATA_CSV + }); + let batchSize = readlineSync.question(`Enter the max number of records per transaction or batch size(${gbl.constants.DEFAULT_BATCH_SIZE}): `, { + limit: function (input) { + return parseInt(input) > 0; + }, + limitMessage: 'Must be greater than 0', + defaultInput: gbl.constants.DEFAULT_BATCH_SIZE + }); + let parsedData = csvParse(csvFilePath); + let validData = parsedData.filter(row => + web3.utils.isAddress(row[0]) && + moment.unix(row[1]).isValid() && + moment.unix(row[2]).isValid() && + moment.unix(row[3]).isValid() && + typeof row[4] === 'boolean' + ); + let invalidRows = parsedData.filter(row => !validData.includes(row)); + if (invalidRows.length > 0) { + console.log(chalk.red(`The following lines from csv file are not valid: ${invalidRows.map(r => parsedData.indexOf(r) + 1).join(',')} `)); } - - if (missingDistribs.length > 0) { - console.log("************************************************************************************************"); - console.log("-- No LogModifyWhitelist event was found for the following data arrays. Please review them manually --") - console.log(missingDistribs) - console.log("************************************************************************************************"); - } else { - console.log("\n************************************************************************************************"); - console.log("All accounts passed through from the CSV were successfully whitelisted, because we were able to read them all from events") - console.log("************************************************************************************************"); + let batches = common.splitIntoBatches(validData, batchSize); + let [investorArray, fromTimesArray, toTimesArray, expiryTimeArray, canBuyFromSTOArray] = common.transposeBatches(batches); + for (let batch = 0; batch < batches.length; batch++) { + console.log(`Batch ${batch + 1} - Attempting to change accredited accounts: \n\n`, investorArray[batch], '\n'); + let action = await currentTransferManager.methods.modifyWhitelistMulti(investorArray[batch], fromTimesArray[batch], toTimesArray[batch], expiryTimeArray[batch], canBuyFromSTOArray[batch]); + let receipt = await common.sendTransaction(action); + console.log(chalk.green('Whitelist transaction was successful.')); + console.log(`${receipt.gasUsed} gas used.Spent: ${web3.utils.fromWei((new web3.utils.BN(receipt.gasUsed)).mul(new web3.utils.BN(defaultGasPrice)))} ETH`); } - } async function manualApprovalTransferManager() { - console.log(chalk.blue(`Manual Approval Transfer Manager at ${currentTransferManager.options.address}`), '\n'); + console.log(chalk.blue(`Manual Approval Transfer Manager at ${currentTransferManager.options.address} `), '\n'); let options = ['Check manual approval', 'Add manual approval', 'Revoke manual approval', 'Check manual blocking', 'Add manual blocking', 'Revoke manual blocking']; @@ -671,8 +545,8 @@ async function manualApprovalTransferManager() { let manualApproval = await getManualApproval(from, to); if (manualApproval) { console.log(`Manual approval found!`); - console.log(`Allowance: ${web3.utils.fromWei(manualApproval.allowance)}`); - console.log(`Expiry time: ${moment.unix(manualApproval.expiryTime).format('MMMM Do YYYY, HH:mm:ss')};`) + console.log(`Allowance: ${web3.utils.fromWei(manualApproval.allowance)} `); + console.log(`Expiry time: ${moment.unix(manualApproval.expiryTime).format('MMMM Do YYYY, HH:mm:ss')}; `) } else { console.log(chalk.yellow(`There are no manual approvals from ${from} to ${to}.`)); } @@ -693,13 +567,13 @@ async function manualApprovalTransferManager() { if (!await getManualApproval(from, to)) { let allowance = readlineSync.question('Enter the amount of tokens which will be approved: '); let oneHourFromNow = Math.floor(Date.now() / 1000 + 3600); - let expiryTime = readlineSync.questionInt(`Enter the time (Unix Epoch time) until which the transfer is allowed (1 hour from now = ${oneHourFromNow}): `, { defaultInput: oneHourFromNow }); + let expiryTime = readlineSync.questionInt(`Enter the time(Unix Epoch time) until which the transfer is allowed(1 hour from now = ${oneHourFromNow}): `, { defaultInput: oneHourFromNow }); let addManualApprovalAction = currentTransferManager.methods.addManualApproval(from, to, web3.utils.toWei(allowance), expiryTime); let addManualApprovalReceipt = await common.sendTransaction(addManualApprovalAction); let addManualApprovalEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, addManualApprovalReceipt.logs, 'AddManualApproval'); console.log(chalk.green(`Manual approval has been added successfully!`)); } else { - console.log(chalk.red(`A manual approval already exists from ${from} to ${to}. Revoke it first if you want to add a new one.`)); + console.log(chalk.red(`A manual approval already exists from ${from} to ${to}.Revoke it first if you want to add a new one.`)); } break; case 'Revoke manual approval': @@ -741,7 +615,7 @@ async function manualApprovalTransferManager() { let manualBlocking = await getManualBlocking(from, to); if (manualBlocking) { console.log(`Manual blocking found!`); - console.log(`Expiry time: ${moment.unix(manualBlocking).format('MMMM Do YYYY, HH:mm:ss')};`) + console.log(`Expiry time: ${moment.unix(manualBlocking).format('MMMM Do YYYY, HH:mm:ss')}; `) } else { console.log(chalk.yellow(`There are no manual blockings from ${from} to ${to}.`)); } @@ -761,13 +635,13 @@ async function manualApprovalTransferManager() { }); if (!await getManualBlocking(from, to)) { let oneHourFromNow = Math.floor(Date.now() / 1000 + 3600); - let expiryTime = readlineSync.questionInt(`Enter the time (Unix Epoch time) until which the transfer is blocked (1 hour from now = ${oneHourFromNow}): `, { defaultInput: oneHourFromNow }); + let expiryTime = readlineSync.questionInt(`Enter the time(Unix Epoch time) until which the transfer is blocked(1 hour from now = ${oneHourFromNow}): `, { defaultInput: oneHourFromNow }); let addManualBlockingAction = currentTransferManager.methods.addManualBlocking(from, to, expiryTime); let addManualBlockingReceipt = await common.sendTransaction(addManualBlockingAction); let addManualBlockingEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, addManualBlockingReceipt.logs, 'AddManualBlocking'); console.log(chalk.green(`Manual blocking has been added successfully!`)); } else { - console.log(chalk.red(`A manual blocking already exists from ${from} to ${to}. Revoke it first if you want to add a new one.`)); + console.log(chalk.red(`A manual blocking already exists from ${from} to ${to}.Revoke it first if you want to add a new one.`)); } break; case 'Revoke manual blocking': @@ -818,7 +692,7 @@ async function getManualBlocking(_from, _to) { } async function singleTradeVolumeRestrictionTM() { - console.log(chalk.blue(`Single Trade Volume Restriction Transfer Manager at ${currentTransferManager.options.address}`)); + console.log(chalk.blue(`Single Trade Volume Restriction Transfer Manager at ${currentTransferManager.options.address} `)); console.log(); // Show current data @@ -831,9 +705,9 @@ async function singleTradeVolumeRestrictionTM() { } let displayAllowPrimaryIssuance = await currentTransferManager.methods.allowPrimaryIssuance().call(); - console.log(`- Limit type: ${displayIsInPercentage ? `Percentage` : `Tokens`}`); - console.log(`- Default transfer limit: ${displayGlobalTransferLimit} ${displayIsInPercentage ? `%` : `${tokenSymbol}`}`); - console.log(`- Allow primary issuance: ${displayAllowPrimaryIssuance ? `YES` : `NO`}`); + console.log(`- Limit type: ${displayIsInPercentage ? `Percentage` : `Tokens`} `); + console.log(`- Default transfer limit: ${displayGlobalTransferLimit} ${displayIsInPercentage ? `%` : `${tokenSymbol}`} `); + console.log(`- Allow primary issuance: ${displayAllowPrimaryIssuance ? `YES` : `NO`} `); // ------------------ let options = []; @@ -895,7 +769,7 @@ async function singleTradeVolumeRestrictionTM() { let changeTransferLimitToTokensReceipt = await common.sendTransaction(changeTransferLimitToTokensAction); let changeTransferLimitToTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeTransferLimitToTokensReceipt.logs, 'GlobalTransferLimitInTokensSet'); console.log(chalk.green(`Transfer limit has been set to tokens sucessfully!`)); - console.log(chalk.green(`The default transfer limit is ${web3.utils.fromWei(changeTransferLimitToTokensEvent._amount)} ${tokenSymbol}`)); + console.log(chalk.green(`The default transfer limit is ${web3.utils.fromWei(changeTransferLimitToTokensEvent._amount)} ${tokenSymbol} `)); break; case 'Change transfer limit to percentage': let newDefaultLimitInPercentage = toWeiPercentage(readlineSync.question('Enter the percentage for default limit: ', { @@ -908,7 +782,7 @@ async function singleTradeVolumeRestrictionTM() { let changeTransferLimitToPercentageReceipt = await common.sendTransaction(changeTransferLimitToPercentageAction); let changeTransferLimitToPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeTransferLimitToPercentageReceipt.logs, 'GlobalTransferLimitInPercentageSet'); console.log(chalk.green(`Transfer limit has been set to tokens sucessfully!`)); - console.log(chalk.green(`The default transfer limit is ${fromWeiPercentage(changeTransferLimitToPercentageEvent._percentage)} %`)); + console.log(chalk.green(`The default transfer limit is ${fromWeiPercentage(changeTransferLimitToPercentageEvent._percentage)} % `)); break; case 'Change default percentage limit': let defaultLimitInPercentage = toWeiPercentage(readlineSync.question('Enter the percentage for default limit: ', { @@ -920,7 +794,7 @@ async function singleTradeVolumeRestrictionTM() { let changeGlobalLimitInPercentageAction = currentTransferManager.methods.changeGlobalLimitInPercentage(defaultLimitInPercentage); let changeGlobalLimitInPercentageReceipt = await common.sendTransaction(changeGlobalLimitInPercentageAction); let changeGlobalLimitInPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeGlobalLimitInPercentageReceipt.logs, 'GlobalTransferLimitInPercentageSet'); - console.log(chalk.green(`The default transfer limit is ${fromWeiPercentage(changeGlobalLimitInPercentageEvent._percentage)} %`)); + console.log(chalk.green(`The default transfer limit is ${fromWeiPercentage(changeGlobalLimitInPercentageEvent._percentage)} % `)); break; case 'Change default tokens limit': let defaultLimitInTokens = web3.utils.toWei(readlineSync.question('Enter the amount of tokens for default limit: ', { @@ -932,7 +806,7 @@ async function singleTradeVolumeRestrictionTM() { let changeGlobalLimitInTokensAction = currentTransferManager.methods.changeGlobalLimitInTokens(defaultLimitInTokens); let changeGlobalLimitInTokensReceipt = await common.sendTransaction(changeGlobalLimitInTokensAction); let changeGlobalLimitInTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeGlobalLimitInTokensReceipt.logs, 'GlobalTransferLimitInTokensSet'); - console.log(chalk.green(`The default transfer limit is ${web3.utils.fromWei(changeGlobalLimitInTokensEvent._amount)} ${tokenSymbol}`)); + console.log(chalk.green(`The default transfer limit is ${web3.utils.fromWei(changeGlobalLimitInTokensEvent._amount)} ${tokenSymbol} `)); break; case 'Set percentage transfer limit per account': let percentageAccount = readlineSync.question('Enter the wallet: ', { @@ -950,7 +824,7 @@ async function singleTradeVolumeRestrictionTM() { let setTransferLimitInPercentageAction = currentTransferManager.methods.setTransferLimitInPercentage(percentageAccount, accountLimitInPercentage); let setTransferLimitInPercentageReceipt = await common.sendTransaction(setTransferLimitInPercentageAction); let setTransferLimitInPercentageEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, setTransferLimitInPercentageReceipt.logs, 'TransferLimitInPercentageSet'); - console.log(chalk.green(`The transfer limit for ${setTransferLimitInPercentageEvent._wallet} is ${fromWeiPercentage(setTransferLimitInPercentageEvent._percentage)} %`)); + console.log(chalk.green(`The transfer limit for ${setTransferLimitInPercentageEvent._wallet} is ${fromWeiPercentage(setTransferLimitInPercentageEvent._percentage)} % `)); break; case 'Set tokens transfer limit per account': let tokensAccount = readlineSync.question('Enter the wallet: ', { @@ -968,7 +842,7 @@ async function singleTradeVolumeRestrictionTM() { let setTransferLimitInTokensAction = currentTransferManager.methods.setTransferLimitInTokens(tokensAccount, accountLimitInTokens); let setTransferLimitInTokensReceipt = await common.sendTransaction(setTransferLimitInTokensAction); let setTransferLimitInTokensEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, setTransferLimitInTokensReceipt.logs, 'TransferLimitInTokensSet'); - console.log(chalk.green(`The transfer limit for ${setTransferLimitInTokensEvent._wallet} is ${web3.utils.fromWei(setTransferLimitInTokensEvent._amount)} ${tokenSymbol}`)); + console.log(chalk.green(`The transfer limit for ${setTransferLimitInTokensEvent._wallet} is ${web3.utils.fromWei(setTransferLimitInTokensEvent._amount)} ${tokenSymbol} `)); break; case 'Remove percentage transfer limit per account': let percentageAccountToRemove = readlineSync.question('Enter the wallet to remove: ', { @@ -1007,8 +881,8 @@ function signData(tmAddress, investorAddress, fromTime, toTime, expiryTime, rest ) .slice(2); packedData = new Buffer(packedData, "hex"); - packedData = Buffer.concat([new Buffer(`\x19Ethereum Signed Message:\n${packedData.length.toString()}`), packedData]); - packedData = web3.sha3(`0x${packedData.toString("hex")}`, { encoding: "hex" }); + packedData = Buffer.concat([new Buffer(`\x19Ethereum Signed Message: \n${ packedData.length.toString() } `), packedData]); + packedData = web3.sha3(`0x${ packedData.toString("hex") } `, { encoding: "hex" }); return ethUtil.ecsign(new Buffer(packedData.slice(2), "hex"), new Buffer(pk, "hex")); } */ @@ -1098,7 +972,7 @@ async function selectToken() { return { symbol: tokenData[0], address: t }; })); let options = tokenDataArray.map(function (t) { - return `${t.symbol} - Deployed at ${t.address}`; + return `${t.symbol} - Deployed at ${t.address} `; }); options.push('Enter token symbol manually'); @@ -1126,8 +1000,5 @@ module.exports = { addTransferManagerModule: async function (_tokenSymbol) { await initialize(_tokenSymbol); return addTransferManagerModule() - }, - startCSV: async function (tokenSymbol, batchSize) { - return startCSV(tokenSymbol, batchSize); } } \ No newline at end of file diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 524c167cb..0ffba10dd 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -107,15 +107,6 @@ program await transfer_ownership.executeApp(contractAddress, transferTo); }); -program - .command('whitelist [batchSize]') - .alias('w') - .description('Mass-update a whitelist of allowed/known investors') - .action(async function (tokenSymbol, batchSize) { - await gbl.initialize(program.remoteNode); - await transfer_manager.startCSV(tokenSymbol, batchSize); - }); - program .command('dividends_manager [dividendsType]') .alias('dm') From e4252109678f58f54fb03e57802490f763a50209 Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 3 Dec 2018 10:06:11 -0300 Subject: [PATCH 135/139] Fix --- CLI/commands/common/common_functions.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CLI/commands/common/common_functions.js b/CLI/commands/common/common_functions.js index a59b9ac21..c19834037 100644 --- a/CLI/commands/common/common_functions.js +++ b/CLI/commands/common/common_functions.js @@ -155,9 +155,11 @@ module.exports = { }, transposeBatches: function (batches) { let result = []; - let columns = batches[0][0].length; - for (let index = 0; index < columns; index++) { - result[index] = batches.map(batch => batch.map(record => record[index])); + if (batches.length > 0 && batches[0].length > 0) { + let columns = batches[0][0].length; + for (let index = 0; index < columns; index++) { + result[index] = batches.map(batch => batch.map(record => record[index])); + } } return result; } From ee54b6d907d3f88d2a577cb12da17ad067f355fe Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 3 Dec 2018 10:07:05 -0300 Subject: [PATCH 136/139] Multi mint in batches --- CLI/commands/common/constants.js | 3 +- CLI/commands/sto_manager.js | 2 +- CLI/commands/token_manager.js | 252 ++++++++----------------------- CLI/commands/transfer_manager.js | 6 +- CLI/polymath-cli.js | 18 +-- 5 files changed, 75 insertions(+), 206 deletions(-) diff --git a/CLI/commands/common/constants.js b/CLI/commands/common/constants.js index bb9c8f69c..30a3bf699 100644 --- a/CLI/commands/common/constants.js +++ b/CLI/commands/common/constants.js @@ -31,5 +31,6 @@ module.exports = Object.freeze({ POLY: 1, DAI: 2 }, - DEFAULT_BATCH_SIZE: 75 + DEFAULT_BATCH_SIZE: 75, + ADDRESS_ZERO: '0x0000000000000000000000000000000000000000' }); \ No newline at end of file diff --git a/CLI/commands/sto_manager.js b/CLI/commands/sto_manager.js index d5bd58a4d..b66f3d80e 100644 --- a/CLI/commands/sto_manager.js +++ b/CLI/commands/sto_manager.js @@ -779,7 +779,7 @@ async function changeNonAccreditedLimitsInBatch(currentSTO) { let batches = common.splitIntoBatches(validData, batchSize); let [investorArray, limitArray] = common.transposeBatches(batches); for (let batch = 0; batch < batches.length; batch++) { - console.log(`Batch ${batch + 1} - Attempting to change accredited accounts:\n\n`, investorArray[batch], '\n'); + console.log(`Batch ${batch + 1} - Attempting to change non accredited limit to accounts:\n\n`, investorArray[batch], '\n'); let action = await currentSTO.methods.changeNonAccreditedLimit(investorArray[batch], limitArray[batch]); let receipt = await common.sendTransaction(action); console.log(chalk.green('Change non accredited limits transaction was successful.')); diff --git a/CLI/commands/token_manager.js b/CLI/commands/token_manager.js index e8556450d..e10f81467 100644 --- a/CLI/commands/token_manager.js +++ b/CLI/commands/token_manager.js @@ -5,8 +5,10 @@ const stoManager = require('./sto_manager'); const transferManager = require('./transfer_manager'); const common = require('./common/common_functions'); const gbl = require('./common/global'); -const csv_shared = require('./common/csv_shared'); -const BigNumber = require('bignumber.js'); +const csvParse = require('./helpers/csv'); + +// Constants +const MULTIMINT_DATA_CSV = './CLI/data/ST/multi_mint_data.csv'; // Load contract artifacts const contracts = require('./helpers/contract_addresses'); @@ -16,19 +18,10 @@ let securityTokenRegistry; let polyToken; let featureRegistry; let securityToken; -let tokenDivisible; let allModules; let tokenSymbol -/* CSV data control */ -let distribData = new Array(); -let fullFileData = new Array(); -let badData = new Array(); -let affiliatesFailedArray = new Array(); -let affiliatesKYCInvalidArray = new Array(); -/* End CSV data control */ - async function setup() { try { let securityTokenRegistryAddress = await contracts.securityTokenRegistry(); @@ -289,7 +282,7 @@ async function listInvestorsAtCheckpoint(checkpointId) { } async function mintTokens() { - let options = ['Modify whitelist', 'Mint tokens to a single address', `Modify whitelist and mint tokens using data from 'whitelist_data.csv' and 'multi_mint_data.csv'`]; + let options = ['Modify whitelist', 'Mint tokens to a single address', `Mint tokens to multiple addresses from CSV`]; let index = readlineSync.keyInSelect(options, 'What do you want to do?', { cancel: 'Return' }); let selected = index == -1 ? 'Return' : options[index]; console.log('Selected:', selected); @@ -313,8 +306,9 @@ async function mintTokens() { let amount = readlineSync.question(`Enter the amount of tokens to mint: `); await mintToSingleAddress(receiver, amount); break; - case `Modify whitelist and mint tokens using data from 'whitelist_data.csv' and 'multi_mint_data.csv'`: - await multi_mint_tokens(); + case `Mint tokens to multiple addresses from CSV`: + console.log(chalk.yellow(`Investors should be previously whitelisted.`)); + await multiMint(); break; } } @@ -345,192 +339,67 @@ async function mintToSingleAddress(_investor, _amount) { } } -async function multi_mint_tokens() { - await transferManager.startCSV(tokenSymbol, 75); - console.log(chalk.green(`\nCongratulations! All the affiliates get succssfully whitelisted, Now its time to Mint the tokens\n`)); - console.log(chalk.red(`WARNING: `) + `Please make sure all the addresses that get whitelisted are only eligible to hold or get Security token\n`); - - await startCSV(tokenSymbol, 75) - console.log(chalk.green(`\nCongratulations! Tokens get successfully Minted and transferred to token holders`)); -} -/// - -async function startCSV(tokenSymbol, batchSize) { - securityToken = await csv_shared.start(tokenSymbol, batchSize); - - let result_processing = await csv_shared.read('./CLI/data/multi_mint_data.csv', multimint_processing); - distribData = result_processing.distribData; - fullFileData = result_processing.fullFileData; - badData = result_processing.badData; - - tokenDivisible = await securityToken.methods.granularity().call() == 1; - - await saveInBlockchain(); - await finalResults(); -} - -function multimint_processing(csv_line) { - let isAddress = web3.utils.isAddress(csv_line[0]); - let validToken = isValidToken(csv_line[1]); - - if (isAddress && - validToken) { - return [true, new Array(web3.utils.toChecksumAddress(csv_line[0]), validToken)] +async function multiMint(_csvFilePath, _batchSize) { + let csvFilePath; + if (typeof _csvFilePath !== 'undefined') { + csvFilePath = _csvFilePath; } else { - return [false, new Array(csv_line[0], csv_line[1])] + csvFilePath = readlineSync.question(`Enter the path for csv data file (${MULTIMINT_DATA_CSV}): `, { + defaultInput: MULTIMINT_DATA_CSV + }); } -} - -function isValidToken(token) { - var tokenAmount = parseFloat(token); - if (tokenDivisible) { - return tokenAmount + let batchSize; + if (typeof _batchSize !== 'undefined') { + batchSize = _batchSize; } else { - if ((tokenAmount % 1 == 0)) { - return tokenAmount; - } - return false - } -} - -async function saveInBlockchain() { - let gtmModules = await securityToken.methods.getModulesByType(3).call(); - - if (gtmModules.length > 0) { - console.log("Minting of tokens is only allowed before the STO get attached"); - process.exit(0); - } - - console.log(` - ----------------------------------------- - ----- Mint the tokens to affiliates ----- - ----------------------------------------- - `); - - for (let i = 0; i < distribData.length; i++) { - try { - let affiliatesVerifiedArray = [], tokensVerifiedArray = []; - - // Splitting the user arrays to be organized by input - for (let j = 0; j < distribData[i].length; j++) { - let investorAccount = distribData[i][j][0]; - let tokenAmount = web3.utils.toWei((distribData[i][j][1]).toString(), "ether"); - let verifiedTransaction = await securityToken.methods.verifyTransfer("0x0000000000000000000000000000000000000000", investorAccount, tokenAmount, web3.utils.fromAscii('')).call(); - if (verifiedTransaction) { - affiliatesVerifiedArray.push(investorAccount); - tokensVerifiedArray.push(tokenAmount); - } else { - let gtmModule = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call(); - let generalTransferManager = new web3.eth.Contract(abis.generalTransferManager(), gtmModule[0]); - let validKYC = (await generalTransferManager.methods.whitelist(Issuer.address).call()).expiryTime > Math.floor(Date.now()/1000); - if (validKYC) { - affiliatesFailedArray.push(investorAccount); - } else { - affiliatesKYCInvalidArray.push(investorAccount); - } - } - } - - let mintMultiAction = await securityToken.methods.mintMulti(affiliatesVerifiedArray, tokensVerifiedArray); - let tx = await common.sendTransaction(mintMultiAction); - console.log(`Batch ${i} - Attempting to send the Minted tokens to affiliates accounts:\n\n`, affiliatesVerifiedArray, "\n\n"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------"); - console.log("Multi Mint transaction was successful.", tx.gasUsed, "gas used. Spent:", web3.utils.fromWei(BigNumber(tx.gasUsed * defaultGasPrice).toString(), "ether"), "Ether"); - console.log("---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n\n"); - - } catch (err) { - console.log("ERROR", err) - process.exit(0) - } - } - - return; -} - -async function finalResults() { - let totalInvestors = 0; - let updatedInvestors = 0; - let investorObjectLookup = {}; - let investorData_Events = new Array(); - - let event_data = await securityToken.getPastEvents('Minted', {fromBlock: 0, toBlock: 'latest'}, () => {}); - - for (var i = 0; i < event_data.length; i++) { - let combineArray = []; - - let investorAddress_Event = event_data[i].returnValues._to; - let amount_Event = event_data[i].returnValues._value; - let blockNumber = event_data[i].blockNumber; - - combineArray.push(investorAddress_Event); - combineArray.push(amount_Event); - combineArray.push(blockNumber); - - investorData_Events.push(combineArray) - - // We have already recorded it, so this is an update to our object - if (investorObjectLookup.hasOwnProperty(investorAddress_Event)) { - // The block number form the event we are checking is bigger, so we gotta replace it - if (investorObjectLookup[investorAddress_Event].recordedBlockNumber < blockNumber) { - investorObjectLookup[investorAddress_Event] = {amount: amount_Event, recordedBlockNumber: blockNumber}; - updatedInvestors += 1; - } + batchSize = readlineSync.question(`Enter the max number of records per transaction or batch size (${gbl.constants.DEFAULT_BATCH_SIZE}): `, { + limit: function (input) { + return parseInt(input) > 0; + }, + limitMessage: 'Must be greater than 0', + defaultInput: gbl.constants.DEFAULT_BATCH_SIZE + }); + } + let parsedData = csvParse(csvFilePath); + let tokenDivisible = await securityToken.methods.granularity().call() == 1; + let validData = parsedData.filter(row => + web3.utils.isAddress(row[0]) && + (!isNaN(row[1]) && (tokenDivisible || parseFloat(row[1]) % 1 == 0)) + ); + let invalidRows = parsedData.filter(row => !validData.includes(row)); + if (invalidRows.length > 0) { + console.log(chalk.red(`The following lines from csv file are not valid: ${invalidRows.map(r => parsedData.indexOf(r) + 1).join(',')} `)); + } + let verifiedData = []; + let unverifiedData = []; + for (const row of validData) { + let investorAccount = row[0]; + let tokenAmount = web3.utils.toWei(row[1].toString()); + let verifiedTransaction = await securityToken.methods.verifyTransfer(gbl.constants.ADDRESS_ZERO, investorAccount, tokenAmount, web3.utils.fromAscii('')).call(); + if (verifiedTransaction) { + verifiedData.push(row); } else { - investorObjectLookup[investorAddress_Event] = {amount: amount_Event, recordedBlockNumber: blockNumber}; - totalInvestors += 1; + unverifiedData.push(row); } } - let investorAddress_Events = Object.keys(investorObjectLookup) - - console.log(`******************** EVENT LOGS ANALYSIS COMPLETE ********************\n`); - console.log(`A total of ${totalInvestors} affiliated investors get the token\n`); - console.log(`This script in total sent ${fullFileData.length - badData.length - affiliatesFailedArray.length - affiliatesKYCInvalidArray.length} new investors and updated investors to the blockchain.\n`); - console.log(`There were ${badData.length} bad entries that didnt get sent to the blockchain in the script.\n`); - console.log(`There were ${affiliatesKYCInvalidArray.length} accounts with invalid KYC.\n`); - console.log(`There were ${affiliatesFailedArray.length} accounts that didn't get sent to the blockchain as they would fail.\n`); - console.log("************************************************************************************************"); - console.log("OBJECT WITH EVERY USER AND THEIR MINTED TOKEN: \n\n", investorObjectLookup) - console.log("************************************************************************************************"); - console.log("LIST OF ALL INVESTORS WHO GOT THE MINTED TOKENS: \n\n", investorAddress_Events) - - let missingDistribs = [], failedVerificationDistribs = [], invalidKYCDistribs = []; - for (let l = 0; l < fullFileData.length; l++) { - if (affiliatesKYCInvalidArray.includes(fullFileData[l][0])) { - invalidKYCDistribs.push(fullFileData[l]); - } else if (affiliatesFailedArray.includes(fullFileData[l][0])) { - failedVerificationDistribs.push(fullFileData[l]); - } else if (!investorObjectLookup.hasOwnProperty(fullFileData[l][0])) { - missingDistribs.push(fullFileData[l]); - } + let batches = common.splitIntoBatches(verifiedData, batchSize); + let [investorArray, amountArray] = common.transposeBatches(batches); + for (let batch = 0; batch < batches.length; batch++) { + console.log(`Batch ${batch + 1} - Attempting to mint tokens to accounts: \n\n`, investorArray[batch], '\n'); + amountArray[batch] = amountArray[batch].map(a => web3.utils.toWei(a.toString())); + let action = await securityToken.methods.mintMulti(investorArray[batch], amountArray[batch]); + let receipt = await common.sendTransaction(action); + console.log(chalk.green('Multi mint transaction was successful.')); + console.log(`${receipt.gasUsed} gas used.Spent: ${web3.utils.fromWei((new web3.utils.BN(receipt.gasUsed)).mul(new web3.utils.BN(defaultGasPrice)))} ETH`); } - if (invalidKYCDistribs.length > 0) { - console.log("**************************************************************************************************************************"); - console.log("The following data arrays have an invalid KYC. Please review if these accounts are whitelisted and their KYC is not expired\n"); - console.log(invalidKYCDistribs); - console.log("**************************************************************************************************************************"); - } - if (failedVerificationDistribs.length > 0) { + if (unverifiedData.length > 0) { console.log("*********************************************************************************************************"); - console.log("-- The following data arrays failed at verifyTransfer. Please review if these accounts are whitelisted --\n"); - console.log(failedVerificationDistribs); + console.log('The following data arrays failed at verifyTransfer. Please review if these accounts are whitelisted\n'); + console.log(chalk.red(unverifiedData.map(d => `${d[0]}, ${d[1]}`).join('\n'))); console.log("*********************************************************************************************************"); } - if (missingDistribs.length > 0) { - console.log("******************************************************************************************"); - console.log("-- No Minted event was found for the following data arrays. Please review them manually --\n"); - console.log(missingDistribs); - console.log("******************************************************************************************"); - } - if (missingDistribs.length == 0 && - failedVerificationDistribs.length == 0 && - invalidKYCDistribs.length == 0) { - console.log("\n**************************************************************************************************************************"); - console.log("All accounts passed through from the CSV were successfully get the tokens, because we were able to read them all from events"); - console.log("****************************************************************************************************************************"); - } - } async function withdrawFromContract(erc20address, value) { @@ -824,10 +693,11 @@ async function selectToken() { module.exports = { executeApp: async function (_tokenSymbol) { - await initialize(_tokenSymbol) + await initialize(_tokenSymbol); return executeApp(); }, - startCSV: async function (tokenSymbol, batchSize) { - return startCSV(tokenSymbol, batchSize); + multiMint: async function (_tokenSymbol, _csvPath, _batchSize) { + await initialize(_tokenSymbol); + return multiMint(_csvPath, _batchSize); } } diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index ca2f4ee06..ee42b2fa4 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -483,10 +483,10 @@ async function generalTransferManager() { } async function modifyWhitelistInBatch() { - let csvFilePath = readlineSync.question(`Enter the path for csv data file(${WHITELIST_DATA_CSV}): `, { + let csvFilePath = readlineSync.question(`Enter the path for csv data file (${WHITELIST_DATA_CSV}): `, { defaultInput: WHITELIST_DATA_CSV }); - let batchSize = readlineSync.question(`Enter the max number of records per transaction or batch size(${gbl.constants.DEFAULT_BATCH_SIZE}): `, { + let batchSize = readlineSync.question(`Enter the max number of records per transaction or batch size (${gbl.constants.DEFAULT_BATCH_SIZE}): `, { limit: function (input) { return parseInt(input) > 0; }, @@ -508,7 +508,7 @@ async function modifyWhitelistInBatch() { let batches = common.splitIntoBatches(validData, batchSize); let [investorArray, fromTimesArray, toTimesArray, expiryTimeArray, canBuyFromSTOArray] = common.transposeBatches(batches); for (let batch = 0; batch < batches.length; batch++) { - console.log(`Batch ${batch + 1} - Attempting to change accredited accounts: \n\n`, investorArray[batch], '\n'); + console.log(`Batch ${batch + 1} - Attempting to modify whitelist to accounts: \n\n`, investorArray[batch], '\n'); let action = await currentTransferManager.methods.modifyWhitelistMulti(investorArray[batch], fromTimesArray[batch], toTimesArray[batch], expiryTimeArray[batch], canBuyFromSTOArray[batch]); let receipt = await common.sendTransaction(action); console.log(chalk.green('Whitelist transaction was successful.')); diff --git a/CLI/polymath-cli.js b/CLI/polymath-cli.js index 0ffba10dd..2ce101a4d 100644 --- a/CLI/polymath-cli.js +++ b/CLI/polymath-cli.js @@ -74,19 +74,17 @@ program .command('token_manager') .alias('stm') .option('-t, --securityToken ', 'Selects a ST to manage') + .option('-m, --multiMint ', 'Distribute tokens to previously whitelisted investors') + .option('-b, --batchSize ', 'Max number of records per transaction') .description('Manage your Security Tokens, mint tokens, add modules and change config') .action(async function (cmd) { await gbl.initialize(program.remoteNode); - await token_manager.executeApp(cmd.securityToken); - }); - -program - .command('multi_mint [batchSize]') - .alias('mi') - .description('Distribute tokens to previously whitelisted investors') - .action(async function (tokenSymbol, batchSize) { - await gbl.initialize(program.remoteNode); - await token_manager.startCSV(tokenSymbol, batchSize); + if (cmd.multiMint) { + let batchSize = cmd.batchSize ? cmd.batchSize : gbl.constants.DEFAULT_BATCH_SIZE; + await token_manager.multiMint(cmd.securityToken, cmd.multiMint, batchSize); + } else { + await token_manager.executeApp(cmd.securityToken); + } }); program From cb079cb8ac75aa6003e8d0c0a796c7f87e11b214 Mon Sep 17 00:00:00 2001 From: Ricko Date: Mon, 3 Dec 2018 14:41:51 +0100 Subject: [PATCH 137/139] Fuzz test permissions manager module (#395) * count transfer manager module fuzz testfinished * fuzz test for general transfer manager * fuzz tests updates * permission manager fuzzer volumn restriction transfer manager * mint token err * minting issue * fixing some testsing issuesss * all done * fixed cleaning up and commenting of the fuzz test codes * fixed conflict and merged new development functions, deleted all code with STVRTM. * get rid of test for STVTM * adding back missing file * get rid of STVR test * Delete x_single_trade_volume_restriction.js * deleted unused code :( --- .eslintrc.js | 4 +- test/helpers/createInstances.js | 14 - test/x_single_trade_volume_restriction.js | 726 -------------------- test/z_general_permission_manager_fuzzer.js | 669 ++++++++++++++++++ 4 files changed, 672 insertions(+), 741 deletions(-) delete mode 100644 test/x_single_trade_volume_restriction.js create mode 100644 test/z_general_permission_manager_fuzzer.js diff --git a/.eslintrc.js b/.eslintrc.js index 463539deb..8b0c0ac0f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -14,6 +14,8 @@ module.exports = { "quotes": 0, "semi": 0, "no-undef": 0, - "key-spacing": 0 + "key-spacing": 0, + "no-tabs": 0, + "no-mixed-spaces-and-tabs":0 } }; diff --git a/test/helpers/createInstances.js b/test/helpers/createInstances.js index 2021d350e..a739e86fb 100644 --- a/test/helpers/createInstances.js +++ b/test/helpers/createInstances.js @@ -11,7 +11,6 @@ const SecurityTokenRegistryMock = artifacts.require("./SecurityTokenRegistryMock const ERC20DividendCheckpointFactory = artifacts.require("./ERC20DividendCheckpointFactory.sol"); const EtherDividendCheckpointFactory = artifacts.require("./EtherDividendCheckpointFactory.sol"); const ManualApprovalTransferManagerFactory = artifacts.require("./ManualApprovalTransferManagerFactory.sol"); -const SingleTradeVolumeRestrictionManagerFactory = artifacts.require('./SingleTradeVolumeRestrictionTMFactory.sol'); const TrackedRedemptionFactory = artifacts.require("./TrackedRedemptionFactory.sol"); const PercentageTransferManagerFactory = artifacts.require("./PercentageTransferManagerFactory.sol"); const ScheduledCheckpointFactory = artifacts.require('./ScheduledCheckpointFactory.sol'); @@ -41,7 +40,6 @@ let I_TrackedRedemptionFactory; let I_ScheduledCheckpointFactory; let I_MockBurnFactory; let I_MockWrongTypeBurnFactory; -let I_SingleTradeVolumeRestrictionManagerFactory; let I_ManualApprovalTransferManagerFactory; let I_VolumeRestrictionTransferManagerFactory; let I_PercentageTransferManagerFactory; @@ -255,18 +253,6 @@ export async function deployLockupVolumeRTMAndVerified(accountPolymath, MRProxyI return new Array(I_VolumeRestrictionTransferManagerFactory); } -export async function deploySingleTradeVolumeRMAndVerified(accountPolymath, MRProxyInstance, polyToken, setupCost) { - I_SingleTradeVolumeRestrictionManagerFactory = await SingleTradeVolumeRestrictionManagerFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath }); - assert.notEqual( - I_SingleTradeVolumeRestrictionManagerFactory.address.valueOf(), - "0x0000000000000000000000000000000000000000", - "SingleTradeVolumeRestrictionManagerFactory contract was not deployed" - ); - - await registerAndVerifyByMR(I_SingleTradeVolumeRestrictionManagerFactory.address, accountPolymath, MRProxyInstance); - return new Array(I_SingleTradeVolumeRestrictionManagerFactory); -} - export async function deployScheduleCheckpointAndVerified(accountPolymath, MRProxyInstance, polyToken, setupCost) { I_ScheduledCheckpointFactory = await ScheduledCheckpointFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath }); assert.notEqual( diff --git a/test/x_single_trade_volume_restriction.js b/test/x_single_trade_volume_restriction.js deleted file mode 100644 index 15c01e68c..000000000 --- a/test/x_single_trade_volume_restriction.js +++ /dev/null @@ -1,726 +0,0 @@ -import latestTime from './helpers/latestTime'; -import { duration, promisifyLogWatch, latestBlock } from './helpers/utils'; -import { takeSnapshot, increaseTime, revertToSnapshot } from './helpers/time'; -import { encodeModuleCall } from './helpers/encodeCall'; -import {deploySingleTradeVolumeRMAndVerified, setUpPolymathNetwork } from "./helpers/createInstances"; -import { catchRevert } from "./helpers/exceptions"; - -const SecurityToken = artifacts.require('./SecurityToken.sol'); -const GeneralPermissionManagerFactory = artifacts.require('./GeneralPermissionManagerFactory.sol'); -const GeneralTransferManager = artifacts.require('./GeneralTransferManager'); -const SingleTradeVolumeRestrictionManager = artifacts.require('./SingleTradeVolumeRestrictionTM'); -const CountTransferManagerFactory = artifacts.require('./CountTransferManagerFactory.sol'); -const GeneralPermissionManager = artifacts.require('./GeneralPermissionManager'); - -const Web3 = require('web3'); -const BigNumber = require('bignumber.js'); -const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")) // Hardcoded development port - -contract('SingleTradeVolumeRestrictionManager', accounts => { - - - - // Accounts Variable declaration - let account_polymath; - let account_issuer; - let token_owner; - let account_investor1; - let account_investor2; - let account_investor3; - let account_investor4; - let account_investor5; - let zero_address = '0x0000000000000000000000000000000000000000'; - - // investor Details - let fromTime = latestTime(); - let toTime = latestTime(); - let expiryTime = toTime + duration.days(15); - - let message = "Transaction Should Fail!"; - - // Contract Instance Declaration - let I_SecurityTokenRegistryProxy - let I_GeneralTransferManagerFactory; - let I_GeneralPermissionManager; - let I_GeneralTransferManager; - let I_SingleTradeVolumeRestrictionManagerFactory; - let I_SingleTradeVolumeRestrictionManager; - let P_SingleTradeVolumeRestrictionManagerFactory; - let P_SingleTradeVolumeRestrictionManager; - let I_SingleTradeVolumeRestrictionPercentageManager; - let I_ModuleRegistry; - let I_MRProxied; - let I_ModuleRegistryProxy; - let I_FeatureRegistry; - let I_SecurityTokenRegistry; - let I_STRProxied; - let I_STFactory; - let I_SecurityToken; - let I_PolyToken; - let I_PolymathRegistry; - - // SecurityToken Details - const name = "Team"; - const symbol = "sap"; - const tokenDetails = "This is equity type of issuance"; - const decimals = 18; - const contact = "team@polymath.network"; - const STVRParameters = ["bool", "uint256", "bool"]; - - // Module key - const delegateManagerKey = 1; - const transferManagerKey = 2; - const stoKey = 3; - - // Initial fee for ticker registry and security token registry - const initRegFee = web3.utils.toWei("250"); - - before(async () => { - // Accounts setup - account_polymath = accounts[0]; - account_issuer = accounts[1]; - - token_owner = account_issuer; - - account_investor1 = accounts[6]; - account_investor2 = accounts[7]; - account_investor3 = accounts[8]; - account_investor4 = accounts[9]; - account_investor5 = accounts[5]; - - let instances = await setUpPolymathNetwork(account_polymath, token_owner); - - [ - I_PolymathRegistry, - I_PolyToken, - I_FeatureRegistry, - I_ModuleRegistry, - I_ModuleRegistryProxy, - I_MRProxied, - I_GeneralTransferManagerFactory, - I_STFactory, - I_SecurityTokenRegistry, - I_SecurityTokenRegistryProxy, - I_STRProxied - ] = instances; - - // STEP 4: Deploy the SingleTradeVolumeRestrictionManagerFactory - [I_SingleTradeVolumeRestrictionManagerFactory] = await deploySingleTradeVolumeRMAndVerified(account_polymath, I_MRProxied, I_PolyToken.address, 0); - [P_SingleTradeVolumeRestrictionManagerFactory] = await deploySingleTradeVolumeRMAndVerified(account_polymath, I_MRProxied, I_PolyToken.address, web3.utils.toWei("500")); - - }); - - describe("Generate the SecurityToken", async () => { - it("Should register the ticker before the generation of the security token", async () => { - await I_PolyToken.approve(I_STRProxied.address, initRegFee, { - from: token_owner - }); - let tx = await I_STRProxied.registerTicker(token_owner, symbol, contact, { - from: token_owner - }); - assert.equal(tx.logs[0].args._owner, token_owner); - assert.equal(tx.logs[0].args._ticker, symbol.toUpperCase()); - }); - - it("Should generate the new security token with the same symbol as registered above", async () => { - await I_PolyToken.approve(I_STRProxied.address, initRegFee, { - from: token_owner - }); - let _blockNo = latestBlock(); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { - from: token_owner - }); - - // Verify the successful generation of the security token - assert.equal(tx.logs[1].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); - - I_SecurityToken = SecurityToken.at(tx.logs[1].args._securityTokenAddress); - - const log = await promisifyLogWatch(I_SecurityToken.ModuleAdded({ - from: _blockNo - }), 1); - - // Verify that GeneralTransferManager module get added successfully or not - assert.equal(log.args._types[0].toNumber(), 2); - assert.equal( - web3.utils.toAscii(log.args._name) - .replace(/\u0000/g, ''), - "GeneralTransferManager" - ); - }); - - it("Should intialize the auto attached modules", async () => { - let moduleData = (await I_SecurityToken.getModulesByType(2))[0]; - I_GeneralTransferManager = GeneralTransferManager.at(moduleData); - }); - }); - // - describe("Buy tokens using whitelist & manual approvals", async () => { - - it("Should Buy the tokens", async () => { - // Add the Investor in to the whitelist - - let tx = await I_GeneralTransferManager.modifyWhitelist( - account_investor1, - latestTime(), - latestTime(), - latestTime() + duration.days(10), - true, { - from: account_issuer - }); - - assert.equal(tx.logs[0].args._investor.toLowerCase(), account_investor1.toLowerCase(), "Failed in adding the investor in whitelist"); - - // Jump time - await increaseTime(5000); - - // Mint some tokens - await I_SecurityToken.mint(account_investor1, web3.utils.toWei('100', 'ether'), { - from: token_owner - }); - - assert.equal( - (await I_SecurityToken.balanceOf(account_investor1)).toNumber(), - web3.utils.toWei('100', 'ether') - ); - }); - - it("Should Buy some more tokens", async () => { - // Add the Investor in to the whitelist - - let tx = await I_GeneralTransferManager.modifyWhitelist( - account_investor2, - latestTime(), - latestTime(), - latestTime() + duration.days(10), - true, { - from: account_issuer - }); - - assert.equal(tx.logs[0].args._investor.toLowerCase(), account_investor2.toLowerCase(), "Failed in adding the investor in whitelist"); - - // Mint some tokens - await I_SecurityToken.mint(account_investor2, web3.utils.toWei('1', 'ether'), { - from: token_owner - }); - - assert.equal( - (await I_SecurityToken.balanceOf(account_investor2)).toNumber(), - web3.utils.toWei('1', 'ether') - ); - }); - // - it("Fails to attach the SingleTradeVolumeRestrictionManager with the security token due to fees not paid", async () => { - let managerArgs = encodeModuleCall(STVRParameters, [true, 90, false]); - - await I_PolyToken.getTokens(web3.utils.toWei("500", "ether"), token_owner); - await catchRevert( - I_SecurityToken.addModule(P_SingleTradeVolumeRestrictionManagerFactory.address, managerArgs, web3.utils.toWei("500", "ether"), 0, { from: token_owner}) - ); - }); - - it("Should successfully attach the Paid SingleTradeVolumeRestrictionManager with the security token", async () => { - let managerArgs = encodeModuleCall(STVRParameters, [false, 90, false]); - await I_PolyToken.transfer(I_SecurityToken.address, web3.utils.toWei("500", "ether"), { from: token_owner }); - - let tx = await I_SecurityToken.addModule(P_SingleTradeVolumeRestrictionManagerFactory.address, managerArgs, web3.utils.toWei("500", "ether"), 0, { - from: token_owner - }); - - assert.equal(tx.logs[3].args._types[0].toNumber(), transferManagerKey, "SingleTradeVolumeRestrictionManager did not get deployed"); - assert.equal( - web3.utils.toAscii(tx.logs[3].args._name) - .replace(/\u0000/g, ''), - "SingleTradeVolumeRestrictionTM", - "SingleTradeVolumeRestrictionManagerFactory module was not added" - ); - P_SingleTradeVolumeRestrictionManager = SingleTradeVolumeRestrictionManager.at(tx.logs[3].args._module); - }); - - it("Should successfully attach the SingleTradeVolumeRestrictionManager with the security token", async () => { - let managerArgs = encodeModuleCall(STVRParameters, [false, (7 * Math.pow(10, 16)).toString(), false]) - const tx = await I_SecurityToken.addModule(I_SingleTradeVolumeRestrictionManagerFactory.address, managerArgs, 0, 0, { - from: token_owner - }); - assert.equal(tx.logs[2].args._types[0].toNumber(), transferManagerKey, "TransferManager doesn't get deployed"); - assert.equal( - web3.utils.toAscii(tx.logs[2].args._name) - .replace(/\u0000/g, ''), - "SingleTradeVolumeRestrictionTM", - "SingleTradeVolumeRestriction module was not added" - ); - I_SingleTradeVolumeRestrictionManager = SingleTradeVolumeRestrictionManager.at(tx.logs[2].args._module); - }); - - it("Should successfully attach the SingleTradeVolumeRestrictionManager (Percentage) with the security token", async () => { - let managerArgs = encodeModuleCall(STVRParameters, [true, 90, false]); - const tx = await I_SecurityToken.addModule(I_SingleTradeVolumeRestrictionManagerFactory.address, managerArgs, 0, 0, { - from: token_owner - }); - assert.equal(tx.logs[2].args._types[0].toNumber(), transferManagerKey, "PercentageTransferManager doesn't get deployed"); - assert.equal( - web3.utils.toAscii(tx.logs[2].args._name) - .replace(/\u0000/g, ''), - "SingleTradeVolumeRestrictionTM", - "SingleTradeVolumeRestriction module was not added" - ); - I_SingleTradeVolumeRestrictionPercentageManager = SingleTradeVolumeRestrictionManager.at(tx.logs[2].args._module); - }); - - it('should return get permissions', async () => { - let permissions = await I_SingleTradeVolumeRestrictionPercentageManager.getPermissions(); - assert.equal(permissions.length, 1, "Invalid Permissions"); - assert.equal( - web3.utils.toAscii(permissions[0]).replace(/\u0000/g, ''), - "ADMIN", - 'Wrong permissions' - ); - }); - - it("Should allow the primary issuance", async() => { - let snapId = await takeSnapshot(); - await I_SingleTradeVolumeRestrictionManager.setAllowPrimaryIssuance(true, {from: token_owner}); - await catchRevert( - I_SingleTradeVolumeRestrictionManager.setAllowPrimaryIssuance(true, {from: token_owner}) - ) - await revertToSnapshot(snapId); - }) - - it("add exempt wallet -- Not authorised ", async () => { - await catchRevert ( - I_SingleTradeVolumeRestrictionManager.addExemptWallet(accounts[5]) - ); - - await catchRevert( - I_SingleTradeVolumeRestrictionManager.addExemptWallet(zero_address, { from: token_owner }) - ); - - let tx = await I_SingleTradeVolumeRestrictionManager.addExemptWallet(accounts[5], { - from: token_owner - }); - assert.equal(tx.logs[0].args._wallet, accounts[5], "Wrong wallet added as exempt"); - }); - - it("Should remove an exempt wallet", async () => { - await catchRevert ( - I_SingleTradeVolumeRestrictionManager.removeExemptWallet(accounts[5]) - ); - // 0 address are not allowed to add - await catchRevert ( - I_SingleTradeVolumeRestrictionManager.removeExemptWallet(zero_address, { from: token_owner }) - ); - - let tx = await I_SingleTradeVolumeRestrictionManager.removeExemptWallet(accounts[5], { from: token_owner }); - assert.equal(tx.logs[0].args._wallet, accounts[5], "Wrong wallet removed from exempt"); - }); - - it('should set transfer limit for a wallet', async () => { - await catchRevert ( - I_SingleTradeVolumeRestrictionManager.setTransferLimitInTokens(accounts[4], 100) - ); - - // Transfer limits can't be set to 0 - await catchRevert ( - I_SingleTradeVolumeRestrictionManager.setTransferLimitInTokens(accounts[4], 0, { from: token_owner }) - ); - - // Transfer limit cannot be set in percentage - await catchRevert( - I_SingleTradeVolumeRestrictionManager.setTransferLimitInPercentage(accounts[4], 10, { from: token_owner }) - ); - - let tx = await I_SingleTradeVolumeRestrictionManager.setTransferLimitInTokens(accounts[4], 100, { - from: token_owner - }); - assert.equal(tx.logs[0].args._wallet, accounts[4]); - assert.equal(tx.logs[0].args._amount, 100); - - await catchRevert( - I_SingleTradeVolumeRestrictionPercentageManager.setTransferLimitInPercentage(accounts[4], 0, { from: token_owner }) - ); - // Transfer limit can not be set to more 0 - await catchRevert ( - I_SingleTradeVolumeRestrictionPercentageManager.setTransferLimitInPercentage(accounts[4], 101 * 10 ** 16, { from: token_owner }) - ); - // Transfer limit in tokens can not be set for a manager that has transfer limit set as percentage - await catchRevert ( - I_SingleTradeVolumeRestrictionPercentageManager.setTransferLimitInTokens(accounts[4], 1, { from: token_owner }) - ); - - tx = await I_SingleTradeVolumeRestrictionPercentageManager.setTransferLimitInPercentage(accounts[4], 50, { from: token_owner }); - assert.equal(tx.logs[0].args._wallet, accounts[4], "Wrong wallet added to transfer limits"); - assert.equal(tx.logs[0].args._percentage, 50, "Wrong percentage set"); - }); - - it('should remove transfer limit for wallet', async () => { - // Non Admins cannot set/remove transfer limits - await catchRevert ( - I_SingleTradeVolumeRestrictionManager.removeTransferLimitInTokens(accounts[4]) - ); - - // Non Admins cannot set/remove transfer limits - await catchRevert ( - I_SingleTradeVolumeRestrictionManager.removeTransferLimitInTokens(accounts[0], { from: token_owner }) - ); - - let tx = await I_SingleTradeVolumeRestrictionManager.removeTransferLimitInTokens(accounts[4], { - from: token_owner - }); - assert.equal(tx.logs[0].args._wallet, accounts[4], "Wrong wallet removed"); - }); - - it("Should pause the tranfers at Manager level", async () => { - let tx = await I_SingleTradeVolumeRestrictionManager.pause({ - from: token_owner - }); - }); - - it('Should be able to set a global transfer limit', async () => { - // only owner is allowed - await catchRevert( - I_SingleTradeVolumeRestrictionManager.changeGlobalLimitInTokens(100 * 10 ** 18) - ); - //Cannot change global limit in percentage when set to tokens - await catchRevert( - I_SingleTradeVolumeRestrictionManager.changeGlobalLimitInPercentage(100 * 10 ** 18, { from: token_owner }) - ); - // Global limit cannot be set to 0 - await catchRevert( - I_SingleTradeVolumeRestrictionManager.changeGlobalLimitInTokens(0, { from: token_owner }) - ); - - let tx = await I_SingleTradeVolumeRestrictionManager.changeGlobalLimitInTokens(10, { - from: token_owner - }); - assert.equal(tx.logs[0].args._amount, 10, "Global Limit not set"); - - //Global limit can be set by non-admins - await catchRevert( - I_SingleTradeVolumeRestrictionPercentageManager.changeGlobalLimitInTokens(89) - ); - // cannot change global limit in tokens if transfer limit is set to percentage - await catchRevert( - I_SingleTradeVolumeRestrictionPercentageManager.changeGlobalLimitInTokens(89, { from: token_owner }) - ); - // Cannot set global limit in tokens to 0 - await catchRevert( - I_SingleTradeVolumeRestrictionPercentageManager.changeGlobalLimitInTokens(0, { from: token_owner }) - ); - - tx = await I_SingleTradeVolumeRestrictionPercentageManager.changeGlobalLimitInPercentage(40, { from: token_owner }); - assert.equal(tx.logs[0].args._percentage, 40, "Global Limit not set"); - // Global limit cannot be set to more than 100 - await catchRevert( - I_SingleTradeVolumeRestrictionPercentageManager.changeGlobalLimitInPercentage(101 * 10 ** 16, { from: token_owner }) - ); - // Global limit in percentage cannot be set when limit is in tokens - await catchRevert( - I_SingleTradeVolumeRestrictionManager.changeGlobalLimitInPercentage(10, { from: token_owner }) - ); - // Global limit in tokens cannot be set when limit is in percentage - await catchRevert( - I_SingleTradeVolumeRestrictionPercentageManager.changeGlobalLimitInTokens(10, { from: token_owner }) - ); - }); - - it("Should perform batch updates", async () => { - let wallets = [accounts[0], accounts[1], accounts[2]]; - let tokenLimits = [1, 2, 3]; - let percentageLimits = [5, 6, 7]; - - // Exempt wallet multi cannot be empty wallet - await catchRevert( - P_SingleTradeVolumeRestrictionManager.addExemptWalletMulti([], { from: token_owner }) - ); - - // add exempt wallet multi - let tx = await P_SingleTradeVolumeRestrictionManager.addExemptWalletMulti(wallets, { - from: token_owner - }); - let logs = tx.logs.filter(log => log.event === 'ExemptWalletAdded'); - assert.equal(logs.length, wallets.length, "Batch Exempt wallets not added"); - for (let i = 0; i < logs.length; i++) { - assert.equal(logs[i].args._wallet, wallets[i], "Wallet not added as exempt wallet"); - } - - // Exempt wallet multi cannot be empty wallet - await catchRevert( - P_SingleTradeVolumeRestrictionManager.removeExemptWalletMulti([], { from: token_owner }) - ); - - // remove exempt wallet multi - tx = await P_SingleTradeVolumeRestrictionManager.removeExemptWalletMulti(wallets, { - from: token_owner - }) - logs = tx.logs.filter(log => log.event === 'ExemptWalletRemoved'); - assert.equal(logs.length, wallets.length, "Batch Exempt wallets not removed"); - - for (let i = 0; i < logs.length; i++) { - assert.equal(logs[i].args._wallet, wallets[i], "Wallet not added as exempt wallet"); - } - // wallets cannot be empty - await catchRevert( - P_SingleTradeVolumeRestrictionManager.setTransferLimitInTokensMulti([], tokenLimits, { from: token_owner }) - ); - // wallet array length dont match - await catchRevert( - P_SingleTradeVolumeRestrictionManager.setTransferLimitInTokensMulti([accounts[0]], tokenLimits, { from: token_owner }) - ); - - tx = await P_SingleTradeVolumeRestrictionManager.setTransferLimitInTokensMulti(wallets, tokenLimits, { - from: token_owner - }); - logs = tx.logs.filter(log => log.event == 'TransferLimitInTokensSet'); - assert.equal(wallets.length, logs.length, "Transfer limit not set"); - for (let i = 0; i < wallets.length; i++) { - assert.equal(logs[i].args._wallet, wallets[i], "transfer limit not set for wallet"); - assert.equal(logs[i].args._amount.toNumber(), tokenLimits[i]); - } - // Wallets cannot be empty - await catchRevert( - P_SingleTradeVolumeRestrictionManager.removeTransferLimitInTokensMulti([], { from: token_owner }) - ); - tx = await P_SingleTradeVolumeRestrictionManager.removeTransferLimitInTokensMulti(wallets, { - from: token_owner - }); - logs = tx.logs.filter(log => log.event === 'TransferLimitInTokensRemoved'); - assert.equal(logs.length, wallets.length, "Transfer limit not removed"); - for (let i = 0; i < wallets.length; i++) { - assert.equal(logs[i].args._wallet, wallets[i], "transfer limit not removed for wallet"); - } - // wallets cannot be empty - await catchRevert( - I_SingleTradeVolumeRestrictionPercentageManager.setTransferLimitInPercentageMulti([], percentageLimits, { from: token_owner }) - ); - // wallets and amounts dont match be empty - await catchRevert( - I_SingleTradeVolumeRestrictionPercentageManager.setTransferLimitInPercentageMulti(wallets, [], { from: token_owner }) - ); - tx = await I_SingleTradeVolumeRestrictionPercentageManager.setTransferLimitInPercentageMulti(wallets, percentageLimits, { - from: token_owner - }); - logs = tx.logs.filter(log => log.event == 'TransferLimitInPercentageSet'); - assert.equal(logs.length, wallets.length, "transfer limits not set for wallets"); - - for (let i = 0; i < wallets.length; i++) { - assert.equal(logs[i].args._wallet, wallets[i], "Transfer limit not set for wallet"); - assert.equal(logs[i].args._percentage.toNumber(), percentageLimits[i]); - } - // Wallets cannot be empty - await catchRevert( - I_SingleTradeVolumeRestrictionPercentageManager.removeTransferLimitInPercentageMulti([], { from: token_owner }) - ); - - tx = await I_SingleTradeVolumeRestrictionPercentageManager.removeTransferLimitInPercentageMulti(wallets, { - from: token_owner - }); - logs = tx.logs.filter(log => log.event == 'TransferLimitInPercentageRemoved'); - assert.equal(logs.length, wallets.length, "transfer limits not set for wallets"); - - for (let i = 0; i < wallets.length; i++) { - assert.equal(logs[i].args._wallet, wallets[i], "Transfer limit not set for wallet"); - } - // Wallet should not be removed - await catchRevert( - I_SingleTradeVolumeRestrictionPercentageManager.removeTransferLimitInPercentage(wallets[0], { from: token_owner }) - ); - }) - - it('should be able to transfer tokens SingleTradeVolumeRestriction', async () => { - await I_SingleTradeVolumeRestrictionManager.unpause({ - from: token_owner - }) - await I_SingleTradeVolumeRestrictionPercentageManager.pause({ - from: token_owner - }) - await P_SingleTradeVolumeRestrictionManager.pause({ - from: token_owner - }); - - await I_GeneralTransferManager.modifyWhitelist( - account_investor3, - latestTime(), - latestTime(), - latestTime() + duration.days(10), - true, { - from: account_issuer - } - ); - - await I_GeneralTransferManager.modifyWhitelist( - account_investor4, - latestTime(), - latestTime(), - latestTime() + duration.days(10), - true, { - from: account_issuer - } - ); - - await I_GeneralTransferManager.modifyWhitelist( - account_investor5, - latestTime(), - latestTime(), - latestTime() + duration.days(10), - true, { - from: account_issuer - } - ); - - - //setting a max of 5 tokens - await I_SingleTradeVolumeRestrictionManager.changeGlobalLimitInTokens(web3.utils.toWei('5', 'ether'), { - from: token_owner - }) - // Transfer should have not happened - await catchRevert( - I_SecurityToken.transfer(account_investor3, web3.utils.toWei('6', 'ether'), { from: account_investor1 }) - ); - - await I_SecurityToken.transfer(account_investor3, web3.utils.toWei('4', 'ether'), { - from: account_investor1 - }); - assert.equal((await I_SecurityToken.balanceOf(account_investor3)).toNumber(), web3.utils.toWei('4', 'ether')); - - // exempt wallet - await I_SingleTradeVolumeRestrictionManager.addExemptWallet(account_investor1, { - from: token_owner - }); - await I_SecurityToken.transfer(account_investor5, web3.utils.toWei('7', 'ether'), { - from: account_investor1 - }); - assert.equal((await I_SecurityToken.balanceOf(account_investor5)).toNumber(), web3.utils.toWei('7', 'ether')); - - //special limits wallet - await I_SingleTradeVolumeRestrictionManager.setTransferLimitInTokens(account_investor5, web3.utils.toWei('5', 'ether'), { - from: token_owner - }); - - // Transfer should have not happened - await catchRevert( - I_SecurityToken.transfer(account_investor4, web3.utils.toWei('7', 'ether'), { from: account_investor5 }) - ); - - await I_SecurityToken.transfer(account_investor4, web3.utils.toWei('4', 'ether'), { - from: account_investor5 - }) - assert.equal((await I_SecurityToken.balanceOf(account_investor4)).toNumber(), web3.utils.toWei('4', 'ether')) - }) - - it('should be able to transfer tokens (percentage transfer limit)', async () => { - await I_SingleTradeVolumeRestrictionManager.pause({ - from: token_owner - }); - let balance = (await I_SecurityToken.balanceOf(account_investor2)).toNumber(); - await I_SecurityToken.transfer(account_investor1, balance, { - from: account_investor2 - }); - - - balance = (await I_SecurityToken.balanceOf(account_investor3)).toNumber(); - - await I_SecurityToken.transfer(account_investor1, balance, { - from: account_investor3 - }); - - - balance = (await I_SecurityToken.balanceOf(account_investor4)).toNumber(); - await I_SecurityToken.transfer(account_investor1, balance, { - from: account_investor4 - }); - - balance = (await I_SecurityToken.balanceOf(account_investor5)).toNumber(); - await I_SecurityToken.transfer(account_investor1, balance, { - from: account_investor5 - }); - - await I_SingleTradeVolumeRestrictionPercentageManager.unpause({ - from: token_owner - }); - // // - await I_SingleTradeVolumeRestrictionPercentageManager.changeGlobalLimitInPercentage(49 * 10 ** 16, { - from: token_owner - }); - - // Transfer above limit happened - await catchRevert( - I_SecurityToken.transfer(account_investor2, web3.utils.toWei('90', 'ether'), { from: account_investor1 }) - ); - - await I_SecurityToken.transfer(account_investor2, web3.utils.toWei('20', 'ether'), { - from: account_investor1 - }); - assert.equal((await I_SecurityToken.balanceOf(account_investor2)).toNumber(), web3.utils.toWei('20', 'ether')) - - await I_SingleTradeVolumeRestrictionPercentageManager.setTransferLimitInPercentage(account_investor1, 5 * 10 ** 16, { - from: token_owner - }); - // transfer happened above limit - await catchRevert( - I_SecurityToken.transfer(account_investor2, web3.utils.toWei('35', 'ether'), { from: account_investor1 }) - ); - - await I_SecurityToken.transfer(account_investor3, web3.utils.toWei('1', 'ether'), { - from: account_investor1 - }); - assert.equal((await I_SecurityToken.balanceOf(account_investor3)).toNumber(), web3.utils.toWei('1', 'ether')); - }); - - it('should change transfer limits to tokens', async () => { - // Should not change to percentage again - await catchRevert( - I_SingleTradeVolumeRestrictionPercentageManager.changeTransferLimitToPercentage(1, { from: token_owner }) - ); - - - let tx = await I_SingleTradeVolumeRestrictionPercentageManager.changeTransferLimitToTokens(1, { - from: token_owner - }); - assert.equal(await I_SingleTradeVolumeRestrictionPercentageManager.isTransferLimitInPercentage(), false, "Error Changing"); - assert.equal(tx.logs[0].args._amount.toNumber(), 1, "Transfer limit not changed"); - }) - - it('should change transfer limits to percentage', async () => { - // Should not change to tokens again - await catchRevert( - I_SingleTradeVolumeRestrictionManager.changeTransferLimitToTokens(1, { from: token_owner }) - ); - - let tx = await I_SingleTradeVolumeRestrictionPercentageManager.changeTransferLimitToPercentage(1, { - from: token_owner - }); - assert.ok(await I_SingleTradeVolumeRestrictionPercentageManager.isTransferLimitInPercentage(), "Error Changing"); - assert.equal(tx.logs[0].args._percentage.toNumber(), 1, "Transfer limit not changed"); - }) - - - - }); - - describe("SingleTradeVolumeRestrictionManager Factory test cases", async () => { - - it("Should get the exact details of the factory", async () => { - assert.equal(await I_SingleTradeVolumeRestrictionManagerFactory.getSetupCost.call(), 0); - assert.equal((await I_SingleTradeVolumeRestrictionManagerFactory.getTypes.call())[0], 2); - let name = web3.utils.toUtf8(await I_SingleTradeVolumeRestrictionManagerFactory.getName.call()); - assert.equal(name, "SingleTradeVolumeRestrictionTM", "Wrong Module added"); - let desc = await I_SingleTradeVolumeRestrictionManagerFactory.description.call(); - assert.equal(desc, "Imposes volume restriction on a single trade", "Wrong Module added"); - let title = await I_SingleTradeVolumeRestrictionManagerFactory.title.call(); - assert.equal(title, "Single Trade Volume Restriction Manager", "Wrong Module added"); - let inst = await I_SingleTradeVolumeRestrictionManagerFactory.getInstructions.call(); - assert.equal(inst, "Allows an issuer to impose volume restriction on a single trade. Init function takes two parameters. First parameter is a bool indicating if restriction is in percentage. The second parameter is the value in percentage or amount of tokens", "Wrong Module added"); - let version = await I_SingleTradeVolumeRestrictionManagerFactory.version.call(); - assert.equal(version, "1.0.0", "Version not correct"); - }); - - it("Should get the tags of the factory", async () => { - let tags = await I_SingleTradeVolumeRestrictionManagerFactory.getTags.call(); - assert.equal(web3.utils.toUtf8(tags[0]), "Single Trade"); - assert.equal(web3.utils.toUtf8(tags[1]), "Transfer"); - assert.equal(web3.utils.toUtf8(tags[2]), "Volume"); - }); - - - }); -}); diff --git a/test/z_general_permission_manager_fuzzer.js b/test/z_general_permission_manager_fuzzer.js new file mode 100644 index 000000000..4206991ee --- /dev/null +++ b/test/z_general_permission_manager_fuzzer.js @@ -0,0 +1,669 @@ +import latestTime from './helpers/latestTime'; +import {signData} from './helpers/signData'; +import { pk } from './helpers/testprivateKey'; +import { duration, promisifyLogWatch, latestBlock } from './helpers/utils'; +import { takeSnapshot, increaseTime, revertToSnapshot } from './helpers/time'; +import { catchRevert } from "./helpers/exceptions"; +import { setUpPolymathNetwork, + deployGPMAndVerifyed, + deployCountTMAndVerifyed, + deployLockupVolumeRTMAndVerified, + deployPercentageTMAndVerified, + deployManualApprovalTMAndVerifyed +} from "./helpers/createInstances"; +import { encodeModuleCall } from "./helpers/encodeCall"; + +const SecurityToken = artifacts.require('./SecurityToken.sol'); +const GeneralTransferManager = artifacts.require('./GeneralTransferManager'); +const GeneralPermissionManager = artifacts.require('./GeneralPermissionManager'); +const CountTransferManager = artifacts.require("./CountTransferManager"); +const VolumeRestrictionTransferManager = artifacts.require('./LockupVolumeRestrictionTM'); +const PercentageTransferManager = artifacts.require('./PercentageTransferManager'); +const ManualApprovalTransferManager = artifacts.require('./ManualApprovalTransferManager'); + +const Web3 = require('web3'); +const BigNumber = require('bignumber.js'); +const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")) // Hardcoded development port + +contract('GeneralPermissionManager', accounts => { + + // Accounts Variable declaration + let account_polymath; + let account_issuer; + let token_owner; + let token_owner_pk; + let account_investor1; + let account_investor2; + let account_investor3; + let account_investor4; + let account_delegate; + let account_delegate2; + // investor Details + let fromTime = latestTime(); + let toTime = latestTime(); + let expiryTime = toTime + duration.days(15); + + let message = "Transaction Should Fail!"; + + // Contract Instance Declaration + let I_GeneralPermissionManagerFactory; + let P_GeneralPermissionManagerFactory; + let I_SecurityTokenRegistryProxy; + let P_GeneralPermissionManager; + let I_GeneralTransferManagerFactory; + let I_VolumeRestrictionTransferManagerFactory; + let I_PercentageTransferManagerFactory; + let I_PercentageTransferManager; + let I_VolumeRestrictionTransferManager; + let I_GeneralPermissionManager; + let I_GeneralTransferManager; + let I_ModuleRegistryProxy; + let I_ModuleRegistry; + let I_FeatureRegistry; + let I_SecurityTokenRegistry; + let I_DummySTOFactory; + let I_STFactory; + let I_SecurityToken; + let I_MRProxied; + let I_STRProxied; + let I_PolyToken; + let I_PolymathRegistry; + let I_CountTransferManagerFactory; + let I_CountTransferManager; + let I_SingleTradeVolumeRestrictionManagerFactory; + let I_SingleTradeVolumeRestrictionManager; + let I_SingleTradeVolumeRestrictionPercentageManager; + let P_SingleTradeVolumeRestrictionManager; + let P_SingleTradeVolumeRestrictionManagerFactory; + let I_ManualApprovalTransferManagerFactory; + let I_ManualApprovalTransferManager; + + // SecurityToken Details + const name = "Team"; + const symbol = "sap"; + const tokenDetails = "This is equity type of issuance"; + const decimals = 18; + const contact = "team@polymath.network"; + const delegateDetails = "Hello I am legit delegate"; + const STVRParameters = ["bool", "uint256", "bool"]; + + // Module key + const delegateManagerKey = 1; + const transferManagerKey = 2; + const stoKey = 3; + + // Initial fee for ticker registry and security token registry + const initRegFee = web3.utils.toWei("250"); + + // CountTransferManager details + const holderCount = 2; // Maximum number of token holders + let bytesSTO = encodeModuleCall(["uint256"], [holderCount]); + + let _details = "details holding for test"; + let testRepeat = 20; + + // permission manager fuzz test + let perms = ['ADMIN','WHITELIST', 'FLAGS', 'TRANSFER_APPROVAL']; + let totalPerms = perms.length; + + before(async () => { + // Accounts setup + account_polymath = accounts[0]; + account_issuer = accounts[1]; + + token_owner = account_issuer; + token_owner_pk = pk.account_1; + + account_investor1 = accounts[8]; + account_investor2 = accounts[9]; + account_investor3 = accounts[5]; + account_investor4 = accounts[6]; + account_delegate = accounts[7]; + // account_delegate2 = accounts[6]; + + + // Step 1: Deploy the genral PM ecosystem + let instances = await setUpPolymathNetwork(account_polymath, token_owner); + + [ + I_PolymathRegistry, + I_PolyToken, + I_FeatureRegistry, + I_ModuleRegistry, + I_ModuleRegistryProxy, + I_MRProxied, + I_GeneralTransferManagerFactory, + I_STFactory, + I_SecurityTokenRegistry, + I_SecurityTokenRegistryProxy, + I_STRProxied + ] = instances; + + // STEP 5: Deploy the GeneralDelegateManagerFactory + [I_GeneralPermissionManagerFactory] = await deployGPMAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, 0); + // STEP 6: Deploy the GeneralDelegateManagerFactory + [P_GeneralPermissionManagerFactory] = await deployGPMAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, web3.utils.toWei("500")); + + // Deploy Modules + [I_CountTransferManagerFactory] = await deployCountTMAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, 0); + + [I_VolumeRestrictionTransferManagerFactory] = await deployLockupVolumeRTMAndVerified(account_polymath, I_MRProxied, I_PolyToken.address, 0); + + [I_PercentageTransferManagerFactory] = await deployPercentageTMAndVerified(account_polymath, I_MRProxied, I_PolyToken.address, 0); + + [I_ManualApprovalTransferManagerFactory] = await deployManualApprovalTMAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, 0); + + // Printing all the contract addresses + console.log(` + --------------------- Polymath Network Smart Contracts: --------------------- + PolymathRegistry: ${I_PolymathRegistry.address} + SecurityTokenRegistryProxy: ${I_SecurityTokenRegistryProxy.address} + SecurityTokenRegistry: ${I_SecurityTokenRegistry.address} + ModuleRegistryProxy ${I_ModuleRegistryProxy.address} + ModuleRegistry: ${I_ModuleRegistry.address} + FeatureRegistry: ${I_FeatureRegistry.address} + + STFactory: ${I_STFactory.address} + GeneralTransferManagerFactory: ${I_GeneralTransferManagerFactory.address} + GeneralPermissionManagerFactory: ${I_GeneralPermissionManagerFactory.address} + ----------------------------------------------------------------------------- + `); + }); + + describe("Generate the SecurityToken", async () => { + it("Should register the ticker before the generation of the security token", async () => { + await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); + let tx = await I_STRProxied.registerTicker(token_owner, symbol, contact, { from: token_owner }); + assert.equal(tx.logs[0].args._owner, token_owner); + assert.equal(tx.logs[0].args._ticker, symbol.toUpperCase()); + }); + + it("Should generate the new security token with the same symbol as registered above", async () => { + await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); + let _blockNo = latestBlock(); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + + // Verify the successful generation of the security token + assert.equal(tx.logs[1].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); + + I_SecurityToken = SecurityToken.at(tx.logs[1].args._securityTokenAddress); + + const log = await promisifyLogWatch(I_SecurityToken.ModuleAdded({ from: _blockNo }), 1); + + // Verify that GeneralTransferManager module get added successfully or not + assert.equal(log.args._types[0].toNumber(), 2); + assert.equal(web3.utils.toAscii(log.args._name).replace(/\u0000/g, ""), "GeneralTransferManager"); + }); + + it("Should intialize the auto attached modules", async () => { + let moduleData = (await I_SecurityToken.getModulesByType(2))[0]; + I_GeneralTransferManager = GeneralTransferManager.at(moduleData); + }); + + it("Should successfully attach the General permission manager factory with the security token -- failed because Token is not paid", async () => { + let errorThrown = false; + await I_PolyToken.getTokens(web3.utils.toWei("500", "ether"), token_owner); + await catchRevert( + I_SecurityToken.addModule(P_GeneralPermissionManagerFactory.address, "0x", web3.utils.toWei("500", "ether"), 0, { from: token_owner }) + ); + }); + + it("Should successfully attach the General permission manager factory with the security token", async () => { + let snapId = await takeSnapshot(); + await I_PolyToken.transfer(I_SecurityToken.address, web3.utils.toWei("500", "ether"), { from: token_owner }); + const tx = await I_SecurityToken.addModule( + P_GeneralPermissionManagerFactory.address, + "0x", + web3.utils.toWei("500", "ether"), + 0, + { from: token_owner } + ); + assert.equal(tx.logs[3].args._types[0].toNumber(), delegateManagerKey, "General Permission Manager doesn't get deployed"); + assert.equal( + web3.utils.toAscii(tx.logs[3].args._name).replace(/\u0000/g, ""), + "GeneralPermissionManager", + "GeneralPermissionManagerFactory module was not added" + ); + P_GeneralPermissionManager = GeneralPermissionManager.at(tx.logs[3].args._module); + await revertToSnapshot(snapId); + }); + + it("Should successfully attach the General permission manager factory with the security token", async () => { + const tx = await I_SecurityToken.addModule(I_GeneralPermissionManagerFactory.address, "0x", 0, 0, { from: token_owner }); + assert.equal(tx.logs[2].args._types[0].toNumber(), delegateManagerKey, "General Permission Manager doesn't get deployed"); + assert.equal( + web3.utils.toAscii(tx.logs[2].args._name).replace(/\u0000/g, ""), + "GeneralPermissionManager", + "GeneralPermissionManagerFactory module was not added" + ); + I_GeneralPermissionManager = GeneralPermissionManager.at(tx.logs[2].args._module); + }); + }); + + describe("fuzz test for general transfer manager", async () => { + + it("should pass fuzz test for changeIssuanceAddress(), changeSigningAddress() ", async () => { + + console.log("1"); + // fuzz test loop over total times of testRepeat, inside each loop, we use a variable j to randomly choose an account out of the 10 default accounts + for (var i = 2; i < testRepeat; i++) { + var j = Math.floor(Math.random() * 10); + if (j === 1 || j === 0) { j = 2 }; // exclude account 1 & 0 because they might come with default perms + + // add account as a Delegate if it is not + if (await I_GeneralPermissionManager.checkDelegate(accounts[j]) !== true) { + await I_GeneralPermissionManager.addDelegate(accounts[j], _details, { from: token_owner }); + } + + // target permission should alaways be false for each test before assigning + if (await I_GeneralPermissionManager.checkPermission(accounts[j], I_GeneralTransferManager.address, 'FLAGS') === true) { + await I_GeneralPermissionManager.changePermission(accounts[j], I_GeneralTransferManager.address, 'FLAGS', false, { from: token_owner }); + } else if (await I_GeneralPermissionManager.checkPermission(accounts[j], I_GeneralTransferManager.address, 'WHITELIST') === true) { + await I_GeneralPermissionManager.changePermission(accounts[j], I_GeneralTransferManager.address, 'WHITELIST', false, { from: token_owner }); + } + + // assign a random perm + let randomPerms = perms[Math.floor(Math.random() * Math.floor(totalPerms))]; + let fromTime = latestTime(); + let toTime = latestTime() + duration.days(20); + let expiryTime = toTime + duration.days(10); + + await I_GeneralPermissionManager.changePermission(accounts[j], I_GeneralTransferManager.address, randomPerms, true, { from: token_owner }); + + let currentAllowAllTransferStats = await I_GeneralTransferManager.allowAllTransfers(); + let currentAllowAllWhitelistTransfersStats = await I_GeneralTransferManager.allowAllWhitelistTransfers(); + let currentAllowAllWhitelistIssuancesStats = await I_GeneralTransferManager.allowAllWhitelistIssuances(); + let currentAllowAllBurnTransfersStats = await I_GeneralTransferManager.allowAllBurnTransfers(); + console.log("2"); + // let userPerm = await I_GeneralPermissionManager.checkPermission(accounts[j], I_GeneralTransferManager.address, 'FLAGS'); + if (randomPerms === 'FLAGS') { + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " about to start") + await I_GeneralTransferManager.changeIssuanceAddress( accounts[j], { from: accounts[j] }); + assert.equal(await I_GeneralTransferManager.issuanceAddress(), accounts[j]); + + await I_GeneralTransferManager.changeSigningAddress( accounts[j], { from: accounts[j] }); + assert.equal(await I_GeneralTransferManager.signingAddress(), accounts[j]); + + await I_GeneralTransferManager.changeAllowAllTransfers(!currentAllowAllTransferStats, { from: accounts[j] }); + assert.equal(await I_GeneralTransferManager.allowAllTransfers(), !currentAllowAllTransferStats); + + await I_GeneralTransferManager.changeAllowAllWhitelistTransfers(!currentAllowAllWhitelistTransfersStats, { from: accounts[j] }); + assert.equal(await I_GeneralTransferManager.allowAllWhitelistTransfers(), !currentAllowAllWhitelistTransfersStats); + + await I_GeneralTransferManager.changeAllowAllWhitelistIssuances(!currentAllowAllWhitelistIssuancesStats, { from: accounts[j] }); + assert.equal(await I_GeneralTransferManager.allowAllWhitelistIssuances(), !currentAllowAllWhitelistIssuancesStats); + + await I_GeneralTransferManager.changeAllowAllBurnTransfers(!currentAllowAllBurnTransfersStats, { from: accounts[j] }); + assert.equal(await I_GeneralTransferManager.allowAllBurnTransfers(), !currentAllowAllBurnTransfersStats); + + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " for functions with require perm FLAGS passed") + } else { + await catchRevert(I_GeneralTransferManager.changeIssuanceAddress( accounts[j], { from: accounts[j] })); + await catchRevert(I_GeneralTransferManager.changeSigningAddress( accounts[j], { from: accounts[j] })); + await catchRevert(I_GeneralTransferManager.changeAllowAllTransfers( !currentAllowAllTransferStats, { from: accounts[j] })); + await catchRevert(I_GeneralTransferManager.changeAllowAllWhitelistTransfers( !currentAllowAllWhitelistTransfersStats, { from: accounts[j] })); + await catchRevert(I_GeneralTransferManager.changeAllowAllWhitelistIssuances( !currentAllowAllWhitelistIssuancesStats, { from: accounts[j] })); + await catchRevert(I_GeneralTransferManager.changeAllowAllBurnTransfers( !currentAllowAllBurnTransfersStats, { from: accounts[j] })); + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " for functions require perm FLAGS failed as expected"); + } + + console.log("3"); + if (randomPerms === 'WHITELIST') { + let tx = await I_GeneralTransferManager.modifyWhitelist(accounts[j], fromTime, toTime, expiryTime, 1, { from: accounts[j] }); + assert.equal(tx.logs[0].args._investor, accounts[j]); + console.log("3.1"); + let tx2 = await I_GeneralTransferManager.modifyWhitelistMulti([accounts[3], accounts[4]], [fromTime, fromTime], [toTime, toTime], [expiryTime, expiryTime], [1, 1], { from: accounts[j] }); + console.log(tx2.logs[1].args); + assert.equal(tx2.logs[1].args._investor, accounts[4]); + console.log("3.2"); + } else { + console.log("3.3"); + await catchRevert(I_GeneralTransferManager.modifyWhitelist(accounts[j], fromTime, toTime, expiryTime, 1, { from: accounts[j] })); + console.log("3.4"); + await catchRevert(I_GeneralTransferManager.modifyWhitelistMulti([accounts[3], accounts[4]], [fromTime, fromTime], [toTime, toTime], [expiryTime, expiryTime], [1, 1], { from: accounts[j] })); + console.log("3.5"); + } + } + console.log("4"); + await I_GeneralTransferManager.changeIssuanceAddress("0x0000000000000000000000000000000000000000", { from: token_owner }); + }) + }); + + describe("fuzz test for count transfer manager", async () => { + + it("Should successfully attach the CountTransferManager with the security token", async () => { + const tx = await I_SecurityToken.addModule(I_CountTransferManagerFactory.address, bytesSTO, 0, 0, { from: token_owner }); + assert.equal(tx.logs[2].args._types[0].toNumber(), transferManagerKey, "CountTransferManager doesn't get deployed"); + assert.equal( + web3.utils.toAscii(tx.logs[2].args._name).replace(/\u0000/g, ""), + "CountTransferManager", + "CountTransferManager module was not added" + ); + I_CountTransferManager = CountTransferManager.at(tx.logs[2].args._module); + }); + + it("should pass fuzz test for changeHolderCount()", async () => { + // fuzz test loop over total times of testRepeat, inside each loop, we use a variable j to randomly choose an account out of the 10 default accounts + for (var i = 2; i < testRepeat; i++) { + var j = Math.floor(Math.random() * 10); + if (j === 1 || j === 0) { j = 2 }; // exclude account 1 & 0 because they might come with default perms + + // add account as a Delegate if it is not + if (await I_GeneralPermissionManager.checkDelegate(accounts[j]) !== true) { + await I_GeneralPermissionManager.addDelegate(accounts[j], _details, { from: token_owner }); + } + + // target permission should alaways be false for each test before assigning + if (await I_GeneralPermissionManager.checkPermission(accounts[j], I_CountTransferManager.address, 'ADMIN') === true) { + await I_GeneralPermissionManager.changePermission(accounts[j], I_CountTransferManager.address, 'ADMIN', false, { from: token_owner }); + } + + // assign a random perm + let randomPerms = perms[Math.floor(Math.random() * Math.floor(totalPerms))]; + await I_GeneralPermissionManager.changePermission(accounts[j], I_CountTransferManager.address, randomPerms, true, { from: token_owner }); + if (randomPerms === 'ADMIN') { + // console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " should pass"); + await I_CountTransferManager.changeHolderCount(i + 1, { from: accounts[j] }); + assert.equal((await I_CountTransferManager.maxHolderCount()).toNumber(), i + 1); + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " passed"); + } else { + // console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " should failed"); + await catchRevert(I_CountTransferManager.changeHolderCount(i+1, { from: accounts[j] })); + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " failed as expected"); + } + } + }); + }); + + + describe("fuzz test for percentage transfer manager", async () => { + + // PercentageTransferManager details + const holderPercentage = 70 * 10**16; // Maximum number of token holders + + let bytesSTO = web3.eth.abi.encodeFunctionCall({ + name: 'configure', + type: 'function', + inputs: [{ + type: 'uint256', + name: '_maxHolderPercentage' + },{ + type: 'bool', + name: '_allowPrimaryIssuance' + } + ] + }, [holderPercentage, false]); + + it("Should successfully attach the percentage transfer manager with the security token", async () => { + console.log("1"); + const tx = await I_SecurityToken.addModule(I_PercentageTransferManagerFactory.address, bytesSTO, 0, 0, { from: token_owner }); + I_PercentageTransferManager = PercentageTransferManager.at(tx.logs[2].args._module); + }); + + it("should pass fuzz test for modifyWhitelist with perm WHITELIST", async () => { + // fuzz test loop over total times of testRepeat, inside each loop, we use a variable j to randomly choose an account out of the 10 default accounts + for (var i = 2; i < testRepeat; i++) { + var j = Math.floor(Math.random() * 10); + if (j === 1 || j === 0) { j = 2 }; // exclude account 1 & 0 because they might come with default perms + + // add account as a Delegate if it is not + if (await I_GeneralPermissionManager.checkDelegate(accounts[j]) !== true) { + await I_GeneralPermissionManager.addDelegate(accounts[j], _details, { from: token_owner }); + } + + // target permission should alaways be false for each test before assigning + if (await I_GeneralPermissionManager.checkPermission(accounts[j], I_PercentageTransferManager.address, 'WHITELIST') === true) { + await I_GeneralPermissionManager.changePermission(accounts[j], I_PercentageTransferManager.address, 'WHITELIST', false, { from: token_owner }); + } + + // assign a random perm + let randomPerms = perms[Math.floor(Math.random() * Math.floor(totalPerms))]; + await I_GeneralPermissionManager.changePermission(accounts[j], I_PercentageTransferManager.address, randomPerms, true, { from: token_owner }); + + //try add multi lock ups + if (randomPerms === 'WHITELIST') { + // console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " should pass"); + await I_PercentageTransferManager.modifyWhitelist(account_investor3, 1, { from: accounts[j] }); + console.log("Test number " + i + " with account " + j + " and perm WHITELIST passed as expected"); + } else { + // console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " should failed"); + await catchRevert(I_PercentageTransferManager.modifyWhitelist(account_investor3, 1, { from: accounts[j] })); + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " failed as expected"); + } + } + }); + + it("should pass fuzz test for modifyWhitelistMulti with perm WHITELIST", async () => { + // fuzz test loop over total times of testRepeat, inside each loop, we use a variable j to randomly choose an account out of the 10 default accounts + for (var i = 2; i < testRepeat; i++) { + var j = Math.floor(Math.random() * 10); + if (j === 1 || j === 0) { j = 2 }; // exclude account 1 & 0 because they might come with default perms + + // add account as a Delegate if it is not + if (await I_GeneralPermissionManager.checkDelegate(accounts[j]) !== true) { + await I_GeneralPermissionManager.addDelegate(accounts[j], _details, { from: token_owner }); + } + + // target permission should alaways be false for each test before assigning + if (await I_GeneralPermissionManager.checkPermission(accounts[j], I_PercentageTransferManager.address, 'WHITELIST') === true) { + await I_GeneralPermissionManager.changePermission(accounts[j], I_PercentageTransferManager.address, 'WHITELIST', false, { from: token_owner }); + } + + // assign a random perm + let randomPerms = perms[Math.floor(Math.random() * Math.floor(totalPerms))]; + await I_GeneralPermissionManager.changePermission(accounts[j], I_PercentageTransferManager.address, randomPerms, true, { from: token_owner }); + + if (randomPerms === 'WHITELIST') { + // console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " should pass"); + await I_PercentageTransferManager.modifyWhitelistMulti([account_investor3, account_investor4], [0, 1], { from: accounts[j] }); + console.log("Test number " + i + " with account " + j + " and perm WHITELIST passed as expected"); + + } else { + // console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " should failed"); + await catchRevert( I_PercentageTransferManager.modifyWhitelistMulti([account_investor3, account_investor4], [0, 1], { from: accounts[j] })); + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " failed as expected"); + } + } + }); + + it("should pass fuzz test for setAllowPrimaryIssuance with perm ADMIN", async () => { + + // let snapId = await takeSnapshot(); + // fuzz test loop over total times of testRepeat, inside each loop, we use a variable j to randomly choose an account out of the 10 default accounts + for (var i = 2; i < testRepeat; i++) { + + var j = Math.floor(Math.random() * 10); + if (j === 1 || j === 0) { j = 2 }; // exclude account 1 & 0 because they might come with default perms + + // add account as a Delegate if it is not + if (await I_GeneralPermissionManager.checkDelegate(accounts[j]) !== true) { + await I_GeneralPermissionManager.addDelegate(accounts[j], _details, { from: token_owner }); + } + + // target permission should alaways be false for each test before assigning + if (await I_GeneralPermissionManager.checkPermission(accounts[j], I_PercentageTransferManager.address, 'ADMIN') === true) { + await I_GeneralPermissionManager.changePermission(accounts[j], I_PercentageTransferManager.address, 'ADMIN', false, { from: token_owner }); + } + + // assign a random perm + let randomPerms = perms[Math.floor(Math.random() * Math.floor(totalPerms))]; + await I_GeneralPermissionManager.changePermission(accounts[j], I_PercentageTransferManager.address, randomPerms, true, { from: token_owner }); + + let primaryIssuanceStat = await I_PercentageTransferManager.allowPrimaryIssuance({ from: token_owner }); + + if (randomPerms === 'ADMIN') { + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " should pass"); + await I_PercentageTransferManager.setAllowPrimaryIssuance(!primaryIssuanceStat, { from: accounts[j] }); + console.log("Test number " + i + " with account " + j + " and perm ADMIN passed as expected"); + + } else { + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " should failed"); + await catchRevert( I_PercentageTransferManager.setAllowPrimaryIssuance(!primaryIssuanceStat, { from: accounts[j] })); + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " failed as expected"); + } + // await revertToSnapshot(snapId); + } + }); + }); + + + describe("fuzz test for manual approval transfer manager", async () => { + + it("Should successfully attach the ManualApprovalTransferManager with the security token", async () => { + const tx = await I_SecurityToken.addModule(I_ManualApprovalTransferManagerFactory.address, "", 0, 0, { from: token_owner }); + assert.equal(tx.logs[2].args._types[0].toNumber(), transferManagerKey, "ManualApprovalTransferManager doesn't get deployed"); + assert.equal( + web3.utils.toUtf8(tx.logs[2].args._name), + "ManualApprovalTransferManager", + "ManualApprovalTransferManager module was not added" + ); + I_ManualApprovalTransferManager = ManualApprovalTransferManager.at(tx.logs[2].args._module); + }); + + it("should pass fuzz test for addManualApproval & revokeManualApproval with perm TRANSFER_APPROVAL", async () => { + + let tx; + // fuzz test loop over total times of testRepeat, inside each loop, we use a variable j to randomly choose an account out of the 10 default accounts + for (var i = 2; i < testRepeat; i++) { + + let snapId = await takeSnapshot(); + + + var j = Math.floor(Math.random() * 10); + if (j === 1 || j === 0) { j = 2 }; // exclude account 1 & 0 because they might come with default perms + + // add account as a Delegate if it is not + if (await I_GeneralPermissionManager.checkDelegate(accounts[j]) !== true) { + await I_GeneralPermissionManager.addDelegate(accounts[j], _details, { from: token_owner }); + } + + // target permission should alaways be false for each test before assigning + if (await I_GeneralPermissionManager.checkPermission(accounts[j], I_ManualApprovalTransferManager.address, 'TRANSFER_APPROVAL') === true) { + await I_GeneralPermissionManager.changePermission(accounts[j], I_ManualApprovalTransferManager.address, 'TRANSFER_APPROVAL', false, { from: token_owner }); + } + + // assign a random perm + let randomPerms = perms[Math.floor(Math.random() * Math.floor(totalPerms))]; + await I_GeneralPermissionManager.changePermission(accounts[j], I_ManualApprovalTransferManager.address, randomPerms, true, { from: token_owner }); + + if (randomPerms === "TRANSFER_APPROVAL" ) { + console.log("Test number " + i + " with account " + j + " and perm TRANSFER_APPROVAL " + " should pass"); + await I_ManualApprovalTransferManager.addManualApproval( + account_investor1, + account_investor4, + web3.utils.toWei("2", "ether"), + latestTime() + duration.days(1), + { from: accounts[j] } + ); + + console.log("2"); + tx = await I_ManualApprovalTransferManager.revokeManualApproval(account_investor1, account_investor4, { + from: accounts[j] + }); + assert.equal(tx.logs[0].args._from, account_investor1); + assert.equal(tx.logs[0].args._to, account_investor4); + assert.equal(tx.logs[0].args._addedBy, accounts[j]); + + console.log("3"); + console.log("Test number " + i + " with account " + j + " and perm TRANSFER_APPROVAL passed as expected"); + } else { + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " should failed"); + await catchRevert( + I_ManualApprovalTransferManager.addManualApproval( + account_investor1, + account_investor4, + web3.utils.toWei("2", "ether"), + latestTime() + duration.days(1), + { from: accounts[j] } + ) + ); + + await I_ManualApprovalTransferManager.addManualApproval( + account_investor1, + account_investor4, + web3.utils.toWei("2", "ether"), + latestTime() + duration.days(1), + { from: token_owner } + ); + + await catchRevert(I_ManualApprovalTransferManager.revokeManualApproval(account_investor1, account_investor4, { + from: accounts[j] + }) + ); + + + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " failed as expected"); + } + + await revertToSnapshot(snapId); + }; + + + }); + + it("should pass fuzz test for addManualBlocking and revokeManualBlocking with perm TRANSFER_APPROVAL", async () => { + console.log("1"); + await I_ManualApprovalTransferManager.addManualBlocking(account_investor1, account_investor2, latestTime() + duration.days(1), { + from: token_owner + }); + console.log("2"); + await I_ManualApprovalTransferManager.revokeManualBlocking(account_investor1, account_investor2, { from: token_owner }); + console.log("3"); + + // fuzz test loop over total times of testRepeat, inside each loop, we use a variable j to randomly choose an account out of the 10 default accounts + for (var i = 2; i < testRepeat; i++) { + + let snapId = await takeSnapshot(); + + var j = Math.floor(Math.random() * 10); + if (j === 1 || j === 0) { j = 2 }; // exclude account 1 & 0 because they might come with default perms + + // add account as a Delegate if it is not + if (await I_GeneralPermissionManager.checkDelegate(accounts[j]) !== true) { + await I_GeneralPermissionManager.addDelegate(accounts[j], _details, { from: token_owner }); + } + + // target permission should alaways be false for each test before assigning + if (await I_GeneralPermissionManager.checkPermission(accounts[j], I_ManualApprovalTransferManager.address, 'TRANSFER_APPROVAL') === true) { + await I_GeneralPermissionManager.changePermission(accounts[j], I_ManualApprovalTransferManager.address, 'TRANSFER_APPROVAL', false, { from: token_owner }); + } + + // assign a random perm + let randomPerms = perms[Math.floor(Math.random() * Math.floor(totalPerms))]; + await I_GeneralPermissionManager.changePermission(accounts[j], I_ManualApprovalTransferManager.address, randomPerms, true, { from: token_owner }); + + if (randomPerms === "TRANSFER_APPROVAL") { + console.log("Test number " + i + " with account " + j + " and perm TRANSFER_APPROVAL " + " should pass"); + await I_ManualApprovalTransferManager.addManualBlocking(account_investor1, account_investor2, latestTime() + duration.days(1), { + from: accounts[j] + }); + + console.log("2"); + await I_ManualApprovalTransferManager.revokeManualBlocking(account_investor1, account_investor2, { from: accounts[j] }); + + console.log("Test number " + i + " with account " + j + " and perm TRANSFER_APPROVAL passed as expected"); + } else { + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " should failed"); + await catchRevert( + I_ManualApprovalTransferManager.addManualBlocking(account_investor1, account_investor2, latestTime() + duration.days(1), { + from: accounts[j] + }) + ); + + await I_ManualApprovalTransferManager.addManualBlocking(account_investor1, account_investor2, latestTime() + duration.days(1), { + from: token_owner + }); + + await catchRevert( + I_ManualApprovalTransferManager.revokeManualBlocking(account_investor1, account_investor2, { from: accounts[j] }) + ); + + console.log("Test number " + i + " with account " + j + " and perm " + randomPerms + " failed as expected"); + } + + await revertToSnapshot(snapId); + }; + }); + }); + +}); From 343b43208f337ca5e07696f54a4ba90f0aa2944c Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 3 Dec 2018 19:35:48 -0300 Subject: [PATCH 138/139] modifyWhitelistMulti for PercentageTM --- CLI/commands/common/csv_shared.js | 82 ------------------- CLI/commands/common/csv_sync.js | 39 --------- CLI/commands/transfer_manager.js | 28 ++++++- .../Transfer/PercentageTM/whitelist_data.csv | 10 +++ 4 files changed, 37 insertions(+), 122 deletions(-) delete mode 100644 CLI/commands/common/csv_shared.js delete mode 100644 CLI/commands/common/csv_sync.js create mode 100644 CLI/data/Transfer/PercentageTM/whitelist_data.csv diff --git a/CLI/commands/common/csv_shared.js b/CLI/commands/common/csv_shared.js deleted file mode 100644 index 471db13d1..000000000 --- a/CLI/commands/common/csv_shared.js +++ /dev/null @@ -1,82 +0,0 @@ -var contracts = require('../helpers/contract_addresses'); -var abis = require('../helpers/contract_abis'); -var csv = require('./csv_sync'); - -let BATCH_SIZE = 70; - -async function startScript(tokenSymbol, batchSize) { - if (batchSize) { - BATCH_SIZE = batchSize; - } - let STAddress = await checkST(tokenSymbol); - return new web3.eth.Contract(abis.securityToken(), STAddress); -}; - -async function checkST(tokenSymbol) { - let securityTokenRegistry = await STConnect(); - - return await securityTokenRegistry.methods.getSecurityTokenAddress(tokenSymbol).call({}, function (error, result) { - if (result != "0x0000000000000000000000000000000000000000") { - return result - } else { - console.log("Token doesn't exist") - process.exit(0) - } - }); -} - -async function STConnect() { - try { - let STRegistryAddress = await contracts.securityTokenRegistry(); - let STRegistry = new web3.eth.Contract(abis.securityTokenRegistry(), STRegistryAddress); - return STRegistry; - } catch (err) { - console.log("There was a problem getting the contracts. Make sure they are deployed to the selected network."); - process.exit(0); - } -} - -async function readScript(file, processing) { - let allocData = new Array(); - let distribData = new Array(); - let fullFileData = new Array(); - let badData = new Array(); - let i = 0; - - var CSV_STRING = csv(file); - - CSV_STRING.forEach(line => { - let data_processed = processing(line); - fullFileData.push(data_processed[1]); - - if (data_processed[0]) { - allocData.push(data_processed[1]); - i++; - if (i >= BATCH_SIZE) { - distribData.push(allocData); - allocData = []; - i = 0; - } - } else { - badData.push(data_processed[1]); - } - }); - - distribData.push(allocData); - allocData = []; - - return { - distribData: distribData, - fullFileData: fullFileData, - badData: badData - } -} - -module.exports = { - start: async (tokenSymbol, batchSize) => { - return await startScript(tokenSymbol, batchSize); - }, - read: async (file, processing) => { - return await readScript(file, processing); - } -} \ No newline at end of file diff --git a/CLI/commands/common/csv_sync.js b/CLI/commands/common/csv_sync.js deleted file mode 100644 index 6955a2445..000000000 --- a/CLI/commands/common/csv_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var fs = require('fs'); - -function load(filename, options) { - var content = fs.readFileSync(filename, 'utf-8'); - var lines = content.split('\n'); - var splitToColumns = options && check.fn(options.getColumns) ? options.getColumns : getColumns; - var results = []; - - lines.forEach(function (line, index) { - if (!line) { - return; - } - - var obj = []; - var values = stripQuotes(splitToColumns(line, index)); - - values.forEach(function (value) { - obj.push(value) - }); - - results.push(obj); - }); - - return results; -} - -function getColumns(line) { - var columns = line.split(','); - return columns; -} - -function stripQuotes(words) { - return words.map(function (word) { - word = word.trim(); - return word.replace(/"/g, ''); - }); -} - -module.exports = load; diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index 79eae49f4..e56233466 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -10,6 +10,7 @@ const csvParse = require('./helpers/csv'); /////////////////// // Constants const WHITELIST_DATA_CSV = './CLI/data/Transfer/GTM/whitelist_data.csv'; +const PERCENTAGE_WHITELIST_DATA_CSV = './CLI/data/Transfer/PercentageTM/whitelist_data.csv'; // App flow let tokenSymbol; @@ -518,7 +519,7 @@ async function modifyWhitelistInBatch() { console.log(`Batch ${batch + 1} - Attempting to modify whitelist to accounts: \n\n`, investorArray[batch], '\n'); let action = await currentTransferManager.methods.modifyWhitelistMulti(investorArray[batch], fromTimesArray[batch], toTimesArray[batch], expiryTimeArray[batch], canBuyFromSTOArray[batch]); let receipt = await common.sendTransaction(action); - console.log(chalk.green('Whitelist transaction was successful.')); + console.log(chalk.green('Modify whitelist transaction was successful.')); console.log(`${receipt.gasUsed} gas used.Spent: ${web3.utils.fromWei((new web3.utils.BN(receipt.gasUsed)).mul(new web3.utils.BN(defaultGasPrice)))} ETH`); } } @@ -785,6 +786,31 @@ async function percentageTransferManager() { } break; case 'Modify whitelist from CSV': + let csvFilePath = readlineSync.question(`Enter the path for csv data file (${PERCENTAGE_WHITELIST_DATA_CSV}): `, { + defaultInput: PERCENTAGE_WHITELIST_DATA_CSV + }); + let batchSize = readlineSync.question(`Enter the max number of records per transaction or batch size (${gbl.constants.DEFAULT_BATCH_SIZE}): `, { + limit: function (input) { + return parseInt(input) > 0; + }, + limitMessage: 'Must be greater than 0', + defaultInput: gbl.constants.DEFAULT_BATCH_SIZE + }); + let parsedData = csvParse(csvFilePath); + let validData = parsedData.filter(row => web3.utils.isAddress(row[0]) && typeof row[1] === 'boolean'); + let invalidRows = parsedData.filter(row => !validData.includes(row)); + if (invalidRows.length > 0) { + console.log(chalk.red(`The following lines from csv file are not valid: ${invalidRows.map(r => parsedData.indexOf(r) + 1).join(',')}`)); + } + let batches = common.splitIntoBatches(validData, batchSize); + let [investorArray, isWhitelistedArray] = common.transposeBatches(batches); + for (let batch = 0; batch < batches.length; batch++) { + console.log(`Batch ${batch + 1} - Attempting to modify whitelist accounts:\n\n`, investorArray[batch], '\n'); + let action = await currentTransferManager.methods.modifyWhitelistMulti(investorArray[batch], isWhitelistedArray[batch]); + let receipt = await common.sendTransaction(action); + console.log(chalk.green('Modify whitelist transaction was successful.')); + console.log(`${receipt.gasUsed} gas used. Spent: ${web3.utils.fromWei((new web3.utils.BN(receipt.gasUsed)).mul(new web3.utils.BN(defaultGasPrice)))} ETH`); + } break; case 'Allow primary issuance': case 'Disallow primary issuance': diff --git a/CLI/data/Transfer/PercentageTM/whitelist_data.csv b/CLI/data/Transfer/PercentageTM/whitelist_data.csv new file mode 100644 index 000000000..19d7f163c --- /dev/null +++ b/CLI/data/Transfer/PercentageTM/whitelist_data.csv @@ -0,0 +1,10 @@ +0xee7ae74d964f2be7d72c1b187b38e2ed3615d4d1,true +0x2f0fd672bf222413cc69dc1f4f1d7e93ad1763a1,true +0xac297053173b02b02a737d47f7b4a718e5b170ef,true +0x49fc0b78238dab644698a90fa351b4c749e123d2,true +0x10223927009b8add0960359dd90d1449415b7ca9,true +0x3c65cfe3de848cf38e9d76e9c3e57a2f1140b399,true +0xabf60de3265b3017db7a1be66fc8b364ec1dbb98,true +0xb841fe5a89da1bbef2d0805fbd7ffcbbb2fca5e3,false +0x56be93088141b16ebaa9416122fd1d928da25ecf,false +0xbb276b6f68f0a41d54b7e0a608fe8eb1ebdee7b0,false \ No newline at end of file From 3dba7bdd01ce453d7b2112d902781a4dc2017b66 Mon Sep 17 00:00:00 2001 From: Adam Dossa Date: Wed, 5 Dec 2018 08:33:46 -0500 Subject: [PATCH 139/139] Optimise GTM (#443) * WIP * WIP * Fixes * Update config * Log gas for 50 txs * WIP * update * Fix tests * Fix typo * Change onWhitelist logic * Update changelog * Update all test cases * Add whitelist optimization * Make Dividend modules proxies * Updates * minor cleanup * make script dynamic * Keep ABI constant * Fixes * Update change log * Updates * add require statement in factory constructors * remove the test cases for the STVRTM * Return investor data in getAllInvestorsData * CLI changes according GTM optimizations * Bump versions * version changes * Update CHANGELOG.md --- CHANGELOG.md | 16 +- CLI/commands/transfer_manager.js | 68 +- CLI/package.json | 1 + CLI/yarn.lock | 85 +- .../modules/Checkpoint/DividendCheckpoint.sol | 37 +- .../Checkpoint/DividendCheckpointStorage.sol | 43 + .../Checkpoint/ERC20DividendCheckpoint.sol | 39 +- .../ERC20DividendCheckpointFactory.sol | 13 +- .../ERC20DividendCheckpointStorage.sol | 11 + .../Checkpoint/EtherDividendCheckpoint.sol | 25 +- .../EtherDividendCheckpointFactory.sol | 13 +- contracts/modules/Module.sol | 20 +- contracts/modules/ModuleStorage.sol | 30 + .../GeneralTransferManager.sol | 171 ++- .../GeneralTransferManagerFactory.sol | 16 +- .../GeneralTransferManagerStorage.sol | 53 + .../ManualApprovalTransferManagerFactory.sol | 2 +- .../proxy/ERC20DividendCheckpointProxy.sol | 31 + .../proxy/EtherDividendCheckpointProxy.sol | 30 + .../proxy/GeneralTransferManagerProxy.sol | 30 + contracts/proxy/OwnedProxy.sol | 91 ++ migrations/2_deploy_contracts.js | 24 +- package.json | 1 + scripts/compareStorageLayout.js | 139 ++ test/b_capped_sto.js | 2 +- test/e_erc20_dividends.js | 6 +- test/f_ether_dividends.js | 4 +- test/h_general_transfer_manager.js | 124 +- test/helpers/createInstances.js | 32 +- test/j_manual_approval_transfer_manager.js | 2 +- test/l_percentage_transfer_manager.js | 2 +- test/p_usd_tiered_sto.js | 6 +- test/q_usd_tiered_sto_sim.js | 2 +- test/r_concurrent_STO.js | 4 +- test/u_module_registry_proxy.js | 5 +- test/v_tracked_redemptions.js | 2 +- ...kup_volume_restriction_transfer_manager.js | 8 +- yarn.lock | 1247 +---------------- 38 files changed, 1067 insertions(+), 1368 deletions(-) create mode 100644 contracts/modules/Checkpoint/DividendCheckpointStorage.sol create mode 100644 contracts/modules/Checkpoint/ERC20DividendCheckpointStorage.sol create mode 100644 contracts/modules/ModuleStorage.sol create mode 100644 contracts/modules/TransferManager/GeneralTransferManagerStorage.sol create mode 100644 contracts/proxy/ERC20DividendCheckpointProxy.sol create mode 100644 contracts/proxy/EtherDividendCheckpointProxy.sol create mode 100644 contracts/proxy/GeneralTransferManagerProxy.sol create mode 100644 contracts/proxy/OwnedProxy.sol create mode 100644 scripts/compareStorageLayout.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bd254564..562d7c4f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,14 +16,26 @@ All notable changes to this project will be documented in this file. * Added `getTokensSoldByTier` to return sold (not minted during finalisation) tokens in each tier to USDTSTO. * Removed individual mappings for tier data removed in UDSTSTO. +## GeneralTransferManager +* `getInvestors`, `getAllInvestorsData`, `getInvestorsData` added to GTM to allow easy data queries. +* `modifyDefaults(uint64 _defaultFromTime, uint64 _defaultToTime)` added which sets a default timestamp used when `fromTime` or `toTime` are 0 +* Add `address[] public investors` to record a list of all addresses that have been added to the whitelist (`getInvestors`). +* General Transfer Manager: Fix for when `allowAllWhitelistIssuances` is FALSE +* General Transfer Manager: Make GTM a Proxy based implementation to reduce deployment gas costs +* Changed the version of `GeneralTransferManagerFactory` from `1.0.0` to `2.1.0`. + ## Manual Approval TransferManager * Removed `0x0` check for the `_from` address to `ManualApprovalTransferManager`. This allows for the Issuer/Transfer Agent to approve a one-off mint of tokens that otherwise would not be possible. -* Changed the version of `ManualApprovalTransferManagerFactory` from `1.0.0` to `2.0.1`. +* Changed the version of `ManualApprovalTransferManagerFactory` from `1.0.0` to `2.1.0`. * Deployed 2.0.1 `ManualApprovalTransferManagerFactory` to address 0x6af2afad53cb334e62b90ddbdcf3a086f654c298 +## Dividends +* Changed the version of `ERC20DividendCheckpointFactory` & `EtherDividendCheckpointFactory` from `1.0.0` to `2.1.0`. +* Applied proxy pattern to Dividends modules + ## Changed * `getAllModulesAndPermsFromTypes()` does not take securityToken address as a parameter anymore. - + # v1.5.0 - Release Candidate diff --git a/CLI/commands/transfer_manager.js b/CLI/commands/transfer_manager.js index dd92864df..4d551e05c 100644 --- a/CLI/commands/transfer_manager.js +++ b/CLI/commands/transfer_manager.js @@ -6,6 +6,7 @@ const contracts = require('./helpers/contract_addresses'); const abis = require('./helpers/contract_abis'); const gbl = require('./common/global'); const csvParse = require('./helpers/csv'); +const { table } = require('table') /////////////////// // Constants @@ -328,6 +329,8 @@ async function generalTransferManager() { let displayAllowAllWhitelistTransfers = await currentTransferManager.methods.allowAllWhitelistTransfers().call(); let displayAllowAllWhitelistIssuances = await currentTransferManager.methods.allowAllWhitelistIssuances().call(); let displayAllowAllBurnTransfers = await currentTransferManager.methods.allowAllBurnTransfers().call(); + let displayDefaults = await currentTransferManager.methods.defaults().call(); + let displayInvestors = await currentTransferManager.methods.getInvestors().call(); console.log(`- Issuance address: ${displayIssuanceAddress}`); console.log(`- Signing address: ${displaySigningAddress}`); @@ -335,10 +338,19 @@ async function generalTransferManager() { console.log(`- Allow all whitelist transfers: ${displayAllowAllWhitelistTransfers ? `YES` : `NO`}`); console.log(`- Allow all whitelist issuances: ${displayAllowAllWhitelistIssuances ? `YES` : `NO`}`); console.log(`- Allow all burn transfers: ${displayAllowAllBurnTransfers ? `YES` : `NO`}`); + console.log(`- Default times:`); + console.log(` - From time: ${displayDefaults.fromTime} (${moment.unix(displayDefaults.fromTime).format('MMMM Do YYYY, HH:mm:ss')})`); + console.log(` - To time: ${displayDefaults.toTime} (${moment.unix(displayDefaults.toTime).format('MMMM Do YYYY, HH:mm:ss')})`); + console.log(`- Investors: ${displayInvestors.length}`); // ------------------ - let options = ['Check whitelist', 'Modify whitelist', 'Modify whitelist from CSV', /*'Modify Whitelist Signed',*/ - `Change issuance address`, 'Change signing address']; + let options = []; + if (displayInvestors.length > 0) { + options.push(`Show investors`, `Show whitelist data`); + } + options.push('Modify whitelist', 'Modify whitelist from CSV', /*'Modify Whitelist Signed',*/ + 'Change the default times used when they are zero', `Change issuance address`, 'Change signing address'); + if (displayAllowAllTransfers) { options.push('Disallow all transfers'); } else { @@ -364,18 +376,33 @@ async function generalTransferManager() { let optionSelected = options[index]; console.log('Selected:', index != -1 ? optionSelected : 'Return', '\n'); switch (optionSelected) { - case 'Check whitelist': - let investorToCheck = readlineSync.question('Enter the address you want to check: ', { + case `Show investors`: + console.log('***** List of investors on whitelist *****'); + displayInvestors.map(i => console.log(i)); + break; + case `Show whitelist data`: + let investorsToShow = readlineSync.question(`Enter the addresses of the investors you want to show (i.e: addr1,addr2,addr3) or leave empty to show them all: `, { limit: function (input) { - return web3.utils.isAddress(input); + return input === '' || input.split(",").every(a => web3.utils.isAddress(a)); }, - limitMessage: "Must be a valid address" + limitMessage: `All addresses must be valid` }); - let timeRestriction = await currentTransferManager.methods.whitelist(investorToCheck).call(); - console.log(`Sale lockup: ${moment.unix(timeRestriction.fromTime).format('MMMM Do YYYY, HH:mm:ss')}`); - console.log(`Buy lockup: ${moment.unix(timeRestriction.toTime).format('MMMM Do YYYY, HH:mm:ss')}`); - console.log(`KYC expiry time: ${moment.unix(timeRestriction.expiryTime).format('MMMM Do YYYY, HH:mm:ss')}`); - console.log(`Restricted investor: ${timeRestriction.canBuyFromSTO ? 'YES' : 'NO'} `); + if (investorsToShow === '') { + let whitelistData = await currentTransferManager.methods.getAllInvestorsData().call(); + showWhitelistTable(whitelistData[0], whitelistData[1], whitelistData[2], whitelistData[3], whitelistData[4]); + } else { + let investorsArray = investorsToShow.split(','); + let whitelistData = await currentTransferManager.methods.getInvestorsData(investorsArray).call(); + showWhitelistTable(investorsArray, whitelistData[0], whitelistData[1], whitelistData[2], whitelistData[3]); + } + break; + case 'Change the default times used when they are zero': + let fromTimeDefault = readlineSync.questionInt(`Enter the default time (Unix Epoch time) used when fromTime is zero: `); + let toTimeDefault = readlineSync.questionInt(`Enter the default time (Unix Epoch time) used when fromTime is zero: `); + let changeDefaultsAction = currentTransferManager.methods.changeDefaults(fromTimeDefault, toTimeDefault); + let changeDefaultsReceipt = await common.sendTransaction(changeDefaultsAction); + let changeDefaultsEvent = common.getEventFromLogs(currentTransferManager._jsonInterface, changeDefaultsReceipt.logs, 'ChangeDefaults'); + console.log(chalk.green(`Default times have been updated successfully!`)); break; case 'Modify whitelist': let investor = readlineSync.question('Enter the address to whitelist: ', { @@ -490,6 +517,21 @@ async function generalTransferManager() { } } +function showWhitelistTable(investorsArray, fromTimeArray, toTimeArray, expiryTimeArray, canBuyFromSTOArray) { + let dataTable = [['Investor', 'From time', 'To time', 'KYC expiry date', 'Restricted']]; + for (let i = 0; i < investorsArray.length; i++) { + dataTable.push([ + investorsArray[i], + moment.unix(fromTimeArray[i]).format('MM/DD/YYYY HH:mm'), + moment.unix(toTimeArray[i]).format('MM/DD/YYYY HH:mm'), + moment.unix(expiryTimeArray[i]).format('MM/DD/YYYY HH:mm'), + canBuyFromSTOArray[i] ? 'YES' : 'NO' + ]); + } + console.log(); + console.log(table(dataTable)); +} + async function modifyWhitelistInBatch() { let csvFilePath = readlineSync.question(`Enter the path for csv data file (${WHITELIST_DATA_CSV}): `, { defaultInput: WHITELIST_DATA_CSV @@ -553,8 +595,8 @@ async function manualApprovalTransferManager() { let manualApproval = await getManualApproval(from, to); if (manualApproval) { console.log(`Manual approval found!`); - console.log(`Allowance: ${web3.utils.fromWei(manualApproval.allowance)} `); - console.log(`Expiry time: ${moment.unix(manualApproval.expiryTime).format('MMMM Do YYYY, HH:mm:ss')}; `) + console.log(`Allowance: ${web3.utils.fromWei(manualApproval.allowance)}`); + console.log(`Expiry time: ${moment.unix(manualApproval.expiryTime).format('MMMM Do YYYY, HH:mm:ss')}`); } else { console.log(chalk.yellow(`There are no manual approvals from ${from} to ${to}.`)); } diff --git a/CLI/package.json b/CLI/package.json index 64fb2a221..4dfcbf3a4 100644 --- a/CLI/package.json +++ b/CLI/package.json @@ -17,6 +17,7 @@ "readline-sync": "^1.4.9", "request": "^2.88.0", "request-promise": "^4.2.2", + "table": "^5.1.1", "web3": "1.0.0-beta.35" } } diff --git a/CLI/yarn.lock b/CLI/yarn.lock index 51925f5ef..91ef48a56 100644 --- a/CLI/yarn.lock +++ b/CLI/yarn.lock @@ -30,7 +30,22 @@ ajv@^5.3.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" -ansi-styles@^3.2.1: +ajv@^6.6.1: + version "6.6.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.6.1.tgz#6360f5ed0d80f232cc2b294c362d5dc2e538dd61" + integrity sha512-ZoJjft5B+EJBjUyu9C9Hc0OZyPZSSlOF+plzouTrg6UlA8f+e/n8NIgBFG/9tppJtpPWfthHakK7juJdNDODww== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -68,6 +83,11 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + async-limiter@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" @@ -741,6 +761,11 @@ fast-deep-equal@^1.0.0: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -1042,6 +1067,11 @@ is-callable@^1.1.3: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + is-function@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" @@ -1120,6 +1150,11 @@ json-schema-traverse@^0.3.0: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" @@ -1155,7 +1190,7 @@ keccakjs@^0.2.1: browserify-sha3 "^0.0.1" sha3 "^1.1.0" -lodash@^4.13.1: +lodash@^4.13.1, lodash@^4.17.11: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== @@ -1496,6 +1531,11 @@ punycode@^1.4.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + qs@6.5.2, qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" @@ -1749,6 +1789,15 @@ simple-get@^2.7.0: once "^1.3.1" simple-concat "^1.0.0" +slice-ansi@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.0.0.tgz#5373bdb8559b45676e8541c66916cdd6251612e7" + integrity sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + sshpk@^1.7.0: version "1.15.1" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.15.1.tgz#b79a089a732e346c6e0714830f36285cd38191a2" @@ -1784,6 +1833,14 @@ strict-uri-encode@^1.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= +string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -1791,6 +1848,13 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + strip-dirs@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5" @@ -1831,6 +1895,16 @@ swarm-js@0.1.37: tar.gz "^1.0.5" xhr-request-promise "^0.1.2" +table@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/table/-/table-5.1.1.tgz#92030192f1b7b51b6eeab23ed416862e47b70837" + integrity sha512-NUjapYb/qd4PeFW03HnAuOJ7OMcBkJlqeClWxeNlQ0lXGSb52oZXGzkO0/I0ARegQ2eUT1g2VDJH0eUxDRcHmw== + dependencies: + ajv "^6.6.1" + lodash "^4.17.11" + slice-ansi "2.0.0" + string-width "^2.1.1" + tar-stream@^1.5.2: version "1.6.2" resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" @@ -1956,6 +2030,13 @@ unpipe@1.0.0, unpipe@~1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + url-parse-lax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" diff --git a/contracts/modules/Checkpoint/DividendCheckpoint.sol b/contracts/modules/Checkpoint/DividendCheckpoint.sol index 452a48b13..3a345af25 100644 --- a/contracts/modules/Checkpoint/DividendCheckpoint.sol +++ b/contracts/modules/Checkpoint/DividendCheckpoint.sol @@ -8,6 +8,7 @@ pragma solidity ^0.4.24; import "./ICheckpoint.sol"; +import "./DividendCheckpointStorage.sol"; import "../Module.sol"; import "../../interfaces/ISecurityToken.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; @@ -17,43 +18,9 @@ import "openzeppelin-solidity/contracts/math/Math.sol"; * @title Checkpoint module for issuing ether dividends * @dev abstract contract */ -contract DividendCheckpoint is ICheckpoint, Module { +contract DividendCheckpoint is DividendCheckpointStorage, ICheckpoint, Module { using SafeMath for uint256; - uint256 public EXCLUDED_ADDRESS_LIMIT = 50; - bytes32 public constant DISTRIBUTE = "DISTRIBUTE"; - bytes32 public constant MANAGE = "MANAGE"; - bytes32 public constant CHECKPOINT = "CHECKPOINT"; - - struct Dividend { - uint256 checkpointId; - uint256 created; // Time at which the dividend was created - uint256 maturity; // Time after which dividend can be claimed - set to 0 to bypass - uint256 expiry; // Time until which dividend can be claimed - after this time any remaining amount can be withdrawn by issuer - - // set to very high value to bypass - uint256 amount; // Dividend amount in WEI - uint256 claimedAmount; // Amount of dividend claimed so far - uint256 totalSupply; // Total supply at the associated checkpoint (avoids recalculating this) - bool reclaimed; // True if expiry has passed and issuer has reclaimed remaining dividend - uint256 dividendWithheld; - uint256 dividendWithheldReclaimed; - mapping (address => bool) claimed; // List of addresses which have claimed dividend - mapping (address => bool) dividendExcluded; // List of addresses which cannot claim dividends - bytes32 name; // Name/title - used for identification - } - - // List of all dividends - Dividend[] public dividends; - - // List of addresses which cannot claim dividends - address[] public excluded; - - // Mapping from address to withholding tax as a percentage * 10**16 - mapping (address => uint256) public withholdingTax; - - // Total amount of ETH withheld per investor - mapping (address => uint256) public investorWithheld; - event SetDefaultExcludedAddresses(address[] _excluded, uint256 _timestamp); event SetWithholding(address[] _investors, uint256[] _withholding, uint256 _timestamp); event SetWithholdingFixed(address[] _investors, uint256 _withholding, uint256 _timestamp); diff --git a/contracts/modules/Checkpoint/DividendCheckpointStorage.sol b/contracts/modules/Checkpoint/DividendCheckpointStorage.sol new file mode 100644 index 000000000..4cf1f2838 --- /dev/null +++ b/contracts/modules/Checkpoint/DividendCheckpointStorage.sol @@ -0,0 +1,43 @@ +pragma solidity ^0.4.24; + +/** + * @title Holds the storage variable for the DividendCheckpoint modules (i.e ERC20, Ether) + * @dev abstract contract + */ +contract DividendCheckpointStorage { + + uint256 public EXCLUDED_ADDRESS_LIMIT = 50; + bytes32 public constant DISTRIBUTE = "DISTRIBUTE"; + bytes32 public constant MANAGE = "MANAGE"; + bytes32 public constant CHECKPOINT = "CHECKPOINT"; + + struct Dividend { + uint256 checkpointId; + uint256 created; // Time at which the dividend was created + uint256 maturity; // Time after which dividend can be claimed - set to 0 to bypass + uint256 expiry; // Time until which dividend can be claimed - after this time any remaining amount can be withdrawn by issuer - + // set to very high value to bypass + uint256 amount; // Dividend amount in WEI + uint256 claimedAmount; // Amount of dividend claimed so far + uint256 totalSupply; // Total supply at the associated checkpoint (avoids recalculating this) + bool reclaimed; // True if expiry has passed and issuer has reclaimed remaining dividend + uint256 dividendWithheld; + uint256 dividendWithheldReclaimed; + mapping (address => bool) claimed; // List of addresses which have claimed dividend + mapping (address => bool) dividendExcluded; // List of addresses which cannot claim dividends + bytes32 name; // Name/title - used for identification + } + + // List of all dividends + Dividend[] public dividends; + + // List of addresses which cannot claim dividends + address[] public excluded; + + // Mapping from address to withholding tax as a percentage * 10**16 + mapping (address => uint256) public withholdingTax; + + // Total amount of ETH withheld per investor + mapping (address => uint256) public investorWithheld; + +} diff --git a/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol b/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol index 1f7f25cd5..b779088f7 100644 --- a/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol +++ b/contracts/modules/Checkpoint/ERC20DividendCheckpoint.sol @@ -1,17 +1,16 @@ pragma solidity ^0.4.24; import "./DividendCheckpoint.sol"; +import "./ERC20DividendCheckpointStorage.sol"; import "../../interfaces/IOwnable.sol"; import "../../interfaces/IERC20.sol"; /** * @title Checkpoint module for issuing ERC20 dividends */ -contract ERC20DividendCheckpoint is DividendCheckpoint { +contract ERC20DividendCheckpoint is ERC20DividendCheckpointStorage, DividendCheckpoint { using SafeMath for uint256; - // Mapping to token address for each dividend - mapping (uint256 => address) public dividendTokens; event ERC20DividendDeposited( address indexed _depositor, uint256 _checkpointId, @@ -68,8 +67,8 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { address _token, uint256 _amount, bytes32 _name - ) - external + ) + external withPerm(MANAGE) { createDividendWithExclusions(_maturity, _expiry, _token, _amount, excluded, _name); @@ -133,16 +132,16 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { * @param _name Name/Title for identification */ function createDividendWithCheckpointAndExclusions( - uint256 _maturity, - uint256 _expiry, - address _token, - uint256 _amount, - uint256 _checkpointId, + uint256 _maturity, + uint256 _expiry, + address _token, + uint256 _amount, + uint256 _checkpointId, address[] _excluded, bytes32 _name - ) + ) public - withPerm(MANAGE) + withPerm(MANAGE) { _createDividendWithCheckpointAndExclusions(_maturity, _expiry, _token, _amount, _checkpointId, _excluded, _name); } @@ -158,15 +157,15 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { * @param _name Name/Title for identification */ function _createDividendWithCheckpointAndExclusions( - uint256 _maturity, - uint256 _expiry, - address _token, - uint256 _amount, - uint256 _checkpointId, + uint256 _maturity, + uint256 _expiry, + address _token, + uint256 _amount, + uint256 _checkpointId, address[] _excluded, bytes32 _name - ) - internal + ) + internal { ISecurityToken securityTokenInstance = ISecurityToken(securityToken); require(_excluded.length <= EXCLUDED_ADDRESS_LIMIT, "Too many addresses excluded"); @@ -210,7 +209,7 @@ contract ERC20DividendCheckpoint is DividendCheckpoint { } /** - * @notice Emits the ERC20DividendDeposited event. + * @notice Emits the ERC20DividendDeposited event. * Seperated into a different function as a workaround for stack too deep error */ function _emitERC20DividendDepositedEvent( diff --git a/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol b/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol index 5fd158c26..bae9913b8 100644 --- a/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol +++ b/contracts/modules/Checkpoint/ERC20DividendCheckpointFactory.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./ERC20DividendCheckpoint.sol"; +import "../../proxy/ERC20DividendCheckpointProxy.sol"; import "../ModuleFactory.sol"; /** @@ -8,22 +8,27 @@ import "../ModuleFactory.sol"; */ contract ERC20DividendCheckpointFactory is ModuleFactory { + address public logicContract; + /** * @notice Constructor * @param _polyAddress Address of the polytoken * @param _setupCost Setup cost of the module * @param _usageCost Usage cost of the module * @param _subscriptionCost Subscription cost of the module + * @param _logicContract Contract address that contains the logic related to `description` */ - constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public + constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost, address _logicContract) public ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost) { - version = "1.0.0"; + require(_logicContract != address(0), "Invalid logic contract"); + version = "2.1.0"; name = "ERC20DividendCheckpoint"; title = "ERC20 Dividend Checkpoint"; description = "Create ERC20 dividends for token holders at a specific checkpoint"; compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); + logicContract = _logicContract; } /** @@ -33,7 +38,7 @@ contract ERC20DividendCheckpointFactory is ModuleFactory { function deploy(bytes /* _data */) external returns(address) { if (setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "insufficent allowance"); - address erc20DividendCheckpoint = new ERC20DividendCheckpoint(msg.sender, address(polyToken)); + address erc20DividendCheckpoint = new ERC20DividendCheckpointProxy(msg.sender, address(polyToken), logicContract); /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(erc20DividendCheckpoint, getName(), address(this), msg.sender, setupCost, now); return erc20DividendCheckpoint; diff --git a/contracts/modules/Checkpoint/ERC20DividendCheckpointStorage.sol b/contracts/modules/Checkpoint/ERC20DividendCheckpointStorage.sol new file mode 100644 index 000000000..29401f8d9 --- /dev/null +++ b/contracts/modules/Checkpoint/ERC20DividendCheckpointStorage.sol @@ -0,0 +1,11 @@ +pragma solidity ^0.4.24; + +/** + * @title It holds the storage variables related to ERC20DividendCheckpoint module + */ +contract ERC20DividendCheckpointStorage { + + // Mapping to token address for each dividend + mapping (uint256 => address) public dividendTokens; + +} diff --git a/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol b/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol index 4def51468..f5a916818 100644 --- a/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol +++ b/contracts/modules/Checkpoint/EtherDividendCheckpoint.sol @@ -8,6 +8,7 @@ import "../../interfaces/IOwnable.sol"; */ contract EtherDividendCheckpoint is DividendCheckpoint { using SafeMath for uint256; + event EtherDividendDeposited( address indexed _depositor, uint256 _checkpointId, @@ -56,7 +57,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { uint256 _expiry, uint256 _checkpointId, bytes32 _name - ) + ) external payable withPerm(MANAGE) @@ -76,7 +77,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { uint256 _expiry, address[] _excluded, bytes32 _name - ) + ) public payable withPerm(MANAGE) @@ -94,10 +95,10 @@ contract EtherDividendCheckpoint is DividendCheckpoint { * @param _name Name/title for identification */ function createDividendWithCheckpointAndExclusions( - uint256 _maturity, - uint256 _expiry, - uint256 _checkpointId, - address[] _excluded, + uint256 _maturity, + uint256 _expiry, + uint256 _checkpointId, + address[] _excluded, bytes32 _name ) public @@ -116,12 +117,12 @@ contract EtherDividendCheckpoint is DividendCheckpoint { * @param _name Name/title for identification */ function _createDividendWithCheckpointAndExclusions( - uint256 _maturity, - uint256 _expiry, - uint256 _checkpointId, - address[] _excluded, + uint256 _maturity, + uint256 _expiry, + uint256 _checkpointId, + address[] _excluded, bytes32 _name - ) + ) internal { require(_excluded.length <= EXCLUDED_ADDRESS_LIMIT, "Too many addresses excluded"); @@ -169,7 +170,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint { */ function _payDividend(address _payee, Dividend storage _dividend, uint256 _dividendIndex) internal { (uint256 claim, uint256 withheld) = calculateDividend(_dividendIndex, _payee); - _dividend.claimed[_payee] = true; + _dividend.claimed[_payee] = true; uint256 claimAfterWithheld = claim.sub(withheld); if (claimAfterWithheld > 0) { /*solium-disable-next-line security/no-send*/ diff --git a/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol b/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol index 315760be1..712292d0a 100644 --- a/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol +++ b/contracts/modules/Checkpoint/EtherDividendCheckpointFactory.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./EtherDividendCheckpoint.sol"; +import "../../proxy/EtherDividendCheckpointProxy.sol"; import "../ModuleFactory.sol"; /** @@ -8,22 +8,27 @@ import "../ModuleFactory.sol"; */ contract EtherDividendCheckpointFactory is ModuleFactory { + address public logicContract; + /** * @notice Constructor * @param _polyAddress Address of the polytoken * @param _setupCost Setup cost of the module * @param _usageCost Usage cost of the module * @param _subscriptionCost Subscription cost of the module + * @param _logicContract Contract address that contains the logic related to `description` */ - constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public + constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost, address _logicContract) public ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost) { - version = "1.0.0"; + require(_logicContract != address(0), "Invalid logic contract"); + version = "2.1.0"; name = "EtherDividendCheckpoint"; title = "Ether Dividend Checkpoint"; description = "Create ETH dividends for token holders at a specific checkpoint"; compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); + logicContract = _logicContract; } /** @@ -33,7 +38,7 @@ contract EtherDividendCheckpointFactory is ModuleFactory { function deploy(bytes /* _data */) external returns(address) { if(setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "Insufficent allowance or balance"); - address ethDividendCheckpoint = new EtherDividendCheckpoint(msg.sender, address(polyToken)); + address ethDividendCheckpoint = new EtherDividendCheckpointProxy(msg.sender, address(polyToken), logicContract); /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(ethDividendCheckpoint, getName(), address(this), msg.sender, setupCost, now); return ethDividendCheckpoint; diff --git a/contracts/modules/Module.sol b/contracts/modules/Module.sol index 1e27d424e..1566a3428 100644 --- a/contracts/modules/Module.sol +++ b/contracts/modules/Module.sol @@ -2,33 +2,23 @@ pragma solidity ^0.4.24; import "../interfaces/IModule.sol"; import "../interfaces/ISecurityToken.sol"; -import "../interfaces/IERC20.sol"; +import "./ModuleStorage.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; /** * @title Interface that any module contract should implement * @notice Contract is abstract */ -contract Module is IModule { - - address public factory; - - address public securityToken; - - bytes32 public constant FEE_ADMIN = "FEE_ADMIN"; - - IERC20 public polyToken; +contract Module is IModule, ModuleStorage { /** * @notice Constructor * @param _securityToken Address of the security token * @param _polyAddress Address of the polytoken */ - constructor (address _securityToken, address _polyAddress) public { - require(_securityToken != address(0) && _polyAddress != address(0), "Invalid address"); - securityToken = _securityToken; - factory = msg.sender; - polyToken = IERC20(_polyAddress); + constructor (address _securityToken, address _polyAddress) public + ModuleStorage(_securityToken, _polyAddress) + { } //Allows owner, factory or permissioned delegate diff --git a/contracts/modules/ModuleStorage.sol b/contracts/modules/ModuleStorage.sol new file mode 100644 index 000000000..cd52c9de2 --- /dev/null +++ b/contracts/modules/ModuleStorage.sol @@ -0,0 +1,30 @@ +pragma solidity ^0.4.24; + +import "../interfaces/IERC20.sol"; + +/** + * @title Storage for Module contract + * @notice Contract is abstract + */ +contract ModuleStorage { + + /** + * @notice Constructor + * @param _securityToken Address of the security token + * @param _polyAddress Address of the polytoken + */ + constructor (address _securityToken, address _polyAddress) public { + securityToken = _securityToken; + factory = msg.sender; + polyToken = IERC20(_polyAddress); + } + + address public factory; + + address public securityToken; + + bytes32 public constant FEE_ADMIN = "FEE_ADMIN"; + + IERC20 public polyToken; + +} diff --git a/contracts/modules/TransferManager/GeneralTransferManager.sol b/contracts/modules/TransferManager/GeneralTransferManager.sol index 814d54d7b..12bfa72ca 100644 --- a/contracts/modules/TransferManager/GeneralTransferManager.sol +++ b/contracts/modules/TransferManager/GeneralTransferManager.sol @@ -1,47 +1,16 @@ pragma solidity ^0.4.24; import "./ITransferManager.sol"; +import "./GeneralTransferManagerStorage.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /** * @title Transfer Manager module for core transfer validation functionality */ -contract GeneralTransferManager is ITransferManager { +contract GeneralTransferManager is GeneralTransferManagerStorage, ITransferManager { using SafeMath for uint256; - //Address from which issuances come - address public issuanceAddress = address(0); - - //Address which can sign whitelist changes - address public signingAddress = address(0); - - bytes32 public constant WHITELIST = "WHITELIST"; - bytes32 public constant FLAGS = "FLAGS"; - - //from and to timestamps that an investor can send / receive tokens respectively - struct TimeRestriction { - uint256 fromTime; - uint256 toTime; - uint256 expiryTime; - bool canBuyFromSTO; - } - - // An address can only send / receive tokens once their corresponding uint256 > block.number - // (unless allowAllTransfers == true or allowAllWhitelistTransfers == true) - mapping (address => TimeRestriction) public whitelist; - // Map of used nonces by customer - mapping(address => mapping(uint256 => bool)) public nonceMap; - - //If true, there are no transfer restrictions, for any addresses - bool public allowAllTransfers = false; - //If true, time lock is ignored for transfers (address must still be on whitelist) - bool public allowAllWhitelistTransfers = false; - //If true, time lock is ignored for issuances (address must still be on whitelist) - bool public allowAllWhitelistIssuances = true; - //If true, time lock is ignored for burn transactions - bool public allowAllBurnTransfers = false; - // Emit when Issuance address get changed event ChangeIssuanceAddress(address _issuanceAddress); // Emit when there is change in the flag variable called allowAllTransfers @@ -55,6 +24,13 @@ contract GeneralTransferManager is ITransferManager { // Emit when there is change in the flag variable called signingAddress event ChangeSigningAddress(address _signingAddress); // Emit when investor details get modified related to their whitelisting + event ChangeDefaults(uint64 _defaultFromTime, uint64 _defaultToTime); + + // _fromTime is the time from which the _investor can send tokens + // _toTime is the time from which the _investor can receive tokens + // if allowAllWhitelistIssuances is TRUE, then _toTime is ignored when receiving tokens from the issuance address + // if allowAllWhitelistTransfers is TRUE, then _toTime and _fromTime is ignored when sending or receiving tokens + // in any case, any investor sending or receiving tokens, must have a _expiryTime in the future event ModifyWhitelist( address _investor, uint256 _dateAdded, @@ -83,6 +59,17 @@ contract GeneralTransferManager is ITransferManager { return bytes4(0); } + /** + * @notice Used to change the default times used when fromTime / toTime are zero + * @param _defaultFromTime default for zero fromTime + * @param _defaultToTime default for zero toTime + */ + function changeDefaults(uint64 _defaultFromTime, uint64 _defaultToTime) public withPerm(FLAGS) { + defaults.fromTime = _defaultFromTime; + defaults.toTime = _defaultToTime; + emit ChangeDefaults(_defaultFromTime, _defaultToTime); + } + /** * @notice Used to change the Issuance Address * @param _issuanceAddress new address for the issuance @@ -168,16 +155,25 @@ contract GeneralTransferManager is ITransferManager { //Anyone on the whitelist can transfer, regardless of time return (_onWhitelist(_to) && _onWhitelist(_from)) ? Result.VALID : Result.NA; } - if (allowAllWhitelistIssuances && _from == issuanceAddress) { - if (!whitelist[_to].canBuyFromSTO && _isSTOAttached()) { + + (uint64 adjustedFromTime, uint64 adjustedToTime) = _adjustTimes(whitelist[_from].fromTime, whitelist[_to].toTime); + if (_from == issuanceAddress) { + // Possible STO transaction, but investor not allowed to purchased from STO + if ((whitelist[_to].canBuyFromSTO == 0) && _isSTOAttached()) { return Result.NA; } - return _onWhitelist(_to) ? Result.VALID : Result.NA; + // if allowAllWhitelistIssuances is true, so time stamp ignored + if (allowAllWhitelistIssuances) { + return _onWhitelist(_to) ? Result.VALID : Result.NA; + } else { + return (_onWhitelist(_to) && (adjustedToTime <= uint64(now))) ? Result.VALID : Result.NA; + } } + //Anyone on the whitelist can transfer provided the blocknumber is large enough /*solium-disable-next-line security/no-block-members*/ - return ((_onWhitelist(_from) && whitelist[_from].fromTime <= now) && - (_onWhitelist(_to) && whitelist[_to].toTime <= now)) ? Result.VALID : Result.NA; /*solium-disable-line security/no-block-members*/ + return ((_onWhitelist(_from) && (adjustedFromTime <= uint64(now))) && + (_onWhitelist(_to) && (adjustedToTime <= uint64(now)))) ? Result.VALID : Result.NA; /*solium-disable-line security/no-block-members*/ } return Result.NA; } @@ -200,9 +196,35 @@ contract GeneralTransferManager is ITransferManager { public withPerm(WHITELIST) { - //Passing a _time == 0 into this function, is equivalent to removing the _investor from the whitelist - whitelist[_investor] = TimeRestriction(_fromTime, _toTime, _expiryTime, _canBuyFromSTO); - /*solium-disable-next-line security/no-block-members*/ + _modifyWhitelist(_investor, _fromTime, _toTime, _expiryTime, _canBuyFromSTO); + } + + /** + * @notice Adds or removes addresses from the whitelist. + * @param _investor is the address to whitelist + * @param _fromTime is the moment when the sale lockup period ends and the investor can freely sell his tokens + * @param _toTime is the moment when the purchase lockup period ends and the investor can freely purchase tokens from others + * @param _expiryTime is the moment till investors KYC will be validated. After that investor need to do re-KYC + * @param _canBuyFromSTO is used to know whether the investor is restricted investor or not. + */ + function _modifyWhitelist( + address _investor, + uint256 _fromTime, + uint256 _toTime, + uint256 _expiryTime, + bool _canBuyFromSTO + ) + internal + { + require(_investor != address(0), "Invalid investor"); + uint8 canBuyFromSTO = 0; + if (_canBuyFromSTO) { + canBuyFromSTO = 1; + } + if (whitelist[_investor].added == uint8(0)) { + investors.push(_investor); + } + whitelist[_investor] = TimeRestriction(uint64(_fromTime), uint64(_toTime), uint64(_expiryTime), canBuyFromSTO, uint8(1)); emit ModifyWhitelist(_investor, now, msg.sender, _fromTime, _toTime, _expiryTime, _canBuyFromSTO); } @@ -226,7 +248,7 @@ contract GeneralTransferManager is ITransferManager { require(_toTimes.length == _expiryTimes.length, "Mismatched input lengths"); require(_canBuyFromSTO.length == _toTimes.length, "Mismatched input length"); for (uint256 i = 0; i < _investors.length; i++) { - modifyWhitelist(_investors[i], _fromTimes[i], _toTimes[i], _expiryTimes[i], _canBuyFromSTO[i]); + _modifyWhitelist(_investors[i], _fromTimes[i], _toTimes[i], _expiryTimes[i], _canBuyFromSTO[i]); } } @@ -267,10 +289,7 @@ contract GeneralTransferManager is ITransferManager { abi.encodePacked(this, _investor, _fromTime, _toTime, _expiryTime, _canBuyFromSTO, _validFrom, _validTo, _nonce) ); _checkSig(hash, _v, _r, _s); - //Passing a _time == 0 into this function, is equivalent to removing the _investor from the whitelist - whitelist[_investor] = TimeRestriction(_fromTime, _toTime, _expiryTime, _canBuyFromSTO); - /*solium-disable-next-line security/no-block-members*/ - emit ModifyWhitelist(_investor, now, msg.sender, _fromTime, _toTime, _expiryTime, _canBuyFromSTO); + _modifyWhitelist(_investor, _fromTime, _toTime, _expiryTime, _canBuyFromSTO); } /** @@ -289,8 +308,7 @@ contract GeneralTransferManager is ITransferManager { * @param _investor Address of the investor */ function _onWhitelist(address _investor) internal view returns(bool) { - return (((whitelist[_investor].fromTime != 0) || (whitelist[_investor].toTime != 0)) && - (whitelist[_investor].expiryTime >= now)); /*solium-disable-line security/no-block-members*/ + return (whitelist[_investor].expiryTime >= uint64(now)); /*solium-disable-line security/no-block-members*/ } /** @@ -301,6 +319,63 @@ contract GeneralTransferManager is ITransferManager { return attached; } + /** + * @notice Internal function to adjust times using default values + */ + function _adjustTimes(uint64 _fromTime, uint64 _toTime) internal view returns(uint64, uint64) { + uint64 adjustedFromTime = _fromTime; + uint64 adjustedToTime = _toTime; + if (_fromTime == 0) { + adjustedFromTime = defaults.fromTime; + } + if (_toTime == 0) { + adjustedToTime = defaults.toTime; + } + return (adjustedFromTime, adjustedToTime); + } + + /** + * @dev Returns list of all investors + */ + function getInvestors() external view returns(address[]) { + return investors; + } + + /** + * @dev Returns list of all investors data + */ + function getAllInvestorsData() external view returns(address[], uint256[], uint256[], uint256[], bool[]) { + (uint256[] memory fromTimes, uint256[] memory toTimes, uint256[] memory expiryTimes, bool[] memory canBuyFromSTOs) + = _investorsData(investors); + return (investors, fromTimes, toTimes, expiryTimes, canBuyFromSTOs); + + } + + /** + * @dev Returns list of specified investors data + */ + function getInvestorsData(address[] _investors) external view returns(uint256[], uint256[], uint256[], bool[]) { + return _investorsData(_investors); + } + + function _investorsData(address[] _investors) internal view returns(uint256[], uint256[], uint256[], bool[]) { + uint256[] memory fromTimes = new uint256[](_investors.length); + uint256[] memory toTimes = new uint256[](_investors.length); + uint256[] memory expiryTimes = new uint256[](_investors.length); + bool[] memory canBuyFromSTOs = new bool[](_investors.length); + for (uint256 i = 0; i < _investors.length; i++) { + fromTimes[i] = whitelist[_investors[i]].fromTime; + toTimes[i] = whitelist[_investors[i]].toTime; + expiryTimes[i] = whitelist[_investors[i]].expiryTime; + if (whitelist[_investors[i]].canBuyFromSTO == 0) { + canBuyFromSTOs[i] = false; + } else { + canBuyFromSTOs[i] = true; + } + } + return (fromTimes, toTimes, expiryTimes, canBuyFromSTOs); + } + /** * @notice Return the permissions flag that are associated with general trnasfer manager */ diff --git a/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol b/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol index c15eb52aa..cffc61a32 100644 --- a/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/GeneralTransferManagerFactory.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./GeneralTransferManager.sol"; +import "../../proxy/GeneralTransferManagerProxy.sol"; import "../ModuleFactory.sol"; /** @@ -8,19 +8,27 @@ import "../ModuleFactory.sol"; */ contract GeneralTransferManagerFactory is ModuleFactory { + address public logicContract; + /** * @notice Constructor * @param _polyAddress Address of the polytoken + * @param _setupCost Setup cost of the module + * @param _usageCost Usage cost of the module + * @param _subscriptionCost Subscription cost of the module + * @param _logicContract Contract address that contains the logic related to `description` */ - constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public + constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost, address _logicContract) public ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost) { - version = "1.0.0"; + require(_logicContract != address(0), "Invalid logic contract"); + version = "2.1.0"; name = "GeneralTransferManager"; title = "General Transfer Manager"; description = "Manage transfers using a time based whitelist"; compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0)); + logicContract = _logicContract; } @@ -31,7 +39,7 @@ contract GeneralTransferManagerFactory is ModuleFactory { function deploy(bytes /* _data */) external returns(address) { if (setupCost > 0) require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom because of sufficent Allowance is not provided"); - address generalTransferManager = new GeneralTransferManager(msg.sender, address(polyToken)); + address generalTransferManager = new GeneralTransferManagerProxy(msg.sender, address(polyToken), logicContract); /*solium-disable-next-line security/no-block-members*/ emit GenerateModuleFromFactory(address(generalTransferManager), getName(), address(this), msg.sender, setupCost, now); return address(generalTransferManager); diff --git a/contracts/modules/TransferManager/GeneralTransferManagerStorage.sol b/contracts/modules/TransferManager/GeneralTransferManagerStorage.sol new file mode 100644 index 000000000..cca7b5dd1 --- /dev/null +++ b/contracts/modules/TransferManager/GeneralTransferManagerStorage.sol @@ -0,0 +1,53 @@ +pragma solidity ^0.4.24; + +/** + * @title Transfer Manager module for core transfer validation functionality + */ +contract GeneralTransferManagerStorage { + + //Address from which issuances come + address public issuanceAddress = address(0); + + //Address which can sign whitelist changes + address public signingAddress = address(0); + + bytes32 public constant WHITELIST = "WHITELIST"; + bytes32 public constant FLAGS = "FLAGS"; + + //from and to timestamps that an investor can send / receive tokens respectively + struct TimeRestriction { + uint64 fromTime; + uint64 toTime; + uint64 expiryTime; + uint8 canBuyFromSTO; + uint8 added; + } + + // Allows all TimeRestrictions to be offset + struct Defaults { + uint64 fromTime; + uint64 toTime; + } + + // Offset to be applied to all timings (except KYC expiry) + Defaults public defaults; + + // List of all addresses that have been added to the GTM at some point + address[] public investors; + + // An address can only send / receive tokens once their corresponding uint256 > block.number + // (unless allowAllTransfers == true or allowAllWhitelistTransfers == true) + mapping (address => TimeRestriction) public whitelist; + // Map of used nonces by customer + mapping(address => mapping(uint256 => bool)) public nonceMap; + + //If true, there are no transfer restrictions, for any addresses + bool public allowAllTransfers = false; + //If true, time lock is ignored for transfers (address must still be on whitelist) + bool public allowAllWhitelistTransfers = false; + //If true, time lock is ignored for issuances (address must still be on whitelist) + bool public allowAllWhitelistIssuances = true; + //If true, time lock is ignored for burn transactions + bool public allowAllBurnTransfers = false; + +} diff --git a/contracts/modules/TransferManager/ManualApprovalTransferManagerFactory.sol b/contracts/modules/TransferManager/ManualApprovalTransferManagerFactory.sol index 9c5513ee7..3fd33a39b 100644 --- a/contracts/modules/TransferManager/ManualApprovalTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/ManualApprovalTransferManagerFactory.sol @@ -18,7 +18,7 @@ contract ManualApprovalTransferManagerFactory is ModuleFactory { constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost) { - version = "2.0.1"; + version = "2.1.0"; name = "ManualApprovalTransferManager"; title = "Manual Approval Transfer Manager"; description = "Manage transfers using single approvals / blocking"; diff --git a/contracts/proxy/ERC20DividendCheckpointProxy.sol b/contracts/proxy/ERC20DividendCheckpointProxy.sol new file mode 100644 index 000000000..8839d30e1 --- /dev/null +++ b/contracts/proxy/ERC20DividendCheckpointProxy.sol @@ -0,0 +1,31 @@ +pragma solidity ^0.4.24; + +import "../modules/Checkpoint/ERC20DividendCheckpointStorage.sol"; +import "../modules/Checkpoint/DividendCheckpointStorage.sol"; +import "./OwnedProxy.sol"; +import "../Pausable.sol"; +import "../modules/ModuleStorage.sol"; + +/** + * @title Transfer Manager module for core transfer validation functionality + */ +contract ERC20DividendCheckpointProxy is ERC20DividendCheckpointStorage, DividendCheckpointStorage, ModuleStorage, Pausable, OwnedProxy { + + /** + * @notice Constructor + * @param _securityToken Address of the security token + * @param _polyAddress Address of the polytoken + * @param _implementation representing the address of the new implementation to be set + */ + constructor (address _securityToken, address _polyAddress, address _implementation) + public + ModuleStorage(_securityToken, _polyAddress) + { + require( + _implementation != address(0), + "Implementation address should not be 0x" + ); + __implementation = _implementation; + } + +} diff --git a/contracts/proxy/EtherDividendCheckpointProxy.sol b/contracts/proxy/EtherDividendCheckpointProxy.sol new file mode 100644 index 000000000..40b1c1332 --- /dev/null +++ b/contracts/proxy/EtherDividendCheckpointProxy.sol @@ -0,0 +1,30 @@ +pragma solidity ^0.4.24; + +import "../modules/Checkpoint/DividendCheckpointStorage.sol"; +import "./OwnedProxy.sol"; +import "../Pausable.sol"; +import "../modules/ModuleStorage.sol"; + +/** + * @title Transfer Manager module for core transfer validation functionality + */ +contract EtherDividendCheckpointProxy is DividendCheckpointStorage, ModuleStorage, Pausable, OwnedProxy { + + /** + * @notice Constructor + * @param _securityToken Address of the security token + * @param _polyAddress Address of the polytoken + * @param _implementation representing the address of the new implementation to be set + */ + constructor (address _securityToken, address _polyAddress, address _implementation) + public + ModuleStorage(_securityToken, _polyAddress) + { + require( + _implementation != address(0), + "Implementation address should not be 0x" + ); + __implementation = _implementation; + } + +} diff --git a/contracts/proxy/GeneralTransferManagerProxy.sol b/contracts/proxy/GeneralTransferManagerProxy.sol new file mode 100644 index 000000000..cb9b69070 --- /dev/null +++ b/contracts/proxy/GeneralTransferManagerProxy.sol @@ -0,0 +1,30 @@ +pragma solidity ^0.4.24; + +import "../modules/TransferManager/GeneralTransferManagerStorage.sol"; +import "./OwnedProxy.sol"; +import "../Pausable.sol"; +import "../modules/ModuleStorage.sol"; + +/** + * @title Transfer Manager module for core transfer validation functionality + */ +contract GeneralTransferManagerProxy is GeneralTransferManagerStorage, ModuleStorage, Pausable, OwnedProxy { + + /** + * @notice Constructor + * @param _securityToken Address of the security token + * @param _polyAddress Address of the polytoken + * @param _implementation representing the address of the new implementation to be set + */ + constructor (address _securityToken, address _polyAddress, address _implementation) + public + ModuleStorage(_securityToken, _polyAddress) + { + require( + _implementation != address(0), + "Implementation address should not be 0x" + ); + __implementation = _implementation; + } + +} diff --git a/contracts/proxy/OwnedProxy.sol b/contracts/proxy/OwnedProxy.sol new file mode 100644 index 000000000..b75142fbe --- /dev/null +++ b/contracts/proxy/OwnedProxy.sol @@ -0,0 +1,91 @@ +pragma solidity ^0.4.18; + +import "./Proxy.sol"; + +/** + * @title OwnedProxy + * @dev This contract combines an upgradeability proxy with basic authorization control functionalities + */ +contract OwnedProxy is Proxy { + + // Owner of the contract + address private __owner; + + // Address of the current implementation + address internal __implementation; + + /** + * @dev Event to show ownership has been transferred + * @param _previousOwner representing the address of the previous owner + * @param _newOwner representing the address of the new owner + */ + event ProxyOwnershipTransferred(address _previousOwner, address _newOwner); + + /** + * @dev Throws if called by any account other than the owner. + */ + modifier ifOwner() { + if (msg.sender == _owner()) { + _; + } else { + _fallback(); + } + } + + /** + * @dev the constructor sets the original owner of the contract to the sender account. + */ + constructor() public { + _setOwner(msg.sender); + } + + /** + * @dev Tells the address of the owner + * @return the address of the owner + */ + function _owner() internal view returns (address) { + return __owner; + } + + /** + * @dev Sets the address of the owner + */ + function _setOwner(address _newOwner) internal { + require(_newOwner != address(0), "Address should not be 0x"); + __owner = _newOwner; + } + + /** + * @notice Internal function to provide the address of the implementation contract + */ + function _implementation() internal view returns (address) { + return __implementation; + } + + /** + * @dev Tells the address of the proxy owner + * @return the address of the proxy owner + */ + function proxyOwner() external ifOwner returns (address) { + return _owner(); + } + + /** + * @dev Tells the address of the current implementation + * @return address of the current implementation + */ + function implementation() external ifOwner returns (address) { + return _implementation(); + } + + /** + * @dev Allows the current owner to transfer control of the contract to a newOwner. + * @param _newOwner The address to transfer ownership to. + */ + function transferProxyOwnership(address _newOwner) external ifOwner { + require(_newOwner != address(0), "Address should not be 0x"); + emit ProxyOwnershipTransferred(_owner(), _newOwner); + _setOwner(_newOwner); + } + +} diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index 694fdf03e..f25cfab35 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -1,9 +1,12 @@ const PolymathRegistry = artifacts.require('./PolymathRegistry.sol') const GeneralTransferManagerFactory = artifacts.require('./GeneralTransferManagerFactory.sol') +const GeneralTransferManagerLogic = artifacts.require('./GeneralTransferManager.sol') const GeneralPermissionManagerFactory = artifacts.require('./GeneralPermissionManagerFactory.sol') const PercentageTransferManagerFactory = artifacts.require('./PercentageTransferManagerFactory.sol') const USDTieredSTOProxyFactory = artifacts.require('./USDTieredSTOProxyFactory.sol'); const CountTransferManagerFactory = artifacts.require('./CountTransferManagerFactory.sol') +const EtherDividendCheckpointLogic = artifacts.require('./EtherDividendCheckpoint.sol') +const ERC20DividendCheckpointLogic = artifacts.require('./ERC20DividendCheckpoint.sol') const EtherDividendCheckpointFactory = artifacts.require('./EtherDividendCheckpointFactory.sol') const ERC20DividendCheckpointFactory = artifacts.require('./ERC20DividendCheckpointFactory.sol') const ModuleRegistry = artifacts.require('./ModuleRegistry.sol'); @@ -145,10 +148,22 @@ module.exports = function (deployer, network, accounts) { moduleRegistry = ModuleRegistry.at(ModuleRegistryProxy.address); // Add module registry to polymath registry return polymathRegistry.changeAddress("ModuleRegistry", ModuleRegistryProxy.address, {from: PolymathAccount}); + }).then(() => { + // B) Deploy the GeneralTransferManagerLogic Contract (Factory used to generate the GeneralTransferManager contract and this + // manager attach with the securityToken contract at the time of deployment) + return deployer.deploy(GeneralTransferManagerLogic, "0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", {from: PolymathAccount}); + }).then(() => { + // B) Deploy the GeneralTransferManagerLogic Contract (Factory used to generate the GeneralTransferManager contract and this + // manager attach with the securityToken contract at the time of deployment) + return deployer.deploy(ERC20DividendCheckpointLogic, "0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", {from: PolymathAccount}); + }).then(() => { + // B) Deploy the GeneralTransferManagerLogic Contract (Factory used to generate the GeneralTransferManager contract and this + // manager attach with the securityToken contract at the time of deployment) + return deployer.deploy(EtherDividendCheckpointLogic, "0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", {from: PolymathAccount}); }).then(() => { // B) Deploy the GeneralTransferManagerFactory Contract (Factory used to generate the GeneralTransferManager contract and this // manager attach with the securityToken contract at the time of deployment) - return deployer.deploy(GeneralTransferManagerFactory, PolyToken, 0, 0, 0, {from: PolymathAccount}); + return deployer.deploy(GeneralTransferManagerFactory, PolyToken, 0, 0, 0, GeneralTransferManagerLogic.address, {from: PolymathAccount}); }).then(() => { // C) Deploy the GeneralPermissionManagerFactory Contract (Factory used to generate the GeneralPermissionManager contract and // this manager attach with the securityToken contract at the time of deployment) @@ -164,11 +179,11 @@ module.exports = function (deployer, network, accounts) { }).then(() => { // D) Deploy the EtherDividendCheckpointFactory Contract (Factory used to generate the EtherDividendCheckpoint contract use // to provide the functionality of the dividend in terms of ETH) - return deployer.deploy(EtherDividendCheckpointFactory, PolyToken, 0, 0, 0, {from: PolymathAccount}); + return deployer.deploy(EtherDividendCheckpointFactory, PolyToken, 0, 0, 0, EtherDividendCheckpointLogic.address, {from: PolymathAccount}); }).then(() => { // D) Deploy the ERC20DividendCheckpointFactory Contract (Factory used to generate the ERC20DividendCheckpoint contract use // to provide the functionality of the dividend in terms of ERC20 token) - return deployer.deploy(ERC20DividendCheckpointFactory, PolyToken, 0, 0, 0, {from: PolymathAccount}); + return deployer.deploy(ERC20DividendCheckpointFactory, PolyToken, 0, 0, 0, ERC20DividendCheckpointLogic.address, {from: PolymathAccount}); }).then(() => { // D) Deploy the ManualApprovalTransferManagerFactory Contract (Factory used to generate the ManualApprovalTransferManager contract use // to manual approve the transfer that will overcome the other transfer restrictions) @@ -303,6 +318,7 @@ module.exports = function (deployer, network, accounts) { POLYOracle: ${POLYOracle} STFactory: ${STFactory.address} + GeneralTransferManagerLogic: ${GeneralTransferManagerLogic.address} GeneralTransferManagerFactory: ${GeneralTransferManagerFactory.address} GeneralPermissionManagerFactory: ${GeneralPermissionManagerFactory.address} @@ -313,6 +329,8 @@ module.exports = function (deployer, network, accounts) { CountTransferManagerFactory: ${CountTransferManagerFactory.address} PercentageTransferManagerFactory: ${PercentageTransferManagerFactory.address} ManualApprovalTransferManagerFactory: ${ManualApprovalTransferManagerFactory.address} + EtherDividendCheckpointLogic: ${EtherDividendCheckpointLogic.address} + ERC20DividendCheckpointLogic: ${ERC20DividendCheckpointLogic.address} EtherDividendCheckpointFactory: ${EtherDividendCheckpointFactory.address} ERC20DividendCheckpointFactory: ${ERC20DividendCheckpointFactory.address} --------------------------------------------------------------------------------- diff --git a/package.json b/package.json index ef2d76c38..58104d99b 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "ethers": "^3.0.15", "fs": "0.0.1-security", "openzeppelin-solidity": "1.10.0", + "prompt": "^1.0.0", "readline-sync": "^1.4.9", "request": "^2.88.0", "request-promise": "^4.2.2", diff --git a/scripts/compareStorageLayout.js b/scripts/compareStorageLayout.js new file mode 100644 index 000000000..c339bf095 --- /dev/null +++ b/scripts/compareStorageLayout.js @@ -0,0 +1,139 @@ +const fs = require('fs'); +const _ = require('underscore'); +const solc = require('solc'); +const prompt = require('prompt'); +const path = require('path'); +const util = require('util'); +const exec = util.promisify(require('child_process').exec); + +prompt.start(); + +prompt.get(['LogicContract', 'ProxyContract'], async(err, result) => { + + let logicContract; + let proxyContract; + + const fileList = walkSync('./contracts', []); + + let paths = findPath(result.LogicContract, result.ProxyContract, fileList); + + if (paths.length == 2) { + + console.log("Contracts exists \n"); + + await flatContracts(paths); + + if (path.basename(paths[0]) === result.LogicContract) { + logicContract = fs.readFileSync(`./flat/${path.basename(paths[0])}`, 'utf8'); + } else { + logicContract = fs.readFileSync(`./flat/${path.basename(paths[1])}`, 'utf8'); + } + if (path.basename(paths[0]) === result.ProxyContract) { + proxyContract = fs.readFileSync(`./flat/${path.basename(paths[0])}`, 'utf8'); + } else { + proxyContract = fs.readFileSync(`./flat/${path.basename(paths[1])}`, 'utf8'); + } + + let logicInput = { + 'contracts': logicContract + } + let proxyInput = { + 'contracts': proxyContract + } + + console.log(compareStorageLayouts(parseContract(logicInput), parseContract(proxyInput))); + + } else { + console.log("Contracts doesn't exists"); + } +}); + +function traverseAST(_input, _elements) { + if(_input.children) { + for(var i=0;i<_input.children.length;i++) { + traverseAST(_input.children[i], _elements); + } + } + _elements.push(_input); +} + +function compareStorageLayouts(logicLayout, proxyLayout) { + function makeComp(x) { + return [x.constant, x.name, x.stateVariable, x.storageLocation, x.type, x.value, x.visibility].join(':'); + } + // if(newLayout.length < oldLayout.length) return false; + for(var i=0; i < logicLayout.length; i++) { + const a = logicLayout[i].attributes; + const comp1 = makeComp(a) + console.log(comp1); + const b = proxyLayout[i].attributes; + const comp2 = makeComp(b); + console.log(comp2); + if(comp1 != comp2) { + return false; + } + } + return true; +} + +function parseContract(input) { + + var output = solc.compile({ sources: input }, 1, _.noop); + const elements = []; + const AST = output.sources.contracts.AST; + // console.log(AST); + traverseAST(AST, elements); + // console.log(elements); + + // filter out all Contract Definitions + const contractDefinitions = _.filter(elements, (e,i) => e.name == 'ContractDefinition'); + + // filter out all linearizedBaseContracts + // pick the last one as the last contract always has the full inheritance + const linearizedBaseContracts = _.last(_.map(contractDefinitions, e => e.attributes.linearizedBaseContracts)); + + // get all stateVariables + const stateVariables = _.filter(elements, e => e.attributes && e.attributes.stateVariable ) + + // group them by scope + const stateVariableMap = _.groupBy(stateVariables, e => e.attributes.scope); + + orderedStateVariables = _.reduceRight(linearizedBaseContracts, (a, b) => { + return a.concat(stateVariableMap[b] || []) + }, []); + return orderedStateVariables; +} + +var walkSync = function(dir, filelist) { + files = fs.readdirSync(dir); + filelist = filelist || []; + files.forEach(function(file) { + if (fs.statSync(path.join(dir, file)).isDirectory()) { + filelist = walkSync(path.join(dir, file), filelist); + } + else { + filelist.push(path.join(dir, file)); + } + }); + return filelist; +}; + +var findPath = function(logicContractName, proxyContractName, fileList) { + let paths = new Array(); + for (let i =0; i < fileList.length; i++) { + if ((logicContractName === path.basename(fileList[i]) || logicContractName === (path.basename(fileList[i])).split(".")[0]) || + (proxyContractName === path.basename(fileList[i]) || proxyContractName === (path.basename(fileList[i])).split(".")[0])) { + paths.push(fileList[i]); + } + } + return paths; +} + +async function flatContracts(_paths, _logic) { + let promises = new Array(); + for (let i = 0; i< _paths.length; i++) { + promises.push(await exec(`./node_modules/.bin/sol-merger ${_paths[i]} ./flat`)); + } + await Promise.all(promises); +} + diff --git a/test/b_capped_sto.js b/test/b_capped_sto.js index 539d91b26..4ab4c79fc 100644 --- a/test/b_capped_sto.js +++ b/test/b_capped_sto.js @@ -130,7 +130,7 @@ contract("CappedSTO", accounts => { // STEP 5: Deploy the GeneralDelegateManagerFactory [I_GeneralPermissionManagerFactory] = await deployGPMAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, 0); - + // STEP 6: Deploy the CappedSTOFactory I_CappedSTOFactory = await CappedSTOFactory.new(I_PolyToken.address, cappedSTOSetupCost, 0, 0, { from: token_owner }); diff --git a/test/e_erc20_dividends.js b/test/e_erc20_dividends.js index b832bcee2..96f27883b 100644 --- a/test/e_erc20_dividends.js +++ b/test/e_erc20_dividends.js @@ -89,7 +89,7 @@ contract("ERC20DividendCheckpoint", accounts => { account_investor4 = accounts[9]; account_temp = accounts[2]; account_manager = accounts[5]; - + // Step 1: Deploy the genral PM ecosystem let instances = await setUpPolymathNetwork(account_polymath, token_owner); @@ -970,7 +970,7 @@ contract("ERC20DividendCheckpoint", accounts => { let expiry = latestTime() + duration.days(10); let exclusions = [1]; let checkpointID = await I_SecurityToken.createCheckpoint.call({ from: token_owner }); - await I_SecurityToken.createCheckpoint({ from: token_owner }); + await I_SecurityToken.createCheckpoint({ from: token_owner }); await catchRevert(I_ERC20DividendCheckpoint.createDividendWithCheckpointAndExclusions( maturity, expiry, @@ -1105,7 +1105,7 @@ contract("ERC20DividendCheckpoint", accounts => { it("should get the exact details of the factory", async () => { assert.equal((await I_ERC20DividendCheckpointFactory.getSetupCost.call()).toNumber(), 0); assert.equal((await I_ERC20DividendCheckpointFactory.getTypes.call())[0], 4); - assert.equal(await I_ERC20DividendCheckpointFactory.version.call(), "1.0.0"); + assert.equal(await I_ERC20DividendCheckpointFactory.version.call(), "2.1.0"); assert.equal( web3.utils.toAscii(await I_ERC20DividendCheckpointFactory.getName.call()).replace(/\u0000/g, ""), "ERC20DividendCheckpoint", diff --git a/test/f_ether_dividends.js b/test/f_ether_dividends.js index b4e5bbf2b..6b7461629 100644 --- a/test/f_ether_dividends.js +++ b/test/f_ether_dividends.js @@ -851,7 +851,7 @@ contract("EtherDividendCheckpoint", accounts => { let expiry = latestTime() + duration.days(10); let exclusions = [1]; let checkpointID = await I_SecurityToken.createCheckpoint.call({ from: token_owner }); - await I_SecurityToken.createCheckpoint({ from: token_owner }); + await I_SecurityToken.createCheckpoint({ from: token_owner }); await catchRevert(I_EtherDividendCheckpoint.createDividendWithCheckpointAndExclusions( maturity, expiry, @@ -954,7 +954,7 @@ contract("EtherDividendCheckpoint", accounts => { it("should get the exact details of the factory", async () => { assert.equal((await I_EtherDividendCheckpointFactory.getSetupCost.call()).toNumber(), 0); assert.equal((await I_EtherDividendCheckpointFactory.getTypes.call())[0], 4); - assert.equal(await I_EtherDividendCheckpointFactory.version.call(), "1.0.0"); + assert.equal(await I_EtherDividendCheckpointFactory.version.call(), "2.1.0"); assert.equal( web3.utils.toAscii(await I_EtherDividendCheckpointFactory.getName.call()).replace(/\u0000/g, ""), "EtherDividendCheckpoint", diff --git a/test/h_general_transfer_manager.js b/test/h_general_transfer_manager.js index 3e060c288..76a9d5806 100644 --- a/test/h_general_transfer_manager.js +++ b/test/h_general_transfer_manager.js @@ -92,6 +92,7 @@ contract("GeneralTransferManager", accounts => { account_investor1 = accounts[8]; account_investor2 = accounts[9]; account_delegate = accounts[7]; + account_investor3 = accounts[5]; account_investor4 = accounts[6]; account_affiliates1 = accounts[3]; @@ -172,14 +173,14 @@ contract("GeneralTransferManager", accounts => { await catchRevert( I_SecurityToken.addModule(P_GeneralTransferManagerFactory.address, "", web3.utils.toWei("500"), 0, {from: account_issuer}) ); - }) + }); it("Should attach the paid GTM", async() => { let snap_id = await takeSnapshot(); await I_PolyToken.getTokens(web3.utils.toWei("500"), I_SecurityToken.address); await I_SecurityToken.addModule(P_GeneralTransferManagerFactory.address, "", web3.utils.toWei("500"), 0, {from: account_issuer}); await revertToSnapshot(snap_id); - }) + }); it("Should whitelist the affiliates before the STO attached", async () => { let tx = await I_GeneralTransferManager.modifyWhitelistMulti( @@ -195,6 +196,32 @@ contract("GeneralTransferManager", accounts => { ); assert.equal(tx.logs[0].args._investor, account_affiliates1); assert.equal(tx.logs[1].args._investor, account_affiliates2); + assert.deepEqual(await I_GeneralTransferManager.getInvestors.call(), [account_affiliates1, account_affiliates2]); + console.log(await I_GeneralTransferManager.getAllInvestorsData.call()); + console.log(await I_GeneralTransferManager.getInvestorsData.call([account_affiliates1, account_affiliates2])); + }); + + it("Should whitelist lots of addresses and check gas", async () => { + let mockInvestors = []; + for (let i = 0; i < 50; i++) { + mockInvestors.push("0x1000000000000000000000000000000000000000".substring(0,42-i.toString().length) + i.toString()); + } + + let times = range1(50); + let bools = rangeB(50); + let tx = await I_GeneralTransferManager.modifyWhitelistMulti( + mockInvestors, + times, + times, + times, + bools, + { + from: account_issuer, + gas: 7900000 + } + ); + console.log("Multi Whitelist x 50: " + tx.receipt.gasUsed); + assert.deepEqual(await I_GeneralTransferManager.getInvestors.call(), [account_affiliates1, account_affiliates2].concat(mockInvestors)); }); it("Should mint the tokens to the affiliates", async () => { @@ -320,7 +347,7 @@ contract("GeneralTransferManager", accounts => { it("Should fail in buying the tokens from the STO -- because amount is 0", async() => { await catchRevert( I_DummySTO.generateTokens(account_investor1, 0, { from: token_owner }) - ); + ); }); it("Should fail in buying the tokens from the STO -- because STO is paused", async() => { @@ -342,6 +369,90 @@ contract("GeneralTransferManager", accounts => { }); }); + describe("Buy tokens using on-chain whitelist and defaults", async () => { + // let snap_id; + + it("Should Buy the tokens", async () => { + // Add the Investor in to the whitelist + // snap_id = await takeSnapshot(); + let tx = await I_GeneralTransferManager.modifyWhitelist( + account_investor1, + 0, + 0, + latestTime() + duration.days(20), + true, + { + from: account_issuer, + gas: 6000000 + } + ); + + assert.equal( + tx.logs[0].args._investor.toLowerCase(), + account_investor1.toLowerCase(), + "Failed in adding the investor in whitelist" + ); + + tx = await I_GeneralTransferManager.modifyWhitelist( + account_investor2, + latestTime(), + latestTime(), + latestTime() + duration.days(20), + true, + { + from: account_issuer, + gas: 6000000 + } + ); + + assert.equal( + tx.logs[0].args._investor.toLowerCase(), + account_investor2.toLowerCase(), + "Failed in adding the investor in whitelist" + ); + + // Jump time + await increaseTime(5000); + + // Can transfer tokens + await I_SecurityToken.transfer(account_investor2, web3.utils.toWei("1", "ether"), {from: account_investor1}); + assert.equal((await I_SecurityToken.balanceOf(account_investor1)).toNumber(), web3.utils.toWei("1", "ether")); + assert.equal((await I_SecurityToken.balanceOf(account_investor1)).toNumber(), web3.utils.toWei("1", "ether")); + }); + + it("Add a from default and check transfers are disabled then enabled in the future", async () => { + let tx = await I_GeneralTransferManager.changeDefaults(latestTime() + duration.days(5), 0, {from: token_owner}); + await I_SecurityToken.transfer(account_investor1, web3.utils.toWei("1", "ether"), {from: account_investor2}); + await catchRevert(I_SecurityToken.transfer(account_investor2, web3.utils.toWei("1", "ether"), {from: account_investor1})); + await increaseTime(duration.days(5)); + await I_SecurityToken.transfer(account_investor2, web3.utils.toWei("1", "ether"), {from: account_investor1}); + }); + + it("Add a to default and check transfers are disabled then enabled in the future", async () => { + let tx = await I_GeneralTransferManager.changeDefaults(0, latestTime() + duration.days(5), {from: token_owner}); + await catchRevert(I_SecurityToken.transfer(account_investor1, web3.utils.toWei("1", "ether"), {from: account_investor2})); + await I_SecurityToken.transfer(account_investor2, web3.utils.toWei("1", "ether"), {from: account_investor1}); + await increaseTime(duration.days(5)); + await I_SecurityToken.transfer(account_investor1, web3.utils.toWei("2", "ether"), {from: account_investor2}); + // revert changes + await I_GeneralTransferManager.modifyWhitelist( + account_investor2, + 0, + 0, + 0, + false, + { + from: account_issuer, + gas: 6000000 + } + ); + await I_GeneralTransferManager.changeDefaults(0, 0, {from: token_owner}); + }); + + + + }); + describe("Buy tokens using off-chain whitelist", async () => { it("Should buy the tokens -- Failed due to investor is not in the whitelist", async () => { await catchRevert(I_DummySTO.generateTokens(account_investor2, web3.utils.toWei("1", "ether"), { from: token_owner })); @@ -690,7 +801,7 @@ contract("GeneralTransferManager", accounts => { [fromTime], [toTime, toTime], [expiryTime, expiryTime], - [true, true], + [1, 1], { from: account_delegate, gas: 6000000 @@ -779,7 +890,7 @@ contract("GeneralTransferManager", accounts => { "Allows an issuer to maintain a time based whitelist of authorised token holders.Addresses are added via modifyWhitelist and take a fromTime (the time from which they can send tokens) and a toTime (the time from which they can receive tokens). There are additional flags, allowAllWhitelistIssuances, allowAllWhitelistTransfers & allowAllTransfers which allow you to set corresponding contract level behaviour. Init function takes no parameters.", "Wrong Module added" ); - assert.equal(await I_GeneralPermissionManagerFactory.version.call(), "1.0.0"); + assert.equal(await I_GeneralTransferManagerFactory.version.call(), "2.1.0"); }); it("Should get the tags of the factory", async () => { @@ -836,3 +947,6 @@ contract("GeneralTransferManager", accounts => { }) }); }); + +function range1(i) {return i?range1(i-1).concat(i):[]} +function rangeB(i) {return i?rangeB(i-1).concat(0):[]} diff --git a/test/helpers/createInstances.js b/test/helpers/createInstances.js index a739e86fb..81ee9606b 100644 --- a/test/helpers/createInstances.js +++ b/test/helpers/createInstances.js @@ -8,6 +8,8 @@ const CappedSTOFactory = artifacts.require("./CappedSTOFactory.sol"); const SecurityTokenRegistryProxy = artifacts.require("./SecurityTokenRegistryProxy.sol"); const SecurityTokenRegistry = artifacts.require("./SecurityTokenRegistry.sol"); const SecurityTokenRegistryMock = artifacts.require("./SecurityTokenRegistryMock.sol"); +const ERC20DividendCheckpoint = artifacts.require("./ERC20DividendCheckpoint.sol"); +const EtherDividendCheckpoint = artifacts.require("./EtherDividendCheckpoint.sol"); const ERC20DividendCheckpointFactory = artifacts.require("./ERC20DividendCheckpointFactory.sol"); const EtherDividendCheckpointFactory = artifacts.require("./EtherDividendCheckpointFactory.sol"); const ManualApprovalTransferManagerFactory = artifacts.require("./ManualApprovalTransferManagerFactory.sol"); @@ -19,6 +21,7 @@ const USDTieredSTOProxyFactory = artifacts.require("./USDTieredSTOProxyFactory") const ManualApprovalTransferManager = artifacts.require("./ManualApprovalTransferManager"); const FeatureRegistry = artifacts.require("./FeatureRegistry.sol"); const STFactory = artifacts.require("./STFactory.sol"); +const GeneralTransferManager = artifacts.require("./GeneralTransferManager.sol"); const GeneralTransferManagerFactory = artifacts.require("./GeneralTransferManagerFactory.sol"); const GeneralPermissionManagerFactory = artifacts.require("./GeneralPermissionManagerFactory.sol"); const CountTransferManagerFactory = artifacts.require("./CountTransferManagerFactory.sol"); @@ -43,10 +46,13 @@ let I_MockWrongTypeBurnFactory; let I_ManualApprovalTransferManagerFactory; let I_VolumeRestrictionTransferManagerFactory; let I_PercentageTransferManagerFactory; +let I_EtherDividendCheckpointLogic; let I_EtherDividendCheckpointFactory; let I_CountTransferManagerFactory; +let I_ERC20DividendCheckpointLogic; let I_ERC20DividendCheckpointFactory; let I_GeneralPermissionManagerFactory; +let I_GeneralTransferManagerLogic; let I_GeneralTransferManagerFactory; let I_GeneralTransferManager; let I_ModuleRegistryProxy; @@ -80,7 +86,9 @@ export async function setUpPolymathNetwork(account_polymath, token_owner) { let b = await deployFeatureRegistry(account_polymath); // STEP 3: Deploy the ModuleRegistry let c = await deployModuleRegistry(account_polymath); - // STEP 4: Deploy the GeneralTransferManagerFactory + // STEP 4a: Deploy the GeneralTransferManagerFactory + let logic = await deployGTMLogic(account_polymath); + // STEP 4b: Deploy the GeneralTransferManagerFactory let d = await deployGTM(account_polymath); // Step 6: Deploy the STversionProxy contract let e = await deploySTFactory(account_polymath); @@ -125,8 +133,20 @@ async function deployModuleRegistry(account_polymath) { return new Array(I_ModuleRegistry, I_ModuleRegistryProxy, I_MRProxied); } +async function deployGTMLogic(account_polymath) { + I_GeneralTransferManagerLogic = await GeneralTransferManager.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: account_polymath }); + + assert.notEqual( + I_GeneralTransferManagerLogic.address.valueOf(), + "0x0000000000000000000000000000000000000000", + "GeneralTransferManagerLogic contract was not deployed" + ); + + return new Array(I_GeneralTransferManagerLogic); +} + async function deployGTM(account_polymath) { - I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(I_PolyToken.address, 0, 0, 0, { from: account_polymath }); + I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(I_PolyToken.address, 0, 0, 0, I_GeneralTransferManagerLogic.address, { from: account_polymath }); assert.notEqual( I_GeneralTransferManagerFactory.address.valueOf(), @@ -191,7 +211,7 @@ async function registerAndVerifyByMR(factoryAdrress, owner, mr) { /// Deploy the TransferManagers export async function deployGTMAndVerifyed(accountPolymath, MRProxyInstance, polyToken, setupCost) { - I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath }); + I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(polyToken, setupCost, 0, 0, I_GeneralTransferManagerLogic.address, { from: accountPolymath }); assert.notEqual( I_GeneralPermissionManagerFactory.address.valueOf(), @@ -341,7 +361,8 @@ export async function deployUSDTieredSTOAndVerified(accountPolymath, MRProxyInst /// Deploy the Dividend Modules export async function deployERC20DividendAndVerifyed(accountPolymath, MRProxyInstance, polyToken, setupCost) { - I_ERC20DividendCheckpointFactory = await ERC20DividendCheckpointFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath }); + I_ERC20DividendCheckpointLogic = await ERC20DividendCheckpoint.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); + I_ERC20DividendCheckpointFactory = await ERC20DividendCheckpointFactory.new(polyToken, setupCost, 0, 0, I_ERC20DividendCheckpointLogic.address, { from: accountPolymath }); assert.notEqual( I_ERC20DividendCheckpointFactory.address.valueOf(), @@ -353,7 +374,8 @@ export async function deployERC20DividendAndVerifyed(accountPolymath, MRProxyIns } export async function deployEtherDividendAndVerifyed(accountPolymath, MRProxyInstance, polyToken, setupCost) { - I_EtherDividendCheckpointFactory = await EtherDividendCheckpointFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath }); + I_EtherDividendCheckpointLogic = await EtherDividendCheckpoint.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); + I_EtherDividendCheckpointFactory = await EtherDividendCheckpointFactory.new(polyToken, setupCost, 0, 0, I_EtherDividendCheckpointLogic.address, { from: accountPolymath }); assert.notEqual( I_EtherDividendCheckpointFactory.address.valueOf(), diff --git a/test/j_manual_approval_transfer_manager.js b/test/j_manual_approval_transfer_manager.js index 5779a1c13..dae21b9c1 100644 --- a/test/j_manual_approval_transfer_manager.js +++ b/test/j_manual_approval_transfer_manager.js @@ -541,7 +541,7 @@ contract("ManualApprovalTransferManager", accounts => { "Allows an issuer to set manual approvals or blocks for specific pairs of addresses and amounts. Init function takes no parameters.", "Wrong Module added" ); - assert.equal(await I_ManualApprovalTransferManagerFactory.version.call(), "2.0.1"); + assert.equal(await I_ManualApprovalTransferManagerFactory.version.call(), "2.1.0"); }); it("Should get the tags of the factory", async () => { diff --git a/test/l_percentage_transfer_manager.js b/test/l_percentage_transfer_manager.js index b15ee41a0..e122bdea2 100644 --- a/test/l_percentage_transfer_manager.js +++ b/test/l_percentage_transfer_manager.js @@ -120,7 +120,7 @@ contract("PercentageTransferManager", accounts => { // STEP 4(b): Deploy the PercentageTransferManager [P_PercentageTransferManagerFactory] = await deployPercentageTMAndVerified(account_polymath, I_MRProxied, I_PolyToken.address, web3.utils.toWei("500", "ether")); - + // Printing all the contract addresses console.log(` --------------------- Polymath Network Smart Contracts: --------------------- diff --git a/test/p_usd_tiered_sto.js b/test/p_usd_tiered_sto.js index 604eb1aaf..1bec3697f 100644 --- a/test/p_usd_tiered_sto.js +++ b/test/p_usd_tiered_sto.js @@ -222,7 +222,7 @@ contract("USDTieredSTO", accounts => { I_SecurityTokenRegistryProxy, I_STRProxied ] = instances; - + I_DaiToken = await PolyTokenFaucet.new({from: POLYMATH}); // STEP 4: Deploy the GeneralDelegateManagerFactory [I_GeneralPermissionManagerFactory] = await deployGPMAndVerifyed(POLYMATH, I_MRProxied, I_PolyToken.address, 0); @@ -4482,7 +4482,7 @@ contract("USDTieredSTO", accounts => { "fundsRaisedUSD not changed as expected" ); }); - + it("should return minted tokens in a tier", async () => { let totalMinted = (await I_USDTieredSTO_Array[0].getTokensSoldByTier.call(0)).toNumber(); let individualMinted = await I_USDTieredSTO_Array[0].getTokensMintedByTier.call(0); @@ -4564,7 +4564,7 @@ contract("USDTieredSTO", accounts => { assert.equal((await I_USDTieredSTOFactory.getSetupCost.call()).toNumber(), STOSetupCost); assert.equal((await I_USDTieredSTOFactory.getTypes.call())[0], 3); assert.equal(web3.utils.hexToString(await I_USDTieredSTOFactory.getName.call()), "USDTieredSTO", "Wrong Module added"); - assert.equal(await I_USDTieredSTOFactory.description.call(), + assert.equal(await I_USDTieredSTOFactory.description.call(), "It allows both accredited and non-accredited investors to contribute into the STO. Non-accredited investors will be capped at a maximum investment limit (as a default or specific to their jurisdiction). Tokens will be sold according to tiers sequentially & each tier has its own price and volume of tokens to sell. Upon receipt of funds (ETH, POLY or DAI), security tokens will automatically transfer to investor’s wallet address", "Wrong Module added"); assert.equal(await I_USDTieredSTOFactory.title.call(), "USD Tiered STO", "Wrong Module added"); diff --git a/test/q_usd_tiered_sto_sim.js b/test/q_usd_tiered_sto_sim.js index 55f84f2b3..b287cb201 100644 --- a/test/q_usd_tiered_sto_sim.js +++ b/test/q_usd_tiered_sto_sim.js @@ -195,7 +195,7 @@ contract("USDTieredSTO Sim", accounts => { I_SecurityTokenRegistryProxy, I_STRProxied ] = instances; - + I_DaiToken = await PolyTokenFaucet.new({from: POLYMATH}); // STEP 5: Deploy the USDTieredSTOFactory diff --git a/test/r_concurrent_STO.js b/test/r_concurrent_STO.js index cfe2767af..3274e7fb8 100644 --- a/test/r_concurrent_STO.js +++ b/test/r_concurrent_STO.js @@ -2,7 +2,7 @@ import latestTime from "./helpers/latestTime"; import { duration, promisifyLogWatch, latestBlock } from "./helpers/utils"; import { takeSnapshot, increaseTime, revertToSnapshot } from "./helpers/time"; import { encodeProxyCall, encodeModuleCall } from "./helpers/encodeCall"; -import { +import { setUpPolymathNetwork, deployDummySTOAndVerifyed, deployCappedSTOAndVerifyed, @@ -94,7 +94,7 @@ contract("Concurrent STO", accounts => { I_SecurityTokenRegistryProxy, I_STRProxied ] = instances; - + // STEP 2: Deploy the STO Factories [I_CappedSTOFactory] = await deployCappedSTOAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, STOSetupCost); diff --git a/test/u_module_registry_proxy.js b/test/u_module_registry_proxy.js index 6d00b8fe2..877d173d4 100644 --- a/test/u_module_registry_proxy.js +++ b/test/u_module_registry_proxy.js @@ -9,6 +9,7 @@ const ModuleRegistryProxy = artifacts.require("./ModuleRegistryProxy.sol"); const ModuleRegistry = artifacts.require("./ModuleRegistry.sol"); const STFactory = artifacts.require("./STFactory.sol"); const SecurityToken = artifacts.require("./SecurityToken.sol"); +const GeneralTransferManagerLogic = artifacts.require("./GeneralTransferManager.sol"); const GeneralTransferManagerFactory = artifacts.require("./GeneralTransferManagerFactory.sol"); const GeneralPermissionManagerFactory = artifacts.require("./GeneralPermissionManagerFactory.sol"); @@ -122,7 +123,9 @@ contract("ModuleRegistryProxy", accounts => { await I_MRProxied.updateFromRegistry({ from: account_polymath }); // STEP 4: Deploy the GeneralTransferManagerFactory - I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(I_PolyToken.address, 0, 0, 0, { + let I_GeneralTransferManagerLogic = await GeneralTransferManagerLogic.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: account_polymath }); + + I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(I_PolyToken.address, 0, 0, 0, I_GeneralTransferManagerLogic.address, { from: account_polymath }); diff --git a/test/v_tracked_redemptions.js b/test/v_tracked_redemptions.js index 159564651..2d5ae8c6c 100644 --- a/test/v_tracked_redemptions.js +++ b/test/v_tracked_redemptions.js @@ -102,7 +102,7 @@ contract("TrackedRedemption", accounts => { I_STRProxied ] = instances; - + // STEP 4: Deploy the TrackedRedemption [I_TrackedRedemptionFactory] = await deployRedemptionAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, 0); [P_TrackedRedemptionFactory] = await deployRedemptionAndVerifyed(account_polymath, I_MRProxied, I_PolyToken.address, web3.utils.toWei("500")); diff --git a/test/w_lockup_volume_restriction_transfer_manager.js b/test/w_lockup_volume_restriction_transfer_manager.js index fe06f3f5c..358e5b702 100644 --- a/test/w_lockup_volume_restriction_transfer_manager.js +++ b/test/w_lockup_volume_restriction_transfer_manager.js @@ -112,7 +112,7 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { STFactory: ${I_STFactory.address} GeneralTransferManagerFactory: ${I_GeneralTransferManagerFactory.address} - LockupVolumeRestrictionTransferManagerFactory: + LockupVolumeRestrictionTransferManagerFactory: ${I_VolumeRestrictionTransferManagerFactory.address} ----------------------------------------------------------------------------- `); @@ -346,14 +346,14 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { // balance should be 9000000000000000000 here (9 eth) let balance = await I_SecurityToken.balanceOf(account_investor2) - + // create a lockup for their entire balance // over 16 seconds total, with 4 periods of 4 seconds each. // this will generate an exception because 9000000000000000000 / 4 = 2250000000000000000 but the token granularity is 1000000000000000000 await catchRevert( I_VolumeRestrictionTransferManager.addLockUp(account_investor2, 16, 4, 0, balance, { from: token_owner }) ); - + }); it("Should prevent the transfer of tokens in a lockup", async() => { @@ -572,7 +572,7 @@ contract('LockupVolumeRestrictionTransferManager', accounts => { }); it("Should revert if the parameters are bad when creating multiple lockups", async() => { - + await catchRevert( // pass in the wrong number of params. txn should revert I_VolumeRestrictionTransferManager.addLockUpMulti( diff --git a/yarn.lock b/yarn.lock index 27308427c..31973936e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,12 +5,10 @@ "@soldoc/markdown@^0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@soldoc/markdown/-/markdown-0.1.0.tgz#9f85be75049af9721b5129f133d52dafbf5f671e" - integrity sha512-V0UnvVVJ1qDzpuKLMuh7oHG94puwi8BI3t99Vrr7dQgIHuJdfZJ4SbGuWuFV/fSthyH++WY4ePO3d6gxfZ2//w== "@soldoc/soldoc@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@soldoc/soldoc/-/soldoc-0.4.3.tgz#24ffee9264228e1c3edd61fd3162d63587954933" - integrity sha1-JP/ukmQijhw+3WH9MWLWNYeVSTM= dependencies: "@soldoc/markdown" "^0.1.0" chalk "^2.3.1" @@ -24,31 +22,26 @@ abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== abbrev@1.0.x: version "1.0.9" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" - integrity sha1-kbR5JYinc4wl813W9jdSovh3YTU= abstract-leveldown@~2.6.0: version "2.6.3" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz#1c5e8c6a5ef965ae8c35dfb3a8770c476b82c4b8" - integrity sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA== dependencies: xtend "~4.0.0" abstract-leveldown@~2.7.1: version "2.7.2" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz#87a44d7ebebc341d59665204834c8b7e0932cc93" - integrity sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w== dependencies: xtend "~4.0.0" accepts@~1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" - integrity sha1-63d99gEXI6OxTopywIBcjoZ0a9I= dependencies: mime-types "~2.1.18" negotiator "0.6.1" @@ -56,56 +49,46 @@ accepts@~1.3.5: acorn-dynamic-import@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4" - integrity sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ= dependencies: acorn "^4.0.3" acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - integrity sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s= dependencies: acorn "^3.0.4" acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - integrity sha1-ReN/s56No/JbruP/U2niu18iAXo= acorn@^4.0.3: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" - integrity sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c= acorn@^5.0.0, acorn@^5.5.0: version "5.7.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" - integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== aes-js@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" - integrity sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0= aes-js@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.1.tgz#89fd1f94ae51b4c72d62466adc1a7323ff52f072" - integrity sha512-cEA0gBelItZZV7iBiL8ApCiNgc+gBWJJ4uoORhbu6vOqAJ0UL9wIlxr4RI7ij9SSVzy6AnPwiu37kVYiHCl3nw== ajv-keywords@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" - integrity sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I= ajv-keywords@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" - integrity sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo= ajv@^5.1.1, ajv@^5.2.2, ajv@^5.2.3, ajv@^5.3.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= dependencies: co "^4.6.0" fast-deep-equal "^1.0.0" @@ -115,7 +98,6 @@ ajv@^5.1.1, ajv@^5.2.2, ajv@^5.2.3, ajv@^5.3.0: ajv@^6.1.0: version "6.5.4" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.4.tgz#247d5274110db653706b550fcc2b797ca28cfc59" - integrity sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" @@ -125,7 +107,6 @@ ajv@^6.1.0: align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - integrity sha1-DNkKVhCT810KmSVsIrcGlDP60Rc= dependencies: kind-of "^3.0.2" longest "^1.0.1" @@ -134,7 +115,6 @@ align-text@^0.1.1, align-text@^0.1.3: ambi@^2.2.0: version "2.5.0" resolved "https://registry.yarnpkg.com/ambi/-/ambi-2.5.0.tgz#7c8e372be48891157e7cea01cb6f9143d1f74220" - integrity sha1-fI43K+SIkRV+fOoBy2+RQ9H3QiA= dependencies: editions "^1.1.1" typechecker "^4.3.0" @@ -142,44 +122,36 @@ ambi@^2.2.0: amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" - integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= ansi-escapes@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" - integrity sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw== ansi-regex@^2.0.0, ansi-regex@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" any-promise@1.3.0, any-promise@^1.0.0, any-promise@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" - integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= anymatch@^1.3.0: version "1.3.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== dependencies: micromatch "^2.1.5" normalize-path "^2.0.0" @@ -187,7 +159,6 @@ anymatch@^1.3.0: anymatch@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== dependencies: micromatch "^3.1.4" normalize-path "^2.1.1" @@ -195,12 +166,10 @@ anymatch@^2.0.0: aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== are-we-there-yet@~1.1.2: version "1.1.5" resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== dependencies: delegates "^1.0.0" readable-stream "^2.0.6" @@ -208,85 +177,56 @@ are-we-there-yet@~1.1.2: argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" -arguments-extended@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/arguments-extended/-/arguments-extended-0.0.3.tgz#6107e4917d0eb6f0a4dd66320fc15afc72ef4946" - integrity sha1-YQfkkX0OtvCk3WYyD8Fa/HLvSUY= - dependencies: - extended "~0.0.3" - is-extended "~0.0.8" - arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= dependencies: arr-flatten "^1.0.1" arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= arr-flatten@^1.0.1, arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-extended@~0.0.3, array-extended@~0.0.4, array-extended@~0.0.5: - version "0.0.11" - resolved "https://registry.yarnpkg.com/array-extended/-/array-extended-0.0.11.tgz#d7144ae748de93ca726f121009dbff1626d164bd" - integrity sha1-1xRK50jek8pybxIQCdv/FibRZL0= - dependencies: - arguments-extended "~0.0.3" - extended "~0.0.3" - is-extended "~0.0.3" array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= dependencies: array-uniq "^1.0.1" array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= asn1.js@^4.0.0: version "4.10.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" - integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== dependencies: bn.js "^4.0.0" inherits "^2.0.1" @@ -295,36 +235,30 @@ asn1.js@^4.0.0: asn1@~0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== dependencies: safer-buffer "~2.1.0" assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= assert@^1.1.1: version "1.4.1" resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" - integrity sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE= dependencies: util "0.10.3" assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" - integrity sha1-GdOGodntxufByF04iu28xW0zYC0= async-eventemitter@^0.2.2: version "0.2.4" resolved "https://registry.yarnpkg.com/async-eventemitter/-/async-eventemitter-0.2.4.tgz#f5e7c8ca7d3e46aab9ec40a292baf686a0bafaca" - integrity sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw== dependencies: async "^2.4.0" @@ -337,49 +271,44 @@ async-eventemitter@ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a async-limiter@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== async@1.x, async@^1.4.2, async@~1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.4.1, async@^2.5.0: version "2.6.1" resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" - integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== dependencies: lodash "^4.17.10" +async@~0.9.0: + version "0.9.2" + resolved "http://registry.npmjs.org/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" + async@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async/-/async-1.0.0.tgz#f8fc04ca3a13784ade9e1641af98578cfbd647a9" - integrity sha1-+PwEyjoTeErenhZBr5hXjPvWR6k= asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= atob@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= aws4@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" - integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= dependencies: chalk "^1.1.3" esutils "^2.0.2" @@ -388,7 +317,6 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: babel-core@^6.0.14, babel-core@^6.26.0: version "6.26.3" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== dependencies: babel-code-frame "^6.26.0" babel-generator "^6.26.0" @@ -413,7 +341,6 @@ babel-core@^6.0.14, babel-core@^6.26.0: babel-generator@^6.26.0: version "6.26.1" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" - integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== dependencies: babel-messages "^6.23.0" babel-runtime "^6.26.0" @@ -427,7 +354,6 @@ babel-generator@^6.26.0: babel-helper-bindify-decorators@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz#14c19e5f142d7b47f19a52431e52b1ccbc40a330" - integrity sha1-FMGeXxQte0fxmlJDHlKxzLxAozA= dependencies: babel-runtime "^6.22.0" babel-traverse "^6.24.1" @@ -436,7 +362,6 @@ babel-helper-bindify-decorators@^6.24.1: babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" - integrity sha1-zORReto1b0IgvK6KAsKzRvmlZmQ= dependencies: babel-helper-explode-assignable-expression "^6.24.1" babel-runtime "^6.22.0" @@ -445,7 +370,6 @@ babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: babel-helper-call-delegate@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" - integrity sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340= dependencies: babel-helper-hoist-variables "^6.24.1" babel-runtime "^6.22.0" @@ -455,7 +379,6 @@ babel-helper-call-delegate@^6.24.1: babel-helper-define-map@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" - integrity sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8= dependencies: babel-helper-function-name "^6.24.1" babel-runtime "^6.26.0" @@ -465,7 +388,6 @@ babel-helper-define-map@^6.24.1: babel-helper-explode-assignable-expression@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" - integrity sha1-8luCz33BBDPFX3BZLVdGQArCLKo= dependencies: babel-runtime "^6.22.0" babel-traverse "^6.24.1" @@ -474,7 +396,6 @@ babel-helper-explode-assignable-expression@^6.24.1: babel-helper-explode-class@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz#7dc2a3910dee007056e1e31d640ced3d54eaa9eb" - integrity sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes= dependencies: babel-helper-bindify-decorators "^6.24.1" babel-runtime "^6.22.0" @@ -484,7 +405,6 @@ babel-helper-explode-class@^6.24.1: babel-helper-function-name@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" - integrity sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= dependencies: babel-helper-get-function-arity "^6.24.1" babel-runtime "^6.22.0" @@ -495,7 +415,6 @@ babel-helper-function-name@^6.24.1: babel-helper-get-function-arity@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" - integrity sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -503,7 +422,6 @@ babel-helper-get-function-arity@^6.24.1: babel-helper-hoist-variables@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" - integrity sha1-HssnaJydJVE+rbyZFKc/VAi+enY= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -511,7 +429,6 @@ babel-helper-hoist-variables@^6.24.1: babel-helper-optimise-call-expression@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" - integrity sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -519,7 +436,6 @@ babel-helper-optimise-call-expression@^6.24.1: babel-helper-regex@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" - integrity sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI= dependencies: babel-runtime "^6.26.0" babel-types "^6.26.0" @@ -528,7 +444,6 @@ babel-helper-regex@^6.24.1: babel-helper-remap-async-to-generator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" - integrity sha1-XsWBgnrXI/7N04HxySg5BnbkVRs= dependencies: babel-helper-function-name "^6.24.1" babel-runtime "^6.22.0" @@ -539,7 +454,6 @@ babel-helper-remap-async-to-generator@^6.24.1: babel-helper-replace-supers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" - integrity sha1-v22/5Dk40XNpohPKiov3S2qQqxo= dependencies: babel-helper-optimise-call-expression "^6.24.1" babel-messages "^6.23.0" @@ -551,7 +465,6 @@ babel-helper-replace-supers@^6.24.1: babel-helpers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" - integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= dependencies: babel-runtime "^6.22.0" babel-template "^6.24.1" @@ -559,61 +472,50 @@ babel-helpers@^6.24.1: babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= dependencies: babel-runtime "^6.22.0" babel-plugin-check-es2015-constants@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - integrity sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o= dependencies: babel-runtime "^6.22.0" babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" - integrity sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU= babel-plugin-syntax-async-generators@^6.5.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" - integrity sha1-a8lj67FuzLrmuStZbrfzXDQqi5o= babel-plugin-syntax-class-properties@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" - integrity sha1-1+sjt5oxf4VDlixQW4J8fWysJ94= babel-plugin-syntax-decorators@^6.13.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b" - integrity sha1-MSVjtNvePMgGzuPkFszurd0RrAs= babel-plugin-syntax-dynamic-import@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da" - integrity sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo= babel-plugin-syntax-exponentiation-operator@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" - integrity sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4= babel-plugin-syntax-object-rest-spread@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" - integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= babel-plugin-syntax-trailing-function-commas@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" - integrity sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM= babel-plugin-transform-async-generator-functions@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" - integrity sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds= dependencies: babel-helper-remap-async-to-generator "^6.24.1" babel-plugin-syntax-async-generators "^6.5.0" @@ -622,7 +524,6 @@ babel-plugin-transform-async-generator-functions@^6.24.1: babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" - integrity sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E= dependencies: babel-helper-remap-async-to-generator "^6.24.1" babel-plugin-syntax-async-functions "^6.8.0" @@ -631,7 +532,6 @@ babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async- babel-plugin-transform-class-properties@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" - integrity sha1-anl2PqYdM9NvN7YRqp3vgagbRqw= dependencies: babel-helper-function-name "^6.24.1" babel-plugin-syntax-class-properties "^6.8.0" @@ -641,7 +541,6 @@ babel-plugin-transform-class-properties@^6.24.1: babel-plugin-transform-decorators@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz#788013d8f8c6b5222bdf7b344390dfd77569e24d" - integrity sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0= dependencies: babel-helper-explode-class "^6.24.1" babel-plugin-syntax-decorators "^6.13.0" @@ -652,21 +551,18 @@ babel-plugin-transform-decorators@^6.24.1: babel-plugin-transform-es2015-arrow-functions@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - integrity sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" - integrity sha1-u8UbSflk1wy42OC5ToICRs46YUE= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es2015-block-scoping@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" - integrity sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8= dependencies: babel-runtime "^6.26.0" babel-template "^6.26.0" @@ -677,7 +573,6 @@ babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es20 babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-classes@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" - integrity sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= dependencies: babel-helper-define-map "^6.24.1" babel-helper-function-name "^6.24.1" @@ -692,7 +587,6 @@ babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-cla babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transform-es2015-computed-properties@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" - integrity sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM= dependencies: babel-runtime "^6.22.0" babel-template "^6.24.1" @@ -700,14 +594,12 @@ babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transfor babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" - integrity sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2015-duplicate-keys@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" - integrity sha1-c+s9MQypaePvnskcU3QabxV2Qj4= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -715,14 +607,12 @@ babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2 babel-plugin-transform-es2015-for-of@^6.22.0, babel-plugin-transform-es2015-for-of@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" - integrity sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" - integrity sha1-g0yJhTvDaxrw86TF26qU/Y6sqos= dependencies: babel-helper-function-name "^6.24.1" babel-runtime "^6.22.0" @@ -731,14 +621,12 @@ babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es20 babel-plugin-transform-es2015-literals@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" - integrity sha1-T1SgLWzWbPkVKAAZox0xklN3yi4= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" - integrity sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ= dependencies: babel-plugin-transform-es2015-modules-commonjs "^6.24.1" babel-runtime "^6.22.0" @@ -747,7 +635,6 @@ babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015 babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: version "6.26.2" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" - integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q== dependencies: babel-plugin-transform-strict-mode "^6.24.1" babel-runtime "^6.26.0" @@ -757,7 +644,6 @@ babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-e babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-es2015-modules-systemjs@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" - integrity sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM= dependencies: babel-helper-hoist-variables "^6.24.1" babel-runtime "^6.22.0" @@ -766,7 +652,6 @@ babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-e babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015-modules-umd@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" - integrity sha1-rJl+YoXNGO1hdq22B9YCNErThGg= dependencies: babel-plugin-transform-es2015-modules-amd "^6.24.1" babel-runtime "^6.22.0" @@ -775,7 +660,6 @@ babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015 babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es2015-object-super@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" - integrity sha1-JM72muIcuDp/hgPa0CH1cusnj40= dependencies: babel-helper-replace-supers "^6.24.1" babel-runtime "^6.22.0" @@ -783,7 +667,6 @@ babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es201 babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015-parameters@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" - integrity sha1-V6w1GrScrxSpfNE7CfZv3wpiXys= dependencies: babel-helper-call-delegate "^6.24.1" babel-helper-get-function-arity "^6.24.1" @@ -795,7 +678,6 @@ babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015- babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" - integrity sha1-JPh11nIch2YbvZmkYi5R8U3jiqA= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -803,14 +685,12 @@ babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transfo babel-plugin-transform-es2015-spread@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" - integrity sha1-1taKmfia7cRTbIGlQujdnxdG+NE= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" - integrity sha1-AMHNsaynERLN8M9hJsLta0V8zbw= dependencies: babel-helper-regex "^6.24.1" babel-runtime "^6.22.0" @@ -819,21 +699,18 @@ babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es201 babel-plugin-transform-es2015-template-literals@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - integrity sha1-qEs0UPfp+PH2g51taH2oS7EjbY0= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-typeof-symbol@^6.22.0, babel-plugin-transform-es2015-typeof-symbol@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" - integrity sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" - integrity sha1-04sS9C6nMj9yk4fxinxa4frrNek= dependencies: babel-helper-regex "^6.24.1" babel-runtime "^6.22.0" @@ -842,7 +719,6 @@ babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es20 babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" - integrity sha1-KrDJx/MJj6SJB3cruBP+QejeOg4= dependencies: babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" babel-plugin-syntax-exponentiation-operator "^6.8.0" @@ -851,7 +727,6 @@ babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-e babel-plugin-transform-object-rest-spread@^6.22.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" - integrity sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY= dependencies: babel-plugin-syntax-object-rest-spread "^6.8.0" babel-runtime "^6.26.0" @@ -859,14 +734,12 @@ babel-plugin-transform-object-rest-spread@^6.22.0: babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" - integrity sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8= dependencies: regenerator-transform "^0.10.0" babel-plugin-transform-strict-mode@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" - integrity sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -874,7 +747,6 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-polyfill@6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" - integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= dependencies: babel-runtime "^6.26.0" core-js "^2.5.0" @@ -883,7 +755,6 @@ babel-polyfill@6.26.0: babel-preset-env@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" - integrity sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg== dependencies: babel-plugin-check-es2015-constants "^6.22.0" babel-plugin-syntax-trailing-function-commas "^6.22.0" @@ -919,7 +790,6 @@ babel-preset-env@^1.7.0: babel-preset-es2015@6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" - integrity sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk= dependencies: babel-plugin-check-es2015-constants "^6.22.0" babel-plugin-transform-es2015-arrow-functions "^6.22.0" @@ -949,7 +819,6 @@ babel-preset-es2015@6.24.1: babel-preset-stage-2@6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz#d9e2960fb3d71187f0e64eec62bc07767219bdc1" - integrity sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE= dependencies: babel-plugin-syntax-dynamic-import "^6.18.0" babel-plugin-transform-class-properties "^6.24.1" @@ -959,7 +828,6 @@ babel-preset-stage-2@6.24.1: babel-preset-stage-3@6.24.1, babel-preset-stage-3@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395" - integrity sha1-g2raCp56f6N8sTj7kyb4eTSkg5U= dependencies: babel-plugin-syntax-trailing-function-commas "^6.22.0" babel-plugin-transform-async-generator-functions "^6.24.1" @@ -970,7 +838,6 @@ babel-preset-stage-3@6.24.1, babel-preset-stage-3@^6.24.1: babel-register@6.26.0, babel-register@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" - integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= dependencies: babel-core "^6.26.0" babel-runtime "^6.26.0" @@ -983,7 +850,6 @@ babel-register@6.26.0, babel-register@^6.26.0: babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= dependencies: core-js "^2.4.0" regenerator-runtime "^0.11.0" @@ -991,7 +857,6 @@ babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: babel-template@^6.24.1, babel-template@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" - integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= dependencies: babel-runtime "^6.26.0" babel-traverse "^6.26.0" @@ -1002,7 +867,6 @@ babel-template@^6.24.1, babel-template@^6.26.0: babel-traverse@^6.24.1, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" - integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= dependencies: babel-code-frame "^6.26.0" babel-messages "^6.23.0" @@ -1017,7 +881,6 @@ babel-traverse@^6.24.1, babel-traverse@^6.26.0: babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" - integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= dependencies: babel-runtime "^6.26.0" esutils "^2.0.2" @@ -1027,7 +890,6 @@ babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: babelify@^7.3.0: version "7.3.0" resolved "https://registry.yarnpkg.com/babelify/-/babelify-7.3.0.tgz#aa56aede7067fd7bd549666ee16dc285087e88e5" - integrity sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU= dependencies: babel-core "^6.0.14" object-assign "^4.0.0" @@ -1035,34 +897,28 @@ babelify@^7.3.0: babylon@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" - integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= base-x@^3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.4.tgz#94c1788736da065edb1d68808869e357c977fa77" - integrity sha512-UYOadoSIkEI/VrRGSG6qp93rp2WdokiAiNYDfGW5qURAY8GiAQkvMbwNNSDYiVJopqv4gCna7xqf4rrNGp+5AA== dependencies: safe-buffer "^5.0.1" base64-js@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978" - integrity sha1-EQHpVE9KdrG8OybUUsqW16NeeXg= base64-js@^1.0.2: version "1.3.0" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" - integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== dependencies: cache-base "^1.0.1" class-utils "^0.3.5" @@ -1075,29 +931,24 @@ base@^0.11.1: bcrypt-pbkdf@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= dependencies: tweetnacl "^0.14.3" big.js@^3.1.3: version "3.2.0" resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" - integrity sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q== bignumber.js@^4.0.2: version "4.1.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1" - integrity sha512-eJzYkFYy9L4JzXsbymsFn3p54D+llV27oTQ+ziJG7WFRheJcNZilgVXMG0LoZtlQSKBsJdWtLFqOD0u+U0jZKA== bignumber.js@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-5.0.0.tgz#fbce63f09776b3000a83185badcde525daf34833" - integrity sha512-KWTu6ZMVk9sxlDJQh2YH1UOnfDP8O8TpxUxgQG/vKASoSnEjK9aVuOueFaPcQEYQ5fyNXNTOYwYw3099RYebWg== bignumber.js@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-6.0.0.tgz#bbfa047644609a5af093e9cbd83b0461fa3f6002" - integrity sha512-x247jIuy60/+FtMRvscqfxtVHQf8AGx2hm9c6btkgC0x/hp9yt+teISNhvF8WlwRkCc5yF2fDECH8SIMe8j+GA== "bignumber.js@git+https://github.com/debris/bignumber.js#master": version "2.0.7" @@ -1114,24 +965,20 @@ bignumber.js@^6.0.0: binary-extensions@^1.0.0: version "1.12.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" - integrity sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg== bindings@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7" - integrity sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw== bip66@^1.1.3: version "1.1.5" resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" - integrity sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI= dependencies: safe-buffer "^5.0.1" bitcore-lib@^0.15.0: version "0.15.0" resolved "https://registry.yarnpkg.com/bitcore-lib/-/bitcore-lib-0.15.0.tgz#f924be13869f2aab7e04aeec5642ad3359b6cec2" - integrity sha512-AeXLWhiivF6CDFzrABZHT4jJrflyylDWTi32o30rF92HW9msfuKpjzrHtFKYGa9w0kNVv5HABQjCB3OEav4PhQ== dependencies: bn.js "=4.11.8" bs58 "=4.0.1" @@ -1143,7 +990,6 @@ bitcore-lib@^0.15.0: bitcore-mnemonic@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bitcore-mnemonic/-/bitcore-mnemonic-1.5.0.tgz#c7e785beb6bf0616ed4992785dc3658670425a39" - integrity sha512-sbeP4xwkindLMfIQhVxj6rZSDMwtiKmfc1DqvwpR6Yg+Qo4I4WHO5pvzb12Y04uDh1N3zgD45esHhfH0HHmE4g== dependencies: bitcore-lib "^0.15.0" unorm "^1.3.3" @@ -1151,7 +997,6 @@ bitcore-mnemonic@^1.5.0: bl@^1.0.0: version "1.2.2" resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" - integrity sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA== dependencies: readable-stream "^2.3.5" safe-buffer "^5.1.1" @@ -1159,39 +1004,32 @@ bl@^1.0.0: block-stream@*: version "0.0.9" resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" - integrity sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo= dependencies: inherits "~2.0.0" bluebird@^2.9.34: version "2.11.0" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1" - integrity sha1-U0uQM8AiyVecVro7Plpcqvu2UOE= bluebird@^3.4.6, bluebird@^3.5.0: version "3.5.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.2.tgz#1be0908e054a751754549c270489c1505d4ab15a" - integrity sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg== bn.js@4.11.6: version "4.11.6" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" - integrity sha1-UzRK2xRhehP26N0s4okF0cC6MhU= bn.js@=4.11.8, bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.3, bn.js@^4.11.6, bn.js@^4.4.0, bn.js@^4.8.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== bn.js@^2.0.3: version "2.2.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-2.2.0.tgz#12162bc2ae71fc40a5626c33438f3a875cd37625" - integrity sha1-EhYrwq5x/EClYmwzQ486h1zTdiU= body-parser@1.18.3, body-parser@^1.16.0: version "1.18.3" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" - integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= dependencies: bytes "3.0.0" content-type "~1.0.4" @@ -1207,7 +1045,6 @@ body-parser@1.18.3, body-parser@^1.16.0: borc@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/borc/-/borc-2.0.3.tgz#08845ea73a6d3211120928ee3929f8dc2de9f52e" - integrity sha512-2mfipKUXn7yLgwn8D5jZkJqd2ZyzqmYZQX/9d4On33oGNDLwxj5qQMst+nkKyEdaujQRFfrZCId+k8wehQVANg== dependencies: bignumber.js "^6.0.0" commander "^2.15.0" @@ -1217,7 +1054,6 @@ borc@^2.0.2: brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" @@ -1225,7 +1061,6 @@ brace-expansion@^1.1.7: braces@^1.8.2: version "1.8.5" resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= dependencies: expand-range "^1.8.1" preserve "^0.2.0" @@ -1234,7 +1069,6 @@ braces@^1.8.2: braces@^2.3.0, braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== dependencies: arr-flatten "^1.1.0" array-unique "^0.3.2" @@ -1250,22 +1084,18 @@ braces@^2.3.0, braces@^2.3.1: brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= browser-stdout@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" - integrity sha1-81HTKWnTL6XXpVZxVCY9korjvR8= browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.0.6: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== dependencies: buffer-xor "^1.0.3" cipher-base "^1.0.0" @@ -1277,7 +1107,6 @@ browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.0.6: browserify-cipher@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" - integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== dependencies: browserify-aes "^1.0.4" browserify-des "^1.0.0" @@ -1286,7 +1115,6 @@ browserify-cipher@^1.0.0: browserify-des@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" - integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== dependencies: cipher-base "^1.0.1" des.js "^1.0.0" @@ -1296,7 +1124,6 @@ browserify-des@^1.0.0: browserify-rsa@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" - integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= dependencies: bn.js "^4.1.0" randombytes "^2.0.1" @@ -1304,14 +1131,12 @@ browserify-rsa@^4.0.0: browserify-sha3@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/browserify-sha3/-/browserify-sha3-0.0.1.tgz#3ff34a3006ef15c0fb3567e541b91a2340123d11" - integrity sha1-P/NKMAbvFcD7NWflQbkaI0ASPRE= dependencies: js-sha3 "^0.3.1" browserify-sign@^4.0.0: version "4.0.4" resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" - integrity sha1-qk62jl17ZYuqa/alfmMMvXqT0pg= dependencies: bn.js "^4.1.1" browserify-rsa "^4.0.0" @@ -1324,14 +1149,12 @@ browserify-sign@^4.0.0: browserify-zlib@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" - integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== dependencies: pako "~1.0.5" browserslist@^3.2.6: version "3.2.8" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" - integrity sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ== dependencies: caniuse-lite "^1.0.30000844" electron-to-chromium "^1.3.47" @@ -1339,19 +1162,16 @@ browserslist@^3.2.6: bs58@=4.0.1, bs58@^4.0.0, bs58@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" - integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= dependencies: base-x "^3.0.2" bs58@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/bs58/-/bs58-2.0.1.tgz#55908d58f1982aba2008fa1bed8f91998a29bf8d" - integrity sha1-VZCNWPGYKrogCPob7Y+RmYopv40= bs58check@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" - integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== dependencies: bs58 "^4.0.0" create-hash "^1.1.0" @@ -1360,17 +1180,14 @@ bs58check@^2.1.2: bson@^1.0.4: version "1.1.0" resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.0.tgz#bee57d1fb6a87713471af4e32bcae36de814b5b0" - integrity sha512-9Aeai9TacfNtWXOYarkFJRW2CWo+dRon+fuLZYJmvLV3+MiUp0bEI6IAZfXEIg7/Pl/7IWlLaDnhzTsD81etQA== buffer-alloc-unsafe@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== buffer-alloc@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== dependencies: buffer-alloc-unsafe "^1.1.0" buffer-fill "^1.0.0" @@ -1378,37 +1195,30 @@ buffer-alloc@^1.2.0: buffer-compare@=1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-compare/-/buffer-compare-1.1.1.tgz#5be7be853af89198d1f4ddc090d1d66a48aef596" - integrity sha1-W+e+hTr4kZjR9N3AkNHWakiu9ZY= buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= buffer-fill@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== buffer-to-arraybuffer@^0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz#6064a40fa76eb43c723aba9ef8f6e1216d10511a" - integrity sha1-YGSkD6dutDxyOrqe+PbhIW0QURo= buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= buffer@^3.0.1: version "3.6.0" resolved "https://registry.yarnpkg.com/buffer/-/buffer-3.6.0.tgz#a72c936f77b96bf52f5f7e7b467180628551defb" - integrity sha1-pyyTb3e5a/UvX357RnGAYoVR3vs= dependencies: base64-js "0.0.8" ieee754 "^1.1.4" @@ -1417,7 +1227,6 @@ buffer@^3.0.1: buffer@^4.3.0, buffer@^4.9.0: version "4.9.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" - integrity sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg= dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" @@ -1426,7 +1235,6 @@ buffer@^4.3.0, buffer@^4.9.0: buffer@^5.0.5: version "5.2.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" - integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg== dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" @@ -1434,22 +1242,18 @@ buffer@^5.0.5: builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= cache-base@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== dependencies: collection-visit "^1.0.0" component-emitter "^1.2.1" @@ -1464,34 +1268,28 @@ cache-base@^1.0.1: caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= dependencies: callsites "^0.2.0" callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - integrity sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk= camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" - integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo= camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= caminte@0.3.7: version "0.3.7" resolved "https://registry.yarnpkg.com/caminte/-/caminte-0.3.7.tgz#ec1ec0457664a0f092643b7c646c457d5cd6f693" - integrity sha1-7B7ARXZkoPCSZDt8ZGxFfVzW9pM= dependencies: bluebird "^3.4.6" uuid "^3.0.1" @@ -1499,17 +1297,14 @@ caminte@0.3.7: caniuse-lite@^1.0.30000844: version "1.0.30000890" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000890.tgz#86a18ffcc65d79ec6a437e985761b8bf1c4efeaf" - integrity sha512-4NI3s4Y6ROm+SgZN5sLUG4k7nVWQnedis3c/RWkynV5G6cHSY7+a8fwFyn2yoBDE3E6VswhTNNwR3PvzGqlTkg== caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= center-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - integrity sha1-qg0yYptu6XIgBBHL1EYckHvCt60= dependencies: align-text "^0.1.3" lazy-cache "^1.0.3" @@ -1517,7 +1312,6 @@ center-align@^0.1.1: chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= dependencies: ansi-styles "^2.2.1" escape-string-regexp "^1.0.2" @@ -1528,7 +1322,6 @@ chalk@^1.1.3: chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" - integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" @@ -1537,19 +1330,16 @@ chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1: chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" - integrity sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I= checkpoint-store@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/checkpoint-store/-/checkpoint-store-1.1.0.tgz#04e4cb516b91433893581e6d4601a78e9552ea06" - integrity sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY= dependencies: functional-red-black-tree "^1.0.1" chokidar@^1.6.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= dependencies: anymatch "^1.3.0" async-each "^1.0.0" @@ -1565,7 +1355,6 @@ chokidar@^1.6.0: chokidar@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" - integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== dependencies: anymatch "^2.0.0" async-each "^1.0.0" @@ -1585,12 +1374,10 @@ chokidar@^2.0.2: chownr@^1.0.1: version "1.1.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" @@ -1598,12 +1385,10 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: circular-json@^0.3.1: version "0.3.3" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" - integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== dependencies: arr-union "^3.1.0" define-property "^0.2.5" @@ -1613,7 +1398,6 @@ class-utils@^0.3.5: cli-color@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-1.3.0.tgz#cd2ec212efbd1a0eeb5b017f17d4e2d15e91420f" - integrity sha512-XmbLr8MzgOup/sPHF4nOZerCOcL7rD7vKWpEl0axUsMAY+AEimOhYva1ksskWqkLGY/bjR9h7Cfbr+RrJRfmTQ== dependencies: ansi-regex "^2.1.1" d "1" @@ -1625,19 +1409,16 @@ cli-color@^1.2.0: cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= dependencies: restore-cursor "^2.0.0" cli-width@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - integrity sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE= dependencies: center-align "^0.1.1" right-align "^0.1.1" @@ -1646,7 +1427,6 @@ cliui@^2.1.0: cliui@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= dependencies: string-width "^1.0.1" strip-ansi "^3.0.1" @@ -1655,7 +1435,6 @@ cliui@^3.2.0: cliui@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" - integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== dependencies: string-width "^2.1.1" strip-ansi "^4.0.0" @@ -1664,22 +1443,18 @@ cliui@^4.0.0: clone@2.x, clone@^2.0.0: version "2.1.2" resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= coinstring@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/coinstring/-/coinstring-2.3.0.tgz#cdb63363a961502404a25afb82c2e26d5ff627a4" - integrity sha1-zbYzY6lhUCQEolr7gsLibV/2J6Q= dependencies: bs58 "^2.0.1" create-hash "^1.1.1" @@ -1687,7 +1462,6 @@ coinstring@^2.0.0: collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= dependencies: map-visit "^1.0.0" object-visit "^1.0.0" @@ -1695,85 +1469,70 @@ collection-visit@^1.0.0: color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: color-name "1.1.3" color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= colors@1.0.x: version "1.0.3" resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" - integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= colors@^1.1.2: version "1.3.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.2.tgz#2df8ff573dfbf255af562f8ce7181d6b971a359b" - integrity sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ== combined-stream@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" - integrity sha1-cj599ugBrFYTETp+RFqbactjKBg= dependencies: delayed-stream "~1.0.0" combined-stream@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" - integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== dependencies: delayed-stream "~1.0.0" commander@2.11.0: version "2.11.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" - integrity sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ== commander@2.15.1: version "2.15.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" - integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== commander@^2.11.0, commander@^2.14.1, commander@^2.15.0, commander@^2.8.1, commander@^2.9.0: version "2.19.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" - integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== commander@~2.17.1: version "2.17.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" - integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== commander@~2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4" - integrity sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ= dependencies: graceful-readlink ">= 1.0.0" compare-versions@^3.0.1: version "3.4.0" resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.4.0.tgz#e0747df5c9cb7f054d6d3dc3e1dbc444f9e92b26" - integrity sha512-tK69D7oNXXqUW3ZNo/z7NXTEz22TCF0pTE+YF9cxvaAM9XnkLo1fV621xCLrRR6aevJlKxExkss0vWqUCUpqdg== component-emitter@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" - integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= concat-stream@^1.6.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== dependencies: buffer-from "^1.0.0" inherits "^2.0.3" @@ -1783,76 +1542,62 @@ concat-stream@^1.6.0: console-browserify@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" - integrity sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA= dependencies: date-now "^0.1.4" console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" - integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= content-disposition@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" - integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ= content-type@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== convert-source-map@^1.5.1: version "1.6.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" - integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== dependencies: safe-buffer "~5.1.1" cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= cookie@0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= cookiejar@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.2.tgz#dd8a235530752f988f9a0844f3fc589e3111125c" - integrity sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA== copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= core-js@^2.4.0, core-js@^2.5.0: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" - integrity sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= cors@^2.8.1: version "2.8.4" resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.4.tgz#2bd381f2eb201020105cd50ea59da63090694686" - integrity sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY= dependencies: object-assign "^4" vary "^1" @@ -1860,7 +1605,6 @@ cors@^2.8.1: coveralls@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.2.tgz#f5a0bcd90ca4e64e088b710fa8dda640aea4884f" - integrity sha512-Tv0LKe/MkBOilH2v7WBiTBdudg2ChfGbdXafc/s330djpF3zKOmuehTeRwjXWc7pzfj9FrDUTA7tEx6Div8NFw== dependencies: growl "~> 1.10.0" js-yaml "^3.11.0" @@ -1872,7 +1616,6 @@ coveralls@^3.0.1: create-ecdh@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" - integrity sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw== dependencies: bn.js "^4.1.0" elliptic "^6.0.0" @@ -1880,7 +1623,6 @@ create-ecdh@^4.0.0: create-hash@^1.1.0, create-hash@^1.1.1, create-hash@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== dependencies: cipher-base "^1.0.1" inherits "^2.0.1" @@ -1891,7 +1633,6 @@ create-hash@^1.1.0, create-hash@^1.1.1, create-hash@^1.1.2: create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: version "1.1.7" resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== dependencies: cipher-base "^1.0.3" create-hash "^1.1.0" @@ -1903,7 +1644,6 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: cron-parser@^2.4.0: version "2.6.0" resolved "https://registry.yarnpkg.com/cron-parser/-/cron-parser-2.6.0.tgz#ae2514ceda9ccb540256e201bdd23ae814e03674" - integrity sha512-KGfDDTjBIx85MnVYcdhLccoJH/7jcYW+5Z/t3Wsg2QlJhmmjf+97z+9sQftS71lopOYYapjEKEvmWaCsym5Z4g== dependencies: is-nan "^1.2.1" moment-timezone "^0.5.0" @@ -1911,7 +1651,6 @@ cron-parser@^2.4.0: cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= dependencies: lru-cache "^4.0.1" shebang-command "^1.2.0" @@ -1920,7 +1659,6 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0: crypto-browserify@3.12.0, crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== dependencies: browserify-cipher "^1.0.0" browserify-sign "^4.0.0" @@ -1937,115 +1675,84 @@ crypto-browserify@3.12.0, crypto-browserify@^3.11.0: crypto-js@^3.1.4, crypto-js@^3.1.5: version "3.1.8" resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.1.8.tgz#715f070bf6014f2ae992a98b3929258b713f08d5" - integrity sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU= crypto-js@^3.1.9-1: version "3.1.9-1" resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.1.9-1.tgz#fda19e761fc077e01ffbfdc6e9fdfc59e8806cd8" - integrity sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg= crypto-random-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" - integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= csextends@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/csextends/-/csextends-1.2.0.tgz#6374b210984b54d4495f29c99d3dd069b80543e5" - integrity sha512-S/8k1bDTJIwuGgQYmsRoE+8P+ohV32WhQ0l4zqrc0XDdxOhjQQD7/wTZwCzoZX53jSX3V/qwjT+OkPTxWQcmjg== cycle@1.0.x: version "1.0.3" resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2" - integrity sha1-IegLK+hYD5i0aPN5QwZisEbDStI= d@1: version "1.0.0" resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" - integrity sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8= dependencies: es5-ext "^0.10.9" dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= dependencies: assert-plus "^1.0.0" -date-extended@~0.0.3: - version "0.0.6" - resolved "https://registry.yarnpkg.com/date-extended/-/date-extended-0.0.6.tgz#23802d57dd1bf7818813fe0c32e851a86da267c9" - integrity sha1-I4AtV90b94GIE/4MMuhRqG2iZ8k= - dependencies: - array-extended "~0.0.3" - extended "~0.0.3" - is-extended "~0.0.3" - date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" - integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= death@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/death/-/death-1.1.0.tgz#01aa9c401edd92750514470b8266390c66c67318" - integrity sha1-AaqcQB7dknUFFEcLgmY5DGbGcxg= debug@*: version "4.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" - integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== dependencies: ms "^2.1.1" debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" debug@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== dependencies: ms "2.0.0" debug@^3.0.1, debug@^3.1.0: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== dependencies: ms "^2.1.1" decamelize@^1.0.0, decamelize@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -declare.js@~0.0.4: - version "0.0.8" - resolved "https://registry.yarnpkg.com/declare.js/-/declare.js-0.0.8.tgz#0478adff9564c004f51df73d8bc134019d28dcde" - integrity sha1-BHit/5VkwAT1Hfc9i8E0AZ0o3N4= decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= decompress-response@^3.2.0, decompress-response@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= dependencies: mimic-response "^1.0.0" decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/decompress-tar/-/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1" - integrity sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ== dependencies: file-type "^5.2.0" is-stream "^1.1.0" @@ -2054,7 +1761,6 @@ decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: decompress-tarbz2@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz#3082a5b880ea4043816349f378b56c516be1a39b" - integrity sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A== dependencies: decompress-tar "^4.1.0" file-type "^6.1.0" @@ -2065,7 +1771,6 @@ decompress-tarbz2@^4.0.0: decompress-targz@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/decompress-targz/-/decompress-targz-4.1.1.tgz#c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee" - integrity sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w== dependencies: decompress-tar "^4.1.1" file-type "^5.2.0" @@ -2074,7 +1779,6 @@ decompress-targz@^4.0.0: decompress-unzip@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/decompress-unzip/-/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69" - integrity sha1-3qrM39FK6vhVePczroIQ+bSEj2k= dependencies: file-type "^3.8.0" get-stream "^2.2.0" @@ -2084,7 +1788,6 @@ decompress-unzip@^4.0.1: decompress@^4.0.0: version "4.2.0" resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.0.tgz#7aedd85427e5a92dacfe55674a7c505e96d01f9d" - integrity sha1-eu3YVCflqS2s/lVnSnxQXpbQH50= dependencies: decompress-tar "^4.0.0" decompress-tarbz2 "^4.0.0" @@ -2098,57 +1801,52 @@ decompress@^4.0.0: deep-assign@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/deep-assign/-/deep-assign-2.0.0.tgz#ebe06b1f07f08dae597620e3dd1622f371a1c572" - integrity sha1-6+BrHwfwja5ZdiDj3RYi83GhxXI= dependencies: is-obj "^1.0.0" +deep-equal@~0.2.1: + version "0.2.2" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-0.2.2.tgz#84b745896f34c684e98f2ce0e42abaf43bba017d" + deep-equal@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" - integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= deferred-leveldown@~1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz#3acd2e0b75d1669924bc0a4b642851131173e1eb" - integrity sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA== dependencies: abstract-leveldown "~2.6.0" define-properties@^1.1.1, define-properties@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== dependencies: object-keys "^1.0.12" define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= dependencies: is-descriptor "^0.1.0" define-property@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= dependencies: is-descriptor "^1.0.0" define-property@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== dependencies: is-descriptor "^1.0.2" isobject "^3.0.1" @@ -2156,12 +1854,10 @@ define-property@^2.0.2: defined@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" - integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= del@^2.0.2: version "2.2.2" resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" - integrity sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag= dependencies: globby "^5.0.0" is-path-cwd "^1.0.0" @@ -2174,27 +1870,22 @@ del@^2.0.2: delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= delimit-stream@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/delimit-stream/-/delimit-stream-0.1.0.tgz#9b8319477c0e5f8aeb3ce357ae305fc25ea1cd2b" - integrity sha1-m4MZR3wOX4rrPONXrjBfwl6hzSs= depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= des.js@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" - integrity sha1-wHTS4qpqipoH29YfmhXCzYPsjsw= dependencies: inherits "^2.0.1" minimalistic-assert "^1.0.0" @@ -2202,34 +1893,28 @@ des.js@^1.0.0: destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= dependencies: repeating "^2.0.0" detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= diff@3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" - integrity sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww== diff@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" - integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== dependencies: bn.js "^4.1.0" miller-rabin "^4.0.0" @@ -2238,7 +1923,6 @@ diffie-hellman@^5.0.0: doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" - integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= dependencies: esutils "^2.0.2" isarray "^1.0.0" @@ -2246,24 +1930,20 @@ doctrine@1.5.0: doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== dependencies: esutils "^2.0.2" dom-walk@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" - integrity sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg= domain-browser@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" - integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== drbg.js@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/drbg.js/-/drbg.js-1.0.1.tgz#3e36b6c42b37043823cdbc332d58f31e2445480b" - integrity sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs= dependencies: browserify-aes "^1.0.6" create-hash "^1.1.2" @@ -2272,19 +1952,16 @@ drbg.js@^1.0.1: duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= eachr@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/eachr/-/eachr-2.0.4.tgz#466f7caa10708f610509e32c807aafe57fc122bf" - integrity sha1-Rm98qhBwj2EFCeMsgHqv5X/BIr8= dependencies: typechecker "^2.0.8" ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= dependencies: jsbn "~0.1.0" safer-buffer "^2.1.0" @@ -2292,12 +1969,10 @@ ecc-jsbn@~0.1.1: editions@^1.1.1, editions@^1.3.3, editions@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/editions/-/editions-1.3.4.tgz#3662cb592347c3168eb8e498a0ff73271d67f50b" - integrity sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg== editions@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/editions/-/editions-2.0.2.tgz#54fdac6fb24b0a1a72ffc1ba0126c10602c3e0bd" - integrity sha512-0B8aSTWUu9+JW99zHoeogavCi+lkE5l35FK0OKe0pCobixJYoeof3ZujtqYzSsU2MskhRadY5V9oWUuyG4aJ3A== dependencies: errlop "^1.0.2" semver "^5.5.0" @@ -2305,17 +1980,14 @@ editions@^2.0.2: ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.3.47: version "1.3.78" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.78.tgz#ecb72b5b166ba6598efb384461d63cad74678ebf" - integrity sha512-p4D/5iX08c3LNep5bWn/X3dFmec1K9le6O43lgRsO/vYKBTH2smWDMDfkGlPtERFcLVkI8xdKW5EokBZODh1xg== elliptic@6.3.3: version "6.3.3" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.3.tgz#5482d9646d54bcb89fd7d994fc9e2e9568876e3f" - integrity sha1-VILZZG1UvLif19mU/J4ulWiHbj8= dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -2325,7 +1997,6 @@ elliptic@6.3.3: elliptic@=6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" - integrity sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8= dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -2338,7 +2009,6 @@ elliptic@=6.4.0: elliptic@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-3.1.0.tgz#c21682ef762769b56a74201609105da11d5f60cc" - integrity sha1-whaC73YnabVqdCAWCRBdoR1fYMw= dependencies: bn.js "^2.0.3" brorand "^1.0.1" @@ -2348,7 +2018,6 @@ elliptic@^3.1.0: elliptic@^6.0.0, elliptic@^6.2.3, elliptic@^6.4.0: version "6.4.1" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a" - integrity sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ== dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -2361,31 +2030,26 @@ elliptic@^6.0.0, elliptic@^6.2.3, elliptic@^6.4.0: emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= encoding@^0.1.11: version "0.1.12" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" - integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s= dependencies: iconv-lite "~0.4.13" end-of-stream@^1.0.0: version "1.4.1" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== dependencies: once "^1.4.0" enhanced-resolve@^3.4.0: version "3.4.1" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz#0421e339fd71419b3da13d129b3979040230476e" - integrity sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24= dependencies: graceful-fs "^4.1.2" memory-fs "^0.4.0" @@ -2395,33 +2059,28 @@ enhanced-resolve@^3.4.0: eol@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/eol/-/eol-0.9.1.tgz#f701912f504074be35c6117a5c4ade49cd547acd" - integrity sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg== errlop@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/errlop/-/errlop-1.0.3.tgz#dba29c90cf832c3d2ce469fe515d7e5eef2c6676" - integrity sha512-5VTnt0yikY4LlQEfCXVSqfE6oLj1HVM4zVSvAKMnoYjL/zrb6nqiLowZS4XlG7xENfyj7lpYWvT+wfSCr6dtlA== dependencies: editions "^1.3.4" errno@^0.1.3, errno@~0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" - integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== dependencies: prr "~1.0.1" error-ex@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== dependencies: is-arrayish "^0.2.1" es-abstract@^1.5.0: version "1.12.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" - integrity sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA== dependencies: es-to-primitive "^1.1.1" function-bind "^1.1.1" @@ -2432,7 +2091,6 @@ es-abstract@^1.5.0: es-to-primitive@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" - integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== dependencies: is-callable "^1.1.4" is-date-object "^1.0.1" @@ -2441,7 +2099,6 @@ es-to-primitive@^1.1.1: es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.45, es5-ext@^0.10.46, es5-ext@^0.10.9, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: version "0.10.46" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.46.tgz#efd99f67c5a7ec789baa3daa7f79870388f7f572" - integrity sha512-24XxRvJXNFwEMpJb3nOkiRJKRoupmjYmOPVlI65Qy2SrtxwOTB+g6ODjBKOtwEHbYrhWRty9xxOWLNdClT2djw== dependencies: es6-iterator "~2.0.3" es6-symbol "~3.1.1" @@ -2450,7 +2107,6 @@ es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.45, es5-ext@^0.10.46, es5-ext@ es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.1, es6-iterator@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= dependencies: d "1" es5-ext "^0.10.35" @@ -2459,7 +2115,6 @@ es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.1, es6-iterator@~2.0 es6-map@^0.1.3: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" - integrity sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA= dependencies: d "1" es5-ext "~0.10.14" @@ -2471,7 +2126,6 @@ es6-map@^0.1.3: es6-set@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" - integrity sha1-0rPsXU2ADO2BjbU40ol02wpzzLE= dependencies: d "1" es5-ext "~0.10.14" @@ -2482,7 +2136,6 @@ es6-set@~0.1.5: es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - integrity sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc= dependencies: d "1" es5-ext "~0.10.14" @@ -2490,7 +2143,6 @@ es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: es6-weak-map@^2.0.1, es6-weak-map@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" - integrity sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8= dependencies: d "1" es5-ext "^0.10.14" @@ -2500,17 +2152,14 @@ es6-weak-map@^2.0.1, es6-weak-map@^2.0.2: escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= escodegen@1.8.x: version "1.8.1" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" - integrity sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg= dependencies: esprima "^2.7.1" estraverse "^1.9.1" @@ -2522,7 +2171,6 @@ escodegen@1.8.x: escope@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" - integrity sha1-4Bl16BJ4GhY6ba392AOY3GTIicM= dependencies: es6-map "^0.1.3" es6-weak-map "^2.0.1" @@ -2532,12 +2180,10 @@ escope@^3.6.0: eslint-config-standard@^11.0.0: version "11.0.0" resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz#87ee0d3c9d95382dc761958cbb23da9eea31e0ba" - integrity sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw== eslint-import-resolver-node@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" - integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== dependencies: debug "^2.6.9" resolve "^1.5.0" @@ -2545,7 +2191,6 @@ eslint-import-resolver-node@^0.3.1: eslint-module-utils@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746" - integrity sha1-snA2LNiLGkitMIl2zn+lTphBF0Y= dependencies: debug "^2.6.8" pkg-dir "^1.0.0" @@ -2553,7 +2198,6 @@ eslint-module-utils@^2.2.0: eslint-plugin-import@^2.10.0: version "2.14.0" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8" - integrity sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g== dependencies: contains-path "^0.1.0" debug "^2.6.8" @@ -2569,7 +2213,6 @@ eslint-plugin-import@^2.10.0: eslint-plugin-node@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz#bf19642298064379315d7a4b2a75937376fa05e4" - integrity sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw== dependencies: ignore "^3.3.6" minimatch "^3.0.4" @@ -2579,17 +2222,14 @@ eslint-plugin-node@^6.0.1: eslint-plugin-promise@^3.7.0: version "3.8.0" resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.8.0.tgz#65ebf27a845e3c1e9d6f6a5622ddd3801694b621" - integrity sha512-JiFL9UFR15NKpHyGii1ZcvmtIqa3UTwiDAGb8atSffe43qJ3+1czVGN6UtkklpcJ2DVnqvTMzEKRaJdBkAL2aQ== eslint-plugin-standard@^3.0.1: version "3.1.0" resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.1.0.tgz#2a9e21259ba4c47c02d53b2d0c9135d4b1022d47" - integrity sha512-fVcdyuKRr0EZ4fjWl3c+gp1BANFJD1+RaWa2UPYfMZ6jCtp5RG00kSaXnK/dE5sYzt4kaWJ9qdxqUfc0d9kX0w== eslint-scope@^3.7.1: version "3.7.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.3.tgz#bb507200d3d17f60247636160b4826284b108535" - integrity sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA== dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" @@ -2597,12 +2237,10 @@ eslint-scope@^3.7.1: eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" - integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== eslint@^4.19.1: version "4.19.1" resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" - integrity sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ== dependencies: ajv "^5.3.0" babel-code-frame "^6.22.0" @@ -2646,7 +2284,6 @@ eslint@^4.19.1: espree@^3.5.4: version "3.5.4" resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" - integrity sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A== dependencies: acorn "^5.5.0" acorn-jsx "^3.0.0" @@ -2654,51 +2291,42 @@ espree@^3.5.4: esprima@2.7.x, esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" - integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" - integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== dependencies: estraverse "^4.0.0" esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" - integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== dependencies: estraverse "^4.1.0" estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" - integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q= estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= eth-block-tracker@^2.2.2: version "2.3.1" resolved "https://registry.yarnpkg.com/eth-block-tracker/-/eth-block-tracker-2.3.1.tgz#ab6d177e5b50128fa06d7ae9e0489c7484bac95e" - integrity sha512-NamWuMBIl8kmkJFVj8WzGatySTzQPQag4Xr677yFxdVtIxACFbL/dQowk0MzEqIKk93U1TwY3MjVU6mOcwZnKA== dependencies: async-eventemitter ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c eth-query "^2.1.0" @@ -2712,7 +2340,6 @@ eth-block-tracker@^2.2.2: eth-lib@0.1.27, eth-lib@^0.1.26: version "0.1.27" resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.1.27.tgz#f0b0fd144f865d2d6bf8257a40004f2e75ca1dd6" - integrity sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA== dependencies: bn.js "^4.11.6" elliptic "^6.4.0" @@ -2725,7 +2352,6 @@ eth-lib@0.1.27, eth-lib@^0.1.26: eth-lib@0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.7.tgz#2f93f17b1e23aec3759cd4a3fe20c1286a3fc1ca" - integrity sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco= dependencies: bn.js "^4.11.6" elliptic "^6.4.0" @@ -2734,7 +2360,6 @@ eth-lib@0.2.7: eth-lightwallet@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/eth-lightwallet/-/eth-lightwallet-3.0.1.tgz#297022932aa568f4e4eb0873bff257f5e5b78709" - integrity sha512-79vVCETy+4l1b6wuOWwjqPW3Bom5ZK46BgkUNwaXhiMG1rrMRHjpjYEWMqH0JHeCzOzB4HBIFz7eK1/4s6w5nA== dependencies: bitcore-lib "^0.15.0" bitcore-mnemonic "^1.5.0" @@ -2751,7 +2376,6 @@ eth-lightwallet@^3.0.1: eth-query@^2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/eth-query/-/eth-query-2.1.2.tgz#d6741d9000106b51510c72db92d6365456a6da5e" - integrity sha1-1nQdkAAQa1FRDHLbktY2VFam2l4= dependencies: json-rpc-random-id "^1.0.0" xtend "^4.0.1" @@ -2759,7 +2383,6 @@ eth-query@^2.1.0: eth-sig-util@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-1.4.2.tgz#8d958202c7edbaae839707fba6f09ff327606210" - integrity sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA= dependencies: ethereumjs-abi "git+https://github.com/ethereumjs/ethereumjs-abi.git" ethereumjs-util "^5.1.1" @@ -2767,7 +2390,6 @@ eth-sig-util@^1.4.2: ethereum-bridge@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/ethereum-bridge/-/ethereum-bridge-0.6.1.tgz#53c93ed7c0e21752a91e5f089a5997e1d6fea228" - integrity sha512-yDTivI85618BoLI71yNRzW6iVcVN2rjnviCIzs0QOCOENj4XpYQhMDGhdqDi8XWDdzTd0Ja/Canuuh3vfE2IcA== dependencies: async "^2.4.1" borc "^2.0.2" @@ -2798,17 +2420,14 @@ ethereum-bridge@^0.6.1: ethereum-common@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.2.0.tgz#13bf966131cce1eeade62a1b434249bb4cb120ca" - integrity sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA== ethereum-common@^0.0.18: version "0.0.18" resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f" - integrity sha1-L9w1dvIykDNYl26znaeDIT/5Uj8= ethereumjs-abi@0.6.4: version "0.6.4" resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.4.tgz#9ba1bb056492d00c27279f6eccd4d58275912c1a" - integrity sha1-m6G7BWSS0AwnJ59uzNTVgnWRLBo= dependencies: bn.js "^4.10.0" ethereumjs-util "^4.3.0" @@ -2823,7 +2442,6 @@ ethereumjs-abi@^0.6.5, "ethereumjs-abi@git+https://github.com/ethereumjs/ethereu ethereumjs-account@^2.0.3: version "2.0.5" resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz#eeafc62de544cb07b0ee44b10f572c9c49e00a84" - integrity sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA== dependencies: ethereumjs-util "^5.0.0" rlp "^2.0.0" @@ -2832,7 +2450,6 @@ ethereumjs-account@^2.0.3: ethereumjs-block@^1.2.2, ethereumjs-block@~1.7.0: version "1.7.1" resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz#78b88e6cc56de29a6b4884ee75379b6860333c3f" - integrity sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg== dependencies: async "^2.0.1" ethereum-common "0.2.0" @@ -2843,26 +2460,22 @@ ethereumjs-block@^1.2.2, ethereumjs-block@~1.7.0: ethereumjs-common@~0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-0.4.1.tgz#27690a24a817b058cc3a2aedef9392e8d7d63984" - integrity sha512-ywYGsOeGCsMNWso5Y4GhjWI24FJv9FK7+VyVKiQgXg8ZRDPXJ7F/kJ1CnjtkjTvDF4e0yqU+FWswlqR3bmZQ9Q== ethereumjs-testrpc-sc@6.1.6: version "6.1.6" resolved "https://registry.yarnpkg.com/ethereumjs-testrpc-sc/-/ethereumjs-testrpc-sc-6.1.6.tgz#290595380b5182814564d4aa38f35b7788aab070" - integrity sha512-iv2qiGBFgk9mn5Nq2enX8dG5WQ7Lk+FCqpnxfPfH4Ns8KLPwttmNOy264nh3SXDJJvcQwz/XnlLteDQVILotbg== dependencies: source-map-support "^0.5.3" ethereumjs-testrpc@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/ethereumjs-testrpc/-/ethereumjs-testrpc-6.0.3.tgz#7a0b87bf3670f92f607f98fa6a78801d9741b124" - integrity sha512-lAxxsxDKK69Wuwqym2K49VpXtBvLEsXr1sryNG4AkvL5DomMdeCBbu3D87UEevKenLHBiT8GTjARwN6Yj039gA== dependencies: webpack "^3.0.0" ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.1, ethereumjs-tx@^1.3.3: version "1.3.7" resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz#88323a2d875b10549b8347e09f4862b546f3d89a" - integrity sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA== dependencies: ethereum-common "^0.0.18" ethereumjs-util "^5.0.0" @@ -2870,7 +2483,6 @@ ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.1, ethereumjs-tx@ ethereumjs-util@^4.3.0: version "4.5.0" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz#3e9428b317eebda3d7260d854fddda954b1f1bc6" - integrity sha1-PpQosxfuvaPXJg2FT93alUsfG8Y= dependencies: bn.js "^4.8.0" create-hash "^1.1.2" @@ -2881,7 +2493,6 @@ ethereumjs-util@^4.3.0: ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.3, ethereumjs-util@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz#3e0c0d1741471acf1036052d048623dee54ad642" - integrity sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA== dependencies: bn.js "^4.11.0" create-hash "^1.1.2" @@ -2894,7 +2505,6 @@ ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereum ethereumjs-vm@^2.0.2: version "2.4.0" resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-2.4.0.tgz#244f1e35f2755e537a13546111d1a4c159d34b13" - integrity sha512-MJ4lCWa5c6LhahhhvoDKW+YGjK00ZQn0RHHLh4L+WaH1k6Qv7/q3uTluew6sJGNCZdlO0yYMDXYW9qyxLHKlgQ== dependencies: async "^2.1.2" async-eventemitter "^0.2.2" @@ -2911,7 +2521,6 @@ ethereumjs-vm@^2.0.2: ethereumjs-wallet@^0.6.0: version "0.6.2" resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.2.tgz#67244b6af3e8113b53d709124b25477b64aeccda" - integrity sha512-DHEKPV9lYORM7dL8602dkb+AgdfzCYz2lxpdYQoD3OwG355LLDuivW9rGuLpDMCry/ORyBYV6n+QCo/71SwACg== dependencies: aes-js "^3.1.1" bs58check "^2.1.2" @@ -2925,7 +2534,6 @@ ethereumjs-wallet@^0.6.0: ethers@^3.0.15: version "3.0.29" resolved "https://registry.yarnpkg.com/ethers/-/ethers-3.0.29.tgz#ce8139955b4ed44456eb6764b089bb117c86775d" - integrity sha512-OGyA5pW5xFC5o/ZV5MfIoVp/EdA1QMg2bMJFf7Kznsz8m7IzzbgsPHTCjzSfKQDs/XDphGyRcA7A6bkIeJL4gw== dependencies: aes-js "3.0.0" bn.js "^4.4.0" @@ -2941,7 +2549,6 @@ ethers@^3.0.15: ethjs-abi@0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/ethjs-abi/-/ethjs-abi-0.1.8.tgz#cd288583ed628cdfadaf8adefa3ba1dbcbca6c18" - integrity sha1-zSiFg+1ijN+tr4re+juh28vKbBg= dependencies: bn.js "4.11.6" js-sha3 "0.5.5" @@ -2950,7 +2557,6 @@ ethjs-abi@0.1.8: ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" - integrity sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk= dependencies: bn.js "4.11.6" number-to-bn "1.7.0" @@ -2958,7 +2564,6 @@ ethjs-unit@0.1.6: ethjs-util@^0.1.3: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" - integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== dependencies: is-hex-prefixed "1.0.0" strip-hex-prefix "1.0.0" @@ -2966,7 +2571,6 @@ ethjs-util@^0.1.3: event-emitter@^0.3.5, event-emitter@~0.3.5: version "0.3.5" resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" - integrity sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk= dependencies: d "1" es5-ext "~0.10.14" @@ -2974,22 +2578,18 @@ event-emitter@^0.3.5, event-emitter@~0.3.5: eventemitter3@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.1.1.tgz#47786bdaa087caf7b1b75e73abc5c7d540158cd0" - integrity sha1-R3hr2qCHyvext15zq8XH1UAVjNA= events@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" - integrity sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ= events@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88" - integrity sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA== evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== dependencies: md5.js "^1.3.4" safe-buffer "^5.1.1" @@ -2997,7 +2597,6 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" @@ -3010,14 +2609,12 @@ execa@^0.7.0: expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= dependencies: is-posix-bracket "^0.1.0" expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= dependencies: debug "^2.3.3" define-property "^0.2.5" @@ -3030,14 +2627,12 @@ expand-brackets@^2.1.4: expand-range@^1.8.1: version "1.8.2" resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= dependencies: fill-range "^2.1.0" express@^4.14.0: version "4.16.4" resolved "https://registry.yarnpkg.com/express/-/express-4.16.4.tgz#fddef61926109e24c515ea97fd2f1bdbf62df12e" - integrity sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg== dependencies: accepts "~1.3.5" array-flatten "1.1.1" @@ -3073,14 +2668,12 @@ express@^4.14.0: extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= dependencies: is-extendable "^0.1.0" extend-shallow@^3.0.0, extend-shallow@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= dependencies: assign-symbols "^1.0.0" is-extendable "^1.0.1" @@ -3088,33 +2681,16 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extended@0.0.6, extended@~0.0.3: - version "0.0.6" - resolved "https://registry.yarnpkg.com/extended/-/extended-0.0.6.tgz#7fb8bf7b9dae397586e48570acfd642c78e50669" - integrity sha1-f7i/e52uOXWG5IVwrP1kLHjlBmk= - dependencies: - extender "~0.0.5" - -extender@~0.0.5: - version "0.0.10" - resolved "https://registry.yarnpkg.com/extender/-/extender-0.0.10.tgz#589c07482be61a1460b6d81f9c24aa67e8f324cd" - integrity sha1-WJwHSCvmGhRgttgfnCSqZ+jzJM0= - dependencies: - declare.js "~0.0.4" extendr@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/extendr/-/extendr-2.1.0.tgz#301aa0bbea565f4d2dc8f570f2a22611a8527b56" - integrity sha1-MBqgu+pWX00tyPVw8qImEahSe1Y= dependencies: typechecker "~2.0.1" external-editor@^2.0.4: version "2.2.0" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" - integrity sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A== dependencies: chardet "^0.4.0" iconv-lite "^0.4.17" @@ -3123,14 +2699,12 @@ external-editor@^2.0.4: extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= dependencies: is-extglob "^1.0.0" extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== dependencies: array-unique "^0.3.2" define-property "^1.0.0" @@ -3144,87 +2718,64 @@ extglob@^2.0.4: extract-opts@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/extract-opts/-/extract-opts-2.2.0.tgz#1fa28eba7352c6db480f885ceb71a46810be6d7d" - integrity sha1-H6KOunNSxttID4hc63GkaBC+bX0= dependencies: typechecker "~2.0.1" extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= extsprintf@^1.2.0: version "1.4.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= eyes@0.1.x: version "0.1.8" resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" - integrity sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A= fake-merkle-patricia-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz#4b8c3acfb520afadf9860b1f14cd8ce3402cddd3" - integrity sha1-S4w6z7Ugr635hgsfFM2M40As3dM= dependencies: checkpoint-store "^1.1.0" -fast-csv@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/fast-csv/-/fast-csv-2.4.1.tgz#bd7dd268391f729367b59445b8dd0ad026881b26" - integrity sha1-vX3SaDkfcpNntZRFuN0K0CaIGyY= - dependencies: - extended "0.0.6" - is-extended "0.0.10" - object-extended "0.0.7" - string-extended "0.0.8" - fast-deep-equal@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= fast-deep-equal@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fd-slicer@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= dependencies: pend "~1.2.0" fetch-ponyfill@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz#ae3ce5f732c645eab87e4ae8793414709b239893" - integrity sha1-rjzl9zLGReq4fkroeTQUcJsjmJM= dependencies: node-fetch "~1.7.1" figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= dependencies: escape-string-regexp "^1.0.5" file-entry-cache@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= dependencies: flat-cache "^1.2.1" object-assign "^4.0.1" @@ -3232,27 +2783,22 @@ file-entry-cache@^2.0.0: file-type@^3.8.0: version "3.9.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" - integrity sha1-JXoHg4TR24CHvESdEH1SpSZyuek= file-type@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6" - integrity sha1-LdvqfHP/42No365J3DOMBYwritY= file-type@^6.1.0: version "6.2.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919" - integrity sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg== filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= fill-range@^2.1.0: version "2.2.4" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== dependencies: is-number "^2.1.0" isobject "^2.0.0" @@ -3263,7 +2809,6 @@ fill-range@^2.1.0: fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= dependencies: extend-shallow "^2.0.1" is-number "^3.0.0" @@ -3273,7 +2818,6 @@ fill-range@^4.0.0: finalhandler@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" - integrity sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg== dependencies: debug "2.6.9" encodeurl "~1.0.2" @@ -3286,7 +2830,6 @@ finalhandler@1.1.1: find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= dependencies: path-exists "^2.0.0" pinkie-promise "^2.0.0" @@ -3294,14 +2837,12 @@ find-up@^1.0.0: find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= dependencies: locate-path "^2.0.0" flat-cache@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" - integrity sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE= dependencies: circular-json "^0.3.1" del "^2.0.2" @@ -3311,31 +2852,26 @@ flat-cache@^1.2.1: for-each@^0.3.2, for-each@~0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" - integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== dependencies: is-callable "^1.1.3" for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= for-own@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= dependencies: for-in "^1.0.1" forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= form-data@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" - integrity sha1-SXBJi+YEwgwAXU9cI67NIda0kJk= dependencies: asynckit "^0.4.0" combined-stream "1.0.6" @@ -3344,29 +2880,24 @@ form-data@~2.3.2: forwarded@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= dependencies: map-cache "^0.2.2" fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== fs-extra@^0.30.0: version "0.30.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= dependencies: graceful-fs "^4.1.2" jsonfile "^2.1.0" @@ -3377,7 +2908,6 @@ fs-extra@^0.30.0: fs-extra@^2.0.0, fs-extra@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-2.1.2.tgz#046c70163cef9aad46b0e4a7fa467fb22d71de35" - integrity sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU= dependencies: graceful-fs "^4.1.2" jsonfile "^2.1.0" @@ -3385,7 +2915,6 @@ fs-extra@^2.0.0, fs-extra@^2.1.2: fs-extra@^4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" - integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== dependencies: graceful-fs "^4.1.2" jsonfile "^4.0.0" @@ -3394,7 +2923,6 @@ fs-extra@^4.0.2: fs-extra@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd" - integrity sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ== dependencies: graceful-fs "^4.1.2" jsonfile "^4.0.0" @@ -3403,14 +2931,12 @@ fs-extra@^5.0.0: fs-minipass@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== dependencies: minipass "^2.2.1" fs-promise@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/fs-promise/-/fs-promise-2.0.3.tgz#f64e4f854bcf689aa8bddcba268916db3db46854" - integrity sha1-9k5PhUvPaJqovdy6JokW2z20aFQ= dependencies: any-promise "^1.3.0" fs-extra "^2.0.0" @@ -3420,17 +2946,14 @@ fs-promise@^2.0.0: fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fs@0.0.1-security: version "0.0.1-security" resolved "https://registry.yarnpkg.com/fs/-/fs-0.0.1-security.tgz#8a7bd37186b6dddf3813f23858b57ecaaf5e41d4" - integrity sha1-invTcYa23d84E/I4WLV+yq9eQdQ= fsevents@^1.0.0, fsevents@^1.2.2: version "1.2.4" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" - integrity sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg== dependencies: nan "^2.9.2" node-pre-gyp "^0.10.0" @@ -3438,7 +2961,6 @@ fsevents@^1.0.0, fsevents@^1.2.2: fstream@^1.0.2, fstream@^1.0.8: version "1.0.11" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" - integrity sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE= dependencies: graceful-fs "^4.1.2" inherits "~2.0.0" @@ -3448,24 +2970,20 @@ fstream@^1.0.2, fstream@^1.0.8: function-bind@^1.0.2, function-bind@^1.1.1, function-bind@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= ganache-cli@^6.1.8: version "6.1.8" resolved "https://registry.yarnpkg.com/ganache-cli/-/ganache-cli-6.1.8.tgz#49a8a331683a9652183f82ef1378d17e1814fcd3" - integrity sha512-yXzteu4SIgUL31mnpm9j+x6dpHUw0p/nsRVkcySKq0w+1vDxH9jMErP1QhZAJuTVE6ni4nfvGSNkaQx5cD3jfg== dependencies: source-map-support "^0.5.3" gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -3479,12 +2997,10 @@ gauge@~2.7.3: get-caller-file@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== get-stream@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" - integrity sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4= dependencies: object-assign "^4.0.1" pinkie-promise "^2.0.0" @@ -3492,24 +3008,20 @@ get-stream@^2.2.0: get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= dependencies: assert-plus "^1.0.0" glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= dependencies: glob-parent "^2.0.0" is-glob "^2.0.0" @@ -3517,14 +3029,12 @@ glob-base@^0.3.0: glob-parent@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= dependencies: is-glob "^2.0.0" glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= dependencies: is-glob "^3.1.0" path-dirname "^1.0.0" @@ -3532,7 +3042,6 @@ glob-parent@^3.1.0: glob@7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -3544,7 +3053,6 @@ glob@7.1.2: glob@^5.0.15: version "5.0.15" resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= dependencies: inflight "^1.0.4" inherits "2" @@ -3555,7 +3063,6 @@ glob@^5.0.15: glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.2: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -3567,7 +3074,6 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.2: glob@~6.0.4: version "6.0.4" resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" - integrity sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI= dependencies: inflight "^1.0.4" inherits "2" @@ -3578,7 +3084,6 @@ glob@~6.0.4: global@~4.3.0: version "4.3.2" resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" - integrity sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8= dependencies: min-document "^2.19.0" process "~0.5.1" @@ -3586,17 +3091,14 @@ global@~4.3.0: globals@^11.0.1: version "11.8.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.8.0.tgz#c1ef45ee9bed6badf0663c5cb90e8d1adec1321d" - integrity sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA== globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== globby@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" - integrity sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0= dependencies: array-union "^1.0.1" arrify "^1.0.0" @@ -3608,7 +3110,6 @@ globby@^5.0.0: got@7.1.0, got@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" - integrity sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw== dependencies: decompress-response "^3.2.0" duplexer3 "^0.1.4" @@ -3628,27 +3129,22 @@ got@7.1.0, got@^7.1.0: graceful-fs@*, graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= "graceful-readlink@>= 1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU= growl@1.10.3: version "1.10.3" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" - integrity sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q== growl@1.10.5, "growl@~> 1.10.0": version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== handlebars@^4.0.1: version "4.0.12" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5" - integrity sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA== dependencies: async "^2.5.0" optimist "^0.6.1" @@ -3659,12 +3155,10 @@ handlebars@^4.0.1: har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= har-validator@~5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" - integrity sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA== dependencies: ajv "^5.3.0" har-schema "^2.0.0" @@ -3672,51 +3166,42 @@ har-validator@~5.1.0: has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= dependencies: ansi-regex "^2.0.0" has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= has-symbol-support-x@^1.4.1: version "1.4.2" resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" - integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== has-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" - integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= has-to-string-tag-x@^1.2.0: version "1.4.1" resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" - integrity sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw== dependencies: has-symbol-support-x "^1.4.1" has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= dependencies: get-value "^2.0.3" has-values "^0.1.4" @@ -3725,7 +3210,6 @@ has-value@^0.3.1: has-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= dependencies: get-value "^2.0.6" has-values "^1.0.0" @@ -3734,12 +3218,10 @@ has-value@^1.0.0: has-values@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= has-values@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= dependencies: is-number "^3.0.0" kind-of "^4.0.0" @@ -3747,14 +3229,12 @@ has-values@^1.0.0: has@^1.0.1, has@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: function-bind "^1.1.1" hash-base@^3.0.0: version "3.0.4" resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" - integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" @@ -3762,7 +3242,6 @@ hash-base@^3.0.0: hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.5" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.5.tgz#e38ab4b85dfb1e0c40fe9265c0e9b54854c23812" - integrity sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA== dependencies: inherits "^2.0.3" minimalistic-assert "^1.0.1" @@ -3770,7 +3249,6 @@ hash.js@^1.0.0, hash.js@^1.0.3: hdkey@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/hdkey/-/hdkey-1.1.0.tgz#e74e7b01d2c47f797fa65d1d839adb7a44639f29" - integrity sha512-E7aU8pNlWUJbXGjTz/+lKf1LkMcA3hUrC5ZleeizrmLSd++kvf8mSOe3q8CmBDA9j4hdfXO5iY6hGiTUCOV2jQ== dependencies: coinstring "^2.0.0" safe-buffer "^5.1.1" @@ -3779,12 +3257,10 @@ hdkey@^1.0.0: he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= dependencies: hash.js "^1.0.3" minimalistic-assert "^1.0.0" @@ -3793,7 +3269,6 @@ hmac-drbg@^1.0.0: home-or-tmp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.1" @@ -3801,12 +3276,10 @@ home-or-tmp@^2.0.0: hosted-git-info@^2.1.4: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" - integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: version "1.6.3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= dependencies: depd "~1.1.2" inherits "2.0.3" @@ -3816,12 +3289,10 @@ http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: http-https@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b" - integrity sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs= http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= dependencies: assert-plus "^1.0.0" jsprim "^1.2.2" @@ -3830,12 +3301,10 @@ http-signature@~1.2.0: https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= i18n@^0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/i18n/-/i18n-0.8.3.tgz#2d8cf1c24722602c2041d01ba6ae5eaa51388f0e" - integrity sha1-LYzxwkciYCwgQdAbpq5eqlE4jw4= dependencies: debug "*" make-plural "^3.0.3" @@ -3844,41 +3313,39 @@ i18n@^0.8.3: mustache "*" sprintf-js ">=1.0.3" +i@0.3.x: + version "0.3.6" + resolved "https://registry.yarnpkg.com/i/-/i-0.3.6.tgz#d96c92732076f072711b6b10fd7d4f65ad8ee23d" + iconv-lite@0.4.23: version "0.4.23" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== dependencies: safer-buffer ">= 2.1.2 < 3" iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" ieee754@^1.1.4, ieee754@^1.1.8: version "1.1.12" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b" - integrity sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA== ignore-walk@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== dependencies: minimatch "^3.0.4" ignore@^3.3.3, ignore@^3.3.6: version "3.3.10" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" - integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== ignorefs@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/ignorefs/-/ignorefs-1.2.0.tgz#da59fb858976e4a5e43702ccd1f282fdbc9e5756" - integrity sha1-2ln7hYl25KXkNwLM0fKC/byeV1Y= dependencies: editions "^1.3.3" ignorepatterns "^1.1.0" @@ -3886,27 +3353,22 @@ ignorefs@^1.0.0: ignorepatterns@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/ignorepatterns/-/ignorepatterns-1.1.0.tgz#ac8f436f2239b5dfb66d5f0d3a904a87ac67cc5e" - integrity sha1-rI9DbyI5td+2bV8NOpBKh6xnzF4= immediate@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c" - integrity sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw= imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= indexof@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" @@ -3914,22 +3376,18 @@ inflight@^1.0.4: inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= inherits@2.0.1, inherits@=2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== inquirer@^3.0.6: version "3.3.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" - integrity sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ== dependencies: ansi-escapes "^3.0.0" chalk "^2.0.0" @@ -3949,91 +3407,76 @@ inquirer@^3.0.6: interpret@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" - integrity sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ= invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== dependencies: loose-envify "^1.0.0" invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= ipaddr.js@1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.8.0.tgz#eaa33d6ddd7ace8f7f6fe0c9ca0440e706738b1e" - integrity sha1-6qM9bd16zo9/b+DJygRA5wZzix4= is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= dependencies: kind-of "^3.0.2" is-accessor-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== dependencies: kind-of "^6.0.0" is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= is-binary-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= dependencies: binary-extensions "^1.0.0" is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== is-builtin-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74= dependencies: builtin-modules "^1.0.0" is-callable@^1.1.3, is-callable@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" - integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= dependencies: kind-of "^3.0.2" is-data-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== dependencies: kind-of "^6.0.0" is-date-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== dependencies: is-accessor-descriptor "^0.1.6" is-data-descriptor "^0.1.4" @@ -4042,7 +3485,6 @@ is-descriptor@^0.1.0: is-descriptor@^1.0.0, is-descriptor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== dependencies: is-accessor-descriptor "^1.0.0" is-data-descriptor "^1.0.0" @@ -4051,261 +3493,210 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-dotfile@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= is-equal-shallow@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= dependencies: is-primitive "^2.0.0" is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= is-extendable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== dependencies: is-plain-object "^2.0.4" -is-extended@0.0.10, is-extended@~0.0.3, is-extended@~0.0.8: - version "0.0.10" - resolved "https://registry.yarnpkg.com/is-extended/-/is-extended-0.0.10.tgz#244e140df75bb1c9a3106f412ff182fb534a6d62" - integrity sha1-JE4UDfdbscmjEG9BL/GC+1NKbWI= - dependencies: - extended "~0.0.3" - is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-finite@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" - integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= dependencies: number-is-nan "^1.0.0" is-fn@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fn/-/is-fn-1.0.0.tgz#9543d5de7bcf5b08a22ec8a20bae6e286d510d8c" - integrity sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw= is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= dependencies: number-is-nan "^1.0.0" is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= is-function@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" - integrity sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU= is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= dependencies: is-extglob "^1.0.0" is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= dependencies: is-extglob "^2.1.0" is-glob@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" - integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= dependencies: is-extglob "^2.1.1" is-hex-prefixed@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" - integrity sha1-fY035q135dEnFIkTxXPggtd39VQ= is-nan@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.2.1.tgz#9faf65b6fb6db24b7f5c0628475ea71f988401e2" - integrity sha1-n69ltvttskt/XAYoR16nH5iEAeI= dependencies: define-properties "^1.1.1" is-natural-number@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" - integrity sha1-q5124dtM7VHjXeDHLr7PCfc0zeg= is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= dependencies: kind-of "^3.0.2" is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= dependencies: kind-of "^3.0.2" is-number@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== is-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" - integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= is-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" - integrity sha1-iVJojF7C/9awPsyF52ngKQMINHA= is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= is-path-in-cwd@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" - integrity sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ== dependencies: is-path-inside "^1.0.0" is-path-inside@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" - integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= dependencies: path-is-inside "^1.0.1" is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: isobject "^3.0.1" is-posix-bracket@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= is-promise@^2.1, is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= is-regex@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= dependencies: has "^1.0.1" is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" - integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== is-retry-allowed@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" - integrity sha1-EaBgVotnM5REAz0BJaYaINVk+zQ= is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= is-symbol@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" - integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== dependencies: has-symbols "^1.0.0" is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= dependencies: isarray "1.0.0" isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= isomorphic-fetch@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" - integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk= dependencies: node-fetch "^1.0.1" whatwg-fetch ">=0.10.0" @@ -4313,12 +3704,10 @@ isomorphic-fetch@^2.2.0: isstream@0.1.x, isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= istanbul@^0.4.5: version "0.4.5" resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" - integrity sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs= dependencies: abbrev "1.0.x" async "1.x" @@ -4338,7 +3727,6 @@ istanbul@^0.4.5: isurl@^1.0.0-alpha5: version "1.0.0" resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" - integrity sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w== dependencies: has-to-string-tag-x "^1.2.0" is-object "^1.0.1" @@ -4346,37 +3734,30 @@ isurl@^1.0.0-alpha5: js-sha3@0.5.5: version "0.5.5" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.5.tgz#baf0c0e8c54ad5903447df96ade7a4a1bca79a4a" - integrity sha1-uvDA6MVK1ZA0R9+Wreekobynmko= js-sha3@0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" - integrity sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc= js-sha3@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.3.1.tgz#86122802142f0828502a0d1dee1d95e253bb0243" - integrity sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM= js-string-escape@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef" - integrity sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8= "js-tokens@^3.0.0 || ^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= js-yaml@3.x, js-yaml@^3.11.0, js-yaml@^3.9.1: version "3.12.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" - integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -4384,27 +3765,22 @@ js-yaml@3.x, js-yaml@^3.11.0, js-yaml@^3.9.1: jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" - integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= json-loader@^0.5.4: version "0.5.7" resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" - integrity sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w== json-rpc-engine@^3.6.0: version "3.8.0" resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz#9d4ff447241792e1d0a232f6ef927302bb0c62a9" - integrity sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA== dependencies: async "^2.0.1" babel-preset-env "^1.7.0" @@ -4416,82 +3792,68 @@ json-rpc-engine@^3.6.0: json-rpc-error@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/json-rpc-error/-/json-rpc-error-2.0.0.tgz#a7af9c202838b5e905c7250e547f1aff77258a02" - integrity sha1-p6+cICg4tekFxyUOVH8a/3cligI= dependencies: inherits "^2.0.1" json-rpc-random-id@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz#ba49d96aded1444dbb8da3d203748acbbcdec8c8" - integrity sha1-uknZat7RRE27jaPSA3SKy7zeyMg= json-schema-traverse@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - integrity sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8= dependencies: jsonify "~0.0.0" json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= json-text-sequence@^0.1: version "0.1.1" resolved "https://registry.yarnpkg.com/json-text-sequence/-/json-text-sequence-0.1.1.tgz#a72f217dc4afc4629fff5feb304dc1bd51a2f3d2" - integrity sha1-py8hfcSvxGKf/1/rME3BvVGi89I= dependencies: delimit-stream "0.1.0" json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= optionalDependencies: graceful-fs "^4.1.6" jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= optionalDependencies: graceful-fs "^4.1.6" jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= dependencies: assert-plus "1.0.0" extsprintf "1.3.0" @@ -4501,7 +3863,6 @@ jsprim@^1.2.2: keccak@^1.0.2: version "1.4.0" resolved "https://registry.yarnpkg.com/keccak/-/keccak-1.4.0.tgz#572f8a6dbee8e7b3aa421550f9e6408ca2186f80" - integrity sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw== dependencies: bindings "^1.2.1" inherits "^2.0.3" @@ -4511,7 +3872,6 @@ keccak@^1.0.2: keccakjs@^0.2.0, keccakjs@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/keccakjs/-/keccakjs-0.2.1.tgz#1d633af907ef305bbf9f2fa616d56c44561dfa4d" - integrity sha1-HWM6+QfvMFu/ny+mFtVsRFYd+k0= dependencies: browserify-sha3 "^0.0.1" sha3 "^1.1.0" @@ -4519,74 +3879,62 @@ keccakjs@^0.2.0, keccakjs@^0.2.1: kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= dependencies: is-buffer "^1.1.5" kind-of@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= dependencies: is-buffer "^1.1.5" kind-of@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== klaw@^1.0.0: version "1.3.1" resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= optionalDependencies: graceful-fs "^4.1.9" lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= lcid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= dependencies: invert-kv "^1.0.0" lcov-parse@^0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" - integrity sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM= level-codec@~7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-7.0.1.tgz#341f22f907ce0f16763f24bddd681e395a0fb8a7" - integrity sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ== level-errors@^1.0.3: version "1.1.2" resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.1.2.tgz#4399c2f3d3ab87d0625f7e3676e2d807deff404d" - integrity sha512-Sw/IJwWbPKF5Ai4Wz60B52yj0zYeqzObLh8k1Tk88jVmD51cJSKWSYpRyhVIvFzZdvsPqlH5wfhp/yxdsaQH4w== dependencies: errno "~0.1.1" level-errors@~1.0.3: version "1.0.5" resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.0.5.tgz#83dbfb12f0b8a2516bdc9a31c4876038e227b859" - integrity sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig== dependencies: errno "~0.1.1" level-iterator-stream@~1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz#e43b78b1a8143e6fa97a4f485eb8ea530352f2ed" - integrity sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0= dependencies: inherits "^2.0.1" level-errors "^1.0.3" @@ -4596,7 +3944,6 @@ level-iterator-stream@~1.3.0: level-ws@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-0.0.0.tgz#372e512177924a00424b0b43aef2bb42496d228b" - integrity sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos= dependencies: readable-stream "~1.0.15" xtend "~2.1.1" @@ -4604,7 +3951,6 @@ level-ws@0.0.0: levelup@^1.2.1: version "1.3.9" resolved "https://registry.yarnpkg.com/levelup/-/levelup-1.3.9.tgz#2dbcae845b2bb2b6bea84df334c475533bbd82ab" - integrity sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ== dependencies: deferred-leveldown "~1.2.1" level-codec "~7.0.0" @@ -4617,7 +3963,6 @@ levelup@^1.2.1: levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= dependencies: prelude-ls "~1.1.2" type-check "~0.3.2" @@ -4625,7 +3970,6 @@ levn@^0.3.0, levn@~0.3.0: load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" - integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" @@ -4636,7 +3980,6 @@ load-json-file@^1.0.0: load-json-file@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" - integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" @@ -4646,12 +3989,10 @@ load-json-file@^2.0.0: loader-runner@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.1.tgz#026f12fe7c3115992896ac02ba022ba92971b979" - integrity sha512-By6ZFY7ETWOc9RFaAIb23IjJVcM4dvJC/N57nmdz9RSkMXvAXGI7SyVlAw3v8vjtDRlqThgVDVmTnr9fqMlxkw== loader-utils@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd" - integrity sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0= dependencies: big.js "^3.1.3" emojis-list "^2.0.0" @@ -4660,7 +4001,6 @@ loader-utils@^1.1.0: locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= dependencies: p-locate "^2.0.0" path-exists "^3.0.0" @@ -4668,54 +4008,44 @@ locate-path@^2.0.0: lodash.assign@^4.0.3, lodash.assign@^4.0.6: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" - integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= lodash@4.x, lodash@^4.13.1, lodash@^4.14.2, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== lodash@=4.17.4: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" - integrity sha1-eCA6TRwyiuHYbcpkYONptX9AVa4= log-driver@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" - integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== long-timeout@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/long-timeout/-/long-timeout-0.1.1.tgz#9721d788b47e0bcb5a24c2e2bee1a0da55dab514" - integrity sha1-lyHXiLR+C8taJMLivuGg2lXatRQ= longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - integrity sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc= loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: js-tokens "^3.0.0 || ^4.0.0" lowercase-keys@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" - integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== lru-cache@^4.0.1: version "4.1.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" - integrity sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA== dependencies: pseudomap "^1.0.2" yallist "^2.1.2" @@ -4723,57 +4053,48 @@ lru-cache@^4.0.1: lru-queue@0.1: version "0.1.0" resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" - integrity sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM= dependencies: es5-ext "~0.10.2" ltgt@~2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" - integrity sha1-81ypHEk/e3PaDgdJUwTxezH4fuU= make-dir@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" - integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== dependencies: pify "^3.0.0" make-plural@^3.0.3, make-plural@~3.0.3: version "3.0.6" resolved "https://registry.yarnpkg.com/make-plural/-/make-plural-3.0.6.tgz#2033a03bac290b8f3bb91258f65b9df7e8b01ca7" - integrity sha1-IDOgO6wpC487uRJY9lud9+iwHKc= optionalDependencies: minimist "^1.2.0" map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= map-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= dependencies: object-visit "^1.0.0" math-interval-parser@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/math-interval-parser/-/math-interval-parser-1.1.0.tgz#dbeda5b06b3249973c6df6170fde2386f0afd893" - integrity sha1-2+2lsGsySZc8bfYXD94jhvCv2JM= dependencies: xregexp "^2.0.0" math-random@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" - integrity sha1-izqsWIuKZuSXXjzepn97sylgH6w= md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== dependencies: hash-base "^3.0.0" inherits "^2.0.1" @@ -4782,19 +4103,16 @@ md5.js@^1.3.4: media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= mem@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" - integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= dependencies: mimic-fn "^1.0.0" memdown@^1.0.0: version "1.4.1" resolved "https://registry.yarnpkg.com/memdown/-/memdown-1.4.1.tgz#b4e4e192174664ffbae41361aa500f3119efe215" - integrity sha1-tOThkhdGZP+65BNhqlAPMRnv4hU= dependencies: abstract-leveldown "~2.7.1" functional-red-black-tree "^1.0.1" @@ -4806,7 +4124,6 @@ memdown@^1.0.0: memoizee@^0.4.14: version "0.4.14" resolved "https://registry.yarnpkg.com/memoizee/-/memoizee-0.4.14.tgz#07a00f204699f9a95c2d9e77218271c7cd610d57" - integrity sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg== dependencies: d "1" es5-ext "^0.10.45" @@ -4820,7 +4137,6 @@ memoizee@^0.4.14: memory-fs@^0.4.0, memory-fs@~0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" - integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= dependencies: errno "^0.1.3" readable-stream "^2.0.1" @@ -4828,17 +4144,14 @@ memory-fs@^0.4.0, memory-fs@~0.4.1: memorystream@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" - integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= merkle-patricia-tree@^2.1.2: version "2.3.2" resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz#982ca1b5a0fde00eed2f6aeed1f9152860b8208a" - integrity sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g== dependencies: async "^1.4.2" ethereumjs-util "^5.0.0" @@ -4852,7 +4165,6 @@ merkle-patricia-tree@^2.1.2: messageformat@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/messageformat/-/messageformat-0.3.1.tgz#e58fff8245e9b3971799e5b43db58b3e9417f5a2" - integrity sha1-5Y//gkXps5cXmeW0PbWLPpQX9aI= dependencies: async "~1.5.2" glob "~6.0.4" @@ -4863,12 +4175,10 @@ messageformat@^0.3.1: methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= micromatch@^2.1.5: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= dependencies: arr-diff "^2.0.0" array-unique "^0.2.1" @@ -4887,7 +4197,6 @@ micromatch@^2.1.5: micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -4906,7 +4215,6 @@ micromatch@^3.1.10, micromatch@^3.1.4: miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== dependencies: bn.js "^4.0.0" brorand "^1.0.1" @@ -4914,73 +4222,60 @@ miller-rabin@^4.0.0: mime-db@~1.36.0: version "1.36.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" - integrity sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw== mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.18, mime-types@~2.1.19: version "2.1.20" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" - integrity sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A== dependencies: mime-db "~1.36.0" mime@1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" - integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ== mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== mimic-response@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== min-document@^2.19.0: version "2.19.0" resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" - integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU= dependencies: dom-walk "^0.1.0" minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= "minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= minimist@^1.2.0, minimist@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= minimist@~0.0.1: version "0.0.10" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= minipass@^2.2.1, minipass@^2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.4.tgz#4768d7605ed6194d6d576169b9e12ef71e9d9957" - integrity sha512-mlouk1OHlaUE8Odt1drMtG1bAJA4ZA6B/ehysgV0LUIrDHdKgo1KorZq3pK0b/7Z7LJIQ12MNM6aC+Tn6lUZ5w== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" @@ -4988,14 +4283,12 @@ minipass@^2.2.1, minipass@^2.3.3: minizlib@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.1.tgz#6734acc045a46e61d596a43bb9d9cd326e19cc42" - integrity sha512-TrfjCjk4jLhcJyGMYymBH6oTXcWjYbUAXTHDbtnWHjZC25h0cdajHuPE1zxb4DVmu8crfh+HwH/WMuyLG0nHBg== dependencies: minipass "^2.2.1" mixin-deep@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" @@ -5003,21 +4296,18 @@ mixin-deep@^1.2.0: mkdirp-promise@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" - integrity sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE= dependencies: mkdirp "*" -mkdirp@*, mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +mkdirp@*, mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@0.x.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" mocha@^4.0.1, mocha@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.1.0.tgz#7d86cfbcf35cb829e2754c32e17355ec05338794" - integrity sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA== dependencies: browser-stdout "1.3.0" commander "2.11.0" @@ -5033,7 +4323,6 @@ mocha@^4.0.1, mocha@^4.1.0: mocha@^5.0.1: version "5.2.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" - integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== dependencies: browser-stdout "1.3.1" commander "2.15.1" @@ -5050,39 +4339,32 @@ mocha@^5.0.1: mock-fs@^4.1.0: version "4.7.0" resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.7.0.tgz#9f17e219cacb8094f4010e0a8c38589e2b33c299" - integrity sha512-WlQNtUlzMRpvLHf8dqeUmNqfdPjGY29KrJF50Ldb4AcL+vQeR8QH3wQcFMgrhTwb1gHjZn9xggho+84tBskLgA== moment-timezone@^0.5.0: version "0.5.21" resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.21.tgz#3cba247d84492174dbf71de2a9848fa13207b845" - integrity sha512-j96bAh4otsgj3lKydm3K7kdtA3iKf2m6MY2iSYCzCm5a1zmHo1g+aK3068dDEeocLZQIS9kU8bsdQHLqEvgW0A== dependencies: moment ">= 2.9.0" "moment@>= 2.9.0", moment@^2.22.2: version "2.22.2" resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66" - integrity sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y= mout@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/mout/-/mout-0.11.1.tgz#ba3611df5f0e5b1ffbfd01166b8f02d1f5fa2b99" - integrity sha1-ujYR318OWx/7/QEWa48C0fX6K5k= ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= ms@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== multihashes@^0.4.5: version "0.4.14" resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-0.4.14.tgz#774db9a161f81a8a27dc60788f91248e020f5244" - integrity sha512-V/g/EIN6nALXfS/xHUAgtfPP3mn3sPIF/i9beuGKf25QXS2QZYCpeVJbDPEannkz32B2fihzCe2D/KMrbcmefg== dependencies: bs58 "^4.0.1" varint "^5.0.0" @@ -5090,22 +4372,18 @@ multihashes@^0.4.5: mustache@*: version "3.0.0" resolved "https://registry.yarnpkg.com/mustache/-/mustache-3.0.0.tgz#3de22dd9ba38152f7355399a953dd4528c403338" - integrity sha512-bhBDkK/PioIbtQzRIbGUGypvc3MC4c389QnJt8KDIEJ666OidRPoXAQAHPivikfS3JkMEaWoPvcDL7YrQxtSwg== mustache@^2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/mustache/-/mustache-2.3.2.tgz#a6d4d9c3f91d13359ab889a812954f9230a3d0c5" - integrity sha512-KpMNwdQsYz3O/SBS1qJ/o3sqUJ5wSb8gb0pul8CO0S56b9Y2ALm8zCfsjPXsqGFfoNBkDwZuZIAjhsZI03gYVQ== -mute-stream@0.0.7: +mute-stream@0.0.7, mute-stream@~0.0.4: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= mz@^2.6.0: version "2.7.0" resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" - integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== dependencies: any-promise "^1.0.0" object-assign "^4.0.1" @@ -5114,22 +4392,18 @@ mz@^2.6.0: nan@2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" - integrity sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA== nan@^2.0.8, nan@^2.2.1, nan@^2.3.3, nan@^2.9.2: version "2.11.1" resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.1.tgz#90e22bccb8ca57ea4cd37cc83d3819b52eea6766" - integrity sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA== nano-json-stream-parser@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" - integrity sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18= nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -5146,12 +4420,14 @@ nanomatch@^1.2.9: natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +ncp@1.0.x: + version "1.0.1" + resolved "http://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz#d15367e5cb87432ba117d2bf80fdf45aecfb4246" needle@^2.2.1: version "2.2.4" resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" - integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== dependencies: debug "^2.1.2" iconv-lite "^0.4.4" @@ -5160,27 +4436,22 @@ needle@^2.2.1: negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" - integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= neo-async@^2.5.0: version "2.5.2" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.2.tgz#489105ce7bc54e709d736b195f82135048c50fcc" - integrity sha512-vdqTKI9GBIYcAEbFAcpKPErKINfPF5zIuz3/niBfq8WUZjpT2tytLlFVrBgWdOtqI4uaA/Rb6No0hux39XXDuw== next-tick@1: version "1.0.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" - integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= node-async-loop@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/node-async-loop/-/node-async-loop-1.2.2.tgz#c5870299bf6477b780c88b431aa5b37733f55a3d" - integrity sha1-xYcCmb9kd7eAyItDGqWzdzP1Wj0= node-cache@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/node-cache/-/node-cache-4.2.0.tgz#48ac796a874e762582692004a376d26dfa875811" - integrity sha512-obRu6/f7S024ysheAjoYFEEBqqDWv4LOMNJEuO8vMeEw2AT4z+NCzO4hlc2lhI4vATzbCQv6kke9FVdx0RbCOw== dependencies: clone "2.x" lodash "4.x" @@ -5188,7 +4459,6 @@ node-cache@^4.1.1: node-fetch@^1.0.1, node-fetch@~1.7.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" - integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== dependencies: encoding "^0.1.11" is-stream "^1.0.1" @@ -5196,7 +4466,6 @@ node-fetch@^1.0.1, node-fetch@~1.7.1: node-libs-browser@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.1.0.tgz#5f94263d404f6e44767d726901fff05478d600df" - integrity sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg== dependencies: assert "^1.1.1" browserify-zlib "^0.2.0" @@ -5225,7 +4494,6 @@ node-libs-browser@^2.0.0: node-pre-gyp@^0.10.0: version "0.10.3" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" - integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== dependencies: detect-libc "^1.0.2" mkdirp "^0.5.1" @@ -5241,7 +4509,6 @@ node-pre-gyp@^0.10.0: node-schedule@^1.2.3: version "1.3.0" resolved "https://registry.yarnpkg.com/node-schedule/-/node-schedule-1.3.0.tgz#e7a7e816a7f2550d5b170bd106e765db28bdf030" - integrity sha512-NNwO9SUPjBwFmPh3vXiPVEhJLn4uqYmZYvJV358SRGM06BR4UoIqxJpeJwDDXB6atULsgQA97MfD1zMd5xsu+A== dependencies: cron-parser "^2.4.0" long-timeout "0.1.1" @@ -5250,14 +4517,12 @@ node-schedule@^1.2.3: nopt@3.x, nopt@~3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" - integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= dependencies: abbrev "1" nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= dependencies: abbrev "1" osenv "^0.1.4" @@ -5265,7 +4530,6 @@ nopt@^4.0.1: normalize-package-data@^2.3.2: version "2.4.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" - integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw== dependencies: hosted-git-info "^2.1.4" is-builtin-module "^1.0.0" @@ -5275,19 +4539,16 @@ normalize-package-data@^2.3.2: normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= dependencies: remove-trailing-separator "^1.0.1" npm-bundled@^1.0.1: version "1.0.5" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" - integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== npm-packlist@^1.1.6: version "1.1.12" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.12.tgz#22bde2ebc12e72ca482abd67afc51eb49377243a" - integrity sha512-WJKFOVMeAlsU/pjXuqVdzU0WfgtIBCupkEVwn+1Y0ERAbUfWw8R4GjgVbaKnUjRoD2FoQbHOCbOyT5Mbs9Lw4g== dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" @@ -5295,14 +4556,12 @@ npm-packlist@^1.1.6: npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= dependencies: path-key "^2.0.0" npmlog@^4.0.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== dependencies: are-we-there-yet "~1.1.2" console-control-strings "~1.1.0" @@ -5312,12 +4571,10 @@ npmlog@^4.0.2: number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= number-to-bn@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" - integrity sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA= dependencies: bn.js "4.11.6" strip-hex-prefix "1.0.0" @@ -5325,57 +4582,40 @@ number-to-bn@1.7.0: oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== object-assign@^4, object-assign@^4.0.0, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= dependencies: copy-descriptor "^0.1.0" define-property "^0.2.5" kind-of "^3.0.3" -object-extended@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/object-extended/-/object-extended-0.0.7.tgz#84fd23f56b15582aeb3e88b05cb55d2432d68a33" - integrity sha1-hP0j9WsVWCrrPoiwXLVdJDLWijM= - dependencies: - array-extended "~0.0.4" - extended "~0.0.3" - is-extended "~0.0.3" - object-inspect@~1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" - integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== object-keys@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" - integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== object-keys@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" - integrity sha1-KKaq50KN0sOpLz2V8hM13SBOAzY= object-visit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= dependencies: isobject "^3.0.0" object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= dependencies: for-own "^0.1.4" is-extendable "^0.1.1" @@ -5383,47 +4623,40 @@ object.omit@^2.0.0: object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= dependencies: isobject "^3.0.1" oboe@2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.3.tgz#2b4865dbd46be81225713f4e9bfe4bcf4f680a4f" - integrity sha1-K0hl29Rr6BIlcT9Om/5Lz09oCk8= dependencies: http-https "^1.0.0" on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= dependencies: ee-first "1.1.1" once@1.x, once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" onetime@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= dependencies: mimic-fn "^1.0.0" openzeppelin-solidity@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/openzeppelin-solidity/-/openzeppelin-solidity-1.10.0.tgz#d77eee6653f5958d051318a61ba0b436f92216c0" - integrity sha512-igkrumQQ2lrN2zjeQV4Dnb0GpTBj1fzMcd8HPyBUqwI0hhuscX/HzXiqKT6gFQl1j9Wy/ppVVs9fqL/foF7Gmg== optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= dependencies: minimist "~0.0.1" wordwrap "~0.0.2" @@ -5431,7 +4664,6 @@ optimist@^0.6.1: optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= dependencies: deep-is "~0.1.3" fast-levenshtein "~2.0.4" @@ -5443,29 +4675,24 @@ optionator@^0.8.1, optionator@^0.8.2: original-require@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/original-require/-/original-require-1.0.1.tgz#0f130471584cd33511c5ec38c8d59213f9ac5e20" - integrity sha1-DxMEcVhM0zURxew4yNWSE/msXiA= os-browserify@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= os-locale@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= dependencies: lcid "^1.0.0" os-locale@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" - integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== dependencies: execa "^0.7.0" lcid "^1.0.0" @@ -5474,12 +4701,10 @@ os-locale@^2.0.0: os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= osenv@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" @@ -5487,48 +4712,40 @@ osenv@^0.1.4: p-cancelable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" - integrity sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw== p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== dependencies: p-try "^1.0.0" p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= dependencies: p-limit "^1.1.0" p-timeout@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" - integrity sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y= dependencies: p-finally "^1.0.0" p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= pako@~1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" - integrity sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg== parse-asn1@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.1.tgz#f6bf293818332bd0dab54efb16087724745e6ca8" - integrity sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw== dependencies: asn1.js "^4.0.0" browserify-aes "^1.0.0" @@ -5539,7 +4756,6 @@ parse-asn1@^5.0.0: parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= dependencies: glob-base "^0.3.0" is-dotfile "^1.0.0" @@ -5549,7 +4765,6 @@ parse-glob@^3.0.4: parse-headers@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.1.tgz#6ae83a7aa25a9d9b700acc28698cd1f1ed7e9536" - integrity sha1-aug6eqJanZtwCswoaYzR8e1+lTY= dependencies: for-each "^0.3.2" trim "0.0.1" @@ -5557,71 +4772,58 @@ parse-headers@^2.0.0: parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= dependencies: error-ex "^1.2.0" parseurl@~1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" - integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= path-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" - integrity sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo= path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= dependencies: pinkie-promise "^2.0.0" path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= path-key@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= path-parse@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= dependencies: graceful-fs "^4.1.2" pify "^2.0.0" @@ -5630,14 +4832,12 @@ path-type@^1.0.0: path-type@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" - integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= dependencies: pify "^2.0.0" pbkdf2@^3.0.3: version "3.0.17" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" - integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== dependencies: create-hash "^1.1.2" create-hmac "^1.1.4" @@ -5648,119 +4848,116 @@ pbkdf2@^3.0.3: pegjs@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/pegjs/-/pegjs-0.10.0.tgz#cf8bafae6eddff4b5a7efb185269eaaf4610ddbd" - integrity sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0= pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= dependencies: pinkie "^2.0.0" pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= pkg-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= dependencies: find-up "^1.0.0" +pkginfo@0.3.x: + version "0.3.1" + resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21" + +pkginfo@0.x.x: + version "0.4.1" + resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff" + pluralize@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= pragma-singleton@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/pragma-singleton/-/pragma-singleton-1.0.3.tgz#6894317bb8d47157e59de2a4a009db7e6f63e30e" - integrity sha1-aJQxe7jUcVflneKkoAnbfm9j4w4= prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= prettier@^1.14.3: version "1.14.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895" - integrity sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg== private@^0.1.6, private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== process-nextick-args@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= process@~0.5.1: version "0.5.2" resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" - integrity sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8= progress@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" - integrity sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8= promise-to-callback@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/promise-to-callback/-/promise-to-callback-1.0.0.tgz#5d2a749010bfb67d963598fcd3960746a68feef7" - integrity sha1-XSp0kBC/tn2WNZj805YHRqaP7vc= dependencies: is-fn "^1.0.0" set-immediate-shim "^1.0.1" +prompt@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prompt/-/prompt-1.0.0.tgz#8e57123c396ab988897fb327fd3aedc3e735e4fe" + dependencies: + colors "^1.1.2" + pkginfo "0.x.x" + read "1.0.x" + revalidator "0.1.x" + utile "0.3.x" + winston "2.1.x" + prop-types@^15.6.2: version "15.6.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102" - integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ== dependencies: loose-envify "^1.3.1" object-assign "^4.1.1" @@ -5768,7 +4965,6 @@ prop-types@^15.6.2: proxy-addr@~2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.4.tgz#ecfc733bf22ff8c6f407fa275327b9ab67e48b93" - integrity sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA== dependencies: forwarded "~0.1.2" ipaddr.js "1.8.0" @@ -5776,22 +4972,18 @@ proxy-addr@~2.0.4: prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= psl@^1.1.24: version "1.1.29" resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" - integrity sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ== public-encrypt@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" - integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== dependencies: bn.js "^4.1.0" browserify-rsa "^4.0.0" @@ -5803,27 +4995,22 @@ public-encrypt@^4.0.0: punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= punycode@^1.2.4, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== qs@6.5.2, qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== query-string@^5.0.1: version "5.1.1" resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" - integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== dependencies: decode-uri-component "^0.2.0" object-assign "^4.1.0" @@ -5832,17 +5019,14 @@ query-string@^5.0.1: querystring-es3@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= querystring@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= randomatic@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.0.tgz#36f2ca708e9e567f5ed2ec01949026d50aa10116" - integrity sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ== dependencies: is-number "^4.0.0" kind-of "^6.0.0" @@ -5851,14 +5035,12 @@ randomatic@^3.0.0: randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: version "2.0.6" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80" - integrity sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A== dependencies: safe-buffer "^5.1.0" randomfill@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" - integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== dependencies: randombytes "^2.0.5" safe-buffer "^5.1.0" @@ -5866,17 +5048,14 @@ randomfill@^1.0.3: randomhex@0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/randomhex/-/randomhex-0.1.5.tgz#baceef982329091400f2a2912c6cd02f1094f585" - integrity sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU= range-parser@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= raw-body@2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" - integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== dependencies: bytes "3.0.0" http-errors "1.6.3" @@ -5886,7 +5065,6 @@ raw-body@2.3.3: rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== dependencies: deep-extend "^0.6.0" ini "~1.3.0" @@ -5896,7 +5074,6 @@ rc@^1.2.7: react-dom@^16.2.0: version "16.5.2" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.5.2.tgz#b69ee47aa20bab5327b2b9d7c1fe2a30f2cfa9d7" - integrity sha512-RC8LDw8feuZOHVgzEf7f+cxBr/DnKdqp56VU0lAs1f4UfKc4cU8wU4fTq/mgnvynLQo8OtlPC19NUFh/zjZPuA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -5906,7 +5083,6 @@ react-dom@^16.2.0: react@^16.2.0: version "16.5.2" resolved "https://registry.yarnpkg.com/react/-/react-16.5.2.tgz#19f6b444ed139baa45609eee6dc3d318b3895d42" - integrity sha512-FDCSVd3DjVTmbEAjUNX6FgfAmQ+ypJfHUsqUJOYNCBUp1h8lqmtC+0mXJ+JjsWx4KAVTkk1vKd1hLQPvEviSuw== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -5916,7 +5092,6 @@ react@^16.2.0: read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= dependencies: find-up "^1.0.0" read-pkg "^1.0.0" @@ -5924,7 +5099,6 @@ read-pkg-up@^1.0.1: read-pkg-up@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" - integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= dependencies: find-up "^2.0.0" read-pkg "^2.0.0" @@ -5932,7 +5106,6 @@ read-pkg-up@^2.0.0: read-pkg@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= dependencies: load-json-file "^1.0.0" normalize-package-data "^2.3.2" @@ -5941,16 +5114,20 @@ read-pkg@^1.0.0: read-pkg@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" - integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= dependencies: load-json-file "^2.0.0" normalize-package-data "^2.3.2" path-type "^2.0.0" +read@1.0.x: + version "1.0.7" + resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" + dependencies: + mute-stream "~0.0.4" + readable-stream@^1.0.33: version "1.1.14" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= dependencies: core-util-is "~1.0.0" inherits "~2.0.1" @@ -5960,7 +5137,6 @@ readable-stream@^1.0.33: readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@^2.2.9, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -5973,7 +5149,6 @@ readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable readable-stream@~1.0.15: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" - integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= dependencies: core-util-is "~1.0.0" inherits "~2.0.1" @@ -5983,7 +5158,6 @@ readable-stream@~1.0.15: readdirp@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== dependencies: graceful-fs "^4.1.11" micromatch "^3.1.10" @@ -5992,34 +5166,28 @@ readdirp@^2.0.0: readline-sync@^1.4.9: version "1.4.9" resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.9.tgz#3eda8e65f23cd2a17e61301b1f0003396af5ecda" - integrity sha1-PtqOZfI80qF+YTAbHwADOWr17No= rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= dependencies: resolve "^1.1.6" regenerate@^1.2.1: version "1.4.0" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" - integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== regenerator-runtime@^0.10.5: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" - integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= regenerator-runtime@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== regenerator-transform@^0.10.0: version "0.10.1" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" - integrity sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q== dependencies: babel-runtime "^6.18.0" babel-types "^6.19.0" @@ -6028,14 +5196,12 @@ regenerator-transform@^0.10.0: regex-cache@^0.4.2: version "0.4.4" resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== dependencies: is-equal-shallow "^0.1.3" regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== dependencies: extend-shallow "^3.0.2" safe-regex "^1.1.0" @@ -6043,12 +5209,10 @@ regex-not@^1.0.0, regex-not@^1.0.2: regexpp@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" - integrity sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw== regexpu-core@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" - integrity sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA= dependencies: regenerate "^1.2.1" regjsgen "^0.2.0" @@ -6057,62 +5221,52 @@ regexpu-core@^2.0.0: regjsgen@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" - integrity sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc= regjsparser@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" - integrity sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw= dependencies: jsesc "~0.5.0" remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= repeat-element@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== repeat-string@^1.5.2, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= dependencies: is-finite "^1.0.0" req-cwd@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/req-cwd/-/req-cwd-1.0.1.tgz#0d73aeae9266e697a78f7976019677e76acf0fff" - integrity sha1-DXOurpJm5penj3l2AZZ352rPD/8= dependencies: req-from "^1.0.1" req-from@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/req-from/-/req-from-1.0.1.tgz#bf81da5147947d32d13b947dc12a58ad4587350e" - integrity sha1-v4HaUUeUfTLRO5R9wSpYrUWHNQ4= dependencies: resolve-from "^2.0.0" request-promise-core@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" - integrity sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY= dependencies: lodash "^4.13.1" request-promise@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.2.tgz#d1ea46d654a6ee4f8ee6a4fea1018c22911904b4" - integrity sha1-0epG1lSm7k+O5qT+oQGMIpEZBLQ= dependencies: bluebird "^3.5.0" request-promise-core "1.1.1" @@ -6122,7 +5276,6 @@ request-promise@^4.2.2: request@^2.67.0, request@^2.79.0, request@^2.81.0, request@^2.85.0, request@^2.88.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" - integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== dependencies: aws-sign2 "~0.7.0" aws4 "^1.8.0" @@ -6148,22 +5301,18 @@ request@^2.67.0, request@^2.79.0, request@^2.81.0, request@^2.85.0, request@^2.8 require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= require-from-string@^1.1.0: version "1.2.1" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" - integrity sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg= require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= dependencies: caller-path "^0.1.0" resolve-from "^1.0.0" @@ -6171,41 +5320,34 @@ require-uncached@^1.0.3: resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= resolve-from@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" - integrity sha1-lICrIOlP+h2egKgEx+oUdhGWa1c= resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= resolve@1.1.x: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= resolve@^1.1.6, resolve@^1.3.3, resolve@^1.5.0, resolve@^1.6.0: version "1.8.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" - integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== dependencies: path-parse "^1.0.5" resolve@~1.7.1: version "1.7.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3" - integrity sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw== dependencies: path-parse "^1.0.5" restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= dependencies: onetime "^2.0.0" signal-exit "^3.0.2" @@ -6213,33 +5355,32 @@ restore-cursor@^2.0.0: resumer@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" - integrity sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k= dependencies: through "~2.3.4" ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +revalidator@0.1.x: + version "0.1.8" + resolved "https://registry.yarnpkg.com/revalidator/-/revalidator-0.1.8.tgz#fece61bfa0c1b52a206bd6b18198184bdd523a3b" right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - integrity sha1-YTObci/mo1FWiSENJOFMlhSGE+8= dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.6.1: +rimraf@2, rimraf@2.x.x, rimraf@^2.2.8, rimraf@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" - integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== dependencies: glob "^7.0.5" ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== dependencies: hash-base "^3.0.0" inherits "^2.0.1" @@ -6247,79 +5388,66 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: rlp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.1.0.tgz#e4f9886d5a982174f314543831e36e1a658460f9" - integrity sha512-93U7IKH5j7nmXFVg19MeNBGzQW5uXW1pmCuKY8veeKIhYTE32C2d0mOegfiIAfXcHOKJjjPlJisn8iHDF5AezA== dependencies: safe-buffer "^5.1.1" run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" - integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= dependencies: is-promise "^2.1.0" rustbn.js@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" - integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== rx-lite-aggregates@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" - integrity sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74= dependencies: rx-lite "*" rx-lite@*, rx-lite@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" - integrity sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ= safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== safe-event-emitter@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz#5b692ef22329ed8f69fdce607e50ca734f6f20af" - integrity sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg== dependencies: events "^3.0.0" safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= dependencies: ret "~0.1.10" safe@^0.4.5: version "0.4.6" resolved "https://registry.yarnpkg.com/safe/-/safe-0.4.6.tgz#1d5580cf2635c5cb940ea48fb5081ae3c25b1be1" - integrity sha1-HVWAzyY1xcuUDqSPtQga48JbG+E= safefs@^3.1.2: version "3.2.2" resolved "https://registry.yarnpkg.com/safefs/-/safefs-3.2.2.tgz#8170c1444d7038e08caea05a374fae2fa349e15c" - integrity sha1-gXDBRE1wOOCMrqBaN0+uL6NJ4Vw= dependencies: graceful-fs "*" "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== scandirectory@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/scandirectory/-/scandirectory-2.5.0.tgz#6ce03f54a090b668e3cbedbf20edf9e310593e72" - integrity sha1-bOA/VKCQtmjjy+2/IO354xBZPnI= dependencies: ignorefs "^1.0.0" safefs "^3.1.2" @@ -6328,24 +5456,20 @@ scandirectory@^2.5.0: schedule@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/schedule/-/schedule-0.5.0.tgz#c128fffa0b402488b08b55ae74bb9df55cc29cc8" - integrity sha512-HUcJicG5Ou8xfR//c2rPT0lPIRR09vVvN81T9fqfVgBmhERUbDEQoYKjpBxbueJnCPpSu2ujXzOnRQt6x9o/jw== dependencies: object-assign "^4.1.1" scrypt-async@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/scrypt-async/-/scrypt-async-1.3.1.tgz#a11fd6fac981b4b823ee01dee0221169500ddae9" - integrity sha1-oR/W+smBtLgj7gHe4CIRaVAN2uk= scrypt-js@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.3.tgz#bb0040be03043da9a012a2cea9fc9f852cfc87d4" - integrity sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q= scrypt.js@0.2.0, scrypt.js@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/scrypt.js/-/scrypt.js-0.2.0.tgz#af8d1465b71e9990110bedfc593b9479e03a8ada" - integrity sha1-r40UZbcemZARC+38WTuUeeA6ito= dependencies: scrypt "^6.0.2" scryptsy "^1.2.1" @@ -6353,21 +5477,18 @@ scrypt.js@0.2.0, scrypt.js@^0.2.0: scrypt@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/scrypt/-/scrypt-6.0.3.tgz#04e014a5682b53fa50c2d5cce167d719c06d870d" - integrity sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0= dependencies: nan "^2.0.8" scryptsy@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-1.2.1.tgz#a3225fa4b2524f802700761e2855bdf3b2d92163" - integrity sha1-oyJfpLJST4AnAHYeKFW987LZIWM= dependencies: pbkdf2 "^3.0.3" secp256k1@^3.0.1: version "3.5.2" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.5.2.tgz#f95f952057310722184fe9c914e6b71281f2f2ae" - integrity sha512-iin3kojdybY6NArd+UFsoTuapOF7bnJNf2UbcWXaY3z+E1sJDipl60vtzB5hbO/uquBu7z0fd4VC4Irp+xoFVQ== dependencies: bindings "^1.2.1" bip66 "^1.1.3" @@ -6381,29 +5502,24 @@ secp256k1@^3.0.1: seek-bzip@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc" - integrity sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w= dependencies: commander "~2.8.1" semaphore@>=1.0.1, semaphore@^1.0.3: version "1.1.0" resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa" - integrity sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA== "semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== semver@~5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" - integrity sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg== send@0.16.2: version "0.16.2" resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" - integrity sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw== dependencies: debug "2.6.9" depd "~1.1.2" @@ -6422,7 +5538,6 @@ send@0.16.2: serve-static@1.13.2: version "1.13.2" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" - integrity sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" @@ -6432,7 +5547,6 @@ serve-static@1.13.2: servify@^0.1.12: version "0.1.12" resolved "https://registry.yarnpkg.com/servify/-/servify-0.1.12.tgz#142ab7bee1f1d033b66d0707086085b17c06db95" - integrity sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw== dependencies: body-parser "^1.16.0" cors "^2.8.1" @@ -6443,17 +5557,14 @@ servify@^0.1.12: set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= set-immediate-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" - integrity sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E= set-value@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -6463,7 +5574,6 @@ set-value@^0.4.3: set-value@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -6473,22 +5583,18 @@ set-value@^2.0.0: setimmediate@1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" - integrity sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48= setimmediate@^1.0.4, setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= setprototypeof@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" @@ -6496,35 +5602,30 @@ sha.js@^2.4.0, sha.js@^2.4.8: sha3@^1.1.0: version "1.2.2" resolved "https://registry.yarnpkg.com/sha3/-/sha3-1.2.2.tgz#a66c5098de4c25bc88336ec8b4817d005bca7ba9" - integrity sha1-pmxQmN5MJbyIM27ItIF9AFvKe6k= dependencies: nan "2.10.0" shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= dependencies: shebang-regex "^1.0.0" shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= shelljs@^0.7.4: version "0.7.8" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" - integrity sha1-3svPh0sNHl+3LhSxZKloMEjprLM= dependencies: glob "^7.0.0" interpret "^1.0.0" rechoir "^0.6.2" -shelljs@^0.8.1, shelljs@^0.8.2: +shelljs@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.2.tgz#345b7df7763f4c2340d584abb532c5f752ca9e35" - integrity sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ== dependencies: glob "^7.0.0" interpret "^1.0.0" @@ -6533,17 +5634,14 @@ shelljs@^0.8.1, shelljs@^0.8.2: signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= simple-concat@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" - integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY= simple-get@^2.7.0: version "2.8.1" resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d" - integrity sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw== dependencies: decompress-response "^3.3.0" once "^1.3.1" @@ -6552,19 +5650,16 @@ simple-get@^2.7.0: slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= slice-ansi@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" - integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== dependencies: is-fullwidth-code-point "^2.0.0" snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== dependencies: define-property "^1.0.0" isobject "^3.0.0" @@ -6573,14 +5668,12 @@ snapdragon-node@^2.0.1: snapdragon-util@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== dependencies: kind-of "^3.2.0" snapdragon@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== dependencies: base "^0.11.1" debug "^2.2.0" @@ -6594,22 +5687,18 @@ snapdragon@^0.8.1: sol-digger@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/sol-digger/-/sol-digger-0.0.2.tgz#406c4a9d31e269e7f88eb1c2ea101318e5e09025" - integrity sha1-QGxKnTHiaef4jrHC6hATGOXgkCU= sol-explore@1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/sol-explore/-/sol-explore-1.6.1.tgz#b59f073c69fe332560d5a10c32ba8ca7f2986cfb" - integrity sha1-tZ8HPGn+MyVg1aEMMrqMp/KYbPs= sol-explore@^1.6.2: version "1.6.2" resolved "https://registry.yarnpkg.com/sol-explore/-/sol-explore-1.6.2.tgz#43ae8c419fd3ac056a05f8a9d1fb1022cd41ecc2" - integrity sha1-Q66MQZ/TrAVqBfip0fsQIs1B7MI= sol-merger@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/sol-merger/-/sol-merger-0.1.2.tgz#1f12500f42d427dc0ec8e4c113392acd8a6f62d9" - integrity sha512-12Z84jxeb5VFlQOGS38HOiTrHYohU07oQ5wHOcFJmcRRbaL5kWN7IcldMO1QdW8kONyKdj0xhukzLlN5m5ix4w== dependencies: bluebird "^3.5.0" cli-color "^1.2.0" @@ -6621,7 +5710,6 @@ sol-merger@^0.1.2: solc@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.24.tgz#354f14b269b38cbaa82a47d1ff151723502b954e" - integrity sha512-2xd7Cf1HeVwrIb6Bu1cwY2/TaLRodrppCq3l7rhLimFQgmxptXhTC3+/wesVLpB09F1A2kZgvbMOgH7wvhFnBQ== dependencies: fs-extra "^0.30.0" memorystream "^0.3.1" @@ -6632,7 +5720,6 @@ solc@0.4.24: solc@^0.4.19, solc@^0.4.2, solc@^0.4.24: version "0.4.25" resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.25.tgz#06b8321f7112d95b4b903639b1138a4d292f5faa" - integrity sha512-jU1YygRVy6zatgXrLY2rRm7HW1d7a8CkkEgNJwvH2VLpWhMFsMdWcJn6kUqZwcSz/Vm+w89dy7Z/aB5p6AFTrg== dependencies: fs-extra "^0.30.0" memorystream "^0.3.1" @@ -6643,7 +5730,6 @@ solc@^0.4.19, solc@^0.4.2, solc@^0.4.24: solidity-coverage@^0.5.11: version "0.5.11" resolved "https://registry.yarnpkg.com/solidity-coverage/-/solidity-coverage-0.5.11.tgz#1ee45f6d98b75a615aadb8f9aa7db4a2b32258e7" - integrity sha512-qikdsSi6+9XbfvwA0aI7HUVpF9fIFNqRWTw23M89GMDY+b6Gj0wWU9IngJS0fimoZIAdEp3bfChxvpfVcrUesg== dependencies: death "^1.1.0" ethereumjs-testrpc-sc "6.1.6" @@ -6659,7 +5745,6 @@ solidity-coverage@^0.5.11: solidity-docgen@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/solidity-docgen/-/solidity-docgen-0.1.0.tgz#f3a56ff074e8c7d832af3a3d462c3b5abf0f64cb" - integrity sha512-F7ufNWmlP5c5hIi66Ijv9tc+HNosyO7ijWq6pRtyBR1WqyJBH/0DJkD6QZI8HkE8p6LEXiPKxGBWbAeVT9Nu9g== dependencies: commander "^2.14.1" lodash "^4.17.5" @@ -6672,7 +5757,6 @@ solidity-docgen@^0.1.0: solidity-parser-sc@0.4.11: version "0.4.11" resolved "https://registry.yarnpkg.com/solidity-parser-sc/-/solidity-parser-sc-0.4.11.tgz#86734c9205537007f4d6201b57176e41696ee607" - integrity sha512-1kV5iC7m3CtMDfmHaVNwz2saSGQVIuF16rIxU417Al38MVCWHMQQ5vT6cmLsNwDe60S74auobWij9vNawSeOyw== dependencies: mocha "^4.1.0" pegjs "^0.10.0" @@ -6681,12 +5765,10 @@ solidity-parser-sc@0.4.11: solium-plugin-security@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/solium-plugin-security/-/solium-plugin-security-0.1.1.tgz#2a87bcf8f8c3abf7d198e292e4ac080284e3f3f6" - integrity sha512-kpLirBwIq4mhxk0Y/nn5cQ6qdJTI+U1LO3gpoNIcqNaW+sI058moXBe2UiHs+9wvF9IzYD49jcKhFTxcR9u9SQ== solium@^1.1.6: version "1.1.8" resolved "https://registry.yarnpkg.com/solium/-/solium-1.1.8.tgz#35d30a15c572a233ce8a90226d6cfccb762fadb7" - integrity sha512-fn0lusM6of14CytIDDHK73SGjn6NsVTaCVJjaKCKJyqKhT00rH/hDtvnIeZ2ZTD9z/xaXd4Js2brW3az6AV9RA== dependencies: ajv "^5.2.2" chokidar "^1.6.0" @@ -6704,7 +5786,6 @@ solium@^1.1.6: solparse@2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/solparse/-/solparse-2.2.5.tgz#72709c867cd6bfc50ec2325f4b81d2b3ea365d99" - integrity sha512-t7tvtR6KU6QfPYLMv1nlCh9DA8HYIu5tbjHpKu0fhGFZ1NuSp0KKDHfFHv07g6v1xgcuUY3rVqNFjZt5b9+5qA== dependencies: mocha "^4.0.1" pegjs "^0.10.0" @@ -6713,17 +5794,14 @@ solparse@2.2.5: sorted-array-functions@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/sorted-array-functions/-/sorted-array-functions-1.2.0.tgz#43265b21d6e985b7df31621b1c11cc68d8efc7c3" - integrity sha512-sWpjPhIZJtqO77GN+LD8dDsDKcWZ9GCOJNqKzi1tvtjGIzwfoyuRH8S0psunmc6Z5P+qfDqztSbwYR5X/e1UTg== source-list-map@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" - integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== source-map-resolve@^0.5.0: version "0.5.2" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" - integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== dependencies: atob "^2.1.1" decode-uri-component "^0.2.0" @@ -6734,14 +5812,12 @@ source-map-resolve@^0.5.0: source-map-support@^0.4.15: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== dependencies: source-map "^0.5.6" source-map-support@^0.5.3: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -6749,29 +5825,24 @@ source-map-support@^0.5.3: source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== source-map@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" - integrity sha1-2rc/vPwrqBm03gO9b26qSBZLP50= dependencies: amdefine ">=0.0.4" spdx-correct@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.2.tgz#19bb409e91b47b1ad54159243f7312a858db3c2e" - integrity sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids "^3.0.0" @@ -6779,12 +5850,10 @@ spdx-correct@^3.0.0: spdx-exceptions@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" - integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== spdx-expression-parse@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== dependencies: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0" @@ -6792,29 +5861,24 @@ spdx-expression-parse@^3.0.0: spdx-license-ids@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz#e2a303236cac54b04031fa7a5a79c7e701df852f" - integrity sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== dependencies: extend-shallow "^3.0.0" sprintf-js@>=1.0.3: version "1.1.1" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.1.tgz#36be78320afe5801f6cea3ee78b6e5aab940ea0c" - integrity sha1-Nr54Mgr+WAH2zqPueLblqrlA6gw= sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sshpk@^1.7.0: version "1.15.1" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.15.1.tgz#b79a089a732e346c6e0714830f36285cd38191a2" - integrity sha512-mSdgNUaidk+dRU5MhYtN9zebdzF2iG0cNPWy8HG+W8y+fT1JnSkh0fzzpjOa0L7P8i1Rscz38t0h4gPcKz43xA== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -6829,12 +5893,10 @@ sshpk@^1.7.0: stack-trace@0.0.x: version "0.0.10" resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" - integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= dependencies: define-property "^0.2.5" object-copy "^0.1.0" @@ -6842,27 +5904,22 @@ static-extend@^0.1.1: "statuses@>= 1.4.0 < 2": version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= statuses@~1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" - integrity sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew== stdio@^0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/stdio/-/stdio-0.2.7.tgz#a1c57da10fe1cfaa0c3bf683c9d0743d1b660839" - integrity sha1-ocV9oQ/hz6oMO/aDydB0PRtmCDk= stealthy-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" - integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= stream-browserify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" - integrity sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds= dependencies: inherits "~2.0.1" readable-stream "^2.0.2" @@ -6870,7 +5927,6 @@ stream-browserify@^2.0.1: stream-http@^2.7.2: version "2.8.3" resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" - integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== dependencies: builtin-status-codes "^3.0.0" inherits "^2.0.1" @@ -6881,22 +5937,10 @@ stream-http@^2.7.2: strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= - -string-extended@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/string-extended/-/string-extended-0.0.8.tgz#741957dff487b0272a79eec5a44f239ee6f17ccd" - integrity sha1-dBlX3/SHsCcqee7FpE8jnubxfM0= - dependencies: - array-extended "~0.0.5" - date-extended "~0.0.3" - extended "~0.0.3" - is-extended "~0.0.3" string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= dependencies: code-point-at "^1.0.0" is-fullwidth-code-point "^1.0.0" @@ -6905,7 +5949,6 @@ string-width@^1.0.1: "string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== dependencies: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" @@ -6913,7 +5956,6 @@ string-width@^1.0.1: string.prototype.trim@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" - integrity sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo= dependencies: define-properties "^1.1.2" es-abstract "^1.5.0" @@ -6922,109 +5964,92 @@ string.prototype.trim@~1.1.2: string_decoder@^1.0.0, string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== dependencies: safe-buffer "~5.1.0" string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= dependencies: ansi-regex "^2.0.0" strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= dependencies: ansi-regex "^3.0.0" strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= dependencies: is-utf8 "^0.2.0" strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= strip-dirs@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5" - integrity sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g== dependencies: is-natural-number "^4.0.1" strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= strip-hex-prefix@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" - integrity sha1-DF8VX+8RUTczd96du1iNoFUA428= dependencies: is-hex-prefixed "1.0.0" strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= supports-color@4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" - integrity sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ== dependencies: has-flag "^2.0.0" supports-color@5.4.0: version "5.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" - integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== dependencies: has-flag "^3.0.0" supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= supports-color@^3.1.0: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" - integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= dependencies: has-flag "^1.0.0" supports-color@^4.2.1: version "4.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" - integrity sha1-vnoN5ITexcXN34s9WRJQRJEvY1s= dependencies: has-flag "^2.0.0" supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" swarm-js@0.1.37: version "0.1.37" resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.37.tgz#27d485317a340bbeec40292af783cc10acfa4663" - integrity sha512-G8gi5fcXP/2upwiuOShJ258sIufBVztekgobr3cVgYXObZwJ5AXLqZn52AI+/ffft29pJexF9WNdUxjlkVehoQ== dependencies: bluebird "^3.5.0" buffer "^5.0.5" @@ -7043,7 +6068,6 @@ swarm-js@0.1.37: table@4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" - integrity sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA== dependencies: ajv "^5.2.3" ajv-keywords "^2.1.0" @@ -7055,12 +6079,10 @@ table@4.0.2: tapable@^0.2.7: version "0.2.8" resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" - integrity sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI= tape@^4.4.0, tape@^4.6.3: version "4.9.1" resolved "https://registry.yarnpkg.com/tape/-/tape-4.9.1.tgz#1173d7337e040c76fbf42ec86fcabedc9b3805c9" - integrity sha512-6fKIXknLpoe/Jp4rzHKFPpJUHDHDqn8jus99IfPnHIjyz78HYlefTGD3b5EkbQzuLfaEvmfPK3IolLgq2xT3kw== dependencies: deep-equal "~1.0.1" defined "~1.0.0" @@ -7079,7 +6101,6 @@ tape@^4.4.0, tape@^4.6.3: tar-stream@^1.5.2: version "1.6.2" resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" - integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A== dependencies: bl "^1.0.0" buffer-alloc "^1.2.0" @@ -7092,7 +6113,6 @@ tar-stream@^1.5.2: tar.gz@^1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/tar.gz/-/tar.gz-1.0.7.tgz#577ef2c595faaa73452ef0415fed41113212257b" - integrity sha512-uhGatJvds/3diZrETqMj4RxBR779LKlIE74SsMcn5JProZsfs9j0QBwWO1RW+IWNJxS2x8Zzra1+AW6OQHWphg== dependencies: bluebird "^2.9.34" commander "^2.8.1" @@ -7103,7 +6123,6 @@ tar.gz@^1.0.5: tar@^2.1.1: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" - integrity sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE= dependencies: block-stream "*" fstream "^1.0.2" @@ -7112,7 +6131,6 @@ tar@^2.1.1: tar@^4: version "4.4.6" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b" - integrity sha512-tMkTnh9EdzxyfW+6GK6fCahagXsnYk6kE6S9Gr9pjVdys769+laCTbodXDhPAjzVtEBazRgP0gYqOjnk9dQzLg== dependencies: chownr "^1.0.1" fs-minipass "^1.2.5" @@ -7125,7 +6143,6 @@ tar@^4: taskgroup@^4.0.5, taskgroup@^4.2.0: version "4.3.1" resolved "https://registry.yarnpkg.com/taskgroup/-/taskgroup-4.3.1.tgz#7de193febd768273c457730497024d512c27915a" - integrity sha1-feGT/r12gnPEV3MElwJNUSwnkVo= dependencies: ambi "^2.2.0" csextends "^1.0.3" @@ -7133,43 +6150,36 @@ taskgroup@^4.0.5, taskgroup@^4.2.0: text-table@^0.2.0, text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= thenify-all@^1.0.0, thenify-all@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" - integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= dependencies: thenify ">= 3.1.0 < 4" "thenify@>= 3.1.0 < 4": version "3.3.0" resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.0.tgz#e69e38a1babe969b0108207978b9f62b88604839" - integrity sha1-5p44obq+lpsBCCB5eLn2K4hgSDk= dependencies: any-promise "^1.0.0" through@^2.3.6, through@~2.3.4, through@~2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= timed-out@^4.0.0, timed-out@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= timers-browserify@^2.0.4: version "2.0.10" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" - integrity sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg== dependencies: setimmediate "^1.0.4" timers-ext@^0.1.5: version "0.1.7" resolved "https://registry.yarnpkg.com/timers-ext/-/timers-ext-0.1.7.tgz#6f57ad8578e07a3fb9f91d9387d65647555e25c6" - integrity sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ== dependencies: es5-ext "~0.10.46" next-tick "1" @@ -7177,7 +6187,6 @@ timers-ext@^0.1.5: tingodb@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/tingodb/-/tingodb-0.6.1.tgz#f63336259af7dfa6c90dfe2556a0dfb0d4eede59" - integrity sha1-9jM2JZr336bJDf4lVqDfsNTu3lk= dependencies: lodash "^4.17.5" safe "^0.4.5" @@ -7188,36 +6197,30 @@ tingodb@^0.6.1: tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== dependencies: os-tmpdir "~1.0.2" to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= to-buffer@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" - integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= dependencies: kind-of "^3.0.2" to-regex-range@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= dependencies: is-number "^3.0.0" repeat-string "^1.6.1" @@ -7225,7 +6228,6 @@ to-regex-range@^2.1.0: to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== dependencies: define-property "^2.0.2" extend-shallow "^3.0.2" @@ -7235,7 +6237,6 @@ to-regex@^3.0.1, to-regex@^3.0.2: tough-cookie@>=2.3.3, tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" - integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== dependencies: psl "^1.1.24" punycode "^1.4.1" @@ -7243,27 +6244,22 @@ tough-cookie@>=2.3.3, tough-cookie@~2.4.3: tree-kill@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" - integrity sha512-DlX6dR0lOIRDFxI0mjL9IYg6OTncLm/Zt+JiBhE5OlFcAR8yc9S7FFXU9so0oda47frdM/JFsk7UjNt9vscKcg== trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= trim@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" - integrity sha1-WFhUf2spB1fulczMZm+1AITEYN0= truffle-blockchain-utils@^0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/truffle-blockchain-utils/-/truffle-blockchain-utils-0.0.5.tgz#a4e5c064dadd69f782a137f3d276d21095da7a47" - integrity sha1-pOXAZNrdafeCoTfz0nbSEJXaekc= truffle-contract-schema@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/truffle-contract-schema/-/truffle-contract-schema-2.0.1.tgz#9bf821d32e26e674ba15eb5d40f96b10b1c9d568" - integrity sha1-m/gh0y4m5nS6FetdQPlrELHJ1Wg= dependencies: ajv "^5.1.1" crypto-js "^3.1.9-1" @@ -7272,7 +6268,6 @@ truffle-contract-schema@^2.0.1: truffle-contract@^3.0.4: version "3.0.6" resolved "https://registry.yarnpkg.com/truffle-contract/-/truffle-contract-3.0.6.tgz#2ef6fc32d7faafa9f4aed8e50001a9fdea342192" - integrity sha1-Lvb8Mtf6r6n0rtjlAAGp/eo0IZI= dependencies: ethjs-abi "0.1.8" truffle-blockchain-utils "^0.0.5" @@ -7283,12 +6278,10 @@ truffle-contract@^3.0.4: truffle-error@^0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/truffle-error/-/truffle-error-0.0.3.tgz#4bf55242e14deee1c7194932709182deff2c97ca" - integrity sha1-S/VSQuFN7uHHGUkycJGC3v8sl8o= truffle-hdwallet-provider-privkey@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/truffle-hdwallet-provider-privkey/-/truffle-hdwallet-provider-privkey-0.1.0.tgz#9417047a74ad37d923df926154b6486ffb57f6c9" - integrity sha512-Vj04yr2d9qLRZspoHztbE/YQnVaoFb90JNZHtggRUm+JFm/NOiSJHLVI63+3mtUIuQ04EuKZ7Df8JQw0Ni7IeA== dependencies: ethereumjs-tx "^1.3.3" ethereumjs-wallet "^0.6.0" @@ -7298,7 +6291,6 @@ truffle-hdwallet-provider-privkey@^0.1.0: truffle-wallet-provider@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/truffle-wallet-provider/-/truffle-wallet-provider-0.0.5.tgz#db59ce6fa1c558766011137509a94dfca8d1408e" - integrity sha1-21nOb6HFWHZgERN1CalN/KjRQI4= dependencies: ethereumjs-wallet "^0.6.0" web3 "^0.18.2" @@ -7307,7 +6299,6 @@ truffle-wallet-provider@0.0.5: truffle@^4.1.13: version "4.1.14" resolved "https://registry.yarnpkg.com/truffle/-/truffle-4.1.14.tgz#8d2c298e29abf9b1e486e44ff9faca6d34bb9030" - integrity sha512-e7tTLvKP3bN9dE7MagfWyFjy4ZgoEGbeujECy1me1ENBzbj/aO/+45gs72qsL3+3IkCNNcWNOJjjrm8BYZZNNg== dependencies: mocha "^4.1.0" original-require "1.0.1" @@ -7316,36 +6307,30 @@ truffle@^4.1.13: tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= dependencies: safe-buffer "^5.0.1" tweetnacl@0.13.2: version "0.13.2" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.13.2.tgz#453161770469d45cd266c36404e2bc99a8fa9944" - integrity sha1-RTFhdwRp1FzSZsNkBOK8maj6mUQ= tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= dependencies: prelude-ls "~1.1.2" type-is@~1.6.16: version "1.6.16" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" - integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== dependencies: media-typer "0.3.0" mime-types "~2.1.18" @@ -7353,36 +6338,30 @@ type-is@~1.6.16: typechecker@^2.0.8: version "2.1.0" resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-2.1.0.tgz#d1c2093a54ff8a19f58cff877eeaa54f2242d383" - integrity sha1-0cIJOlT/ihn1jP+HfuqlTyJC04M= typechecker@^4.3.0: version "4.6.0" resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-4.6.0.tgz#d245d9c2df21147d5e2a942fff170b68ece73c87" - integrity sha512-83OrXpyP3LNr7aRbLkt2nkjE/d7q8su8/uRvrKxCpswqVCVGOgyaKpaz8/MTjQqBYe4eLNuJ44pNakFZKqyPMA== dependencies: editions "^2.0.2" typechecker@~2.0.1: version "2.0.8" resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-2.0.8.tgz#e83da84bb64c584ccb345838576c40b0337db82e" - integrity sha1-6D2oS7ZMWEzLNFg4V2xAsDN9uC4= typedarray-to-buffer@^3.1.2: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== dependencies: is-typedarray "^1.0.0" typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= uglify-js@^2.8.29: version "2.8.29" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" - integrity sha1-KcVzMUgFe7Th913zW3qcty5qWd0= dependencies: source-map "~0.5.1" yargs "~3.10.0" @@ -7392,7 +6371,6 @@ uglify-js@^2.8.29: uglify-js@^3.1.4: version "3.4.9" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3" - integrity sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q== dependencies: commander "~2.17.1" source-map "~0.6.1" @@ -7400,12 +6378,10 @@ uglify-js@^3.1.4: uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - integrity sha1-bgkk1r2mta/jSeOabWMoUKD4grc= uglifyjs-webpack-plugin@^0.4.6: version "0.4.6" resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309" - integrity sha1-uVH0q7a9YX5m9j64kUmOORdj4wk= dependencies: source-map "^0.5.6" uglify-js "^2.8.29" @@ -7414,12 +6390,10 @@ uglifyjs-webpack-plugin@^0.4.6: ultron@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== unbzip2-stream@^1.0.9: version "1.3.1" resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.3.1.tgz#7854da51622a7e63624221196357803b552966a1" - integrity sha512-fIZnvdjblYs7Cru/xC6tCPVhz7JkYcVQQkePwMLyQELzYTds2Xn8QefPVnvdVhhZqubxNA1cASXEH5wcK0Bucw== dependencies: buffer "^3.0.1" through "^2.3.6" @@ -7427,17 +6401,14 @@ unbzip2-stream@^1.0.9: underscore@1.8.3: version "1.8.3" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" - integrity sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI= underscore@^1.8.3: version "1.9.1" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" - integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== union-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= dependencies: arr-union "^3.1.0" get-value "^2.0.6" @@ -7447,22 +6418,18 @@ union-value@^1.0.0: universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== unorm@^1.3.3: version "1.4.1" resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.4.1.tgz#364200d5f13646ca8bcd44490271335614792300" - integrity sha1-NkIA1fE2RsqLzURJAnEzVhR5IwA= unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= dependencies: has-value "^0.3.1" isobject "^3.0.0" @@ -7470,41 +6437,34 @@ unset-value@^1.0.0: upath@^1.0.5: version "1.1.0" resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" - integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== dependencies: punycode "^2.1.0" urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= url-parse-lax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= dependencies: prepend-http "^1.0.1" url-set-query@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" - integrity sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk= url-to-options@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" - integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k= url@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= dependencies: punycode "1.3.2" querystring "0.2.0" @@ -7512,66 +6472,65 @@ url@^0.11.0: use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== utf8@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/utf8/-/utf8-2.1.1.tgz#2e01db02f7d8d0944f77104f1609eb0c304cf768" - integrity sha1-LgHbAvfY0JRPdxBPFgnrDDBM92g= utf8@^2.1.1, utf8@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/utf8/-/utf8-2.1.2.tgz#1fa0d9270e9be850d9b05027f63519bf46457d96" - integrity sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY= utf8@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" - integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= util@0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= dependencies: inherits "2.0.1" util@^0.10.3: version "0.10.4" resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" - integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== dependencies: inherits "2.0.3" +utile@0.3.x: + version "0.3.0" + resolved "https://registry.yarnpkg.com/utile/-/utile-0.3.0.tgz#1352c340eb820e4d8ddba039a4fbfaa32ed4ef3a" + dependencies: + async "~0.9.0" + deep-equal "~0.2.1" + i "0.3.x" + mkdirp "0.x.x" + ncp "1.0.x" + rimraf "2.x.x" + utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= uuid@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" - integrity sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w= uuid@^3.0.1, uuid@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== valid-url@^1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200" - integrity sha1-HBRHm0DxOXp1eC8RXkCGRHQzogA= validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== dependencies: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" @@ -7579,17 +6538,14 @@ validate-npm-package-license@^3.0.1: varint@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.0.tgz#d826b89f7490732fabc0c0ed693ed475dcb29ebf" - integrity sha1-2Ca4n3SQcy+rwMDtaT7Uddyynr8= vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= dependencies: assert-plus "^1.0.0" core-util-is "1.0.2" @@ -7598,14 +6554,12 @@ verror@1.10.0: vm-browserify@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" - integrity sha1-XX6kW7755Kb/ZflUOOCofDV9WnM= dependencies: indexof "0.0.1" watchpack@^1.4.0: version "1.6.0" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" - integrity sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA== dependencies: chokidar "^2.0.2" graceful-fs "^4.1.2" @@ -7614,7 +6568,6 @@ watchpack@^1.4.0: watchr@~2.4.13: version "2.4.13" resolved "https://registry.yarnpkg.com/watchr/-/watchr-2.4.13.tgz#d74847bb4d6f90f61fe2c74f9f68662aa0e07601" - integrity sha1-10hHu01vkPYf4sdPn2hmKqDgdgE= dependencies: eachr "^2.0.2" extendr "^2.1.0" @@ -7628,7 +6581,6 @@ watchr@~2.4.13: web3-bzz@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.0.0-beta.34.tgz#068d37777ab65e5c60f8ec8b9a50cfe45277929c" - integrity sha1-Bo03d3q2Xlxg+OyLmlDP5FJ3kpw= dependencies: got "7.1.0" swarm-js "0.1.37" @@ -7637,7 +6589,6 @@ web3-bzz@1.0.0-beta.34: web3-core-helpers@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.34.tgz#b168da00d3e19e156bc15ae203203dd4dfee2d03" - integrity sha1-sWjaANPhnhVrwVriAyA91N/uLQM= dependencies: underscore "1.8.3" web3-eth-iban "1.0.0-beta.34" @@ -7646,7 +6597,6 @@ web3-core-helpers@1.0.0-beta.34: web3-core-method@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.0.0-beta.34.tgz#ec163c8a2c490fa02a7ec15559fa7307fc7cc6dd" - integrity sha1-7BY8iixJD6AqfsFVWfpzB/x8xt0= dependencies: underscore "1.8.3" web3-core-helpers "1.0.0-beta.34" @@ -7657,7 +6607,6 @@ web3-core-method@1.0.0-beta.34: web3-core-promievent@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.34.tgz#a4f4fa6784bb293e82c60960ae5b56a94cd03edc" - integrity sha1-pPT6Z4S7KT6CxglgrltWqUzQPtw= dependencies: any-promise "1.3.0" eventemitter3 "1.1.1" @@ -7665,7 +6614,6 @@ web3-core-promievent@1.0.0-beta.34: web3-core-requestmanager@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.34.tgz#01f8f6cf2ae6b6f0b70c38bae1ef741b5bab215c" - integrity sha1-Afj2zyrmtvC3DDi64e90G1urIVw= dependencies: underscore "1.8.3" web3-core-helpers "1.0.0-beta.34" @@ -7676,7 +6624,6 @@ web3-core-requestmanager@1.0.0-beta.34: web3-core-subscriptions@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.34.tgz#9fed144033f221c3cf21060302ffdaf5ef2de2de" - integrity sha1-n+0UQDPyIcPPIQYDAv/a9e8t4t4= dependencies: eventemitter3 "1.1.1" underscore "1.8.3" @@ -7685,7 +6632,6 @@ web3-core-subscriptions@1.0.0-beta.34: web3-core@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.0.0-beta.34.tgz#121be8555e9fb00d2c5d05ddd3381d0c9e46987e" - integrity sha1-EhvoVV6fsA0sXQXd0zgdDJ5GmH4= dependencies: web3-core-helpers "1.0.0-beta.34" web3-core-method "1.0.0-beta.34" @@ -7695,7 +6641,6 @@ web3-core@1.0.0-beta.34: web3-eth-abi@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.34.tgz#034533e3aa2f7e59ff31793eaea685c0ed5af67a" - integrity sha1-A0Uz46ovfln/MXk+rqaFwO1a9no= dependencies: bn.js "4.11.6" underscore "1.8.3" @@ -7705,7 +6650,6 @@ web3-eth-abi@1.0.0-beta.34: web3-eth-accounts@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.34.tgz#e09142eeecc797ac3459b75e9b23946d3695f333" - integrity sha1-4JFC7uzHl6w0WbdemyOUbTaV8zM= dependencies: any-promise "1.3.0" crypto-browserify "3.12.0" @@ -7721,7 +6665,6 @@ web3-eth-accounts@1.0.0-beta.34: web3-eth-contract@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.34.tgz#9dbb38fae7643a808427a20180470ec7415c91e6" - integrity sha1-nbs4+udkOoCEJ6IBgEcOx0FckeY= dependencies: underscore "1.8.3" web3-core "1.0.0-beta.34" @@ -7735,7 +6678,6 @@ web3-eth-contract@1.0.0-beta.34: web3-eth-iban@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.34.tgz#9af458605867ccf74ea979aaf326b38ba6a5ba0c" - integrity sha1-mvRYYFhnzPdOqXmq8yazi6alugw= dependencies: bn.js "4.11.6" web3-utils "1.0.0-beta.34" @@ -7743,7 +6685,6 @@ web3-eth-iban@1.0.0-beta.34: web3-eth-personal@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.34.tgz#9afba167342ebde5420bcd5895c3f6c34388f205" - integrity sha1-mvuhZzQuveVCC81YlcP2w0OI8gU= dependencies: web3-core "1.0.0-beta.34" web3-core-helpers "1.0.0-beta.34" @@ -7754,7 +6695,6 @@ web3-eth-personal@1.0.0-beta.34: web3-eth@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.0.0-beta.34.tgz#74086000850c6fe6f535ef49837d6d4bb6113268" - integrity sha1-dAhgAIUMb+b1Ne9Jg31tS7YRMmg= dependencies: underscore "1.8.3" web3-core "1.0.0-beta.34" @@ -7772,7 +6712,6 @@ web3-eth@1.0.0-beta.34: web3-net@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.0.0-beta.34.tgz#427cea2f431881449c8e38d523290f173f9ff63d" - integrity sha1-QnzqL0MYgUScjjjVIykPFz+f9j0= dependencies: web3-core "1.0.0-beta.34" web3-core-method "1.0.0-beta.34" @@ -7781,7 +6720,6 @@ web3-net@1.0.0-beta.34: web3-provider-engine@^13.6.4: version "13.8.0" resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-13.8.0.tgz#4c7c1ad2af5f1fe10343b8a65495879a2f9c00df" - integrity sha512-fZXhX5VWwWpoFfrfocslyg6P7cN3YWPG/ASaevNfeO80R+nzgoPUBXcWQekSGSsNDkeRTis4aMmpmofYf1TNtQ== dependencies: async "^2.5.0" clone "^2.0.0" @@ -7806,7 +6744,6 @@ web3-provider-engine@^13.6.4: web3-provider-engine@^8.4.0: version "8.6.1" resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-8.6.1.tgz#4d86e19e30caaf97df351511ec0f60136e5b30eb" - integrity sha1-TYbhnjDKr5ffNRUR7A9gE25bMOs= dependencies: async "^2.1.2" clone "^2.0.0" @@ -7826,7 +6763,6 @@ web3-provider-engine@^8.4.0: web3-providers-http@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.0.0-beta.34.tgz#e561b52bbb43766282007d40285bfe3550c27e7a" - integrity sha1-5WG1K7tDdmKCAH1AKFv+NVDCfno= dependencies: web3-core-helpers "1.0.0-beta.34" xhr2 "0.1.4" @@ -7834,7 +6770,6 @@ web3-providers-http@1.0.0-beta.34: web3-providers-ipc@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.34.tgz#a1b77f1a306d73649a9c039052e40cb71328d00a" - integrity sha1-obd/GjBtc2SanAOQUuQMtxMo0Ao= dependencies: oboe "2.1.3" underscore "1.8.3" @@ -7843,7 +6778,6 @@ web3-providers-ipc@1.0.0-beta.34: web3-providers-ws@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.34.tgz#7de70f1b83f2de36476772156becfef6e3516eb3" - integrity sha1-fecPG4Py3jZHZ3IVa+z+9uNRbrM= dependencies: underscore "1.8.3" web3-core-helpers "1.0.0-beta.34" @@ -7852,7 +6786,6 @@ web3-providers-ws@1.0.0-beta.34: web3-shh@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.0.0-beta.34.tgz#975061d71eaec42ccee576f7bd8f70f03844afe0" - integrity sha1-l1Bh1x6uxCzO5Xb3vY9w8DhEr+A= dependencies: web3-core "1.0.0-beta.34" web3-core-method "1.0.0-beta.34" @@ -7862,7 +6795,6 @@ web3-shh@1.0.0-beta.34: web3-utils@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.0.0-beta.34.tgz#9411fc39aaef39ca4e06169f762297d9ff020970" - integrity sha1-lBH8OarvOcpOBhafdiKX2f8CCXA= dependencies: bn.js "4.11.6" eth-lib "0.1.27" @@ -7875,7 +6807,6 @@ web3-utils@1.0.0-beta.34: web3@0.19.1: version "0.19.1" resolved "https://registry.yarnpkg.com/web3/-/web3-0.19.1.tgz#e763d5b1107c4bc24abd4f8cbee1ba3659e6eb31" - integrity sha1-52PVsRB8S8JKvU+MvuG6Nlnm6zE= dependencies: bignumber.js "^4.0.2" crypto-js "^3.1.4" @@ -7886,7 +6817,6 @@ web3@0.19.1: web3@0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.2.tgz#c54dac5fc0e377399c04c1a6ecbb12e4513278d6" - integrity sha1-xU2sX8DjdzmcBMGm7LsS5FEyeNY= dependencies: bignumber.js "git+https://github.com/frozeman/bignumber.js-nolookahead.git" crypto-js "^3.1.4" @@ -7897,7 +6827,6 @@ web3@0.20.2: web3@0.20.6: version "0.20.6" resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.6.tgz#3e97306ae024fb24e10a3d75c884302562215120" - integrity sha1-PpcwauAk+yThCj11yIQwJWIhUSA= dependencies: bignumber.js "git+https://github.com/frozeman/bignumber.js-nolookahead.git" crypto-js "^3.1.4" @@ -7908,7 +6837,6 @@ web3@0.20.6: web3@1.0.0-beta.34: version "1.0.0-beta.34" resolved "https://registry.yarnpkg.com/web3/-/web3-1.0.0-beta.34.tgz#347e561b784098cb5563315f490479a1d91f2ab1" - integrity sha1-NH5WG3hAmMtVYzFfSQR5odkfKrE= dependencies: web3-bzz "1.0.0-beta.34" web3-core "1.0.0-beta.34" @@ -7921,7 +6849,6 @@ web3@1.0.0-beta.34: web3@^0.16.0: version "0.16.0" resolved "https://registry.yarnpkg.com/web3/-/web3-0.16.0.tgz#a4554175cd462943035b1f1d39432f741c6b6019" - integrity sha1-pFVBdc1GKUMDWx8dOUMvdBxrYBk= dependencies: bignumber.js "git+https://github.com/debris/bignumber.js#master" crypto-js "^3.1.4" @@ -7931,7 +6858,6 @@ web3@^0.16.0: web3@^0.18.2, web3@^0.18.4: version "0.18.4" resolved "https://registry.yarnpkg.com/web3/-/web3-0.18.4.tgz#81ec1784145491f2eaa8955b31c06049e07c5e7d" - integrity sha1-gewXhBRUkfLqqJVbMcBgSeB8Xn0= dependencies: bignumber.js "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" crypto-js "^3.1.4" @@ -7942,7 +6868,6 @@ web3@^0.18.2, web3@^0.18.4: web3@^0.20.5: version "0.20.7" resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.7.tgz#1605e6d81399ed6f85a471a4f3da0c8be57df2f7" - integrity sha512-VU6/DSUX93d1fCzBz7WP/SGCQizO1rKZi4Px9j/3yRyfssHyFcZamMw2/sj4E8TlfMXONvZLoforR8B4bRoyTQ== dependencies: bignumber.js "git+https://github.com/frozeman/bignumber.js-nolookahead.git" crypto-js "^3.1.4" @@ -7953,7 +6878,6 @@ web3@^0.20.5: webpack-sources@^1.0.1: version "1.3.0" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" - integrity sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA== dependencies: source-list-map "^2.0.0" source-map "~0.6.1" @@ -7961,7 +6885,6 @@ webpack-sources@^1.0.1: webpack@^3.0.0: version "3.12.0" resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.12.0.tgz#3f9e34360370602fcf639e97939db486f4ec0d74" - integrity sha512-Sw7MdIIOv/nkzPzee4o0EdvCuPmxT98+vVpIvwtcwcF1Q4SDSNp92vwcKc4REe7NItH9f1S4ra9FuQ7yuYZ8bQ== dependencies: acorn "^5.0.0" acorn-dynamic-import "^2.0.0" @@ -7998,46 +6921,50 @@ webpack@^3.0.0: whatwg-fetch@>=0.10.0: version "3.0.0" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" - integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" - integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= which@^1.1.1, which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" wide-align@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== dependencies: string-width "^1.0.2 || 2" window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - integrity sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0= window-size@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" - integrity sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU= + +winston@2.1.x: + version "2.1.1" + resolved "http://registry.npmjs.org/winston/-/winston-2.1.1.tgz#3c9349d196207fd1bdff9d4bc43ef72510e3a12e" + dependencies: + async "~1.0.0" + colors "1.0.x" + cycle "1.0.x" + eyes "0.1.x" + isstream "0.1.x" + pkginfo "0.3.x" + stack-trace "0.0.x" winston@^2.3.1: version "2.4.4" resolved "https://registry.yarnpkg.com/winston/-/winston-2.4.4.tgz#a01e4d1d0a103cf4eada6fc1f886b3110d71c34b" - integrity sha512-NBo2Pepn4hK4V01UfcWcDlmiVTs7VTB1h7bgnB0rgP146bYhMxX0ypCz3lBOfNxCO4Zuek7yeT+y/zM1OfMw4Q== dependencies: async "~1.0.0" colors "1.0.x" @@ -8049,22 +6976,18 @@ winston@^2.3.1: wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - integrity sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8= wordwrap@^1.0.0, wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= dependencies: string-width "^1.0.1" strip-ansi "^3.0.1" @@ -8072,19 +6995,16 @@ wrap-ansi@^2.0.0: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= dependencies: mkdirp "^0.5.1" ws@^3.0.0: version "3.3.3" resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== dependencies: async-limiter "~1.0.0" safe-buffer "~5.1.0" @@ -8093,14 +7013,12 @@ ws@^3.0.0: xhr-request-promise@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.2.tgz#343c44d1ee7726b8648069682d0f840c83b4261d" - integrity sha1-NDxE0e53JrhkgGloLQ+EDIO0Jh0= dependencies: xhr-request "^1.0.1" xhr-request@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/xhr-request/-/xhr-request-1.1.0.tgz#f4a7c1868b9f198723444d82dcae317643f2e2ed" - integrity sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA== dependencies: buffer-to-arraybuffer "^0.0.5" object-assign "^4.1.1" @@ -8113,19 +7031,16 @@ xhr-request@^1.0.1: xhr2-cookies@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz#7d77449d0999197f155cb73b23df72505ed89d48" - integrity sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg= dependencies: cookiejar "^2.1.1" xhr2@*, xhr2@0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.1.4.tgz#7f87658847716db5026323812f818cadab387a5f" - integrity sha1-f4dliEdxbbUCYyOBL4GMras4el8= xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: version "2.5.0" resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.5.0.tgz#bed8d1676d5ca36108667692b74b316c496e49dd" - integrity sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ== dependencies: global "~4.3.0" is-function "^1.0.1" @@ -8135,49 +7050,40 @@ xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: xmlhttprequest@*, xmlhttprequest@1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" - integrity sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw= xregexp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" - integrity sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM= xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= xtend@~2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" - integrity sha1-bv7MKk2tjmlixJAbM3znuoe10os= dependencies: object-keys "~0.4.0" y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= yaeti@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" - integrity sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc= yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= yallist@^3.0.0, yallist@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" - integrity sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k= yargs-parser@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" - integrity sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ= dependencies: camelcase "^3.0.0" lodash.assign "^4.0.6" @@ -8185,28 +7091,24 @@ yargs-parser@^2.4.1: yargs-parser@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" - integrity sha1-jQrELxbqVd69MyyvTEA4s+P139k= dependencies: camelcase "^4.1.0" yargs-parser@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.1.0.tgz#f1376a33b6629a5d063782944da732631e966950" - integrity sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ== dependencies: camelcase "^4.1.0" yargs-parser@^9.0.2: version "9.0.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" - integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= dependencies: camelcase "^4.1.0" yargs@^10.0.3: version "10.1.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.1.2.tgz#454d074c2b16a51a43e2fb7807e4f9de69ccb5c5" - integrity sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig== dependencies: cliui "^4.0.0" decamelize "^1.1.1" @@ -8224,7 +7126,6 @@ yargs@^10.0.3: yargs@^11.0.0: version "11.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" - integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== dependencies: cliui "^4.0.0" decamelize "^1.1.1" @@ -8242,7 +7143,6 @@ yargs@^11.0.0: yargs@^4.6.0, yargs@^4.7.1: version "4.8.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" - integrity sha1-wMQpJMpKqmsObaFznfshZDn53cA= dependencies: cliui "^3.2.0" decamelize "^1.1.1" @@ -8262,7 +7162,6 @@ yargs@^4.6.0, yargs@^4.7.1: yargs@^8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" - integrity sha1-YpmpBVsc78lp/355wdkY3Osiw2A= dependencies: camelcase "^4.1.0" cliui "^3.2.0" @@ -8281,7 +7180,6 @@ yargs@^8.0.2: yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - integrity sha1-9+572FfdfB0tOMDnTvvWgdFDH9E= dependencies: camelcase "^1.0.2" cliui "^2.1.0" @@ -8291,7 +7189,6 @@ yargs@~3.10.0: yauzl@^2.4.2: version "2.10.0" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= dependencies: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0"