aboutsummaryrefslogtreecommitdiffstats
path: root/packages/migrations/src/v1/migration.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/migrations/src/v1/migration.ts')
-rw-r--r--packages/migrations/src/v1/migration.ts83
1 files changed, 46 insertions, 37 deletions
diff --git a/packages/migrations/src/v1/migration.ts b/packages/migrations/src/v1/migration.ts
index baa776537..3398537e5 100644
--- a/packages/migrations/src/v1/migration.ts
+++ b/packages/migrations/src/v1/migration.ts
@@ -1,10 +1,8 @@
import { BigNumber, NULL_BYTES } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Provider, TxData } from 'ethereum-types';
-import * as _ from 'lodash';
import { ArtifactWriter } from '../artifact_writer';
-import { ContractName } from '../types';
import { erc20TokenInfo } from '../utils/token_info';
import { artifacts } from './artifacts';
@@ -70,8 +68,13 @@ export const runV1MigrationsAsync = async (provider: Provider, artifactsDir: str
artifactsWriter.saveArtifact(multiSig);
const owner = accounts[0];
- await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: owner });
- await tokenTransferProxy.transferOwnership.sendTransactionAsync(multiSig.address, { from: owner });
+
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: owner }),
+ );
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await tokenTransferProxy.transferOwnership.sendTransactionAsync(multiSig.address, { from: owner }),
+ );
const addTokenGasEstimate = await tokenReg.addToken.estimateGasAsync(
zrxToken.address,
erc20TokenInfo[0].name,
@@ -82,29 +85,33 @@ export const runV1MigrationsAsync = async (provider: Provider, artifactsDir: str
{ from: owner },
);
const decimals = 18;
- await tokenReg.addToken.sendTransactionAsync(
- zrxToken.address,
- '0x Protocol Token',
- 'ZRX',
- decimals,
- NULL_BYTES,
- NULL_BYTES,
- {
- from: owner,
- gas: addTokenGasEstimate,
- },
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await tokenReg.addToken.sendTransactionAsync(
+ zrxToken.address,
+ '0x Protocol Token',
+ 'ZRX',
+ decimals,
+ NULL_BYTES,
+ NULL_BYTES,
+ {
+ from: owner,
+ gas: addTokenGasEstimate,
+ },
+ ),
);
- await tokenReg.addToken.sendTransactionAsync(
- etherToken.address,
- 'Ether Token',
- 'WETH',
- decimals,
- NULL_BYTES,
- NULL_BYTES,
- {
- from: owner,
- gas: addTokenGasEstimate,
- },
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await tokenReg.addToken.sendTransactionAsync(
+ etherToken.address,
+ 'Ether Token',
+ 'WETH',
+ decimals,
+ NULL_BYTES,
+ NULL_BYTES,
+ {
+ from: owner,
+ gas: addTokenGasEstimate,
+ },
+ ),
);
for (const token of erc20TokenInfo) {
const totalSupply = new BigNumber(100000000000000000000);
@@ -117,17 +124,19 @@ export const runV1MigrationsAsync = async (provider: Provider, artifactsDir: str
token.decimals,
totalSupply,
);
- await tokenReg.addToken.sendTransactionAsync(
- dummyToken.address,
- token.name,
- token.symbol,
- token.decimals,
- token.ipfsHash,
- token.swarmHash,
- {
- from: owner,
- gas: addTokenGasEstimate,
- },
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await tokenReg.addToken.sendTransactionAsync(
+ dummyToken.address,
+ token.name,
+ token.symbol,
+ token.decimals,
+ token.ipfsHash,
+ token.swarmHash,
+ {
+ from: owner,
+ gas: addTokenGasEstimate,
+ },
+ ),
);
}
};