aboutsummaryrefslogtreecommitdiffstats
path: root/packages/abi-gen-wrappers
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-11-23 14:52:08 +0800
committerJacob Evans <jacob@dekz.net>2018-11-23 15:17:51 +0800
commitf0f6b26c3bb206f59549e086b788da85bedd26f2 (patch)
tree717caf5737ba103e6e43c0aec10f086beefbd37f /packages/abi-gen-wrappers
parenta5359df002d121c1b7c1f29e8a2bd8b351090ee3 (diff)
downloaddexon-0x-contracts-f0f6b26c3bb206f59549e086b788da85bedd26f2.tar.gz
dexon-0x-contracts-f0f6b26c3bb206f59549e086b788da85bedd26f2.tar.zst
dexon-0x-contracts-f0f6b26c3bb206f59549e086b788da85bedd26f2.zip
bug: Use Testnet Exchange over mainnet
Diffstat (limited to 'packages/abi-gen-wrappers')
-rw-r--r--packages/abi-gen-wrappers/CHANGELOG.json9
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts17
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>) {