diff options
Diffstat (limited to 'packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts')
-rw-r--r-- | packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts b/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts index ffd498055..11b5e7024 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts @@ -4,6 +4,7 @@ import { BaseContract } from '@0x/base-contract'; import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types'; import { BigNumber, classUtils, logUtils } from '@0x/utils'; +import { SimpleContractArtifact } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import * as ethers from 'ethers'; import * as _ from 'lodash'; @@ -3024,32 +3025,38 @@ export class ExchangeContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial<TxData>, + _zrxAssetData: string, ): Promise<ExchangeContract> { if (_.isUndefined(artifact.compilerOutput)) { throw new Error('Compiler output not found in the artifact file'); } const bytecode = artifact.compilerOutput.evm.bytecode.object; const abi = artifact.compilerOutput.abi; - return ExchangeContract.deployAsync(bytecode, abi, provider, txDefaults, ); + return ExchangeContract.deployAsync(bytecode, abi, provider, txDefaults, _zrxAssetData +); } public static async deployAsync( bytecode: string, abi: ContractAbi, provider: Provider, txDefaults: Partial<TxData>, + _zrxAssetData: string, ): Promise<ExchangeContract> { const constructorAbi = BaseContract._lookupConstructorAbi(abi); - [] = BaseContract._formatABIDataItemList( + [_zrxAssetData +] = BaseContract._formatABIDataItemList( constructorAbi.inputs, - [], + [_zrxAssetData +], BaseContract._bigNumberToString, ); const iface = new ethers.utils.Interface(abi); const deployInfo = iface.deployFunction; - const txData = deployInfo.encode(bytecode, []); + const txData = deployInfo.encode(bytecode, [_zrxAssetData +]); const web3Wrapper = new Web3Wrapper(provider); const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync( {data: txData}, @@ -3061,7 +3068,8 @@ export class ExchangeContract extends BaseContract { const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash); logUtils.log(`Exchange successfully deployed at ${txReceipt.contractAddress}`); const contractInstance = new ExchangeContract(abi, txReceipt.contractAddress as string, provider, txDefaults); - contractInstance.constructorArgs = []; + contractInstance.constructorArgs = [_zrxAssetData +]; return contractInstance; } constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) { |