From 4b64d8c3aad3e1fa3d807941e70f2901941c2501 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 20 Nov 2018 23:06:46 +0000 Subject: Allow a `SimpleContractArtifact` to be passed into `deployFrom0xArtifactAsync` --- packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages/abi-gen-wrappers/src') diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts b/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts index ffd498055..a04b6025e 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,7 +3025,7 @@ export class ExchangeContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, ): Promise { -- cgit v1.2.3 From 21f39079c891d3e5b4c60edc51311eb36789d18e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 20 Nov 2018 23:42:35 +0000 Subject: Update abi-gen-wrappers --- packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts | 3 ++- packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts | 3 ++- packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts | 3 ++- packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts | 3 ++- packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts | 3 ++- packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts | 3 ++- packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts | 3 ++- packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts | 3 ++- packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts | 3 ++- packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts | 3 ++- packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts | 3 ++- packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts | 3 ++- packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts | 3 ++- 13 files changed, 26 insertions(+), 13 deletions(-) (limited to 'packages/abi-gen-wrappers/src') diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts b/packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts index 8ca70e026..27f108ebc 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.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'; @@ -1800,7 +1801,7 @@ export class AssetProxyOwnerContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, _owners: string[], diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts index 1efeeed0a..3995c6d87 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.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'; @@ -968,7 +969,7 @@ export class DummyERC20TokenContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, _name: string, diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts index cc5f9679f..a7af2d158 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.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'; @@ -1264,7 +1265,7 @@ export class DummyERC721TokenContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, _name: string, diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts index ab207b38e..474472e43 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.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'; @@ -601,7 +602,7 @@ export class ERC20ProxyContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, ): Promise { diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts index 8ee563b7e..ab208cbf5 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.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'; @@ -508,7 +509,7 @@ export class ERC20TokenContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, ): Promise { diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts index 691c55578..f9730a072 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.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'; @@ -601,7 +602,7 @@ export class ERC721ProxyContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, ): Promise { diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts index d1a2d5670..251dfa5f9 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.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'; @@ -845,7 +846,7 @@ export class ERC721TokenContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, ): Promise { diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts b/packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts index 80bbc52c7..8a88431b3 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/forwarder.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'; @@ -661,7 +662,7 @@ export class ForwarderContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, _exchange: string, diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts b/packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts index 203a66b6d..5f38ffdac 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/i_validator.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'; @@ -60,7 +61,7 @@ export class IValidatorContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, ): Promise { diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts b/packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts index 99809a049..5fa6f1577 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.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'; @@ -55,7 +56,7 @@ export class IWalletContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, ): Promise { diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts b/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts index 38233af3f..ce47b76fc 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.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'; @@ -295,7 +296,7 @@ export class OrderValidatorContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, _exchange: string, diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts b/packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts index 86d1031db..12ec55ae9 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/weth9.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'; @@ -787,7 +788,7 @@ export class WETH9Contract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, ): Promise { diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts index 98079e77b..877ffd12d 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.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'; @@ -598,7 +599,7 @@ export class ZRXTokenContract extends BaseContract { }, }; public static async deployFrom0xArtifactAsync( - artifact: ContractArtifact, + artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial, ): Promise { -- cgit v1.2.3 From f0f6b26c3bb206f59549e086b788da85bedd26f2 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Fri, 23 Nov 2018 17:52:08 +1100 Subject: bug: Use Testnet Exchange over mainnet --- .../abi-gen-wrappers/src/generated-wrappers/exchange.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'packages/abi-gen-wrappers/src') 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, + _zrxAssetData: string, ): Promise { 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, + _zrxAssetData: string, ): Promise { 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) { -- cgit v1.2.3