aboutsummaryrefslogtreecommitdiffstats
path: root/packages/migrations/src/migration.ts
diff options
context:
space:
mode:
authorFred Carlsen <fred@sjelfull.no>2018-11-27 23:19:36 +0800
committerFred Carlsen <fred@sjelfull.no>2018-11-27 23:19:36 +0800
commit9b0020a884bdb98f9da434878fec171ab533ba7e (patch)
treeca285eb7dfd2c68f781b8b74d409fb69665a58dc /packages/migrations/src/migration.ts
parentec12e46e3f52ebb44338c113cecd073979821fae (diff)
parentfdc4a4e5fa31d8797abf6313f4488147853ed77e (diff)
downloaddexon-sol-tools-9b0020a884bdb98f9da434878fec171ab533ba7e.tar
dexon-sol-tools-9b0020a884bdb98f9da434878fec171ab533ba7e.tar.gz
dexon-sol-tools-9b0020a884bdb98f9da434878fec171ab533ba7e.tar.bz2
dexon-sol-tools-9b0020a884bdb98f9da434878fec171ab533ba7e.tar.lz
dexon-sol-tools-9b0020a884bdb98f9da434878fec171ab533ba7e.tar.xz
dexon-sol-tools-9b0020a884bdb98f9da434878fec171ab533ba7e.tar.zst
dexon-sol-tools-9b0020a884bdb98f9da434878fec171ab533ba7e.zip
Merge remote-tracking branch 'upstream/development' into website
Diffstat (limited to 'packages/migrations/src/migration.ts')
-rw-r--r--packages/migrations/src/migration.ts19
1 files changed, 13 insertions, 6 deletions
diff --git a/packages/migrations/src/migration.ts b/packages/migrations/src/migration.ts
index 86c76a54b..c684c4970 100644
--- a/packages/migrations/src/migration.ts
+++ b/packages/migrations/src/migration.ts
@@ -11,10 +11,9 @@ import { erc20TokenInfo, erc721TokenInfo } from './utils/token_info';
/**
* Creates and deploys all the contracts that are required for the latest
- * version of the 0x protocol. Custom migrations can be defined here. This will
- * be called with the CLI 'migrate:v2' command.
- * @param provider Web3 provider instance.
- * @param txDefaults Default transaction values to use when deploying contracts.
+ * version of the 0x protocol.
+ * @param provider Web3 provider instance. Your provider instance should connect to the testnet you want to deploy to.
+ * @param txDefaults Default transaction values to use when deploying contracts (e.g., specify the desired contract creator with the `from` parameter).
* @returns The addresses of the contracts that were deployed.
*/
export async function runMigrationsAsync(provider: Provider, txDefaults: Partial<TxData>): Promise<ContractAddresses> {
@@ -48,6 +47,7 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial
artifacts.Exchange,
provider,
txDefaults,
+ zrxAssetData,
);
// Multisigs
@@ -141,6 +141,13 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial
zrxAssetData,
);
+ // Fund the Forwarder with ZRX
+ const zrxDecimals = await zrxToken.decimals.callAsync();
+ const zrxForwarderAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(5000), zrxDecimals);
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await zrxToken.transfer.sendTransactionAsync(forwarder.address, zrxForwarderAmount, txDefaults),
+ );
+
return {
erc20Proxy: erc20Proxy.address,
erc721Proxy: erc721Proxy.address,
@@ -159,8 +166,8 @@ let _cachedContractAddresses: ContractAddresses;
* Exactly like runMigrationsAsync but will only run the migrations the first
* time it is called. Any subsequent calls will return the cached contract
* addresses.
- * @param provider Web3 provider instance.
- * @param txDefaults Default transaction values to use when deploying contracts.
+ * @param provider Web3 provider instance. Your provider instance should connect to the testnet you want to deploy to.
+ * @param txDefaults Default transaction values to use when deploying contracts (e.g., specify the desired contract creator with the `from` parameter).
* @returns The addresses of the contracts that were deployed.
*/
export async function runMigrationsOnceAsync(