From 01685b7622f7c29137aba65f1836a344b1321555 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Wed, 29 Aug 2018 21:36:20 -0700 Subject: Fix contract not deployed on network bug in ContractWrapper class --- packages/contract-wrappers/CHANGELOG.json | 4 ++++ packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index b7c89a325..3bd89862a 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -4,6 +4,10 @@ "changes": [ { "note": "Add `OrderValidatorWrapper`" + }, + { + "note": + "Fix bug where contracts not deployed on a network showed an `EXCHANGE_CONTRACT_DOES_NOT_EXIST` error instead of `CONTRACT_NOT_DEPLOYED_ON_NETWORK`" } ] }, diff --git a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts index ba36afea1..19de17c0a 100644 --- a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts @@ -145,9 +145,12 @@ export abstract class ContractWrapper { } protected _getContractAddress(artifact: ContractArtifact, addressIfExists?: string): string { if (_.isUndefined(addressIfExists)) { + if (_.isUndefined(artifact.networks[this._networkId])) { + throw new Error(ContractWrappersError.ContractNotDeployedOnNetwork); + } const contractAddress = artifact.networks[this._networkId].address; if (_.isUndefined(contractAddress)) { - throw new Error(ContractWrappersError.ExchangeContractDoesNotExist); + throw new Error(CONTRACT_NAME_TO_NOT_FOUND_ERROR[artifact.contractName]); } return contractAddress; } else { -- cgit v1.2.3 From cdc786a1e36ad60106244fa183e335b36e6889b9 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 4 Sep 2018 15:08:39 +0200 Subject: Remove types for web3-provider-engine from typescript-typings --- packages/contract-wrappers/package.json | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index 7da839a00..5d5c8069a 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -49,6 +49,7 @@ "@0xproject/subproviders": "^2.0.1", "@0xproject/tslint-config": "^1.0.6", "@types/lodash": "4.14.104", + "@types/web3-provider-engine": "^14.0.0", "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", "@types/sinon": "^2.2.2", -- cgit v1.2.3 From 539c243733c60fe083ed0e3e7d7663981f5d7663 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 4 Sep 2018 16:23:02 +0100 Subject: Move fetchers to contract-wrappers --- packages/contract-wrappers/CHANGELOG.json | 4 ++ .../asset_balance_and_proxy_allowance_fetcher.ts | 77 ++++++++++++++++++++++ .../src/fetchers/order_filled_cancelled_fetcher.ts | 30 +++++++++ 3 files changed, 111 insertions(+) create mode 100644 packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts create mode 100644 packages/contract-wrappers/src/fetchers/order_filled_cancelled_fetcher.ts (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index b7c89a325..8a41c560e 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -4,6 +4,10 @@ "changes": [ { "note": "Add `OrderValidatorWrapper`" + }, + { + "note": + "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations" } ] }, diff --git a/packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts b/packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts new file mode 100644 index 000000000..023cd5ac3 --- /dev/null +++ b/packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts @@ -0,0 +1,77 @@ +// tslint:disable:no-unnecessary-type-assertion +import { AbstractBalanceAndProxyAllowanceFetcher, assetDataUtils } from '@0xproject/order-utils'; +import { AssetProxyId, ERC20AssetData, ERC721AssetData } from '@0xproject/types'; +import { BigNumber } from '@0xproject/utils'; +import { BlockParamLiteral } from 'ethereum-types'; + +import { ERC20TokenWrapper } from '../contract_wrappers/erc20_token_wrapper'; +import { ERC721TokenWrapper } from '../contract_wrappers/erc721_token_wrapper'; + +export class AssetBalanceAndProxyAllowanceFetcher implements AbstractBalanceAndProxyAllowanceFetcher { + private readonly _erc20Token: ERC20TokenWrapper; + private readonly _erc721Token: ERC721TokenWrapper; + private readonly _stateLayer: BlockParamLiteral; + constructor(erc20Token: ERC20TokenWrapper, erc721Token: ERC721TokenWrapper, stateLayer: BlockParamLiteral) { + this._erc20Token = erc20Token; + this._erc721Token = erc721Token; + this._stateLayer = stateLayer; + } + public async getBalanceAsync(assetData: string, userAddress: string): Promise { + const decodedAssetData = assetDataUtils.decodeAssetDataOrThrow(assetData); + if (decodedAssetData.assetProxyId === AssetProxyId.ERC20) { + const decodedERC20AssetData = decodedAssetData as ERC20AssetData; + const balance = await this._erc20Token.getBalanceAsync(decodedERC20AssetData.tokenAddress, userAddress, { + defaultBlock: this._stateLayer, + }); + return balance; + } else { + const decodedERC721AssetData = decodedAssetData as ERC721AssetData; + const tokenOwner = await this._erc721Token.getOwnerOfAsync( + decodedERC721AssetData.tokenAddress, + decodedERC721AssetData.tokenId, + { + defaultBlock: this._stateLayer, + }, + ); + const balance = tokenOwner === userAddress ? new BigNumber(1) : new BigNumber(0); + return balance; + } + } + public async getProxyAllowanceAsync(assetData: string, userAddress: string): Promise { + const decodedAssetData = assetDataUtils.decodeAssetDataOrThrow(assetData); + if (decodedAssetData.assetProxyId === AssetProxyId.ERC20) { + const decodedERC20AssetData = decodedAssetData as ERC20AssetData; + const proxyAllowance = await this._erc20Token.getProxyAllowanceAsync( + decodedERC20AssetData.tokenAddress, + userAddress, + { + defaultBlock: this._stateLayer, + }, + ); + return proxyAllowance; + } else { + const decodedERC721AssetData = decodedAssetData as ERC721AssetData; + + const isApprovedForAll = await this._erc721Token.isProxyApprovedForAllAsync( + decodedERC721AssetData.tokenAddress, + userAddress, + { + defaultBlock: this._stateLayer, + }, + ); + if (isApprovedForAll) { + return new BigNumber(this._erc20Token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS); + } else { + const isApproved = await this._erc721Token.isProxyApprovedAsync( + decodedERC721AssetData.tokenAddress, + decodedERC721AssetData.tokenId, + { + defaultBlock: this._stateLayer, + }, + ); + const proxyAllowance = isApproved ? new BigNumber(1) : new BigNumber(0); + return proxyAllowance; + } + } + } +} diff --git a/packages/contract-wrappers/src/fetchers/order_filled_cancelled_fetcher.ts b/packages/contract-wrappers/src/fetchers/order_filled_cancelled_fetcher.ts new file mode 100644 index 000000000..ba6f5fb5e --- /dev/null +++ b/packages/contract-wrappers/src/fetchers/order_filled_cancelled_fetcher.ts @@ -0,0 +1,30 @@ +// tslint:disable:no-unnecessary-type-assertion +import { AbstractOrderFilledCancelledFetcher } from '@0xproject/order-utils'; +import { BigNumber } from '@0xproject/utils'; +import { BlockParamLiteral } from 'ethereum-types'; + +import { ERC20TokenWrapper } from '../contract_wrappers/erc20_token_wrapper'; +import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper'; + +export class OrderFilledCancelledFetcher implements AbstractOrderFilledCancelledFetcher { + private readonly _exchange: ExchangeWrapper; + private readonly _stateLayer: BlockParamLiteral; + constructor(exchange: ExchangeWrapper, stateLayer: BlockParamLiteral) { + this._exchange = exchange; + this._stateLayer = stateLayer; + } + public async getFilledTakerAmountAsync(orderHash: string): Promise { + const filledTakerAmount = this._exchange.getFilledTakerAssetAmountAsync(orderHash, { + defaultBlock: this._stateLayer, + }); + return filledTakerAmount; + } + public async isOrderCancelledAsync(orderHash: string): Promise { + const isCancelled = await this._exchange.isCancelledAsync(orderHash); + return isCancelled; + } + public getZRXAssetData(): string { + const zrxAssetData = this._exchange.getZRXAssetData(); + return zrxAssetData; + } +} -- cgit v1.2.3 From ed786f3e8f970fac88cee68f399813f17160cdd7 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 4 Sep 2018 16:23:29 +0100 Subject: Export fetchers from contract-wrappers --- packages/contract-wrappers/src/index.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/src/index.ts b/packages/contract-wrappers/src/index.ts index b66d8460e..8f32a906f 100644 --- a/packages/contract-wrappers/src/index.ts +++ b/packages/contract-wrappers/src/index.ts @@ -85,3 +85,6 @@ export { ExchangeEventArgs, ExchangeEvents, } from './contract_wrappers/generated/exchange'; + +export { AssetBalanceAndProxyAllowanceFetcher } from './fetchers/asset_balance_and_proxy_allowance_fetcher'; +export { OrderFilledCancelledFetcher } from './fetchers/order_filled_cancelled_fetcher'; -- cgit v1.2.3 From d496a7585c06ff48770841e12f7be5a9707f6d5a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 4 Sep 2018 16:27:16 +0100 Subject: Add `validateFillOrderThrowIfInvalidAsync` and `validateOrderFillableOrThrowAsync` to ExchangeWrapper --- packages/contract-wrappers/CHANGELOG.json | 4 ++ .../contract-wrappers/src/contract_wrappers.ts | 2 + .../src/contract_wrappers/exchange_wrapper.ts | 79 +++++++++++++++++++++- 3 files changed, 83 insertions(+), 2 deletions(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 8a41c560e..9dc9cd1b3 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -8,6 +8,10 @@ { "note": "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations" + }, + { + "note": + "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper" } ] }, diff --git a/packages/contract-wrappers/src/contract_wrappers.ts b/packages/contract-wrappers/src/contract_wrappers.ts index 8ca0fc93c..4272cc943 100644 --- a/packages/contract-wrappers/src/contract_wrappers.ts +++ b/packages/contract-wrappers/src/contract_wrappers.ts @@ -111,6 +111,8 @@ export class ContractWrappers { this.exchange = new ExchangeWrapper( this._web3Wrapper, config.networkId, + this.erc20Token, + this.erc721Token, config.exchangeContractAddress, config.zrxContractAddress, blockPollingIntervalMs, diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts index cfef0f107..dc9ffcbf7 100644 --- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts @@ -1,12 +1,19 @@ import { schemas } from '@0xproject/json-schemas'; -import { assetDataUtils } from '@0xproject/order-utils'; +import { + assetDataUtils, + BalanceAndProxyAllowanceLazyStore, + ExchangeTransferSimulator, + OrderValidationUtils, +} from '@0xproject/order-utils'; import { AssetProxyId, Order, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; -import { ContractAbi, LogWithDecodedArgs } from 'ethereum-types'; +import { BlockParamLiteral, ContractAbi, LogWithDecodedArgs } from 'ethereum-types'; import * as _ from 'lodash'; import { artifacts } from '../artifacts'; +import { AssetBalanceAndProxyAllowanceFetcher } from '../fetchers/asset_balance_and_proxy_allowance_fetcher'; +import { OrderFilledCancelledFetcher } from '../fetchers/order_filled_cancelled_fetcher'; import { methodOptsSchema } from '../schemas/method_opts_schema'; import { orderTxOptsSchema } from '../schemas/order_tx_opts_schema'; import { txOptsSchema } from '../schemas/tx_opts_schema'; @@ -17,13 +24,17 @@ import { IndexedFilterValues, MethodOpts, OrderInfo, + OrderStatus, OrderTransactionOpts, + ValidateOrderFillableOpts, } from '../types'; import { assert } from '../utils/assert'; import { decorators } from '../utils/decorators'; import { TransactionEncoder } from '../utils/transaction_encoder'; import { ContractWrapper } from './contract_wrapper'; +import { ERC20TokenWrapper } from './erc20_token_wrapper'; +import { ERC721TokenWrapper } from './erc721_token_wrapper'; import { ExchangeContract, ExchangeEventArgs, ExchangeEvents } from './generated/exchange'; /** @@ -33,6 +44,8 @@ import { ExchangeContract, ExchangeEventArgs, ExchangeEvents } from './generated export class ExchangeWrapper extends ContractWrapper { public abi: ContractAbi = artifacts.Exchange.compilerOutput.abi; private _exchangeContractIfExists?: ExchangeContract; + private _erc721TokenWrapper: ERC721TokenWrapper; + private _erc20TokenWrapper: ERC20TokenWrapper; private _contractAddressIfExists?: string; private _zrxContractAddressIfExists?: string; /** @@ -48,11 +61,15 @@ export class ExchangeWrapper extends ContractWrapper { constructor( web3Wrapper: Web3Wrapper, networkId: number, + erc20TokenWrapper: ERC20TokenWrapper, + erc721TokenWrapper: ERC721TokenWrapper, contractAddressIfExists?: string, zrxContractAddressIfExists?: string, blockPollingIntervalMs?: number, ) { super(web3Wrapper, networkId, blockPollingIntervalMs); + this._erc20TokenWrapper = erc20TokenWrapper; + this._erc721TokenWrapper = erc721TokenWrapper; this._contractAddressIfExists = contractAddressIfExists; this._zrxContractAddressIfExists = zrxContractAddressIfExists; } @@ -1084,6 +1101,64 @@ export class ExchangeWrapper extends ContractWrapper { ); return logs; } + /** + * Validate if the supplied order is fillable, and throw if it isn't + * @param signedOrder SignedOrder of interest + * @param opts ValidateOrderFillableOpts options (e.g expectedFillTakerTokenAmount. + * If it isn't supplied, we check if the order is fillable for a non-zero amount) + */ + public async validateOrderFillableOrThrowAsync( + signedOrder: SignedOrder, + opts: ValidateOrderFillableOpts = {}, + ): Promise { + const balanceAllowanceFetcher = new AssetBalanceAndProxyAllowanceFetcher( + this._erc20TokenWrapper, + this._erc721TokenWrapper, + BlockParamLiteral.Latest, + ); + const balanceAllowanceStore = new BalanceAndProxyAllowanceLazyStore(balanceAllowanceFetcher); + const exchangeTradeSimulator = new ExchangeTransferSimulator(balanceAllowanceStore); + + const expectedFillTakerTokenAmountIfExists = opts.expectedFillTakerTokenAmount; + const filledCancelledFetcher = new OrderFilledCancelledFetcher(this, BlockParamLiteral.Latest); + const orderValidationUtils = new OrderValidationUtils(filledCancelledFetcher); + await orderValidationUtils.validateOrderFillableOrThrowAsync( + exchangeTradeSimulator, + signedOrder, + this.getZRXAssetData(), + expectedFillTakerTokenAmountIfExists, + ); + } + /** + * Validate a call to FillOrder and throw if it wouldn't succeed + * @param signedOrder SignedOrder of interest + * @param fillTakerAssetAmount Amount we'd like to fill the order for + * @param takerAddress The taker of the order + */ + public async validateFillOrderThrowIfInvalidAsync( + signedOrder: SignedOrder, + fillTakerAssetAmount: BigNumber, + takerAddress: string, + ): Promise { + const balanceAllowanceFetcher = new AssetBalanceAndProxyAllowanceFetcher( + this._erc20TokenWrapper, + this._erc721TokenWrapper, + BlockParamLiteral.Latest, + ); + const balanceAllowanceStore = new BalanceAndProxyAllowanceLazyStore(balanceAllowanceFetcher); + const exchangeTradeSimulator = new ExchangeTransferSimulator(balanceAllowanceStore); + + const filledCancelledFetcher = new OrderFilledCancelledFetcher(this, BlockParamLiteral.Latest); + const orderValidationUtils = new OrderValidationUtils(filledCancelledFetcher); + await orderValidationUtils.validateFillOrderThrowIfInvalidAsync( + exchangeTradeSimulator, + this._web3Wrapper.getProvider(), + signedOrder, + fillTakerAssetAmount, + takerAddress, + this.getZRXAssetData(), + ); + } /** * Retrieves the Ethereum address of the Exchange contract deployed on the network * that the user-passed web3 provider is connected to. -- cgit v1.2.3 From 56847a53f4cae5f6ea68f72f8577ae3f1ea33a04 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 4 Sep 2018 16:41:43 +0100 Subject: Add PR nr --- packages/contract-wrappers/CHANGELOG.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 9dc9cd1b3..f863972f9 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -7,11 +7,13 @@ }, { "note": - "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations" + "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations", + "pr": 1054 }, { "note": - "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper" + "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper", + "pr": 1054 } ] }, -- cgit v1.2.3 From bbfd7647a805c9d6867868b040ca8434f10ef6c3 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 4 Sep 2018 16:52:21 +0100 Subject: Export missing type --- packages/contract-wrappers/src/index.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/src/index.ts b/packages/contract-wrappers/src/index.ts index 8f32a906f..f6d7ff879 100644 --- a/packages/contract-wrappers/src/index.ts +++ b/packages/contract-wrappers/src/index.ts @@ -25,6 +25,7 @@ export { BalanceAndAllowance, OrderAndTraderInfo, TraderInfo, + ValidateOrderFillableOpts, } from './types'; export { Order, SignedOrder, AssetProxyId } from '@0xproject/types'; -- cgit v1.2.3 From 8d8528996a02aa65d81f3c3b59d5a42359205f54 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 4 Sep 2018 17:44:27 +0100 Subject: Export abstract fetchers --- packages/contract-wrappers/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/src/index.ts b/packages/contract-wrappers/src/index.ts index f6d7ff879..2fcdd2ddb 100644 --- a/packages/contract-wrappers/src/index.ts +++ b/packages/contract-wrappers/src/index.ts @@ -87,5 +87,7 @@ export { ExchangeEvents, } from './contract_wrappers/generated/exchange'; +export { AbstractBalanceAndProxyAllowanceFetcher, AbstractOrderFilledCancelledFetcher } from '@0xproject/order-utils'; + export { AssetBalanceAndProxyAllowanceFetcher } from './fetchers/asset_balance_and_proxy_allowance_fetcher'; export { OrderFilledCancelledFetcher } from './fetchers/order_filled_cancelled_fetcher'; -- cgit v1.2.3 From e456332da71f1ed6c6799fabe6c635985ec2ce9d Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 4 Sep 2018 16:47:01 -0400 Subject: Rename and update some artifact locations --- packages/contract-wrappers/package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index 5d5c8069a..b36ae946f 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -12,7 +12,7 @@ "types": "lib/src/index.d.ts", "scripts": { "build": "yarn pre_build && tsc -b", - "pre_build": "run-s update_artifacts_v2_beta update_artifacts_v2 generate_contract_wrappers copy_artifacts", + "pre_build": "run-s update_artifacts generate_contract_wrappers copy_artifacts", "generate_contract_wrappers": "abi-gen --abis 'src/artifacts/@(Exchange|DummyERC20Token|DummyERC721Token|ZRXToken|ERC20Token|ERC721Token|WETH9|ERC20Proxy|ERC721Proxy|Forwarder|OrderValidator).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers", "lint": "tslint --project . --exclude **/src/contract_wrappers/**/* --exclude **/lib/**/*", "test:circleci": "run-s test:coverage", @@ -20,8 +20,7 @@ "rebuild_and_test": "run-s build test", "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", - "update_artifacts_v2_beta": "for i in ${npm_package_config_contracts_v2_beta}; do copyfiles -u 4 ../migrations/artifacts/2.0.0-beta-testnet/$i.json src/artifacts; done;", - "update_artifacts_v2": "for i in ${npm_package_config_contracts_v2}; do copyfiles -u 4 ../migrations/artifacts/2.0.0/$i.json src/artifacts; done;", + "update_artifacts": "for i in ${npm_package_config_contracts_v2}; do copyfiles -u 4 ../migrations/artifacts/2.0.0/$i.json src/artifacts; done;", "copy_artifacts": "copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts", "clean": "shx rm -rf _bundles lib test_temp test/artifacts src/contract_wrappers/generated src/artifacts generated_docs", "run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js lib/test/global_hooks.js --timeout 10000 --bail --exit", -- cgit v1.2.3 From e70882a657acecb7437ce9dd28218d719f8beb3d Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 4 Sep 2018 17:22:22 -0400 Subject: More small chnages/bug fixes --- packages/contract-wrappers/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index b36ae946f..561de60ac 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -27,8 +27,7 @@ "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { - "contracts_v2_beta": "AssetProxyOwner Exchange ERC20Proxy ERC20Token ERC721Proxy ERC721Token WETH9 ZRXToken Forwarder OrderValidator", - "contracts_v2": "DummyERC20Token DummyERC721Token", + "contracts_v2": "AssetProxyOwner Exchange ERC20Proxy ERC20Token ERC721Proxy ERC721Token WETH9 ZRXToken Forwarder OrderValidator DummyERC20Token DummyERC721Token", "postpublish": { "assets": [] } -- cgit v1.2.3 From 9d45d19c80bce5ead92049ab743501f6e40d515a Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 4 Sep 2018 18:10:23 -0400 Subject: More small artifacts updates/changes --- packages/contract-wrappers/test/exchange_wrapper_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/test/exchange_wrapper_test.ts b/packages/contract-wrappers/test/exchange_wrapper_test.ts index 6762c1d43..b3bd7c633 100644 --- a/packages/contract-wrappers/test/exchange_wrapper_test.ts +++ b/packages/contract-wrappers/test/exchange_wrapper_test.ts @@ -358,7 +358,7 @@ describe('ExchangeWrapper', () => { describe('#getVersionAsync', () => { it('should return version the hash', async () => { const version = await contractWrappers.exchange.getVersionAsync(); - const VERSION = '2.0.1-alpha'; + const VERSION = '2.0.0'; expect(version).to.be.equal(VERSION); }); }); -- cgit v1.2.3 From 38acdfd6326af3f5bd865b57bf91080a518305a4 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 5 Sep 2018 11:06:11 +0100 Subject: Update CHANGELOG's to publish non-RC versions --- packages/contract-wrappers/CHANGELOG.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 3ecaea641..8a63c3f87 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -1,6 +1,6 @@ [ { - "version": "1.0.1-rc.6", + "version": "1.0.1", "changes": [ { "note": "Add `OrderValidatorWrapper`" -- cgit v1.2.3 From 481a752e70f6d9b558fb0aaadd4de87899fd9b1a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 5 Sep 2018 11:16:34 +0100 Subject: Updated CHANGELOGS --- packages/contract-wrappers/CHANGELOG.json | 3 ++- packages/contract-wrappers/CHANGELOG.md | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 8a63c3f87..477537bb3 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -20,7 +20,8 @@ "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper", "pr": 1054 } - ] + ], + "timestamp": 1536142250 }, { "version": "1.0.1-rc.5", diff --git a/packages/contract-wrappers/CHANGELOG.md b/packages/contract-wrappers/CHANGELOG.md index fb92ea858..b5be34d36 100644 --- a/packages/contract-wrappers/CHANGELOG.md +++ b/packages/contract-wrappers/CHANGELOG.md @@ -5,6 +5,13 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.1 - _September 5, 2018_ + + * Add `OrderValidatorWrapper` + * Fix bug where contracts not deployed on a network showed an `EXCHANGE_CONTRACT_DOES_NOT_EXIST` error instead of `CONTRACT_NOT_DEPLOYED_ON_NETWORK` (#1044) + * Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations (#1054) + * Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper (#1054) + ## v1.0.1-rc.5 - _August 27, 2018_ * Fix missing `BlockParamLiteral` type import issue -- cgit v1.2.3 From 174b36059368631eeaec3ec7c0a3847350b55d73 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 5 Sep 2018 11:16:45 +0100 Subject: Publish - 0x.js@1.0.1 - @0xproject/abi-gen@1.0.8 - @0xproject/assert@1.0.8 - @0xproject/base-contract@2.0.2 - @0xproject/connect@2.0.0 - @0xproject/contract-wrappers@1.0.1 - contracts@2.1.43 - @0xproject/dev-utils@1.0.7 - ethereum-types@1.0.6 - @0xproject/fill-scenarios@1.0.1 - @0xproject/forwarder-helper@1.0.1 - @0xproject/json-schemas@1.0.1 - @0xproject/metacoin@0.0.18 - @0xproject/migrations@1.0.7 - @0xproject/monorepo-scripts@1.0.8 - @0xproject/order-utils@1.0.1 - @0xproject/order-watcher@1.0.1 - @0xproject/react-docs@1.0.8 - @0xproject/react-shared@1.0.9 - @0xproject/sol-compiler@1.1.2 - @0xproject/sol-cov@2.1.2 - @0xproject/sol-resolver@1.0.8 - @0xproject/sra-report@1.0.8 - @0xproject/sra-spec@1.0.1 - @0xproject/subproviders@2.0.2 - @0xproject/testnet-faucets@1.0.44 - @0xproject/tslint-config@1.0.7 - @0xproject/types@1.0.1 - @0xproject/typescript-typings@2.0.0 - @0xproject/utils@1.0.8 - @0xproject/web3-wrapper@2.0.2 - @0xproject/website@0.0.47 --- packages/contract-wrappers/package.json | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index 561de60ac..5cfe8f6b5 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/contract-wrappers", - "version": "1.0.1-rc.5", + "version": "1.0.1", "description": "Smart TS wrappers for 0x smart contracts", "keywords": [ "0xproject", @@ -41,17 +41,17 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0xproject/abi-gen": "^1.0.7", - "@0xproject/dev-utils": "^1.0.6", - "@0xproject/migrations": "^1.0.6", - "@0xproject/subproviders": "^2.0.1", - "@0xproject/tslint-config": "^1.0.6", + "@0xproject/abi-gen": "^1.0.8", + "@0xproject/dev-utils": "^1.0.7", + "@0xproject/migrations": "^1.0.7", + "@0xproject/subproviders": "^2.0.2", + "@0xproject/tslint-config": "^1.0.7", "@types/lodash": "4.14.104", - "@types/web3-provider-engine": "^14.0.0", "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", "@types/sinon": "^2.2.2", "@types/uuid": "^3.4.2", + "@types/web3-provider-engine": "^14.0.0", "awesome-typescript-loader": "^3.1.3", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", @@ -72,16 +72,16 @@ "web3-provider-engine": "14.0.6" }, "dependencies": { - "@0xproject/assert": "^1.0.7", - "@0xproject/base-contract": "^2.0.1", - "@0xproject/fill-scenarios": "^1.0.1-rc.5", - "@0xproject/json-schemas": "^1.0.1-rc.6", - "@0xproject/order-utils": "^1.0.1-rc.6", - "@0xproject/types": "^1.0.1-rc.6", - "@0xproject/typescript-typings": "^1.0.5", - "@0xproject/utils": "^1.0.7", - "@0xproject/web3-wrapper": "^2.0.1", - "ethereum-types": "^1.0.5", + "@0xproject/assert": "^1.0.8", + "@0xproject/base-contract": "^2.0.2", + "@0xproject/fill-scenarios": "^1.0.1", + "@0xproject/json-schemas": "^1.0.1", + "@0xproject/order-utils": "^1.0.1", + "@0xproject/types": "^1.0.1", + "@0xproject/typescript-typings": "^2.0.0", + "@0xproject/utils": "^1.0.8", + "@0xproject/web3-wrapper": "^2.0.2", + "ethereum-types": "^1.0.6", "ethereumjs-blockstream": "5.0.0", "ethereumjs-util": "^5.1.1", "ethers": "3.0.22", -- cgit v1.2.3