aboutsummaryrefslogtreecommitdiffstats
path: root/packages/migrations/src/migrate.ts
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-08-31 04:38:57 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-09-05 02:07:56 +0800
commit9304d09da6c3a78e25caf67a024b0cfef4a3b922 (patch)
treeed42d4cac26b8e86de1c3909c107c750706b7e42 /packages/migrations/src/migrate.ts
parent6a619a4084188d1c48d8030d0fe2a1ba777c55e3 (diff)
downloaddexon-0x-contracts-9304d09da6c3a78e25caf67a024b0cfef4a3b922.tar.gz
dexon-0x-contracts-9304d09da6c3a78e25caf67a024b0cfef4a3b922.tar.zst
dexon-0x-contracts-9304d09da6c3a78e25caf67a024b0cfef4a3b922.zip
Add mainnet migrations
Diffstat (limited to 'packages/migrations/src/migrate.ts')
-rw-r--r--packages/migrations/src/migrate.ts18
1 files changed, 16 insertions, 2 deletions
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}`);
}