`@0x/contracts-zero-ex`: `bootstrap()` de-registers itself and self-destructs once it's called. `@0x/contracts-zero-ex`: `bootstrap()` now takes arbitrary call data, but the callee is fixed in an immutable. `@0x/contracts-zero-ex`: `bootstrap()` caller is fixed in an immutable. `@0x/contracts-zero-ex`: `bootstrap()` only calls a single target. `@0x/contracts-zero-ex`: Renamed `BasicMigration` to `InitialMigration`. `@0x/contracts-zero-ex`: `InitialMigration` is now the bootstrap target and multiplexes to the initial features. `@0x/contracts-zero-ex`: Add `Migrate` feature and tests. `@0x/contracts-zero-ex`: Re-organize contract locatins (remove `interfaces` folder).
24 lines
785 B
TypeScript
24 lines
785 B
TypeScript
import { SupportedProvider } from '@0x/subproviders';
|
|
import { TxData } from 'ethereum-types';
|
|
|
|
import { artifacts } from '../artifacts';
|
|
import { InitialMigrationContract, ZeroExContract } from '../wrappers';
|
|
|
|
// tslint:disable: completed-docs
|
|
export async function initialMigrateAsync(
|
|
owner: string,
|
|
provider: SupportedProvider,
|
|
txDefaults: Partial<TxData>,
|
|
): Promise<ZeroExContract> {
|
|
const migrator = await InitialMigrationContract.deployFrom0xArtifactAsync(
|
|
artifacts.InitialMigration,
|
|
provider,
|
|
txDefaults,
|
|
artifacts,
|
|
);
|
|
const deployCall = migrator.deploy(owner);
|
|
const zeroEx = new ZeroExContract(await deployCall.callAsync(), provider, {});
|
|
await deployCall.awaitTransactionSuccessAsync();
|
|
return zeroEx;
|
|
}
|