From 707af1ec583dfbe76a8e240bd294689020fcd866 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 21 Nov 2018 21:09:37 +0000 Subject: Updated CHANGELOGS --- packages/migrations/CHANGELOG.json | 3 ++- packages/migrations/CHANGELOG.md | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'packages/migrations') diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index 0056a3166..dea87b477 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -7,7 +7,8 @@ "Export all type declarations used by the public interface, as well as the `ContractAddresses` mapping", "pr": 1301 } - ] + ], + "timestamp": 1542821676 }, { "timestamp": 1542208198, diff --git a/packages/migrations/CHANGELOG.md b/packages/migrations/CHANGELOG.md index 87d0b25ca..986e224b0 100644 --- a/packages/migrations/CHANGELOG.md +++ b/packages/migrations/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.1.0 - _November 21, 2018_ + + * Export all type declarations used by the public interface, as well as the `ContractAddresses` mapping (#1301) + ## v2.0.4 - _November 14, 2018_ * Dependencies updated -- cgit v1.2.3 From f46a49fd13c88dd86c9661d76bace18844642c04 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 21 Nov 2018 21:09:47 +0000 Subject: Publish - 0x.js@2.0.5 - @0x/abi-gen@1.0.17 - @0x/abi-gen-wrappers@1.1.0 - @0x/assert@1.0.18 - @0x/asset-buyer@3.0.1 - @0x/base-contract@3.0.7 - @0x/connect@3.0.7 - @0x/contract-addresses@1.2.0 - @0x/contract-wrappers@4.1.0 - contracts@2.1.55 - @0x/dev-tools-pages@0.0.7 - @0x/dev-utils@1.0.18 - @0x/fill-scenarios@1.0.13 - @0x/instant@1.0.1 - @0x/json-schemas@2.1.2 - @0x/metacoin@0.0.29 - @0x/migrations@2.1.0 - @0x/monorepo-scripts@1.0.14 - @0x/order-utils@3.0.3 - @0x/order-watcher@2.2.5 - @0x/react-docs@1.0.19 - @0x/react-shared@1.0.22 - @0x/sol-compiler@1.1.13 - @0x/sol-cov@2.1.13 - @0x/sol-doc@1.0.8 - @0x/sol-resolver@1.0.17 - @0x/sra-spec@1.0.11 - @0x/subproviders@2.1.5 - @0x/testnet-faucets@1.0.57 - @0x/types@1.3.0 - @0x/utils@2.0.6 - @0x/web3-wrapper@3.1.5 - @0x/website@0.0.60 --- packages/migrations/package.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'packages/migrations') diff --git a/packages/migrations/package.json b/packages/migrations/package.json index 04503c0b2..c1ce7050d 100644 --- a/packages/migrations/package.json +++ b/packages/migrations/package.json @@ -1,6 +1,6 @@ { "name": "@0x/migrations", - "version": "2.0.4", + "version": "2.1.0", "engines": { "node": ">=6.12" }, @@ -23,9 +23,9 @@ }, "license": "Apache-2.0", "devDependencies": { - "@0x/dev-utils": "^1.0.17", + "@0x/dev-utils": "^1.0.18", "@0x/tslint-config": "^1.0.10", - "@0x/types": "^1.2.1", + "@0x/types": "^1.3.0", "@types/yargs": "^10.0.0", "make-promises-safe": "^1.1.0", "npm-run-all": "^4.1.2", @@ -36,16 +36,16 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/abi-gen-wrappers": "^1.0.5", - "@0x/base-contract": "^3.0.6", - "@0x/contract-addresses": "^1.1.0", + "@0x/abi-gen-wrappers": "^1.1.0", + "@0x/base-contract": "^3.0.7", + "@0x/contract-addresses": "^1.2.0", "@0x/contract-artifacts": "^1.1.0", - "@0x/order-utils": "^3.0.2", - "@0x/sol-compiler": "^1.1.12", - "@0x/subproviders": "^2.1.4", + "@0x/order-utils": "^3.0.3", + "@0x/sol-compiler": "^1.1.13", + "@0x/subproviders": "^2.1.5", "@0x/typescript-typings": "^3.0.4", - "@0x/utils": "^2.0.5", - "@0x/web3-wrapper": "^3.1.4", + "@0x/utils": "^2.0.6", + "@0x/web3-wrapper": "^3.1.5", "@ledgerhq/hw-app-eth": "^4.3.0", "ethereum-types": "^1.1.2", "ethers": "~4.0.4", -- cgit v1.2.3 From f0f6b26c3bb206f59549e086b788da85bedd26f2 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Fri, 23 Nov 2018 17:52:08 +1100 Subject: bug: Use Testnet Exchange over mainnet --- packages/migrations/src/migration.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/migrations') diff --git a/packages/migrations/src/migration.ts b/packages/migrations/src/migration.ts index 61ac56938..04d1abd4c 100644 --- a/packages/migrations/src/migration.ts +++ b/packages/migrations/src/migration.ts @@ -47,6 +47,7 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial artifacts.Exchange, provider, txDefaults, + zrxAssetData, ); // Multisigs -- cgit v1.2.3 From 99e92a346b134c1e91ecf02db8124614d8fd971d Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Mon, 26 Nov 2018 09:37:31 +1100 Subject: chore: Fund forwarder in migrations --- packages/migrations/src/migration.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'packages/migrations') diff --git a/packages/migrations/src/migration.ts b/packages/migrations/src/migration.ts index 04d1abd4c..e4febb1f8 100644 --- a/packages/migrations/src/migration.ts +++ b/packages/migrations/src/migration.ts @@ -141,6 +141,11 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial zrxAssetData, ); + // Fund the Forwarder with ZRX + await web3Wrapper.awaitTransactionSuccessAsync( + await zrxToken.transfer.sendTransactionAsync(forwarder.address, new BigNumber(1000000000000000000), txDefaults), + ); + return { erc20Proxy: erc20Proxy.address, erc721Proxy: erc721Proxy.address, -- cgit v1.2.3 From 09a683557bdf8633e1e0ff85ebf8c8789f391c27 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Mon, 26 Nov 2018 09:57:43 +1100 Subject: chore: Update CHANGELOGS use mainnet ZRX amount in Forwarder. --- packages/migrations/CHANGELOG.json | 13 +++++++++++++ packages/migrations/src/migration.ts | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'packages/migrations') diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index dea87b477..f302838a2 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -1,4 +1,17 @@ [ + { + "version": "2.2.0", + "changes": [ + { + "note": "Deploy testnet Exchange arfitact. Previously mainnet Exchange artifact was deployed.", + "pr": 1309 + }, + { + "note": "Fund the Forwarder with ZRX for fees.", + "pr": 1309 + } + ] + }, { "version": "2.1.0", "changes": [ diff --git a/packages/migrations/src/migration.ts b/packages/migrations/src/migration.ts index e4febb1f8..c684c4970 100644 --- a/packages/migrations/src/migration.ts +++ b/packages/migrations/src/migration.ts @@ -142,8 +142,10 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial ); // Fund the Forwarder with ZRX + const zrxDecimals = await zrxToken.decimals.callAsync(); + const zrxForwarderAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(5000), zrxDecimals); await web3Wrapper.awaitTransactionSuccessAsync( - await zrxToken.transfer.sendTransactionAsync(forwarder.address, new BigNumber(1000000000000000000), txDefaults), + await zrxToken.transfer.sendTransactionAsync(forwarder.address, zrxForwarderAmount, txDefaults), ); return { -- cgit v1.2.3 From eefd9d9dd2164c6ff222250934812ac62df9bc15 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 26 Nov 2018 14:59:27 +0000 Subject: Add command-line interface to @0x/migrations --- packages/migrations/bin/0x-migrate.js | 2 ++ packages/migrations/package.json | 3 +++ packages/migrations/src/cli.ts | 38 +++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100755 packages/migrations/bin/0x-migrate.js create mode 100644 packages/migrations/src/cli.ts (limited to 'packages/migrations') diff --git a/packages/migrations/bin/0x-migrate.js b/packages/migrations/bin/0x-migrate.js new file mode 100755 index 000000000..59778c0fc --- /dev/null +++ b/packages/migrations/bin/0x-migrate.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('../lib/cli.js'); diff --git a/packages/migrations/package.json b/packages/migrations/package.json index c1ce7050d..b006a470a 100644 --- a/packages/migrations/package.json +++ b/packages/migrations/package.json @@ -21,6 +21,9 @@ "assets": [] } }, + "bin": { + "0x-migrate": "bin/0x-migrate.js" + }, "license": "Apache-2.0", "devDependencies": { "@0x/dev-utils": "^1.0.18", diff --git a/packages/migrations/src/cli.ts b/packages/migrations/src/cli.ts new file mode 100644 index 000000000..46a524e85 --- /dev/null +++ b/packages/migrations/src/cli.ts @@ -0,0 +1,38 @@ +#!/usr/bin/env node +import { RPCSubprovider, Web3ProviderEngine } from '@0x/subproviders'; +import { logUtils } from '@0x/utils'; +import * as yargs from 'yargs'; + +import { runMigrationsAsync } from './migration'; + +const args = yargs + .option('node-endpoint', { + describe: 'Endpoint where backing Ethereum node is hosted', + type: 'string', + demandOption: false, + default: 'http://localhost:8545', + }) + .option('from', { + describe: 'Ethereum address from which to deploy the contracts', + type: 'string', + demandOption: true, + }) + .example( + '$0 --node-endpoiont http://localhost:8545 --from 0x5409ed021d9299bf6814279a6a1411a7e866a631', + 'Full usage example', + ).argv; + +(async () => { + const rpcSubprovider = new RPCSubprovider(args['node-endpoint']); + const provider = new Web3ProviderEngine(); + provider.addProvider(rpcSubprovider); + provider.start(); + const txDefaults = { + from: args.from, + }; + await runMigrationsAsync(provider, txDefaults); + process.exit(0); +})().catch(err => { + logUtils.log(err); + process.exit(1); +}); -- cgit v1.2.3 From 527f074e598c8ac2e473428e0c192cfbb7a9314d Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 26 Nov 2018 15:03:58 +0000 Subject: Fix typo --- packages/migrations/src/cli.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/migrations') diff --git a/packages/migrations/src/cli.ts b/packages/migrations/src/cli.ts index 46a524e85..94fbb5fe2 100644 --- a/packages/migrations/src/cli.ts +++ b/packages/migrations/src/cli.ts @@ -18,7 +18,7 @@ const args = yargs demandOption: true, }) .example( - '$0 --node-endpoiont http://localhost:8545 --from 0x5409ed021d9299bf6814279a6a1411a7e866a631', + '$0 --node-endpoint http://localhost:8545 --from 0x5409ed021d9299bf6814279a6a1411a7e866a631', 'Full usage example', ).argv; -- cgit v1.2.3 From 9da43878b169226e628ad2ea834e0fab78d5909b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 26 Nov 2018 15:04:27 +0000 Subject: Add CHANGELOG entry to migrations --- packages/migrations/CHANGELOG.json | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'packages/migrations') diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index dea87b477..78719fc90 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.2.0", + "changes": [ + { + "note": "Add CLI `0x-migrate` for running the 0x migrations in a language-agnostic way", + "pr": 1324 + } + ] + }, { "version": "2.1.0", "changes": [ -- cgit v1.2.3 From c6592148a725768f652ddfa8f94aa3e2c6f7f213 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 26 Nov 2018 15:57:49 +0000 Subject: Rename node-endpoint to rpc-url for clarity --- packages/migrations/src/cli.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/migrations') diff --git a/packages/migrations/src/cli.ts b/packages/migrations/src/cli.ts index 94fbb5fe2..2404e7921 100644 --- a/packages/migrations/src/cli.ts +++ b/packages/migrations/src/cli.ts @@ -6,8 +6,8 @@ import * as yargs from 'yargs'; import { runMigrationsAsync } from './migration'; const args = yargs - .option('node-endpoint', { - describe: 'Endpoint where backing Ethereum node is hosted', + .option('rpc-url', { + describe: 'Endpoint where backing Ethereum JSON RPC interface is available', type: 'string', demandOption: false, default: 'http://localhost:8545', @@ -18,12 +18,12 @@ const args = yargs demandOption: true, }) .example( - '$0 --node-endpoint http://localhost:8545 --from 0x5409ed021d9299bf6814279a6a1411a7e866a631', + '$0 --rpc-url http://localhost:8545 --from 0x5409ed021d9299bf6814279a6a1411a7e866a631', 'Full usage example', ).argv; (async () => { - const rpcSubprovider = new RPCSubprovider(args['node-endpoint']); + const rpcSubprovider = new RPCSubprovider(args['rpc-url']); const provider = new Web3ProviderEngine(); provider.addProvider(rpcSubprovider); provider.start(); -- cgit v1.2.3