Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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