diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-06-13 05:01:19 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-06-13 05:01:19 +0800 |
commit | 39692a8b3fd69e5b37e2de568ee74766840ad4b8 (patch) | |
tree | cc2d1ec295d987a360ce07a5c80723b96b0d1816 /packages/migrations/src/v1/migration.ts | |
parent | 2af6d3f6bc03932f53d199971694c3c0d9441ba8 (diff) | |
parent | 787015f5370718e31c7990446fb1da298ed13e6b (diff) | |
download | dexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.tar dexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.tar.gz dexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.tar.bz2 dexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.tar.lz dexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.tar.xz dexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.tar.zst dexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.zip |
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/onboarding-flow-allowances
Diffstat (limited to 'packages/migrations/src/v1/migration.ts')
-rw-r--r-- | packages/migrations/src/v1/migration.ts | 81 |
1 files changed, 46 insertions, 35 deletions
diff --git a/packages/migrations/src/v1/migration.ts b/packages/migrations/src/v1/migration.ts index 7c1cda506..3398537e5 100644 --- a/packages/migrations/src/v1/migration.ts +++ b/packages/migrations/src/v1/migration.ts @@ -68,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, @@ -80,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); @@ -115,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, + }, + ), ); } }; |