From 9304d09da6c3a78e25caf67a024b0cfef4a3b922 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Thu, 30 Aug 2018 13:38:57 -0700 Subject: Add mainnet migrations --- packages/migrations/src/migrate.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'packages/migrations/src/migrate.ts') diff --git a/packages/migrations/src/migrate.ts b/packages/migrations/src/migrate.ts index c46d3580a..6c8b38762 100644 --- a/packages/migrations/src/migrate.ts +++ b/packages/migrations/src/migrate.ts @@ -7,6 +7,7 @@ import * as yargs from 'yargs'; import { runV1MigrationsAsync } from './1.0.0/migration'; import { runV2TestnetMigrationsAsync } from './2.0.0-beta-testnet/migration'; +import { runV2MainnetMigrationsAsync } from './2.0.0-mainnet/migration'; import { runV2MigrationsAsync } from './2.0.0/migration'; import { providerFactory } from './utils/provider_factory'; @@ -15,6 +16,7 @@ enum ContractVersions { V1 = '1.0.0', V2 = '2.0.0', V2Testnet = '2.0.0-beta-testnet', + V2Mainnet = '2.0.0-mainnet', } const args = yargs.argv; @@ -24,6 +26,8 @@ const args = yargs.argv; let providerConfigs; let provider: Provider; let txDefaults; + let web3Wrapper: Web3Wrapper; + let accounts: string[]; switch (contractsVersion) { case ContractVersions.V1: providerConfigs = { shouldUseInProcessGanache: false }; @@ -43,14 +47,24 @@ const args = yargs.argv; break; case ContractVersions.V2Testnet: provider = await providerFactory.getLedgerProviderAsync(); - const web3Wrapper = new Web3Wrapper(provider); - const accounts = await web3Wrapper.getAvailableAddressesAsync(); + web3Wrapper = new Web3Wrapper(provider); + accounts = await web3Wrapper.getAvailableAddressesAsync(); txDefaults = { from: accounts[0], gas: devConstants.GAS_LIMIT, }; await runV2TestnetMigrationsAsync(provider, artifactsDir, txDefaults); break; + case ContractVersions.V2Mainnet: + provider = await providerFactory.getLedgerProviderAsync(); + web3Wrapper = new Web3Wrapper(provider); + accounts = await web3Wrapper.getAvailableAddressesAsync(); + txDefaults = { + from: accounts[0], + gas: devConstants.GAS_LIMIT, + }; + await runV2MainnetMigrationsAsync(provider, artifactsDir, txDefaults); + break; default: throw new Error(`Unsupported contract version: ${contractsVersion}`); } -- cgit v1.2.3 From 66ed6b9b887b97fa117d91f1034ad1aa3c095249 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Tue, 4 Sep 2018 09:48:13 -0700 Subject: Update mainnet configs --- packages/migrations/src/migrate.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'packages/migrations/src/migrate.ts') diff --git a/packages/migrations/src/migrate.ts b/packages/migrations/src/migrate.ts index 6c8b38762..e3651f2dc 100644 --- a/packages/migrations/src/migrate.ts +++ b/packages/migrations/src/migrate.ts @@ -46,7 +46,7 @@ const args = yargs.argv; await runV2MigrationsAsync(provider, artifactsDir, txDefaults); break; case ContractVersions.V2Testnet: - provider = await providerFactory.getLedgerProviderAsync(); + provider = await providerFactory.getKovanLedgerProviderAsync(); web3Wrapper = new Web3Wrapper(provider); accounts = await web3Wrapper.getAvailableAddressesAsync(); txDefaults = { @@ -56,12 +56,13 @@ const args = yargs.argv; await runV2TestnetMigrationsAsync(provider, artifactsDir, txDefaults); break; case ContractVersions.V2Mainnet: - provider = await providerFactory.getLedgerProviderAsync(); + provider = await providerFactory.getMainnetLedgerProviderAsync(); web3Wrapper = new Web3Wrapper(provider); accounts = await web3Wrapper.getAvailableAddressesAsync(); txDefaults = { - from: accounts[0], + from: accounts[2], gas: devConstants.GAS_LIMIT, + gasPrice: 6000000000, }; await runV2MainnetMigrationsAsync(provider, artifactsDir, txDefaults); break; -- cgit v1.2.3 From e70882a657acecb7437ce9dd28218d719f8beb3d Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 4 Sep 2018 17:22:22 -0400 Subject: More small chnages/bug fixes --- packages/migrations/src/migrate.ts | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'packages/migrations/src/migrate.ts') diff --git a/packages/migrations/src/migrate.ts b/packages/migrations/src/migrate.ts index e3651f2dc..338832feb 100644 --- a/packages/migrations/src/migrate.ts +++ b/packages/migrations/src/migrate.ts @@ -1,22 +1,15 @@ #!/usr/bin/env node import { devConstants, web3Factory } from '@0xproject/dev-utils'; import { logUtils } from '@0xproject/utils'; -import { Web3Wrapper } from '@0xproject/web3-wrapper'; import { Provider } from 'ethereum-types'; import * as yargs from 'yargs'; import { runV1MigrationsAsync } from './1.0.0/migration'; -import { runV2TestnetMigrationsAsync } from './2.0.0-beta-testnet/migration'; -import { runV2MainnetMigrationsAsync } from './2.0.0-mainnet/migration'; import { runV2MigrationsAsync } from './2.0.0/migration'; -import { providerFactory } from './utils/provider_factory'; - enum ContractVersions { V1 = '1.0.0', V2 = '2.0.0', - V2Testnet = '2.0.0-beta-testnet', - V2Mainnet = '2.0.0-mainnet', } const args = yargs.argv; @@ -26,8 +19,6 @@ const args = yargs.argv; let providerConfigs; let provider: Provider; let txDefaults; - let web3Wrapper: Web3Wrapper; - let accounts: string[]; switch (contractsVersion) { case ContractVersions.V1: providerConfigs = { shouldUseInProcessGanache: false }; @@ -45,27 +36,6 @@ const args = yargs.argv; }; await runV2MigrationsAsync(provider, artifactsDir, txDefaults); break; - case ContractVersions.V2Testnet: - provider = await providerFactory.getKovanLedgerProviderAsync(); - web3Wrapper = new Web3Wrapper(provider); - accounts = await web3Wrapper.getAvailableAddressesAsync(); - txDefaults = { - from: accounts[0], - gas: devConstants.GAS_LIMIT, - }; - await runV2TestnetMigrationsAsync(provider, artifactsDir, txDefaults); - break; - case ContractVersions.V2Mainnet: - provider = await providerFactory.getMainnetLedgerProviderAsync(); - web3Wrapper = new Web3Wrapper(provider); - accounts = await web3Wrapper.getAvailableAddressesAsync(); - txDefaults = { - from: accounts[2], - gas: devConstants.GAS_LIMIT, - gasPrice: 6000000000, - }; - await runV2MainnetMigrationsAsync(provider, artifactsDir, txDefaults); - break; default: throw new Error(`Unsupported contract version: ${contractsVersion}`); } -- cgit v1.2.3 From 3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Wed, 3 Oct 2018 16:21:17 -0700 Subject: Remove artifacts from migrations package and update contract-wrappers accordingly --- packages/migrations/src/migrate.ts | 39 ++++++++------------------------------ 1 file changed, 8 insertions(+), 31 deletions(-) (limited to 'packages/migrations/src/migrate.ts') diff --git a/packages/migrations/src/migrate.ts b/packages/migrations/src/migrate.ts index 338832feb..27f36ba34 100644 --- a/packages/migrations/src/migrate.ts +++ b/packages/migrations/src/migrate.ts @@ -2,43 +2,20 @@ import { devConstants, web3Factory } from '@0xproject/dev-utils'; import { logUtils } from '@0xproject/utils'; import { Provider } from 'ethereum-types'; -import * as yargs from 'yargs'; -import { runV1MigrationsAsync } from './1.0.0/migration'; -import { runV2MigrationsAsync } from './2.0.0/migration'; - -enum ContractVersions { - V1 = '1.0.0', - V2 = '2.0.0', -} -const args = yargs.argv; +import { runMigrationsAsync } from './migration'; (async () => { - const contractsVersion = args.contractsVersion; - const artifactsDir = `artifacts/${contractsVersion}`; let providerConfigs; let provider: Provider; let txDefaults; - switch (contractsVersion) { - case ContractVersions.V1: - providerConfigs = { shouldUseInProcessGanache: false }; - provider = web3Factory.getRpcProvider(providerConfigs); - txDefaults = { - from: devConstants.TESTRPC_FIRST_ADDRESS, - }; - await runV1MigrationsAsync(provider, artifactsDir, txDefaults); - break; - case ContractVersions.V2: - providerConfigs = { shouldUseInProcessGanache: false }; - provider = web3Factory.getRpcProvider(providerConfigs); - txDefaults = { - from: devConstants.TESTRPC_FIRST_ADDRESS, - }; - await runV2MigrationsAsync(provider, artifactsDir, txDefaults); - break; - default: - throw new Error(`Unsupported contract version: ${contractsVersion}`); - } + + providerConfigs = { shouldUseInProcessGanache: false }; + provider = web3Factory.getRpcProvider(providerConfigs); + txDefaults = { + from: devConstants.TESTRPC_FIRST_ADDRESS, + }; + await runMigrationsAsync(provider, txDefaults); process.exit(0); })().catch(err => { logUtils.log(err); -- cgit v1.2.3 From 9f924e459c43c023e35ab7222cd9824cc0e67411 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Thu, 18 Oct 2018 21:51:56 +1100 Subject: chore: change package org from 0xproject to 0x --- packages/migrations/src/migrate.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/migrations/src/migrate.ts') diff --git a/packages/migrations/src/migrate.ts b/packages/migrations/src/migrate.ts index 27f36ba34..d7a76d2f8 100644 --- a/packages/migrations/src/migrate.ts +++ b/packages/migrations/src/migrate.ts @@ -1,6 +1,6 @@ #!/usr/bin/env node -import { devConstants, web3Factory } from '@0xproject/dev-utils'; -import { logUtils } from '@0xproject/utils'; +import { devConstants, web3Factory } from '@0x/dev-utils'; +import { logUtils } from '@0x/utils'; import { Provider } from 'ethereum-types'; import { runMigrationsAsync } from './migration'; -- cgit v1.2.3