aboutsummaryrefslogtreecommitdiffstats
path: root/packages/migrations/src/migrate.ts
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-09-05 03:32:43 +0800
committerJacob Evans <jacob@dekz.net>2018-09-05 03:32:43 +0800
commit192d4b4dbfa3b3e8a1cc73d4f3e0e11074e3ae6b (patch)
treeaff2c74c7cbebe891f0bf1e17b94da121369f887 /packages/migrations/src/migrate.ts
parent68246fc33546a4d2f56e10a014d0bc56723061c0 (diff)
parent7ef86636aad31c4c8253175c0b2356313fada681 (diff)
downloaddexon-sol-tools-192d4b4dbfa3b3e8a1cc73d4f3e0e11074e3ae6b.tar
dexon-sol-tools-192d4b4dbfa3b3e8a1cc73d4f3e0e11074e3ae6b.tar.gz
dexon-sol-tools-192d4b4dbfa3b3e8a1cc73d4f3e0e11074e3ae6b.tar.bz2
dexon-sol-tools-192d4b4dbfa3b3e8a1cc73d4f3e0e11074e3ae6b.tar.lz
dexon-sol-tools-192d4b4dbfa3b3e8a1cc73d4f3e0e11074e3ae6b.tar.xz
dexon-sol-tools-192d4b4dbfa3b3e8a1cc73d4f3e0e11074e3ae6b.tar.zst
dexon-sol-tools-192d4b4dbfa3b3e8a1cc73d4f3e0e11074e3ae6b.zip
Merge branch 'deployment/2.0.0-beta-testnet/ropsten' of github.com:0xProject/0x-monorepo into deployment/2.0.0-beta-testnet/ropsten
Diffstat (limited to 'packages/migrations/src/migrate.ts')
-rw-r--r--packages/migrations/src/migrate.ts21
1 files changed, 18 insertions, 3 deletions
diff --git a/packages/migrations/src/migrate.ts b/packages/migrations/src/migrate.ts
index c46d3580a..e3651f2dc 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 };
@@ -42,15 +46,26 @@ const args = yargs.argv;
await runV2MigrationsAsync(provider, artifactsDir, txDefaults);
break;
case ContractVersions.V2Testnet:
- provider = await providerFactory.getLedgerProviderAsync();
- const web3Wrapper = new Web3Wrapper(provider);
- const accounts = await web3Wrapper.getAvailableAddressesAsync();
+ 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}`);
}