diff options
Diffstat (limited to 'packages/abi-gen-wrappers')
-rw-r--r-- | packages/abi-gen-wrappers/CHANGELOG.json | 9 | ||||
-rw-r--r-- | packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts | 17 |
2 files changed, 21 insertions, 5 deletions
diff --git a/packages/abi-gen-wrappers/CHANGELOG.json b/packages/abi-gen-wrappers/CHANGELOG.json index 955b8220f..f74d98afa 100644 --- a/packages/abi-gen-wrappers/CHANGELOG.json +++ b/packages/abi-gen-wrappers/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "version": "2.0.0", + "changes": [ + { + "pr": 1309, + "note": "Update Exchange artifact to receive ZRX asset data as a constructor argument" + } + ] + }, + { "version": "1.1.0", "changes": [ { diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts b/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts index a04b6025e..11b5e7024 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts @@ -3028,29 +3028,35 @@ export class ExchangeContract extends BaseContract { 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}, @@ -3062,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>) { |