diff --git a/.circleci/config.yml b/.circleci/config.yml index 7b889cab..bd50bb46 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,6 @@ jobs: paths: - node_modules key: v1-dependencies-{{ checksum "package.json" }} - - run: ~/repo/node_modules/.bin/tsc - run: mkdir ~/junit-oracle - run: JEST_JUNIT_OUTPUT=~/junit-oracle/test-results.xml yarn run test --ci --reporters=default --reporters=jest-junit - store_test_results: diff --git a/config/development.js b/config/development.js deleted file mode 100644 index 456aa8fc..00000000 --- a/config/development.js +++ /dev/null @@ -1,22 +0,0 @@ -const Web3 = require('web3'); -const {chooseProvider} = require('../.tsbuilt/config'); - -const options = { - transactionConfirmationBlocks: 1, - transactionBlockTimeout: 5 -} - -async function getWeb3() { - return new Web3(chooseProvider('http://127.0.0.1:8545'), undefined, options); -} - -async function getAccount(web3) { - let [account, ...accounts] = await web3.eth.getAccounts(); - - return account; -} - -module.exports = { - getWeb3, - getAccount -}; diff --git a/config/rinkeby.js b/config/rinkeby.js deleted file mode 100644 index bfbca19d..00000000 --- a/config/rinkeby.js +++ /dev/null @@ -1,37 +0,0 @@ -const Web3 = require('web3'); -const {getKeyword} = require('../.tsbuilt/config'); -const HDWalletProvider = require("truffle-hdwallet-provider"); - -async function getProvider(network) { - const networkProviderUrl = await getKeyword('provider', `${network}-url`) || `http://${network}.infura.io`; - const privateKeyHex = await getKeyword('private_key', network); - - if (privateKeyHex) { - return new HDWalletProvider(privateKeyHex, networkProviderUrl) - } else { - return networkProviderUrl; // http provider - } -} - -async function getWeb3() { - // Defaults here are a bit high? But deploying contracts is expensive. - let defaultGas = Number(await getKeyword('gas') || 4600000); - let defaultGasPrice = Number(await getKeyword('gas_price') || 12000000000); // 12 gwei - - return new Web3(await getProvider('rinkeby'), undefined, {defaultGas, defaultGasPrice}); -} - -async function getAccount(web3) { - if (process.env['account']) { - return process.env['account'] - } else { - let [account, ...accounts] = await web3.eth.getAccounts(); - - return account; - } -} - -module.exports = { - getWeb3, - getAccount -}; diff --git a/config/test.js b/config/test.js deleted file mode 100644 index eb8b97f7..00000000 --- a/config/test.js +++ /dev/null @@ -1,27 +0,0 @@ -const Web3 = require('web3'); -const ganache = require('ganache-core'); -const {chooseProvider} = require('../.tsbuilt/config'); - -const options = { - transactionConfirmationBlocks: 1, - transactionBlockTimeout: 5 -} - -async function getWeb3() { - return new Web3(chooseProvider(() => ganache.provider()), undefined, options); -} - -async function getAccount(web3) { - if (process.env['account']) { - return process.env['account'] - } else { - let [account, ...accounts] = await web3.eth.getAccounts(); - - return account; - } -} - -module.exports = { - getWeb3, - getAccount -}; diff --git a/jest.config.js b/jest.config.js index 4a715f82..f2a96487 100644 --- a/jest.config.js +++ b/jest.config.js @@ -24,7 +24,7 @@ module.exports = { // collectCoverageFrom: null, // The directory where Jest should output its coverage files - // coverageDirectory: "coverage", + // coverageDirectory: null, // An array of regexp pattern strings used to skip coverage collection // coveragePathIgnorePatterns: [ @@ -52,7 +52,7 @@ module.exports = { // forceCoverageMatch: [], // A path to a module which exports an async function that is triggered once before all test suites - // globalSetup: './.tsbuilt/test.js', + // globalSetup: null, // A path to a module which exports an async function that is triggered once after all test suites // globalTeardown: null, @@ -123,9 +123,7 @@ module.exports = { // setupFiles: [], // A list of paths to modules that run some code to configure or set up the testing framework before each test - setupFilesAfterEnv: [ - './.tsbuilt/test.js' - ], + setupFilesAfterEnv: ["/tests/Matchers.js"], // A list of paths to snapshot serializer modules Jest should use for snapshot testing // snapshotSerializers: [], @@ -140,9 +138,10 @@ module.exports = { // testLocationInResults: false, // The glob patterns Jest uses to detect test files - testMatch: [ - "**/tests/**/*.[jt]s?(x)" - ], + // testMatch: [ + // "**/__tests__/**/*.[jt]s?(x)", + // "**/?(*.)+(spec|test).[tj]s?(x)" + // ], // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped // testPathIgnorePatterns: [ @@ -176,7 +175,7 @@ module.exports = { // unmockedModulePathPatterns: undefined, // Indicates whether each individual test should be reported during the run - verbose: true, + // verbose: null, // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode // watchPathIgnorePatterns: [], diff --git a/package.json b/package.json index bd25f88f..3b593482 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "author": "Compound Labs, Inc.", "license": "MIT", "dependencies": { + "eth-saddle": "^0.0.5", "truffle-hdwallet-provider": "^1.0.10", "web3": "1.0.0-beta.55", "yargs": "^13.2.4" @@ -14,14 +15,10 @@ "devDependencies": { "ganache-core": "^2.5.5", "jest": "^24.8.0", - "jest-junit": "^6.4.0", - "typescript": "^3.5.1" + "jest-cli": "^24.8.0", + "jest-junit": "^6.4.0" }, "scripts": { - "saddle:compile": "mkdir -p .build && solc --combined-json bin,abi --optimize contracts/*.sol > .build/contracts.json", - "saddle:test:run": "node --stack-trace-limit=1000 ./node_modules/jest-cli/bin/jest.js", - "saddle:deploy": "yarn run saddle:compile && node ./.tsbuilt/deploy.js $@", - "compile": "tsc && yarn run saddle:compile", - "test": "yarn run saddle:compile && yarn run saddle:test:run" + "test": "npx saddle compile && npx saddle test" } } diff --git a/saddle.config.js b/saddle.config.js new file mode 100644 index 00000000..ef3f47ff --- /dev/null +++ b/saddle.config.js @@ -0,0 +1,83 @@ + +module.exports = { + // solc: "solc", // Solc command to run + // solc_args: [], // Extra solc args + // build_dir: ".build", // Directory to place built contracts + // contracts: "contracts/*.sol", // Glob to match contract files + tests: ['**/tests/*Test.js'], // Glob to match test files + // networks: { // Define configuration for each network + // development: { + // providers: [ // How to load provider (processed in order) + // {env: "PROVIDER"}, // Try to load Http provider from `PROVIDER` env variable (e.g. env PROVIDER=http://...) + // {http: "http://127.0.0.1:8545"} // Fallback to localhost provider + // ], + // web3: { // Web3 options for immediate confirmation in development mode + // gas: [ + // {env: "GAS"}, + // {default: "4600000"} + // ], + // gas_price: [ + // {env: "GAS_PRICE"}, + // {default: "12000000000"} + // ], + // options: { + // transactionConfirmationBlocks: 1, + // transactionBlockTimeout: 5 + // } + // }, + // accounts: [ // How to load default account for transactions + // {env: "ACCOUNT"}, // Load from `ACCOUNT` env variable (e.g. env ACCOUNT=0x...) + // {unlocked: 0} // Else, try to grab first "unlocked" account from provider + // ] + // }, + // test: { + // providers: [ + // {env: "PROVIDER"}, + // {ganache: {}}, // In test mode, connect to a new ganache provider. Any options will be passed to ganache + // ], + // web3: { + // gas: [ + // {env: "GAS"}, + // {default: "4600000"} + // ], + // gas_price: [ + // {env: "GAS_PRICE"}, + // {default: "12000000000"} + // ], + // options: { + // transactionConfirmationBlocks: 1, + // transactionBlockTimeout: 5 + // } + // }, + // accounts: [ + // {env: "ACCOUNT"}, + // {unlocked: 0} + // ] + // }, + // rinkeby: { + // providers: [ + // {env: "PROVIDER"}, + // {file: "~/.ethereum/rinkeby-url"}, // Load from given file with contents as the URL (e.g. https://infura.io/api-key) + // {http: "https://rinkeby.infura.io"} + // ], + // web3: { + // gas: [ + // {env: "GAS"}, + // {default: "4600000"} + // ], + // gas_price: [ + // {env: "GAS_PRICE"}, + // {default: "12000000000"} + // ], + // options: { + // transactionConfirmationBlocks: 1, + // transactionBlockTimeout: 5 + // } + // }, + // accounts: [ + // {env: "ACCOUNT"}, + // {file: "~/.ethereum/rinkeby"} // Load from given file with contents as the private key (e.g. 0x...) + // ] + // } + // } +} diff --git a/tests/DelFiPriceTest.js b/tests/DelFiPriceTest.js index ab79a3cf..62d60996 100644 --- a/tests/DelFiPriceTest.js +++ b/tests/DelFiPriceTest.js @@ -1,13 +1,13 @@ +const { + address, + bytes, + encode, + sign, + uint256 +} = require('./Helpers'); + describe('DelFiPrice', () => { it('sanity checks the delfi price view', async () => { - const { - address, - deploy, - encode, - sign, - web3 - } = saddle; // XXX this kinda sucks - const sources = [ '0x177ee777e72b8c042e05ef41d1db0f17f1fcb0e8150b37cfad6993e4373bdf10', '0x177ee777e72b8c042e05ef41d1db0f17f1fcb0e8150b37cfad6993e4373bdf11', @@ -15,6 +15,7 @@ describe('DelFiPrice', () => { '0x177ee777e72b8c042e05ef41d1db0f17f1fcb0e8150b37cfad6993e4373bdf13', '0x177ee777e72b8c042e05ef41d1db0f17f1fcb0e8150b37cfad6993e4373bdf14', ].map(web3.eth.accounts.privateKeyToAccount); + const nonSources = [ '0x177ee777e72b8c042e05ef41d1db0f17f1fcb0e8150b37cfad6993e4373bdf15', '0x177ee777e72b8c042e05ef41d1db0f17f1fcb0e8150b37cfad6993e4373bdf16', @@ -22,12 +23,13 @@ describe('DelFiPrice', () => { '0x177ee777e72b8c042e05ef41d1db0f17f1fcb0e8150b37cfad6993e4373bdf18', '0x177ee777e72b8c042e05ef41d1db0f17f1fcb0e8150b37cfad6993e4373bdf19' ].map(web3.eth.accounts.privateKeyToAccount); + const priceData = await deploy('OpenOraclePriceData', []); const delfi = await deploy('DelFiPrice', [priceData.address, sources.map(a => a.address)]); const now = new Date - 0; // Reads a price of an asset that doesn't exist yet - expect(await delfi.methods.prices('ETH').call()).numEquals(0); + expect(await call(delfi.methods.prices('ETH'))).numEquals(0); async function postPrices(timestamp, priceses, symbols, signers = sources) { const messages = [], signatures = []; @@ -40,15 +42,14 @@ describe('DelFiPrice', () => { expect(signatory).toEqual(signers[i].address); messages.push(message); signatures.push(signature); - }) - return delfi.methods.postPrices(messages, signatures, symbols).send({gas: 5000000}); + }); + return send(delfi.methods.postPrices(messages, signatures, symbols), {gas: 5000000}); } async function getPrice(symbol) { - return delfi.methods.prices(symbol).call() + return call(delfi.methods.prices(symbol)) } - /** Posts nothing **/ const post0 = await postPrices(now, [], ['ETH']) @@ -149,4 +150,4 @@ describe('DelFiPrice', () => { expect(await getPrice('ETH')).numEquals(256); }, 30000); -}); \ No newline at end of file +}); diff --git a/tests/Helpers.js b/tests/Helpers.js new file mode 100644 index 00000000..a0f5a699 --- /dev/null +++ b/tests/Helpers.js @@ -0,0 +1,38 @@ +const Web3 = require('web3'); + +const web3 = new Web3(); // no provider, since we won't make any calls + +function address(n) { + return `0x${(n).toString(16).padStart(40, '0')}`; +} + +function bytes(str) { + return web3.eth.abi.encodeParameter('string', str); +} + +function uint256(int) { + return web3.eth.abi.encodeParameter('uint256', int); +} + +function encode(timestamp, pairs) { + return web3.eth.abi.encodeParameters(['uint256', 'bytes[]'], [timestamp, pairs.map(([k, v]) => { + return web3.eth.abi.encodeParameters(['string', 'uint'], [k, v]) + })]); +} + +// XXX maybe want to import signing here, shared with sdk, define there or at top level? +function sign(message, privateKey) { + const hash = web3.utils.keccak256(message); + const {r, s, v} = web3.eth.accounts.sign(hash, privateKey); + const signature = web3.eth.abi.encodeParameters(['bytes32', 'bytes32', 'uint8'], [r, s, v]); + const signatory = web3.eth.accounts.recover(hash, v, r, s); + return {hash, message, signature, signatory}; +} + +module.exports = { + address, + bytes, + uint256, + encode, + sign +}; diff --git a/tests/Matchers.js b/tests/Matchers.js new file mode 100644 index 00000000..f8955cbc --- /dev/null +++ b/tests/Matchers.js @@ -0,0 +1,18 @@ + +expect.extend({ + numEquals(actual, expected) { + return { + pass: actual.toString() == expected.toString(), + message: () => `expected ${JSON.stringify(actual)} == ${JSON.stringify(expected)}` + } + } +}); + +expect.extend({ + toRevert(actual, msg='revert') { + return { + pass: !!actual['message'] && actual.message === `VM Exception while processing transaction: ${msg}`, + message: () => `expected revert, got: ${JSON.stringify(actual)}` + } + } +}); diff --git a/tests/OpenOracleDataTest.js b/tests/OpenOracleDataTest.js index 5e30f645..72969b58 100644 --- a/tests/OpenOracleDataTest.js +++ b/tests/OpenOracleDataTest.js @@ -1,27 +1,25 @@ +const { + address, + bytes, + encode, + sign, + uint256 +} = require('./Helpers'); describe('OpenOracleData', () => { // XXX describe cant be async with jest :( // all things considered, havent found a nice way to do setup it('sets up the oracle data and tests some stuff', async () => { - const { - account, - address, - bytes, - deploy, - encode, - sign, - web3 - } = saddle; // XXX this kinda sucks - const privateKey = '0x177ee777e72b8c042e05ef41d1db0f17f1fcb0e8150b37cfad6993e4373bdf10'; - const oracleData = await deploy('OpenOracleData', [], {from: account}); - const priceData = await deploy('OpenOraclePriceData', [], {from: account}); + const oracleData = await deploy('OpenOracleData', []); + const priceData = await deploy('OpenOraclePriceData', []); // gets default data let { 0: timestamp, 1: value - } = await priceData.methods.get(address(0), 'ETH').call(); + } = await call(priceData.methods.get(address(0), 'ETH')); + expect(timestamp).numEquals(0); expect(value).numEquals(0); @@ -37,19 +35,19 @@ describe('OpenOracleData', () => { } = sign(encode(now, []), privateKey); // the source we recover in solidity should match - expect(await oracleData.methods.source(message, signature).call()).toEqual(signatory); - expect(await oracleData.methods.source(bytes('bad'), signature).call()).not.toEqual(signatory); - await expect(oracleData.methods.source(message, bytes('0xbad')).call()).rejects.toThrow('revert'); + expect(await call(oracleData.methods.source(message, signature))).toEqual(signatory); + expect(await call(oracleData.methods.source(bytes('bad'), signature))).not.toEqual(signatory); + await expect(call(oracleData.methods.source(message, bytes('0xbad')))).rejects.toRevert(); // writes nothing - const wrote0 = await priceData.methods.put(message, signature).send({from: account}); + const wrote0 = await send(priceData.methods.put(message, signature)); expect(wrote0.gasUsed).toBeLessThan(40000); // reads nothing ({ 0: timestamp, 1: value - } = await priceData.methods.get(signatory, K).call()); + } = await call(priceData.methods.get(signatory, K))); expect(timestamp).numEquals(0); expect(value).numEquals(0); @@ -60,14 +58,14 @@ describe('OpenOracleData', () => { signatory } = sign(encode(now, [[K, V]]), privateKey)); - const wrote1 = await priceData.methods.put(message, signature).send({from: account, gas: 1000000}); + const wrote1 = await send(priceData.methods.put(message, signature), {gas: 1000000}); expect(wrote1.gasUsed).toBeLessThan(82000); // reads 1 pair ({ 0: timestamp, 1: value - } = await priceData.methods.get(signatory, K).call()); + } = await call(priceData.methods.get(signatory, K))); expect(timestamp).numEquals(now); expect(value).numEquals(V); @@ -78,12 +76,12 @@ describe('OpenOracleData', () => { signatory } = sign(encode(now - 1, [[K, 6]]), privateKey)); - await priceData.methods.put(message, signature).send({from: account, gas: 1000000}); + await send(priceData.methods.put(message, signature), {gas: 1000000}); ({ 0: timestamp, 1: value - } = await priceData.methods.get(signatory, K).call()); + } = await call(priceData.methods.get(signatory, K))); expect(timestamp).numEquals(now); expect(value).numEquals(V); @@ -97,13 +95,13 @@ describe('OpenOracleData', () => { ['BTC', 9000], ]), privateKey)); - const wrote2a = await priceData.methods.put(message, signature).send({from: account, gas: 1000000}); + const wrote2a = await send(priceData.methods.put(message, signature), {gas: 1000000}); expect(wrote2a.gasUsed).toBeLessThan(130000); ({ 0: timestamp, 1: value - } = await priceData.methods.get(signatory, 'BTC').call()); + } = await call(priceData.methods.get(signatory, 'BTC'))); expect(timestamp).numEquals(now); expect(value).numEquals(9000); @@ -116,7 +114,7 @@ describe('OpenOracleData', () => { ['BTC', 9000], ]), privateKey)); - const wrote2b = await priceData.methods.put(message, signature).send({from: account, gas: 1000000}); + const wrote2b = await send(priceData.methods.put(message, signature), {gas: 1000000}); expect(wrote2b.gasUsed).toBeLessThan(70000); }, 30000); diff --git a/tests/OpenOracleViewTest.js b/tests/OpenOracleViewTest.js index baf26314..909ce5bd 100644 --- a/tests/OpenOracleViewTest.js +++ b/tests/OpenOracleViewTest.js @@ -4,6 +4,6 @@ describe('OpenOracleView', () => { const oracleData = await saddle.deploy('OpenOracleData', []); const oracleView = await saddle.deploy('OpenOracleView', [oracleData.address, []]); - expect(await oracleView.methods.data.call()).toEqual(oracleData.address); + expect(await call(oracleView.methods.data)).toEqual(oracleData.address); }); }); diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 03478bf9..00000000 --- a/tsconfig.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "compilerOptions": { - /* Basic Options */ - "target": "es2018", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ - "lib": ["esnext"], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "./.tsbuilt", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "composite": true, /* Enable project compilation */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - - /* Strict Type-Checking Options */ - "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - }, - "include": [ - "./tsrc/**/*" - ] -} diff --git a/tsrc/config.ts b/tsrc/config.ts deleted file mode 100644 index 51a6e4da..00000000 --- a/tsrc/config.ts +++ /dev/null @@ -1,55 +0,0 @@ -import Web3 from 'web3'; -import * as fs from 'fs'; -import * as path from 'path'; -import {readFile} from './file'; - -export interface Config { - network: string -} - -export function chooseProvider(def: string | (() => string)): string { - return process.env['provider'] || Web3.givenProvider || ( typeof(def) === 'function' ? def() : def ); -} - -export async function getKeyword(keyword, file) { - const kwVal = process.env[keyword]; - if (kwVal) { - return kwVal; - } - - const kwUpperVal = process.env[keyword.toUpperCase()]; - if (kwUpperVal) { - return kwUpperVal; - } - - const networksHome = process.env['ETHEREUM_NETWORKS_HOME']; - if (networksHome && file) { - try { - // Try to read from file - const networkPathResolved = path.join(fs.realpathSync(networksHome), file); - return await readFile(networkPathResolved, null, contents => contents.trim()); - } catch (e) { - // File does not exist or is inaccessible - } - } - - return null; -} - -export async function loadConfig(network: string): Promise { - return { - network: network - }; -} - -export async function loadWeb3(config: Config): Promise { - const fn: any = await import(path.join(process.cwd(), 'config', config.network)); - - return await fn.getWeb3(); -} - -export async function loadAccount(config: Config, web3: Web3): Promise { - const fn: any = await import(path.join(process.cwd(), 'config', config.network)); - - return await fn.getAccount(web3); -} diff --git a/tsrc/contract.ts b/tsrc/contract.ts deleted file mode 100644 index 5874eeca..00000000 --- a/tsrc/contract.ts +++ /dev/null @@ -1,52 +0,0 @@ -import Web3 from 'web3'; -import {Contract} from 'web3-eth-contract'; -import * as path from 'path'; -import ganache from 'ganache-core'; -import {readFile, writeFile} from './file'; - -const BUILD_FILE_NAME = 'contracts.json'; - -interface ContractBuild { - abi: string - bin: string -} - -function getBuildFile(file: string): string { - return path.join(process.cwd(), '.build', file); -} - -async function getContract(network: string, name: string): Promise { - let contracts = await readFile(getBuildFile(BUILD_FILE_NAME), {}, JSON.parse); - let contractsObject = contracts["contracts"] || {}; - - let foundContract = Object.entries(contractsObject).find(([pathContractName, contract]) => { - let [_, contractName] = pathContractName.split(":", 2); - return contractName == name; - }); - - if (foundContract) { - let [_, contractBuild] = foundContract; - - return contractBuild; - } else { - return null; - } -} - -export async function deployContract(web3: Web3, network: string, from: string, name: string, args: any[]): Promise { - let contractBuild = await getContract(network, name); - if (!contractBuild) { - throw new Error(`Cannot find contract \`${name}\` in build folder.`); - } - - const contractAbi = JSON.parse(contractBuild.abi); - const contract = new web3.eth.Contract(contractAbi, undefined, {from, gasPrice: '3000000000', gas: 1e6, data: ''}); - return await contract.deploy({data: '0x' + contractBuild.bin, arguments: args}).send({from, gas: 2000000}); -} - -export async function saveContract(name: string, contract: Contract, network: string): Promise { - let file = getBuildFile(`${network}.json`); - let curr = await readFile(file, {}, JSON.parse); - curr[name] = contract.address; - await writeFile(file, JSON.stringify(curr)); -} diff --git a/tsrc/deploy.ts b/tsrc/deploy.ts deleted file mode 100644 index 1bc97ce5..00000000 --- a/tsrc/deploy.ts +++ /dev/null @@ -1,39 +0,0 @@ -import {loadConfig, loadWeb3, loadAccount} from './config'; -import {deployContract, saveContract} from './contract'; -import yargs from 'yargs'; - -const argv = yargs - .option('network', {alias: 'n', description: 'Chosen network', type: 'string', default: 'development'}) - .help() - .alias('help', 'h') - .argv; - -const [contractName, ...contractArgsRaw] = argv._; -const contractArgs = contractArgsRaw.map((arg) => { - if (/^\[.*\]$/.test(arg)) { - // turn arrays into arrays - return arg.substring(1, arg.length-1).split(","); - } else { - return arg; - } -}) - - -if (!contractName || contractName.trim() === "") { - throw "Please specify a contract to deploy."; -} - -(async function () { - let config = await loadConfig(argv.network); - let web3 = await loadWeb3(config); - console.log(web3.currentProvider); - console.log(`Using network ${argv.network} ${web3.currentProvider.host}`); - - let account = await loadAccount(config, web3); - console.log(`Deploying contract ${contractName} with args ${JSON.stringify(contractArgs)}`); - - let contract = await deployContract(web3, config.network, account, contractName, contractArgs); - await saveContract(contractName, contract, config.network); - - console.log(`Deployed ${contractName} at ${contract.address}`); -})(); diff --git a/tsrc/file.ts b/tsrc/file.ts deleted file mode 100644 index d43f328e..00000000 --- a/tsrc/file.ts +++ /dev/null @@ -1,23 +0,0 @@ -import * as fs from 'fs'; - -export async function readFile(file: string, def: T, fn: (data: string) => T): Promise { - return new Promise((resolve, reject) => { - fs.access(file, fs.constants.F_OK, (err) => { - if (err) { - resolve(def); - } else { - fs.readFile(file, 'utf8', (err, data) => { - return err ? reject(err) : resolve(fn(data)); - }); - } - }); - }); -} - -export async function writeFile(file: string, data: string): Promise { - return new Promise((resolve, reject) => { - fs.writeFile(file, data, (err) => { - return err ? reject(err) : resolve(); - }); - }); -} diff --git a/tsrc/test.ts b/tsrc/test.ts deleted file mode 100644 index feb4d05f..00000000 --- a/tsrc/test.ts +++ /dev/null @@ -1,72 +0,0 @@ -import Web3 from 'web3'; -import {loadConfig, loadWeb3, loadAccount} from './config'; -import {deployContract} from './contract'; -import {Contract} from 'web3-eth-contract'; - -import expect from 'expect'; - -export async function configure(network = 'test') { - let config = await loadConfig(network); - let web3 = await loadWeb3(config); - console.log(`Using network ${network} ${web3.currentProvider.host}`); - - let account = await loadAccount(config, web3); - - function address(n) { - return `0x${(n).toString(16).padStart(40, '0')}`; - } - - function bytes(str) { - return web3.eth.abi.encodeParameter('string', str); - } - - function uint256(int) { - return web3.eth.abi.encodeParameter('uint256', int); - } - - // XXX shared lib? - function encode(timestamp, pairs) { - return web3.eth.abi.encodeParameters(['uint256', 'bytes[]'], [timestamp, pairs.map(([k, v]) => { - return web3.eth.abi.encodeParameters(['string', 'uint'], [k, v]) - })]); - } - - // XXX maybe want to import signing here, shared with sdk, define there or at top level? - function sign(message, privateKey) { - const hash = web3.utils.keccak256(message); - const {r, s, v} = web3.eth.accounts.sign(hash, privateKey); - const signature = web3.eth.abi.encodeParameters(['bytes32', 'bytes32', 'uint8'], [r, s, v]); - const signatory = web3.eth.accounts.recover(hash, v, r, s); - return {hash, message, signature, signatory}; - } - - expect.extend({ - numEquals(actual, expected) { - return { - pass: actual.toString() == expected.toString(), - message: () => `expected ${JSON.stringify(actual)} == ${JSON.stringify(expected)}` - } - } - }); - - async function deploy(contract: string, args: any[]): Promise { - console.log(["Deploying", contract, args]); - - return deployContract(web3, config.network, account, contract, args); - } - - return global['saddle'] = { - account, - address, - bytes, - uint256, - deploy, - encode, - sign, - web3 - }; -} - -if (global['beforeAll']) { - global['beforeAll'](configure); -} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index f90fabc3..5ba9284b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -319,9 +319,9 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.0.6" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.6.tgz#328dd1a8fc4cfe3c8458be9477b219ea158fd7b2" - integrity sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw== + version "7.0.7" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.7.tgz#2496e9ff56196cc1429c72034e07eab6121b6f3f" + integrity sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw== dependencies: "@babel/types" "^7.3.0" @@ -353,14 +353,14 @@ "@types/istanbul-lib-report" "*" "@types/node@*": - version "12.0.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.7.tgz#4f2563bad652b2acb1722d7e7aae2b0ff62d192c" - integrity sha512-1YKeT4JitGgE4SOzyB9eMwO0nGVNkNEsm9qlIt1Lqm/tG2QEiSMTD4kS3aO6L+w5SClLVxALmIBESK6Mk5wX0A== + version "12.0.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.10.tgz#51babf9c7deadd5343620055fc8aff7995c8b031" + integrity sha512-LcsGbPomWsad6wmMNv7nBLw7YYYyfdYcz6xryKYQhx89c3XXan+8Q6AJ43G5XDIaklaVkK3mE4fCb0SBvMiPSQ== "@types/node@^10.12.18", "@types/node@^10.3.2": - version "10.14.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" - integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== + version "10.14.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.10.tgz#e491484c6060af8d461e12ec81c0da8a3282b8de" + integrity sha512-V8wj+w2YMNvGuhgl/MA5fmTxgjmVHVoasfIaxMMZJV6Y8Kk+Ydpi1z2whoShDCJ2BuNVoqH/h1hrygnBxkrw/Q== "@types/stack-utils@^1.0.1": version "1.0.1" @@ -1438,9 +1438,9 @@ bs58check@^2.1.2: safe-buffer "^5.1.2" bser@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" - integrity sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk= + version "2.1.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.0.tgz#65fc784bf7f87c009b973c12db6546902fa9c7b5" + integrity sha512-8zsjWrQkkBoLK6uxASk1nJ2SKv97ltiGDo6A3wA0/yRPz+CwmEyDo0hUrhIuukG2JHpAl3bvFIixw2/3Hi0DOg== dependencies: node-int64 "^0.4.0" @@ -1544,9 +1544,9 @@ camelcase@^5.0.0: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== caniuse-lite@^1.0.30000844: - version "1.0.30000974" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000974.tgz#b7afe14ee004e97ce6dc73e3f878290a12928ad8" - integrity sha512-xc3rkNS/Zc3CmpMKuczWEdY2sZgx09BkAxfvkxlAEBTqcMHeL8QnPqhKse+5sRTi3nrw2pJwToD2WvKn1Uhvww== + version "1.0.30000976" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000976.tgz#d30fe12662cb2a21e130d307db9907513ca830a2" + integrity sha512-tleNB1IwPRqZiod6nUNum63xQCMN96BUO2JTeiwuRM7p9d616EHsMBjBWJMudX39qCaPuWY8KEWzMZq7A9XQMQ== capture-exit@^2.0.0: version "2.0.0" @@ -2133,9 +2133,9 @@ ee-first@1.1.1: integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.3.47: - version "1.3.150" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.150.tgz#afb972b53a702b37c76db843c39c967e9f68464b" - integrity sha512-5wuYlaXhXbBvavSTij5ZyidICB6sAK/1BwgZZoPCgsniid1oDgzVvDOV/Dw6J25lKV9QZ9ZdQCp8MEfF0/OIKA== + version "1.3.169" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.169.tgz#f9722d3f6a18a19c1fc1216bf9e1654daafab539" + integrity sha512-CxKt4ONON7m0ekVaFzvTZakHgGQsLMRH0J8W6h4lhyBNgskj3CIJz4bj+bh5+G26ztAe6dZjmYUeEW4u/VSnLQ== elliptic@6.3.3: version "6.3.3" @@ -2362,13 +2362,26 @@ eth-query@^2.0.2, eth-query@^2.1.0, eth-query@^2.1.2: json-rpc-random-id "^1.0.0" xtend "^4.0.1" -eth-sig-util@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.0.2.tgz#bfdb274293620404b7631019dc3d7f17bb2e06f4" - integrity sha512-tB6E8jf/aZQ943bo3+iojl8xRe3Jzcl+9OT6v8K7kWis6PdIX19SB2vYvN849cB9G9m/XLjYFK381SgdbsnpTA== +eth-saddle@^0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/eth-saddle/-/eth-saddle-0.0.5.tgz#201fa814881b01cc8b47b8b6626ac499a46f25c3" + integrity sha512-yGPIs4iVqYlJOdUmjRWuruKkenkQnhCThPTxQknWTiZEAErNvSwzug+UkfrE9D3BvXQEau5cyqcDkHbaKa/owA== + dependencies: + truffle-hdwallet-provider "^1.0.10" + web3 "1.0.0-beta.55" + yargs "^13.2.4" + +eth-sig-util@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.1.2.tgz#9b357395b5ca07fae6b430d3e534cf0a0f1df118" + integrity sha512-bNgt7txkEmaNlLf+PrbwYIdp4KRkB3E7hW0/QwlBpgv920pVVyQnF0evoovfiRveNKM4OrtPYZTojjmsfuCUOw== dependencies: + buffer "^5.2.1" + elliptic "^6.4.0" ethereumjs-abi "0.6.5" ethereumjs-util "^5.1.1" + tweetnacl "^1.0.0" + tweetnacl-util "^0.15.0" eth-sig-util@^1.4.2: version "1.4.2" @@ -2467,9 +2480,9 @@ ethereumjs-common@^0.6.0: integrity sha512-4jOrfDu9qOBTTGGb3zrfT1tE1Hyc6a8LJpEk0Vk9AYlLkBY7crjVICyJpRvjNI+KLDMpMITMw3eWVZOLMtZdhw== ethereumjs-common@^1.1.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.2.1.tgz#e8bbc43f6a6ece1447cc1faebbef9122adbd153f" - integrity sha512-VNr8MBdKHHuWgpYhRUhkp05P0mTcTH8Udb8wXcnnxUmwOWl388Sk/Lw2KL1rQNsV3gid2BB2auHT4vcfs9PFbw== + version "1.3.0" + resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.3.0.tgz#ca7d152b615d5e1851fcf184d062bf14c62c18e6" + integrity sha512-/jdFHyHOIS3FiAnunwRZ+oNulFtNNSHyWii3PaNHReOUmBAxij7KMyZLKh0tE16JEsJtXOVz1ceYuq++ILzv+g== ethereumjs-tx@1.3.7, ethereumjs-tx@^1.1.1, ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.3, ethereumjs-tx@^1.3.7: version "1.3.7" @@ -2564,9 +2577,9 @@ ethers@4.0.0-beta.1: xmlhttprequest "1.8.0" ethers@^4.0.27: - version "4.0.29" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.29.tgz#b698f5d8a5a89bfd3d12dba2ad5a4cd9a95a93bb" - integrity sha512-WCaH8an3Y+i85zW6Y6fmt0oQE9GXJy9NjqNVDTJVUJ/WBLIB1z17nG16lbOz3zVYWFgarfnzVakN2G7AyXk1Xg== + version "4.0.31" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.31.tgz#50b066d8c74140944edfd2ad0a805162c30e3a20" + integrity sha512-S2zKBGvEBIng7hghAXZ9259xCkClyRr/bM0F297O3lAnC6sYjTHNIMtiqWmA89qieAIyzWUZn/aCLUslRlJFkw== dependencies: "@types/node" "^10.3.2" aes-js "3.0.0" @@ -2951,9 +2964,9 @@ functional-red-black-tree@^1.0.1: integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= ganache-core@^2.5.5: - version "2.5.5" - resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.5.5.tgz#84da56de1957b6200a2d02934853fe7af89d260b" - integrity sha512-mrvPCtDjFLWmqygCx6LngWfA1hv6DH+iisEVYxRmCujstcMgzqi5UQdcKprxoO2Jx9st1fWVvDLi/tc6WHPGoA== + version "2.5.6" + resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.5.6.tgz#dd2ce3ec6e86930f8662cf4985c778cdf9b6ea79" + integrity sha512-Xvi5iOa8TQMbYCpWVrjnUHuBWFRZl1hJeNaxnytM2uh08elVXuKgcDdH8g7j1+r6WgW2FQmoowj4K/m/G999XA== dependencies: abstract-leveldown "3.0.0" async "2.6.1" @@ -2963,7 +2976,7 @@ ganache-core@^2.5.5: clone "2.1.2" debug "3.1.0" encoding-down "5.0.4" - eth-sig-util "2.0.2" + eth-sig-util "2.1.2" ethereumjs-abi "0.6.5" ethereumjs-account "2.0.5" ethereumjs-block "2.1.0" @@ -3346,7 +3359,12 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -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: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inherits@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= @@ -3758,9 +3776,9 @@ jest-get-type@^24.8.0: integrity sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ== jest-haste-map@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.0.tgz#51794182d877b3ddfd6e6d23920e3fe72f305800" - integrity sha512-ZBPRGHdPt1rHajWelXdqygIDpJx8u3xOoLyUBWRW28r3tagrgoepPrzAozW7kW9HrQfhvmiv1tncsxqHJO1onQ== + version "24.8.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.1.tgz#f39cc1d2b1d907e014165b4bd5a957afcb992982" + integrity sha512-SwaxMGVdAZk3ernAx2Uv2sorA7jm3Kx+lR0grp6rMmnY06Kn/urtKx1LPN2mGTea4fCT38impYT28FfcLUhX0g== dependencies: "@jest/types" "^24.8.0" anymatch "^2.0.0" @@ -5250,9 +5268,9 @@ private@^0.1.6, private@^0.1.8: 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== + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== process@~0.5.1: version "0.5.2" @@ -5294,9 +5312,9 @@ pseudomap@^1.0.1: integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= psl@^1.1.24, psl@^1.1.28: - version "1.1.32" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.32.tgz#3f132717cf2f9c169724b2b6caf373cf694198db" - integrity sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g== + version "1.1.33" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.33.tgz#5533d9384ca7aab86425198e10e8053ebfeab661" + integrity sha512-LTDP2uSrsc7XCb5lO7A8BI1qYxRe/8EqlRvMeEl6rsnYAqDOl8xHR+8lSAIVfrNaSAlTPTNOCgNjWcoUL3AZsw== public-encrypt@^4.0.0: version "4.0.3" @@ -6341,9 +6359,9 @@ swarm-js@0.1.37: xhr-request-promise "^0.1.2" symbol-tree@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" - integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY= + version "3.2.4" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== tape@^4.6.3, tape@^4.8.0: version "4.10.2" @@ -6543,9 +6561,9 @@ trim-right@^1.0.1: integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= truffle-hdwallet-provider@^1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/truffle-hdwallet-provider/-/truffle-hdwallet-provider-1.0.10.tgz#74781ab328b7c41b505a5dc76249a4e75bc287a8" - integrity sha512-nP66WEuboye8lZblXhVaoCieubBxcCqQFpR8k1CsFq016iWDiPypPiqY8X4jdSTKNOJ8mfa4yOmQr9cGt20bzQ== + version "1.0.11" + resolved "https://registry.yarnpkg.com/truffle-hdwallet-provider/-/truffle-hdwallet-provider-1.0.11.tgz#caa18fc0770068662dc00988578b2b1baaf2a764" + integrity sha512-4J+cB//8zGDWnsU5i6nSQG0BET2NkN+9TuraS61FkhSsYtYcDvKr23ZjvI44XzKnxvB2i8sMr+WGfzNDtZme0A== dependencies: any-promise "^1.3.0" bindings "^1.3.1" @@ -6553,9 +6571,9 @@ truffle-hdwallet-provider@^1.0.10: websocket "^1.0.28" tslib@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== tunnel-agent@^0.6.0: version "0.6.0" @@ -6564,11 +6582,21 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" +tweetnacl-util@^0.15.0: + version "0.15.0" + resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.0.tgz#4576c1cee5e2d63d207fee52f1ba02819480bc75" + integrity sha1-RXbBzuXi1j0gf+5S8boCgZSAvHU= + 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= +tweetnacl@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.1.tgz#2594d42da73cd036bd0d2a54683dd35a6b55ca17" + integrity sha512-kcoMoKTPYnoeS50tzoqjPY3Uv9axeuuFAZY9M/9zFnhoVvRfxz9K29IMPD7jGmt2c8SW7i3gT9WqDl2+nV7p4A== + type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" @@ -6596,11 +6624,6 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.1.tgz#ba72a6a600b2158139c5dd8850f700e231464202" - integrity sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw== - typewise-core@^1.2, typewise-core@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/typewise-core/-/typewise-core-1.2.0.tgz#97eb91805c7f55d2f941748fa50d315d991ef195" @@ -7712,9 +7735,9 @@ yargs-parser@^11.1.1: decamelize "^1.2.0" yargs-parser@^13.1.0: - version "13.1.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.0.tgz#7016b6dd03e28e1418a510e258be4bff5a31138f" - integrity sha512-Yq+32PrijHRri0vVKQEm+ys8mbqWjLiwQkMFNXEENutzLPP0bE4Lcd4iA3OQY5HF+GD3xXxf0MEHb8E4/SA3AA== + version "13.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" + integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== dependencies: camelcase "^5.0.0" decamelize "^1.2.0"