Created
May 27, 2020 17:17
-
-
Save rahuldamodar94/d5cde3db1a8765d75b14e0fb423056e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
import { devConstants, web3Factory } from '@0x/dev-utils'; | |
import { logUtils } from '@0x/utils'; | |
import { MnemonicWalletSubprovider, RPCSubprovider, Web3ProviderEngine } from '@0x/subproviders'; | |
import { Web3Wrapper } from '@0x/web3-wrapper'; | |
import { runMigrationsAsync } from './migration'; | |
import { providerUtils } from '@0x/utils'; | |
(async () => { | |
const mnemonicWallet = new MnemonicWalletSubprovider({ | |
mnemonic: 'seedwords', | |
baseDerivationPath: `44'/60'/0'/0`, | |
}); | |
const providerEngine = new Web3ProviderEngine(); | |
providerEngine.addProvider(mnemonicWallet); | |
providerEngine.addProvider(new RPCSubprovider('https://testnetv3.matic.network')); | |
providerUtils.startProviderEngine(providerEngine); | |
const web3Wrapper = new Web3Wrapper(providerEngine); | |
const [owner] = await web3Wrapper.getAvailableAddressesAsync(); | |
console.log('########################', owner) | |
let txDefaults = { | |
from: owner, | |
gas: 8000000, | |
gasPrice: 1 | |
}; | |
let response = await runMigrationsAsync(providerEngine, txDefaults); | |
console.log(response) | |
process.exit(0); | |
})().catch(err => { | |
logUtils.log(err); | |
process.exit(1); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment