diff options
286 files changed, 5025 insertions, 1996 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index 0aec168cf..38fb2624a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ jobs: command: sudo npm install --global yarn@1.9.4 - run: name: yarn - command: yarn --frozen-lockfile --ignore-engines install + command: yarn --frozen-lockfile --ignore-engines install || yarn --frozen-lockfile --ignore-engines install - setup_remote_docker - run: yarn build:ci:no_website - run: yarn build:ts @@ -297,6 +297,7 @@ jobs: - repo-{{ .Environment.CIRCLE_SHA1 }} - run: yarn lerna run lint - run: yarn prettier:ci + - run: yarn deps_versions:ci - run: cd packages/0x.js && yarn build:umd:prod - run: yarn bundlewatch submit-coverage: diff --git a/.github/autolabeler.yml b/.github/autolabeler.yml index 321ec18a4..fb5b00aa4 100644 --- a/.github/autolabeler.yml +++ b/.github/autolabeler.yml @@ -2,6 +2,7 @@ python: ['python-packages'] contracts: ['contracts'] sol-doc: ['packages/sol-doc'] sol-resolver: ['packages/sol-resolver'] +contracts-gen: ['packages/contracts-gen'] sra-spec: ['packages/sra-spec'] subproviders: ['packages/subproviders'] contract-addresses: ['packages/contract-addresses'] diff --git a/contracts/asset-proxy/CHANGELOG.json b/contracts/asset-proxy/CHANGELOG.json index 9307f7da4..de7e90d66 100644 --- a/contracts/asset-proxy/CHANGELOG.json +++ b/contracts/asset-proxy/CHANGELOG.json @@ -1,5 +1,41 @@ [ { + "version": "1.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "version": "1.0.3", + "changes": [ + { + "note": "Fake publish to enable pinning" + } + ], + "timestamp": 1549504360 + }, + { + "timestamp": 1549452781, + "version": "1.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549373905, + "version": "1.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "1.0.0", "changes": [ { diff --git a/contracts/asset-proxy/CHANGELOG.md b/contracts/asset-proxy/CHANGELOG.md index 779eb68a7..fcf5202c6 100644 --- a/contracts/asset-proxy/CHANGELOG.md +++ b/contracts/asset-proxy/CHANGELOG.md @@ -5,24 +5,22 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v2.2.3 - _January 17, 2019_ +## v1.0.4 - _February 7, 2019_ * Dependencies updated -## v2.2.2 - _January 15, 2019_ +## v1.0.3 - _February 7, 2019_ - * Dependencies updated + * Fake publish to enable pinning -## v2.2.1 - _January 11, 2019_ +## v1.0.2 - _February 6, 2019_ * Dependencies updated -## v2.2.0 - _January 9, 2019_ +## v1.0.1 - _February 5, 2019_ - * Added LibAddressArray (#1383) - * Add validation and comments to MultiAssetProxy (#1455) - * Move OrderValidator to extensions (#1464) + * Dependencies updated -## v2.1.59 - _December 13, 2018_ +## v1.0.0 - _Invalid date_ - * Dependencies updated + * Move all AssetProxy contracts out of contracts-protocol to new package (#1539) diff --git a/contracts/asset-proxy/compiler.json b/contracts/asset-proxy/compiler.json index 70d4c6b20..aab143bad 100644 --- a/contracts/asset-proxy/compiler.json +++ b/contracts/asset-proxy/compiler.json @@ -3,10 +3,7 @@ "contractsDir": "./contracts", "useDockerisedSolc": true, "compilerSettings": { - "optimizer": { - "enabled": true, - "runs": 1000000 - }, + "optimizer": { "enabled": true, "runs": 1000000 }, "outputSelection": { "*": { "*": [ @@ -20,12 +17,17 @@ } }, "contracts": [ - "IAssetData", - "IAssetProxy", - "IAuthorizable", - "ERC20Proxy", - "ERC721Proxy", - "MixinAuthorizable", - "MultiAssetProxy" + "@0x/contracts-erc20/contracts/test/DummyERC20Token.sol", + "@0x/contracts-erc20/contracts/test/DummyMultipleReturnERC20Token.sol", + "@0x/contracts-erc20/contracts/test/DummyNoReturnERC20Token.sol", + "@0x/contracts-erc721/contracts/test/DummyERC721Receiver.sol", + "@0x/contracts-erc721/contracts/test/DummyERC721Token.sol", + "src/ERC20Proxy.sol", + "src/ERC721Proxy.sol", + "src/MixinAuthorizable.sol", + "src/MultiAssetProxy.sol", + "src/interfaces/IAssetData.sol", + "src/interfaces/IAssetProxy.sol", + "src/interfaces/IAuthorizable.sol" ] } diff --git a/contracts/asset-proxy/package.json b/contracts/asset-proxy/package.json index 360fdab75..def8eead7 100644 --- a/contracts/asset-proxy/package.json +++ b/contracts/asset-proxy/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-asset-proxy", - "version": "1.0.0", + "version": "1.0.4", "engines": { "node": ">=6.12" }, @@ -29,10 +29,12 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", + "contracts:gen": "contracts-gen", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "generated-artifacts/@(ERC20Proxy|ERC721Proxy|IAssetData|IAssetProxy|IAuthorizable|MixinAuthorizable|MultiAssetProxy).json" + "abis": "./generated-artifacts/@(DummyERC20Token|DummyERC721Receiver|DummyERC721Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|ERC20Proxy|ERC721Proxy|IAssetData|IAssetProxy|IAuthorizable|MixinAuthorizable|MultiAssetProxy).json", + "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { "type": "git", @@ -44,10 +46,11 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.22", - "@0x/dev-utils": "^1.0.24", - "@0x/sol-compiler": "^2.0.2", - "@0x/tslint-config": "^2.0.2", + "@0x/abi-gen": "^2.0.2", + "@0x/contracts-gen": "^1.0.1", + "@0x/dev-utils": "^2.0.2", + "@0x/sol-compiler": "^3.0.2", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "@types/node": "*", "chai": "^4.0.1", @@ -63,18 +66,18 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/base-contract": "^3.0.13", - "@0x/contracts-test-utils": "^2.0.1", - "@0x/contracts-erc20": "1.0.0", - "@0x/contracts-erc721": "1.0.0", - "@0x/contracts-utils": "3.0.0", - "@0x/order-utils": "^3.1.2", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "ethereum-types": "^1.1.6", - "lodash": "^4.17.5" + "@0x/base-contract": "^4.0.2", + "@0x/contracts-erc20": "1.0.2", + "@0x/contracts-erc721": "1.0.2", + "@0x/contracts-test-utils": "^3.0.3", + "@0x/contracts-utils": "2.0.1", + "@0x/order-utils": "^6.0.1", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "ethereum-types": "^2.0.0", + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/contracts/asset-proxy/src/artifacts.ts b/contracts/asset-proxy/src/artifacts.ts new file mode 100644 index 000000000..d82c0537e --- /dev/null +++ b/contracts/asset-proxy/src/artifacts.ts @@ -0,0 +1,33 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +import { ContractArtifact } from 'ethereum-types'; + +import * as DummyERC20Token from '../generated-artifacts/DummyERC20Token.json'; +import * as DummyERC721Receiver from '../generated-artifacts/DummyERC721Receiver.json'; +import * as DummyERC721Token from '../generated-artifacts/DummyERC721Token.json'; +import * as DummyMultipleReturnERC20Token from '../generated-artifacts/DummyMultipleReturnERC20Token.json'; +import * as DummyNoReturnERC20Token from '../generated-artifacts/DummyNoReturnERC20Token.json'; +import * as ERC20Proxy from '../generated-artifacts/ERC20Proxy.json'; +import * as ERC721Proxy from '../generated-artifacts/ERC721Proxy.json'; +import * as IAssetData from '../generated-artifacts/IAssetData.json'; +import * as IAssetProxy from '../generated-artifacts/IAssetProxy.json'; +import * as IAuthorizable from '../generated-artifacts/IAuthorizable.json'; +import * as MixinAuthorizable from '../generated-artifacts/MixinAuthorizable.json'; +import * as MultiAssetProxy from '../generated-artifacts/MultiAssetProxy.json'; +export const artifacts = { + DummyERC20Token: DummyERC20Token as ContractArtifact, + DummyMultipleReturnERC20Token: DummyMultipleReturnERC20Token as ContractArtifact, + DummyNoReturnERC20Token: DummyNoReturnERC20Token as ContractArtifact, + DummyERC721Receiver: DummyERC721Receiver as ContractArtifact, + DummyERC721Token: DummyERC721Token as ContractArtifact, + ERC20Proxy: ERC20Proxy as ContractArtifact, + ERC721Proxy: ERC721Proxy as ContractArtifact, + MixinAuthorizable: MixinAuthorizable as ContractArtifact, + MultiAssetProxy: MultiAssetProxy as ContractArtifact, + IAssetData: IAssetData as ContractArtifact, + IAssetProxy: IAssetProxy as ContractArtifact, + IAuthorizable: IAuthorizable as ContractArtifact, +}; diff --git a/contracts/asset-proxy/src/artifacts/index.ts b/contracts/asset-proxy/src/artifacts/index.ts deleted file mode 100644 index 7f3060815..000000000 --- a/contracts/asset-proxy/src/artifacts/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ContractArtifact } from 'ethereum-types'; - -import * as ERC20Proxy from '../../generated-artifacts/ERC20Proxy.json'; -import * as ERC721Proxy from '../../generated-artifacts/ERC721Proxy.json'; -import * as IAssetData from '../../generated-artifacts/IAssetData.json'; -import * as IAssetProxy from '../../generated-artifacts/IAssetProxy.json'; -import * as IAuthorizable from '../../generated-artifacts/IAuthorizable.json'; -import * as MixinAuthorizable from '../../generated-artifacts/MixinAuthorizable.json'; -import * as MultiAssetProxy from '../../generated-artifacts/MultiAssetProxy.json'; - -export const artifacts = { - IAuthorizable: IAuthorizable as ContractArtifact, - IAssetData: IAssetData as ContractArtifact, - IAssetProxy: IAssetProxy as ContractArtifact, - ERC20Proxy: ERC20Proxy as ContractArtifact, - ERC721Proxy: ERC721Proxy as ContractArtifact, - MixinAuthorizable: MixinAuthorizable as ContractArtifact, - MultiAssetProxy: MultiAssetProxy as ContractArtifact, -}; diff --git a/contracts/asset-proxy/src/wrappers.ts b/contracts/asset-proxy/src/wrappers.ts new file mode 100644 index 000000000..f8cd342c0 --- /dev/null +++ b/contracts/asset-proxy/src/wrappers.ts @@ -0,0 +1,17 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +export * from '../generated-wrappers/dummy_erc20_token'; +export * from '../generated-wrappers/dummy_erc721_receiver'; +export * from '../generated-wrappers/dummy_erc721_token'; +export * from '../generated-wrappers/dummy_multiple_return_erc20_token'; +export * from '../generated-wrappers/dummy_no_return_erc20_token'; +export * from '../generated-wrappers/erc20_proxy'; +export * from '../generated-wrappers/erc721_proxy'; +export * from '../generated-wrappers/i_asset_data'; +export * from '../generated-wrappers/i_asset_proxy'; +export * from '../generated-wrappers/i_authorizable'; +export * from '../generated-wrappers/mixin_authorizable'; +export * from '../generated-wrappers/multi_asset_proxy'; diff --git a/contracts/asset-proxy/src/wrappers/index.ts b/contracts/asset-proxy/src/wrappers/index.ts deleted file mode 100644 index 6aecbc086..000000000 --- a/contracts/asset-proxy/src/wrappers/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from '../../generated-wrappers/i_asset_data'; -export * from '../../generated-wrappers/i_asset_proxy'; -export * from '../../generated-wrappers/erc20_proxy'; -export * from '../../generated-wrappers/erc721_proxy'; -export * from '../../generated-wrappers/mixin_authorizable'; -export * from '../../generated-wrappers/multi_asset_proxy'; -export * from '../../generated-wrappers/i_authorizable'; diff --git a/contracts/asset-proxy/test/proxies.ts b/contracts/asset-proxy/test/proxies.ts index 797787135..c2f9653aa 100644 --- a/contracts/asset-proxy/test/proxies.ts +++ b/contracts/asset-proxy/test/proxies.ts @@ -1,16 +1,4 @@ import { - artifacts as erc20Artifacts, - DummyERC20TokenContract, - DummyERC20TokenTransferEventArgs, - DummyMultipleReturnERC20TokenContract, - DummyNoReturnERC20TokenContract, -} from '@0x/contracts-erc20'; -import { - artifacts as erc721Artifacts, - DummyERC721ReceiverContract, - DummyERC721TokenContract, -} from '@0x/contracts-erc721'; -import { chaiSetup, constants, expectTransactionFailedAsync, @@ -30,6 +18,12 @@ import * as _ from 'lodash'; import { artifacts, + DummyERC20TokenContract, + DummyERC20TokenTransferEventArgs, + DummyERC721ReceiverContract, + DummyERC721TokenContract, + DummyMultipleReturnERC20TokenContract, + DummyNoReturnERC20TokenContract, ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, @@ -154,7 +148,7 @@ describe('Asset Transfer Proxies', () => { constants.DUMMY_TOKEN_DECIMALS, ); noReturnErc20Token = await DummyNoReturnERC20TokenContract.deployFrom0xArtifactAsync( - erc20Artifacts.DummyNoReturnERC20Token, + artifacts.DummyNoReturnERC20Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, @@ -163,7 +157,7 @@ describe('Asset Transfer Proxies', () => { constants.DUMMY_TOKEN_TOTAL_SUPPLY, ); multipleReturnErc20Token = await DummyMultipleReturnERC20TokenContract.deployFrom0xArtifactAsync( - erc20Artifacts.DummyMultipleReturnERC20Token, + artifacts.DummyMultipleReturnERC20Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, @@ -204,7 +198,7 @@ describe('Asset Transfer Proxies', () => { // Deploy and configure ERC721 tokens and receiver [erc721TokenA, erc721TokenB] = await erc721Wrapper.deployDummyTokensAsync(); erc721Receiver = await DummyERC721ReceiverContract.deployFrom0xArtifactAsync( - erc721Artifacts.DummyERC721Receiver, + artifacts.DummyERC721Receiver, provider, txDefaults, ); @@ -568,7 +562,7 @@ describe('Asset Transfer Proxies', () => { erc721Receiver.address, amount, ); - const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc721Artifacts }); + const logDecoder = new LogDecoder(web3Wrapper, artifacts); const tx = await logDecoder.getTxWithDecodedLogsAsync( await web3Wrapper.sendTransactionAsync({ to: erc721Proxy.address, @@ -760,7 +754,7 @@ describe('Asset Transfer Proxies', () => { inputAmount, ); const erc20Balances = await erc20Wrapper.getBalancesAsync(); - const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc20Artifacts }); + const logDecoder = new LogDecoder(web3Wrapper, artifacts); const tx = await logDecoder.getTxWithDecodedLogsAsync( await web3Wrapper.sendTransactionAsync({ to: multiAssetProxy.address, diff --git a/contracts/asset-proxy/test/utils/erc20_wrapper.ts b/contracts/asset-proxy/test/utils/erc20_wrapper.ts index 12cd06ece..09607e776 100644 --- a/contracts/asset-proxy/test/utils/erc20_wrapper.ts +++ b/contracts/asset-proxy/test/utils/erc20_wrapper.ts @@ -1,4 +1,3 @@ -import { artifacts as tokensArtifacts, DummyERC20TokenContract } from '@0x/contracts-erc20'; import { constants, ERC20BalancesByOwner, txDefaults } from '@0x/contracts-test-utils'; import { assetDataUtils } from '@0x/order-utils'; import { BigNumber } from '@0x/utils'; @@ -6,8 +5,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import { Provider } from 'ethereum-types'; import * as _ from 'lodash'; -import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy'; -import { artifacts } from '../../src/artifacts'; +import { artifacts, DummyERC20TokenContract, ERC20ProxyContract } from '../../src'; export class ERC20Wrapper { private readonly _tokenOwnerAddresses: string[]; @@ -38,7 +36,7 @@ export class ERC20Wrapper { for (let i = 0; i < numberToDeploy; i++) { this._dummyTokenContracts.push( await DummyERC20TokenContract.deployFrom0xArtifactAsync( - tokensArtifacts.DummyERC20Token, + artifacts.DummyERC20Token, this._provider, txDefaults, constants.DUMMY_TOKEN_NAME, diff --git a/contracts/asset-proxy/test/utils/erc721_wrapper.ts b/contracts/asset-proxy/test/utils/erc721_wrapper.ts index fc43d8c52..92d1398a7 100644 --- a/contracts/asset-proxy/test/utils/erc721_wrapper.ts +++ b/contracts/asset-proxy/test/utils/erc721_wrapper.ts @@ -1,4 +1,3 @@ -import { artifacts as tokensArtifacts, DummyERC721TokenContract } from '@0x/contracts-erc721'; import { constants, ERC721TokenIdsByOwner, txDefaults } from '@0x/contracts-test-utils'; import { generatePseudoRandomSalt } from '@0x/order-utils'; import { BigNumber } from '@0x/utils'; @@ -6,8 +5,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import { Provider } from 'ethereum-types'; import * as _ from 'lodash'; -import { ERC721ProxyContract } from '../../generated-wrappers/erc721_proxy'; -import { artifacts } from '../../src/artifacts'; +import { artifacts, DummyERC721TokenContract, ERC721ProxyContract } from '../../src'; export class ERC721Wrapper { private readonly _tokenOwnerAddresses: string[]; @@ -30,7 +28,7 @@ export class ERC721Wrapper { for (const i of _.times(constants.NUM_DUMMY_ERC721_TO_DEPLOY)) { this._dummyTokenContracts.push( await DummyERC721TokenContract.deployFrom0xArtifactAsync( - tokensArtifacts.DummyERC721Token, + artifacts.DummyERC721Token, this._provider, txDefaults, constants.DUMMY_TOKEN_NAME, diff --git a/contracts/asset-proxy/tsconfig.json b/contracts/asset-proxy/tsconfig.json index 7baa48cbe..526be2c64 100644 --- a/contracts/asset-proxy/tsconfig.json +++ b/contracts/asset-proxy/tsconfig.json @@ -1,19 +1,20 @@ { "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib", - "rootDir": ".", - "resolveJsonModule": true - }, + "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ - "./generated-artifacts/IAssetData.json", - "./generated-artifacts/IAssetProxy.json", - "./generated-artifacts/IAuthorizable.json", - "./generated-artifacts/ERC20Proxy.json", - "./generated-artifacts/ERC721Proxy.json", - "./generated-artifacts/MixinAuthorizable.json", - "./generated-artifacts/MultiAssetProxy.json" + "generated-artifacts/DummyERC20Token.json", + "generated-artifacts/DummyERC721Receiver.json", + "generated-artifacts/DummyERC721Token.json", + "generated-artifacts/DummyMultipleReturnERC20Token.json", + "generated-artifacts/DummyNoReturnERC20Token.json", + "generated-artifacts/ERC20Proxy.json", + "generated-artifacts/ERC721Proxy.json", + "generated-artifacts/IAssetData.json", + "generated-artifacts/IAssetProxy.json", + "generated-artifacts/IAuthorizable.json", + "generated-artifacts/MixinAuthorizable.json", + "generated-artifacts/MultiAssetProxy.json" ], "exclude": ["./deploy/solc/solc_bin"] } diff --git a/contracts/erc20/CHANGELOG.json b/contracts/erc20/CHANGELOG.json index 93f284234..972de2038 100644 --- a/contracts/erc20/CHANGELOG.json +++ b/contracts/erc20/CHANGELOG.json @@ -1,5 +1,41 @@ [ { + "version": "1.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "version": "1.0.3", + "changes": [ + { + "note": "Fake publish to enable pinning" + } + ], + "timestamp": 1549504360 + }, + { + "timestamp": 1549452781, + "version": "1.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549373905, + "version": "1.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "1.0.0", "changes": [ { diff --git a/contracts/erc20/CHANGELOG.md b/contracts/erc20/CHANGELOG.md index 59d0804da..658309672 100644 --- a/contracts/erc20/CHANGELOG.md +++ b/contracts/erc20/CHANGELOG.md @@ -5,22 +5,22 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v1.0.6 - _January 17, 2019_ +## v1.0.4 - _February 7, 2019_ * Dependencies updated -## v1.0.5 - _January 15, 2019_ +## v1.0.3 - _February 7, 2019_ - * Dependencies updated + * Fake publish to enable pinning -## v1.0.4 - _January 11, 2019_ +## v1.0.2 - _February 6, 2019_ * Dependencies updated -## v1.0.3 - _January 9, 2019_ +## v1.0.1 - _February 5, 2019_ * Dependencies updated -## v1.0.2 - _December 13, 2018_ +## v1.0.0 - _Invalid date_ - * Dependencies updated + * Move all ERC20 contracts out of contracts-tokens to new package (#1539) diff --git a/contracts/erc20/compiler.json b/contracts/erc20/compiler.json index 264f6231a..033917d22 100644 --- a/contracts/erc20/compiler.json +++ b/contracts/erc20/compiler.json @@ -3,10 +3,7 @@ "contractsDir": "./contracts", "useDockerisedSolc": true, "compilerSettings": { - "optimizer": { - "enabled": true, - "runs": 1000000 - }, + "optimizer": { "enabled": true, "runs": 1000000 }, "outputSelection": { "*": { "*": [ @@ -20,16 +17,16 @@ } }, "contracts": [ - "DummyERC20Token", - "DummyMultipleReturnERC20Token", - "DummyNoReturnERC20Token", - "ReentrantERC20Token", - "ERC20Token", - "IERC20Token", - "MintableERC20Token", - "UnlimitedAllowanceERC20Token", - "IEtherToken", - "WETH9", - "ZRXToken" + "src/ERC20Token.sol", + "src/MintableERC20Token.sol", + "src/UnlimitedAllowanceERC20Token.sol", + "src/WETH9.sol", + "src/ZRXToken.sol", + "src/interfaces/IERC20Token.sol", + "src/interfaces/IEtherToken.sol", + "test/DummyERC20Token.sol", + "test/DummyMultipleReturnERC20Token.sol", + "test/DummyNoReturnERC20Token.sol", + "test/ReentrantERC20Token.sol" ] } diff --git a/contracts/erc20/package.json b/contracts/erc20/package.json index 778b9257d..45272f157 100644 --- a/contracts/erc20/package.json +++ b/contracts/erc20/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-erc20", - "version": "1.0.0", + "version": "1.0.4", "engines": { "node": ">=6.12" }, @@ -29,10 +29,12 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", + "contracts:gen": "contracts-gen", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "generated-artifacts/@(DummyERC20Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|ReentrantERC20Token|ERC20Token|IERC20Token|MintableERC20Token|UnlimitedAllowanceERC20Token|IEtherToken|WETH9|ZRXToken).json" + "abis": "./generated-artifacts/@(DummyERC20Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|ERC20Token|IERC20Token|IEtherToken|MintableERC20Token|ReentrantERC20Token|UnlimitedAllowanceERC20Token|WETH9|ZRXToken).json", + "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { "type": "git", @@ -44,11 +46,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.22", - "@0x/contracts-test-utils": "^2.0.1", - "@0x/dev-utils": "^1.0.24", - "@0x/sol-compiler": "^2.0.2", - "@0x/tslint-config": "^2.0.2", + "@0x/abi-gen": "^2.0.2", + "@0x/contracts-gen": "^1.0.1", + "@0x/contracts-test-utils": "^3.0.3", + "@0x/dev-utils": "^2.0.2", + "@0x/sol-compiler": "^3.0.2", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "@types/node": "*", "chai": "^4.0.1", @@ -64,15 +67,15 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/base-contract": "^3.0.13", - "@0x/contracts-exchange-libs": "1.0.0", - "@0x/contracts-utils": "3.0.0", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "ethereum-types": "^1.1.6", - "lodash": "^4.17.5" + "@0x/base-contract": "^4.0.2", + "@0x/contracts-exchange-libs": "1.0.2", + "@0x/contracts-utils": "2.0.1", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "ethereum-types": "^2.0.0", + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/contracts/erc20/src/artifacts.ts b/contracts/erc20/src/artifacts.ts new file mode 100644 index 000000000..c97a73195 --- /dev/null +++ b/contracts/erc20/src/artifacts.ts @@ -0,0 +1,31 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +import { ContractArtifact } from 'ethereum-types'; + +import * as DummyERC20Token from '../generated-artifacts/DummyERC20Token.json'; +import * as DummyMultipleReturnERC20Token from '../generated-artifacts/DummyMultipleReturnERC20Token.json'; +import * as DummyNoReturnERC20Token from '../generated-artifacts/DummyNoReturnERC20Token.json'; +import * as ERC20Token from '../generated-artifacts/ERC20Token.json'; +import * as IERC20Token from '../generated-artifacts/IERC20Token.json'; +import * as IEtherToken from '../generated-artifacts/IEtherToken.json'; +import * as MintableERC20Token from '../generated-artifacts/MintableERC20Token.json'; +import * as ReentrantERC20Token from '../generated-artifacts/ReentrantERC20Token.json'; +import * as UnlimitedAllowanceERC20Token from '../generated-artifacts/UnlimitedAllowanceERC20Token.json'; +import * as WETH9 from '../generated-artifacts/WETH9.json'; +import * as ZRXToken from '../generated-artifacts/ZRXToken.json'; +export const artifacts = { + ERC20Token: ERC20Token as ContractArtifact, + MintableERC20Token: MintableERC20Token as ContractArtifact, + UnlimitedAllowanceERC20Token: UnlimitedAllowanceERC20Token as ContractArtifact, + WETH9: WETH9 as ContractArtifact, + ZRXToken: (ZRXToken as any) as ContractArtifact, + IERC20Token: IERC20Token as ContractArtifact, + IEtherToken: IEtherToken as ContractArtifact, + DummyERC20Token: DummyERC20Token as ContractArtifact, + DummyMultipleReturnERC20Token: DummyMultipleReturnERC20Token as ContractArtifact, + DummyNoReturnERC20Token: DummyNoReturnERC20Token as ContractArtifact, + ReentrantERC20Token: ReentrantERC20Token as ContractArtifact, +}; diff --git a/contracts/erc20/src/artifacts/index.ts b/contracts/erc20/src/artifacts/index.ts deleted file mode 100644 index ce1ae06ac..000000000 --- a/contracts/erc20/src/artifacts/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { ContractArtifact } from 'ethereum-types'; - -import * as DummyERC20Token from '../../generated-artifacts/DummyERC20Token.json'; -import * as DummyMultipleReturnERC20Token from '../../generated-artifacts/DummyMultipleReturnERC20Token.json'; -import * as DummyNoReturnERC20Token from '../../generated-artifacts/DummyNoReturnERC20Token.json'; -import * as ERC20Token from '../../generated-artifacts/ERC20Token.json'; -import * as IERC20Token from '../../generated-artifacts/IERC20Token.json'; -import * as IEtherToken from '../../generated-artifacts/IEtherToken.json'; -import * as MintableERC20Token from '../../generated-artifacts/MintableERC20Token.json'; -import * as ReentrantERC20Token from '../../generated-artifacts/ReentrantERC20Token.json'; -import * as UnlimitedAllowanceERC20Token from '../../generated-artifacts/UnlimitedAllowanceERC20Token.json'; -import * as WETH9 from '../../generated-artifacts/WETH9.json'; -import * as ZRXToken from '../../generated-artifacts/ZRXToken.json'; - -// tslint:disable:no-unnecessary-type-assertion -export const artifacts = { - DummyERC20Token: DummyERC20Token as ContractArtifact, - DummyMultipleReturnERC20Token: DummyMultipleReturnERC20Token as ContractArtifact, - DummyNoReturnERC20Token: DummyNoReturnERC20Token as ContractArtifact, - ReentrantERC20Token: ReentrantERC20Token as ContractArtifact, - ERC20Token: ERC20Token as ContractArtifact, - IERC20Token: IERC20Token as ContractArtifact, - MintableERC20Token: MintableERC20Token as ContractArtifact, - UnlimitedAllowanceERC20Token: UnlimitedAllowanceERC20Token as ContractArtifact, - IEtherToken: IEtherToken as ContractArtifact, - WETH9: WETH9 as ContractArtifact, - // Note(albrow): "as any" hack still required here because ZRXToken does not - // conform to the v2 artifact type. - ZRXToken: (ZRXToken as any) as ContractArtifact, -}; diff --git a/contracts/erc20/src/wrappers.ts b/contracts/erc20/src/wrappers.ts new file mode 100644 index 000000000..40193e7d8 --- /dev/null +++ b/contracts/erc20/src/wrappers.ts @@ -0,0 +1,16 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +export * from '../generated-wrappers/dummy_erc20_token'; +export * from '../generated-wrappers/dummy_multiple_return_erc20_token'; +export * from '../generated-wrappers/dummy_no_return_erc20_token'; +export * from '../generated-wrappers/erc20_token'; +export * from '../generated-wrappers/i_erc20_token'; +export * from '../generated-wrappers/i_ether_token'; +export * from '../generated-wrappers/mintable_erc20_token'; +export * from '../generated-wrappers/reentrant_erc20_token'; +export * from '../generated-wrappers/unlimited_allowance_erc20_token'; +export * from '../generated-wrappers/weth9'; +export * from '../generated-wrappers/zrx_token'; diff --git a/contracts/erc20/src/wrappers/index.ts b/contracts/erc20/src/wrappers/index.ts deleted file mode 100644 index b4e4ef969..000000000 --- a/contracts/erc20/src/wrappers/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from '../../generated-wrappers/zrx_token'; -export * from '../../generated-wrappers/weth9'; -export * from '../../generated-wrappers/unlimited_allowance_erc20_token'; -export * from '../../generated-wrappers/reentrant_erc20_token'; -export * from '../../generated-wrappers/mintable_erc20_token'; -export * from '../../generated-wrappers/i_ether_token'; -export * from '../../generated-wrappers/i_erc20_token'; -export * from '../../generated-wrappers/erc20_token'; -export * from '../../generated-wrappers/dummy_no_return_erc20_token'; -export * from '../../generated-wrappers/dummy_multiple_return_erc20_token'; -export * from '../../generated-wrappers/dummy_erc20_token'; diff --git a/contracts/erc20/tsconfig.json b/contracts/erc20/tsconfig.json index 4df7424be..74419260a 100644 --- a/contracts/erc20/tsconfig.json +++ b/contracts/erc20/tsconfig.json @@ -1,23 +1,19 @@ { "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib", - "rootDir": ".", - "resolveJsonModule": true - }, + "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ - "./generated-artifacts/DummyERC20Token.json", - "./generated-artifacts/DummyMultipleReturnERC20Token.json", - "./generated-artifacts/DummyNoReturnERC20Token.json", - "./generated-artifacts/ReentrantERC20Token.json", - "./generated-artifacts/ERC20Token.json", - "./generated-artifacts/IERC20Token.json", - "./generated-artifacts/MintableERC20Token.json", - "./generated-artifacts/UnlimitedAllowanceERC20Token.json", - "./generated-artifacts/IEtherToken.json", - "./generated-artifacts/WETH9.json", - "./generated-artifacts/ZRXToken.json" + "generated-artifacts/DummyERC20Token.json", + "generated-artifacts/DummyMultipleReturnERC20Token.json", + "generated-artifacts/DummyNoReturnERC20Token.json", + "generated-artifacts/ERC20Token.json", + "generated-artifacts/IERC20Token.json", + "generated-artifacts/IEtherToken.json", + "generated-artifacts/MintableERC20Token.json", + "generated-artifacts/ReentrantERC20Token.json", + "generated-artifacts/UnlimitedAllowanceERC20Token.json", + "generated-artifacts/WETH9.json", + "generated-artifacts/ZRXToken.json" ], "exclude": ["./deploy/solc/solc_bin"] } diff --git a/contracts/erc721/CHANGELOG.json b/contracts/erc721/CHANGELOG.json index caf1e6701..5f3e08dd3 100644 --- a/contracts/erc721/CHANGELOG.json +++ b/contracts/erc721/CHANGELOG.json @@ -1,5 +1,41 @@ [ { + "version": "1.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "version": "1.0.3", + "changes": [ + { + "note": "Fake publish to enable pinning" + } + ], + "timestamp": 1549504360 + }, + { + "timestamp": 1549452781, + "version": "1.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549373905, + "version": "1.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "1.0.0", "changes": [ { diff --git a/contracts/erc721/CHANGELOG.md b/contracts/erc721/CHANGELOG.md index 59d0804da..5886f10b8 100644 --- a/contracts/erc721/CHANGELOG.md +++ b/contracts/erc721/CHANGELOG.md @@ -5,22 +5,22 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v1.0.6 - _January 17, 2019_ +## v1.0.4 - _February 7, 2019_ * Dependencies updated -## v1.0.5 - _January 15, 2019_ +## v1.0.3 - _February 7, 2019_ - * Dependencies updated + * Fake publish to enable pinning -## v1.0.4 - _January 11, 2019_ +## v1.0.2 - _February 6, 2019_ * Dependencies updated -## v1.0.3 - _January 9, 2019_ +## v1.0.1 - _February 5, 2019_ * Dependencies updated -## v1.0.2 - _December 13, 2018_ +## v1.0.0 - _Invalid date_ - * Dependencies updated + * Move all ERC721 contracts out of contracts-tokens to new package (#1539) diff --git a/contracts/erc721/compiler.json b/contracts/erc721/compiler.json index db8589016..09d79ba28 100644 --- a/contracts/erc721/compiler.json +++ b/contracts/erc721/compiler.json @@ -3,10 +3,7 @@ "contractsDir": "./contracts", "useDockerisedSolc": true, "compilerSettings": { - "optimizer": { - "enabled": true, - "runs": 1000000 - }, + "optimizer": { "enabled": true, "runs": 1000000 }, "outputSelection": { "*": { "*": [ @@ -20,12 +17,12 @@ } }, "contracts": [ - "DummyERC721Receiver", - "InvalidERC721Receiver", - "DummyERC721Token", - "ERC721Token", - "IERC721Receiver", - "IERC721Token", - "MintableERC721Token" + "src/ERC721Token.sol", + "src/MintableERC721Token.sol", + "src/interfaces/IERC721Receiver.sol", + "src/interfaces/IERC721Token.sol", + "test/DummyERC721Receiver.sol", + "test/DummyERC721Token.sol", + "test/InvalidERC721Receiver.sol" ] } diff --git a/contracts/erc721/package.json b/contracts/erc721/package.json index 096e1025e..830ea5d73 100644 --- a/contracts/erc721/package.json +++ b/contracts/erc721/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-erc721", - "version": "1.0.0", + "version": "1.0.4", "engines": { "node": ">=6.12" }, @@ -29,10 +29,12 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", + "contracts:gen": "contracts-gen", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "generated-artifacts/@(DummyERC721Receiver|InvalidERC721Receiver|DummyERC721Token|ERC721Token|IERC721Receiver|IERC721Token|MintableERC721Token).json" + "abis": "./generated-artifacts/@(DummyERC721Receiver|DummyERC721Token|ERC721Token|IERC721Receiver|IERC721Token|InvalidERC721Receiver|MintableERC721Token).json", + "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { "type": "git", @@ -44,11 +46,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.22", - "@0x/contracts-test-utils": "^2.0.1", - "@0x/dev-utils": "^1.0.24", - "@0x/sol-compiler": "^2.0.2", - "@0x/tslint-config": "^2.0.2", + "@0x/abi-gen": "^2.0.2", + "@0x/contracts-gen": "^1.0.1", + "@0x/contracts-test-utils": "^3.0.3", + "@0x/dev-utils": "^2.0.2", + "@0x/sol-compiler": "^3.0.2", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "@types/node": "*", "chai": "^4.0.1", @@ -64,14 +67,14 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/base-contract": "^3.0.13", - "@0x/contracts-utils": "3.0.0", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "ethereum-types": "^1.1.6", - "lodash": "^4.17.5" + "@0x/base-contract": "^4.0.2", + "@0x/contracts-utils": "2.0.1", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "ethereum-types": "^2.0.0", + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/contracts/erc721/src/artifacts.ts b/contracts/erc721/src/artifacts.ts new file mode 100644 index 000000000..79a76e21b --- /dev/null +++ b/contracts/erc721/src/artifacts.ts @@ -0,0 +1,23 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +import { ContractArtifact } from 'ethereum-types'; + +import * as DummyERC721Receiver from '../generated-artifacts/DummyERC721Receiver.json'; +import * as DummyERC721Token from '../generated-artifacts/DummyERC721Token.json'; +import * as ERC721Token from '../generated-artifacts/ERC721Token.json'; +import * as IERC721Receiver from '../generated-artifacts/IERC721Receiver.json'; +import * as IERC721Token from '../generated-artifacts/IERC721Token.json'; +import * as InvalidERC721Receiver from '../generated-artifacts/InvalidERC721Receiver.json'; +import * as MintableERC721Token from '../generated-artifacts/MintableERC721Token.json'; +export const artifacts = { + ERC721Token: ERC721Token as ContractArtifact, + MintableERC721Token: MintableERC721Token as ContractArtifact, + IERC721Receiver: IERC721Receiver as ContractArtifact, + IERC721Token: IERC721Token as ContractArtifact, + DummyERC721Receiver: DummyERC721Receiver as ContractArtifact, + DummyERC721Token: DummyERC721Token as ContractArtifact, + InvalidERC721Receiver: InvalidERC721Receiver as ContractArtifact, +}; diff --git a/contracts/erc721/src/artifacts/index.ts b/contracts/erc721/src/artifacts/index.ts deleted file mode 100644 index 8d5ec8a46..000000000 --- a/contracts/erc721/src/artifacts/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { ContractArtifact } from 'ethereum-types'; - -import * as DummyERC721Receiver from '../../generated-artifacts/DummyERC721Receiver.json'; -import * as DummyERC721Token from '../../generated-artifacts/DummyERC721Token.json'; -import * as ERC721Token from '../../generated-artifacts/ERC721Token.json'; -import * as IERC721Receiver from '../../generated-artifacts/IERC721Receiver.json'; -import * as IERC721Token from '../../generated-artifacts/IERC721Token.json'; -import * as InvalidERC721Receiver from '../../generated-artifacts/InvalidERC721Receiver.json'; -import * as MintableERC721Token from '../../generated-artifacts/MintableERC721Token.json'; - -// tslint:disable:no-unnecessary-type-assertion -export const artifacts = { - DummyERC721Receiver: DummyERC721Receiver as ContractArtifact, - InvalidERC721Receiver: InvalidERC721Receiver as ContractArtifact, - DummyERC721Token: DummyERC721Token as ContractArtifact, - ERC721Token: ERC721Token as ContractArtifact, - IERC721Receiver: IERC721Receiver as ContractArtifact, - IERC721Token: IERC721Token as ContractArtifact, - MintableERC721Token: MintableERC721Token as ContractArtifact, -}; diff --git a/contracts/erc721/src/wrappers.ts b/contracts/erc721/src/wrappers.ts new file mode 100644 index 000000000..716f6cca4 --- /dev/null +++ b/contracts/erc721/src/wrappers.ts @@ -0,0 +1,12 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +export * from '../generated-wrappers/dummy_erc721_receiver'; +export * from '../generated-wrappers/dummy_erc721_token'; +export * from '../generated-wrappers/erc721_token'; +export * from '../generated-wrappers/i_erc721_receiver'; +export * from '../generated-wrappers/i_erc721_token'; +export * from '../generated-wrappers/invalid_erc721_receiver'; +export * from '../generated-wrappers/mintable_erc721_token'; diff --git a/contracts/erc721/src/wrappers/index.ts b/contracts/erc721/src/wrappers/index.ts deleted file mode 100644 index ba6c51885..000000000 --- a/contracts/erc721/src/wrappers/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from '../../generated-wrappers/mintable_erc721_token'; -export * from '../../generated-wrappers/invalid_erc721_receiver'; -export * from '../../generated-wrappers/i_erc721_token'; -export * from '../../generated-wrappers/i_erc721_receiver'; -export * from '../../generated-wrappers/erc721_token'; -export * from '../../generated-wrappers/dummy_erc721_token'; -export * from '../../generated-wrappers/dummy_erc721_receiver'; diff --git a/contracts/erc721/tsconfig.json b/contracts/erc721/tsconfig.json index 098c3a7f3..3b218affe 100644 --- a/contracts/erc721/tsconfig.json +++ b/contracts/erc721/tsconfig.json @@ -1,19 +1,15 @@ { "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib", - "rootDir": ".", - "resolveJsonModule": true - }, + "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ - "./generated-artifacts/DummyERC721Receiver.json", - "./generated-artifacts/InvalidERC721Receiver.json", - "./generated-artifacts/DummyERC721Token.json", - "./generated-artifacts/ERC721Token.json", - "./generated-artifacts/IERC721Receiver.json", - "./generated-artifacts/IERC721Token.json", - "./generated-artifacts/MintableERC721Token.json" + "generated-artifacts/DummyERC721Receiver.json", + "generated-artifacts/DummyERC721Token.json", + "generated-artifacts/ERC721Token.json", + "generated-artifacts/IERC721Receiver.json", + "generated-artifacts/IERC721Token.json", + "generated-artifacts/InvalidERC721Receiver.json", + "generated-artifacts/MintableERC721Token.json" ], "exclude": ["./deploy/solc/solc_bin"] } diff --git a/contracts/exchange-forwarder/CHANGELOG.json b/contracts/exchange-forwarder/CHANGELOG.json index a9e5fa8da..338adde3d 100644 --- a/contracts/exchange-forwarder/CHANGELOG.json +++ b/contracts/exchange-forwarder/CHANGELOG.json @@ -1,5 +1,41 @@ [ { + "version": "1.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "version": "1.0.3", + "changes": [ + { + "note": "Fake publish to enable pinning" + } + ], + "timestamp": 1549504360 + }, + { + "timestamp": 1549452781, + "version": "1.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549373905, + "version": "1.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "1.0.0", "changes": [ { diff --git a/contracts/exchange-forwarder/CHANGELOG.md b/contracts/exchange-forwarder/CHANGELOG.md index 94ffdfb67..24bb6da5b 100644 --- a/contracts/exchange-forwarder/CHANGELOG.md +++ b/contracts/exchange-forwarder/CHANGELOG.md @@ -5,28 +5,22 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v1.2.3 - _January 17, 2019_ +## v1.0.4 - _February 7, 2019_ * Dependencies updated -## v1.2.2 - _January 15, 2019_ +## v1.0.3 - _February 7, 2019_ - * Dependencies updated + * Fake publish to enable pinning -## v1.2.1 - _January 11, 2019_ +## v1.0.2 - _February 6, 2019_ * Dependencies updated -## v1.2.0 - _January 9, 2019_ - - * Added Dutch Auction Wrapper (#1465) - -## v1.1.0 - _Invalid date_ +## v1.0.1 - _February 5, 2019_ - * Added Balance Threshold Filter (#1383) - * Add OrderMatcher (#1117) - * Add OrderValidator (#1464) + * Dependencies updated -## v1.0.2 - _December 13, 2018_ +## v1.0.0 - _Invalid date_ - * Dependencies updated + * Move Forwarder contract out of contracts-extensions into new package (#1539) diff --git a/contracts/exchange-forwarder/compiler.json b/contracts/exchange-forwarder/compiler.json index e93eb4bdd..051e81de5 100644 --- a/contracts/exchange-forwarder/compiler.json +++ b/contracts/exchange-forwarder/compiler.json @@ -3,10 +3,7 @@ "contractsDir": "./contracts", "useDockerisedSolc": true, "compilerSettings": { - "optimizer": { - "enabled": true, - "runs": 1000000 - }, + "optimizer": { "enabled": true, "runs": 1000000 }, "outputSelection": { "*": { "*": [ @@ -19,5 +16,11 @@ } } }, - "contracts": ["Forwarder"] + "contracts": [ + "@0x/contracts-erc20/contracts/src/WETH9.sol", + "@0x/contracts-erc20/contracts/test/DummyERC20Token.sol", + "@0x/contracts-erc721/contracts/test/DummyERC721Token.sol", + "@0x/contracts-exchange/contracts/src/Exchange.sol", + "src/Forwarder.sol" + ] } diff --git a/contracts/exchange-forwarder/package.json b/contracts/exchange-forwarder/package.json index 73a30e851..875d60ae6 100644 --- a/contracts/exchange-forwarder/package.json +++ b/contracts/exchange-forwarder/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-exchange-forwarder", - "version": "1.0.0", + "version": "1.0.4", "engines": { "node": ">=6.12" }, @@ -29,10 +29,12 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", + "contracts:gen": "contracts-gen", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "generated-artifacts/@(Forwarder).json" + "abis": "./generated-artifacts/@(DummyERC20Token|DummyERC721Token|Exchange|Forwarder|WETH9).json", + "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { "type": "git", @@ -44,12 +46,13 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.22", - "@0x/contract-wrappers": "^5.0.1", - "@0x/contracts-test-utils": "^2.0.1", - "@0x/dev-utils": "^1.0.24", - "@0x/sol-compiler": "^2.0.2", - "@0x/tslint-config": "^2.0.2", + "@0x/abi-gen": "^2.0.2", + "@0x/contract-wrappers": "^7.0.2", + "@0x/contracts-gen": "^1.0.1", + "@0x/contracts-test-utils": "^3.0.3", + "@0x/dev-utils": "^2.0.2", + "@0x/sol-compiler": "^3.0.2", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "@types/node": "*", "chai": "^4.0.1", @@ -65,20 +68,20 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/base-contract": "^3.0.13", - "@0x/contracts-asset-proxy": "1.0.0", - "@0x/contracts-exchange-libs": "1.0.0", - "@0x/contracts-exchange": "1.0.0", - "@0x/contracts-erc20": "1.0.0", - "@0x/contracts-erc721": "1.0.0", - "@0x/contracts-utils": "3.0.0", - "@0x/order-utils": "^3.1.2", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "ethereum-types": "^1.1.6", - "lodash": "^4.17.5" + "@0x/base-contract": "^4.0.2", + "@0x/contracts-asset-proxy": "1.0.2", + "@0x/contracts-erc20": "1.0.2", + "@0x/contracts-erc721": "1.0.2", + "@0x/contracts-exchange": "1.0.2", + "@0x/contracts-exchange-libs": "1.0.2", + "@0x/contracts-utils": "2.0.1", + "@0x/order-utils": "^6.0.1", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "ethereum-types": "^2.0.0", + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/contracts/exchange-forwarder/src/artifacts.ts b/contracts/exchange-forwarder/src/artifacts.ts new file mode 100644 index 000000000..94bcdf84a --- /dev/null +++ b/contracts/exchange-forwarder/src/artifacts.ts @@ -0,0 +1,19 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +import { ContractArtifact } from 'ethereum-types'; + +import * as DummyERC20Token from '../generated-artifacts/DummyERC20Token.json'; +import * as DummyERC721Token from '../generated-artifacts/DummyERC721Token.json'; +import * as Exchange from '../generated-artifacts/Exchange.json'; +import * as Forwarder from '../generated-artifacts/Forwarder.json'; +import * as WETH9 from '../generated-artifacts/WETH9.json'; +export const artifacts = { + WETH9: WETH9 as ContractArtifact, + DummyERC20Token: DummyERC20Token as ContractArtifact, + DummyERC721Token: DummyERC721Token as ContractArtifact, + Exchange: Exchange as ContractArtifact, + Forwarder: Forwarder as ContractArtifact, +}; diff --git a/contracts/exchange-forwarder/src/artifacts/index.ts b/contracts/exchange-forwarder/src/artifacts/index.ts deleted file mode 100644 index f15dac49a..000000000 --- a/contracts/exchange-forwarder/src/artifacts/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ContractArtifact } from 'ethereum-types'; - -import * as Forwarder from '../../generated-artifacts/Forwarder.json'; - -export const artifacts = { - Forwarder: Forwarder as ContractArtifact, -}; diff --git a/contracts/exchange-forwarder/src/wrappers.ts b/contracts/exchange-forwarder/src/wrappers.ts new file mode 100644 index 000000000..cbe72c5cf --- /dev/null +++ b/contracts/exchange-forwarder/src/wrappers.ts @@ -0,0 +1,10 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +export * from '../generated-wrappers/dummy_erc20_token'; +export * from '../generated-wrappers/dummy_erc721_token'; +export * from '../generated-wrappers/exchange'; +export * from '../generated-wrappers/forwarder'; +export * from '../generated-wrappers/weth9'; diff --git a/contracts/exchange-forwarder/src/wrappers/index.ts b/contracts/exchange-forwarder/src/wrappers/index.ts deleted file mode 100644 index 89dff9e74..000000000 --- a/contracts/exchange-forwarder/src/wrappers/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '../../generated-wrappers/forwarder'; diff --git a/contracts/exchange-forwarder/test/forwarder.ts b/contracts/exchange-forwarder/test/forwarder.ts index 24c219563..5acf113dd 100644 --- a/contracts/exchange-forwarder/test/forwarder.ts +++ b/contracts/exchange-forwarder/test/forwarder.ts @@ -1,7 +1,5 @@ import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; -import { artifacts as erc20Artifacts, DummyERC20TokenContract, WETH9Contract } from '@0x/contracts-erc20'; -import { DummyERC721TokenContract } from '@0x/contracts-erc721'; -import { artifacts as exchangeArtifacts, ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange'; +import { ExchangeWrapper } from '@0x/contracts-exchange'; import { chaiSetup, constants, @@ -23,7 +21,15 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import * as chai from 'chai'; import { TransactionReceiptWithDecodedLogs } from 'ethereum-types'; -import { artifacts, ForwarderContract, ForwarderWrapper } from '../src'; +import { + artifacts, + DummyERC20TokenContract, + DummyERC721TokenContract, + ExchangeContract, + ForwarderContract, + ForwarderWrapper, + WETH9Contract, +} from '../src'; chaiSetup.configure(); const expect = chai.expect; @@ -88,14 +94,14 @@ describe(ContractName.Forwarder, () => { const erc721Balances = await erc721Wrapper.getBalancesAsync(); erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address]; - wethContract = await WETH9Contract.deployFrom0xArtifactAsync(erc20Artifacts.WETH9, provider, txDefaults); + wethContract = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults); weth = new DummyERC20TokenContract(wethContract.abi, wethContract.address, provider); erc20Wrapper.addDummyTokenContract(weth); wethAssetData = assetDataUtils.encodeERC20AssetData(wethContract.address); zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address); const exchangeInstance = await ExchangeContract.deployFrom0xArtifactAsync( - exchangeArtifacts.Exchange, + artifacts.Exchange, provider, txDefaults, zrxAssetData, @@ -166,7 +172,7 @@ describe(ContractName.Forwarder, () => { describe('constructor', () => { it('should revert if assetProxy is unregistered', async () => { const exchangeInstance = await ExchangeContract.deployFrom0xArtifactAsync( - exchangeArtifacts.Exchange, + artifacts.Exchange, provider, txDefaults, zrxAssetData, diff --git a/contracts/exchange-forwarder/test/utils/forwarder_wrapper.ts b/contracts/exchange-forwarder/test/utils/forwarder_wrapper.ts index 207106852..4f9f6110a 100644 --- a/contracts/exchange-forwarder/test/utils/forwarder_wrapper.ts +++ b/contracts/exchange-forwarder/test/utils/forwarder_wrapper.ts @@ -1,6 +1,3 @@ -import { artifacts as erc20Artifacts } from '@0x/contracts-erc20'; -import { artifacts as erc721Artifacts } from '@0x/contracts-erc721'; -import { artifacts as exchangeArtifacts } from '@0x/contracts-exchange'; import { constants, formatters, LogDecoder, MarketSellOrders } from '@0x/contracts-test-utils'; import { SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; @@ -61,12 +58,7 @@ export class ForwarderWrapper { constructor(contractInstance: ForwarderContract, provider: Provider) { this._forwarderContract = contractInstance; this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, { - ...artifacts, - ...erc20Artifacts, - ...erc721Artifacts, - ...exchangeArtifacts, - }); + this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts); } public async marketSellOrdersWithEthAsync( orders: SignedOrder[], diff --git a/contracts/exchange-forwarder/tsconfig.json b/contracts/exchange-forwarder/tsconfig.json index cd80b5a5f..92c3a0475 100644 --- a/contracts/exchange-forwarder/tsconfig.json +++ b/contracts/exchange-forwarder/tsconfig.json @@ -1,11 +1,13 @@ { "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib", - "rootDir": ".", - "resolveJsonModule": true - }, + "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], - "files": ["./generated-artifacts/Forwarder.json"], + "files": [ + "generated-artifacts/DummyERC20Token.json", + "generated-artifacts/DummyERC721Token.json", + "generated-artifacts/Exchange.json", + "generated-artifacts/Forwarder.json", + "generated-artifacts/WETH9.json" + ], "exclude": ["./deploy/solc/solc_bin"] } diff --git a/contracts/exchange-libs/CHANGELOG.json b/contracts/exchange-libs/CHANGELOG.json index cdaac93ea..5de06a714 100644 --- a/contracts/exchange-libs/CHANGELOG.json +++ b/contracts/exchange-libs/CHANGELOG.json @@ -1,5 +1,41 @@ [ { + "version": "1.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "version": "1.0.3", + "changes": [ + { + "note": "Fake publish to enable pinning" + } + ], + "timestamp": 1549504360 + }, + { + "timestamp": 1549452781, + "version": "1.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549373905, + "version": "1.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "1.0.0", "changes": [ { diff --git a/contracts/exchange-libs/CHANGELOG.md b/contracts/exchange-libs/CHANGELOG.md index 59d0804da..46e970e6f 100644 --- a/contracts/exchange-libs/CHANGELOG.md +++ b/contracts/exchange-libs/CHANGELOG.md @@ -5,22 +5,23 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v1.0.6 - _January 17, 2019_ +## v1.0.4 - _February 7, 2019_ * Dependencies updated -## v1.0.5 - _January 15, 2019_ +## v1.0.3 - _February 7, 2019_ - * Dependencies updated + * Fake publish to enable pinning -## v1.0.4 - _January 11, 2019_ +## v1.0.2 - _February 6, 2019_ * Dependencies updated -## v1.0.3 - _January 9, 2019_ +## v1.0.1 - _February 5, 2019_ * Dependencies updated -## v1.0.2 - _December 13, 2018_ +## v1.0.0 - _Invalid date_ - * Dependencies updated + * Rename contracts-libs to contracts-exchange-libs (#1539) + * Move LibAddressArray contract to contracts-utils (#1539) diff --git a/contracts/exchange-libs/compiler.json b/contracts/exchange-libs/compiler.json index c4f0c6bd9..2a69896e6 100644 --- a/contracts/exchange-libs/compiler.json +++ b/contracts/exchange-libs/compiler.json @@ -3,10 +3,7 @@ "contractsDir": "./contracts", "useDockerisedSolc": true, "compilerSettings": { - "optimizer": { - "enabled": true, - "runs": 1000000 - }, + "optimizer": { "enabled": true, "runs": 1000000 }, "outputSelection": { "*": { "*": [ @@ -20,13 +17,13 @@ } }, "contracts": [ - "TestLibs", - "LibOrder", - "LibMath", - "LibFillResults", - "LibAbiEncoder", - "LibEIP712", - "LibAssetProxyErrors", - "LibConstants" + "src/LibAbiEncoder.sol", + "src/LibAssetProxyErrors.sol", + "src/LibConstants.sol", + "src/LibEIP712.sol", + "src/LibFillResults.sol", + "src/LibMath.sol", + "src/LibOrder.sol", + "test/TestLibs.sol" ] } diff --git a/contracts/exchange-libs/package.json b/contracts/exchange-libs/package.json index f3efdd00e..8ffd5e81d 100644 --- a/contracts/exchange-libs/package.json +++ b/contracts/exchange-libs/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-exchange-libs", - "version": "1.0.0", + "version": "1.0.4", "engines": { "node": ">=6.12" }, @@ -29,10 +29,12 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", + "contracts:gen": "contracts-gen", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "generated-artifacts/@(LibMath|LibOrder|LibFillResults|LibAbiEncoder|TestLibs|LibEIP712).json" + "abis": "./generated-artifacts/@(LibAbiEncoder|LibAssetProxyErrors|LibConstants|LibEIP712|LibFillResults|LibMath|LibOrder|TestLibs).json", + "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { "type": "git", @@ -44,11 +46,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/libs/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.22", - "@0x/contracts-test-utils": "^2.0.1", - "@0x/dev-utils": "^1.0.24", - "@0x/sol-compiler": "^2.0.2", - "@0x/tslint-config": "^2.0.2", + "@0x/abi-gen": "^2.0.2", + "@0x/contracts-gen": "^1.0.1", + "@0x/contracts-test-utils": "^3.0.3", + "@0x/dev-utils": "^2.0.2", + "@0x/sol-compiler": "^3.0.2", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "@types/node": "*", "chai": "^4.0.1", @@ -64,15 +67,15 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/base-contract": "^3.0.13", - "@0x/contracts-utils": "3.0.0", - "@0x/order-utils": "^3.1.2", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "ethereum-types": "^1.1.6", - "lodash": "^4.17.5" + "@0x/base-contract": "^4.0.2", + "@0x/contracts-utils": "2.0.1", + "@0x/order-utils": "^6.0.1", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "ethereum-types": "^2.0.0", + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/contracts/exchange-libs/src/artifacts.ts b/contracts/exchange-libs/src/artifacts.ts new file mode 100644 index 000000000..861d6f3d2 --- /dev/null +++ b/contracts/exchange-libs/src/artifacts.ts @@ -0,0 +1,25 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +import { ContractArtifact } from 'ethereum-types'; + +import * as LibAbiEncoder from '../generated-artifacts/LibAbiEncoder.json'; +import * as LibAssetProxyErrors from '../generated-artifacts/LibAssetProxyErrors.json'; +import * as LibConstants from '../generated-artifacts/LibConstants.json'; +import * as LibEIP712 from '../generated-artifacts/LibEIP712.json'; +import * as LibFillResults from '../generated-artifacts/LibFillResults.json'; +import * as LibMath from '../generated-artifacts/LibMath.json'; +import * as LibOrder from '../generated-artifacts/LibOrder.json'; +import * as TestLibs from '../generated-artifacts/TestLibs.json'; +export const artifacts = { + LibAbiEncoder: LibAbiEncoder as ContractArtifact, + LibAssetProxyErrors: LibAssetProxyErrors as ContractArtifact, + LibConstants: LibConstants as ContractArtifact, + LibEIP712: LibEIP712 as ContractArtifact, + LibFillResults: LibFillResults as ContractArtifact, + LibMath: LibMath as ContractArtifact, + LibOrder: LibOrder as ContractArtifact, + TestLibs: TestLibs as ContractArtifact, +}; diff --git a/contracts/exchange-libs/src/artifacts/index.ts b/contracts/exchange-libs/src/artifacts/index.ts deleted file mode 100644 index 3955bbe2b..000000000 --- a/contracts/exchange-libs/src/artifacts/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ContractArtifact } from 'ethereum-types'; - -import * as LibAbiEncoder from '../../generated-artifacts/LibAbiEncoder.json'; -import * as LibEIP721 from '../../generated-artifacts/LibEIP712.json'; -import * as LibFillResults from '../../generated-artifacts/LibFillResults.json'; -import * as LibMath from '../../generated-artifacts/LibMath.json'; -import * as LibOrder from '../../generated-artifacts/LibOrder.json'; -import * as TestLibs from '../../generated-artifacts/TestLibs.json'; - -export const artifacts = { - TestLibs: TestLibs as ContractArtifact, - LibAbiEncoder: LibAbiEncoder as ContractArtifact, - LibFillResults: LibFillResults as ContractArtifact, - LibMath: LibMath as ContractArtifact, - LibOrder: LibOrder as ContractArtifact, - LibEIP721: LibEIP721 as ContractArtifact, -}; diff --git a/contracts/exchange-libs/src/wrappers.ts b/contracts/exchange-libs/src/wrappers.ts new file mode 100644 index 000000000..05244d87b --- /dev/null +++ b/contracts/exchange-libs/src/wrappers.ts @@ -0,0 +1,13 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +export * from '../generated-wrappers/lib_abi_encoder'; +export * from '../generated-wrappers/lib_asset_proxy_errors'; +export * from '../generated-wrappers/lib_constants'; +export * from '../generated-wrappers/lib_e_i_p712'; +export * from '../generated-wrappers/lib_fill_results'; +export * from '../generated-wrappers/lib_math'; +export * from '../generated-wrappers/lib_order'; +export * from '../generated-wrappers/test_libs'; diff --git a/contracts/exchange-libs/src/wrappers/index.ts b/contracts/exchange-libs/src/wrappers/index.ts deleted file mode 100644 index baaae6e34..000000000 --- a/contracts/exchange-libs/src/wrappers/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from '../../generated-wrappers/test_libs'; -export * from '../../generated-wrappers/lib_abi_encoder'; -export * from '../../generated-wrappers/lib_fill_results'; -export * from '../../generated-wrappers/lib_math'; -export * from '../../generated-wrappers/lib_order'; -export * from '../../generated-wrappers/lib_e_i_p712'; diff --git a/contracts/exchange-libs/tsconfig.json b/contracts/exchange-libs/tsconfig.json index 27ca35085..1b5d54175 100644 --- a/contracts/exchange-libs/tsconfig.json +++ b/contracts/exchange-libs/tsconfig.json @@ -1,18 +1,16 @@ { "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib", - "rootDir": ".", - "resolveJsonModule": true - }, + "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ - "./generated-artifacts/TestLibs.json", - "./generated-artifacts/LibOrder.json", - "./generated-artifacts/LibFillResults.json", - "./generated-artifacts/LibAbiEncoder.json", - "./generated-artifacts/LibEIP712.json", - "./generated-artifacts/LibMath.json" + "generated-artifacts/LibAbiEncoder.json", + "generated-artifacts/LibAssetProxyErrors.json", + "generated-artifacts/LibConstants.json", + "generated-artifacts/LibEIP712.json", + "generated-artifacts/LibFillResults.json", + "generated-artifacts/LibMath.json", + "generated-artifacts/LibOrder.json", + "generated-artifacts/TestLibs.json" ], "exclude": ["./deploy/solc/solc_bin"] } diff --git a/contracts/exchange/CHANGELOG.json b/contracts/exchange/CHANGELOG.json index e4c7aa986..02c614b1a 100644 --- a/contracts/exchange/CHANGELOG.json +++ b/contracts/exchange/CHANGELOG.json @@ -1,5 +1,41 @@ [ { + "version": "1.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "version": "1.0.3", + "changes": [ + { + "note": "Fake publish to enable pinning" + } + ], + "timestamp": 1549504360 + }, + { + "timestamp": 1549452781, + "version": "1.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549373905, + "version": "1.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "1.0.0", "changes": [ { diff --git a/contracts/exchange/CHANGELOG.md b/contracts/exchange/CHANGELOG.md index 779eb68a7..f265cd96f 100644 --- a/contracts/exchange/CHANGELOG.md +++ b/contracts/exchange/CHANGELOG.md @@ -5,24 +5,23 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v2.2.3 - _January 17, 2019_ +## v1.0.4 - _February 7, 2019_ * Dependencies updated -## v2.2.2 - _January 15, 2019_ +## v1.0.3 - _February 7, 2019_ - * Dependencies updated + * Fake publish to enable pinning -## v2.2.1 - _January 11, 2019_ +## v1.0.2 - _February 6, 2019_ * Dependencies updated -## v2.2.0 - _January 9, 2019_ +## v1.0.1 - _February 5, 2019_ - * Added LibAddressArray (#1383) - * Add validation and comments to MultiAssetProxy (#1455) - * Move OrderValidator to extensions (#1464) + * Dependencies updated -## v2.1.59 - _December 13, 2018_ +## v1.0.0 - _Invalid date_ - * Dependencies updated + * Move Exchange contract out of contracts-protocol to new package (#1539) + * Move example contracts out of contracts-examples to new package (#1539) diff --git a/contracts/exchange/compiler.json b/contracts/exchange/compiler.json index 6a5f666d1..b7a94cd13 100644 --- a/contracts/exchange/compiler.json +++ b/contracts/exchange/compiler.json @@ -3,10 +3,7 @@ "contractsDir": "./contracts", "useDockerisedSolc": true, "compilerSettings": { - "optimizer": { - "enabled": true, - "runs": 1000000 - }, + "optimizer": { "enabled": true, "runs": 1000000 }, "outputSelection": { "*": { "*": [ @@ -20,23 +17,31 @@ } }, "contracts": [ - "Exchange", - "IAssetProxyDispatcher", - "IExchange", - "IExchangeCore", - "IMatchOrders", - "ISignatureValidator", - "ITransactions", - "IValidator", - "IWallet", - "IWrapperFunctions", - "TestAssetProxyDispatcher", - "TestExchangeInternals", - "TestSignatureValidator", - "TestStaticCallReceiver", - "ExchangeWrapper", - "Validator", - "Wallet", - "Whitelist" + "@0x/contracts-asset-proxy/contracts/src/ERC20Proxy.sol", + "@0x/contracts-asset-proxy/contracts/src/ERC721Proxy.sol", + "@0x/contracts-asset-proxy/contracts/src/MultiAssetProxy.sol", + "@0x/contracts-erc20/contracts/test/DummyERC20Token.sol", + "@0x/contracts-erc20/contracts/test/DummyNoReturnERC20Token.sol", + "@0x/contracts-erc20/contracts/test/ReentrantERC20Token.sol", + "@0x/contracts-erc721/contracts/test/DummyERC721Token.sol", + "@0x/contracts-exchange-libs/contracts/test/TestLibs.sol", + "examples/ExchangeWrapper.sol", + "examples/Validator.sol", + "examples/Wallet.sol", + "examples/Whitelist.sol", + "src/Exchange.sol", + "src/interfaces/IAssetProxyDispatcher.sol", + "src/interfaces/IExchange.sol", + "src/interfaces/IExchangeCore.sol", + "src/interfaces/IMatchOrders.sol", + "src/interfaces/ISignatureValidator.sol", + "src/interfaces/ITransactions.sol", + "src/interfaces/IValidator.sol", + "src/interfaces/IWallet.sol", + "src/interfaces/IWrapperFunctions.sol", + "test/TestAssetProxyDispatcher.sol", + "test/TestExchangeInternals.sol", + "test/TestSignatureValidator.sol", + "test/TestStaticCallReceiver.sol" ] } diff --git a/contracts/exchange/package.json b/contracts/exchange/package.json index a11767626..b16785087 100644 --- a/contracts/exchange/package.json +++ b/contracts/exchange/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-exchange", - "version": "1.0.0", + "version": "1.0.4", "engines": { "node": ">=6.12" }, @@ -29,10 +29,12 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", + "contracts:gen": "contracts-gen", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "generated-artifacts/@(ERC20Proxy|ERC721Proxy|Exchange|IAssetProxyDispatcher|IExchange|IExchangeCore|IMatchOrders|ISignatureValidator|ITransactions|IWrapperFunctions|IValidator|IWallet|MixinAuthorizable|MultiAssetProxy|TestSignatureValidator|TestAssetProxyDispatcher|TestExchangeInternals|TestStaticCallReceiver|ExchangeWrapper|Validator|Wallet|Whitelist).json" + "abis": "./generated-artifacts/@(DummyERC20Token|DummyERC721Token|DummyNoReturnERC20Token|ERC20Proxy|ERC721Proxy|Exchange|ExchangeWrapper|IAssetProxyDispatcher|IExchange|IExchangeCore|IMatchOrders|ISignatureValidator|ITransactions|IValidator|IWallet|IWrapperFunctions|MultiAssetProxy|ReentrantERC20Token|TestAssetProxyDispatcher|TestExchangeInternals|TestLibs|TestSignatureValidator|TestStaticCallReceiver|Validator|Wallet|Whitelist).json", + "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { "type": "git", @@ -44,10 +46,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.22", - "@0x/dev-utils": "^1.0.24", - "@0x/sol-compiler": "^2.0.2", - "@0x/tslint-config": "^2.0.2", + "@0x/abi-gen": "^2.0.2", + "@0x/contracts-gen": "^1.0.1", + "@0x/contracts-test-utils": "^3.0.3", + "@0x/dev-utils": "^2.0.2", + "@0x/sol-compiler": "^3.0.2", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "@types/node": "*", "chai": "^4.0.1", @@ -63,21 +67,20 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/base-contract": "^3.0.13", - "@0x/contracts-asset-proxy": "1.0.0", - "@0x/contracts-exchange-libs": "1.0.0", - "@0x/contracts-test-utils": "^2.0.1", - "@0x/contracts-erc20": "1.0.0", - "@0x/contracts-erc721": "1.0.0", - "@0x/contracts-utils": "3.0.0", - "@0x/order-utils": "^3.1.2", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "ethereum-types": "^1.1.6", + "@0x/base-contract": "^4.0.2", + "@0x/contracts-asset-proxy": "1.0.2", + "@0x/contracts-erc20": "1.0.2", + "@0x/contracts-erc721": "1.0.2", + "@0x/contracts-exchange-libs": "1.0.2", + "@0x/contracts-utils": "2.0.1", + "@0x/order-utils": "^6.0.1", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "ethereum-types": "^2.0.0", "ethereumjs-util": "^5.1.1", - "lodash": "^4.17.5" + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/contracts/exchange/src/artifacts.ts b/contracts/exchange/src/artifacts.ts new file mode 100644 index 000000000..efdacd376 --- /dev/null +++ b/contracts/exchange/src/artifacts.ts @@ -0,0 +1,61 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +import { ContractArtifact } from 'ethereum-types'; + +import * as DummyERC20Token from '../generated-artifacts/DummyERC20Token.json'; +import * as DummyERC721Token from '../generated-artifacts/DummyERC721Token.json'; +import * as DummyNoReturnERC20Token from '../generated-artifacts/DummyNoReturnERC20Token.json'; +import * as ERC20Proxy from '../generated-artifacts/ERC20Proxy.json'; +import * as ERC721Proxy from '../generated-artifacts/ERC721Proxy.json'; +import * as Exchange from '../generated-artifacts/Exchange.json'; +import * as ExchangeWrapper from '../generated-artifacts/ExchangeWrapper.json'; +import * as IAssetProxyDispatcher from '../generated-artifacts/IAssetProxyDispatcher.json'; +import * as IExchange from '../generated-artifacts/IExchange.json'; +import * as IExchangeCore from '../generated-artifacts/IExchangeCore.json'; +import * as IMatchOrders from '../generated-artifacts/IMatchOrders.json'; +import * as ISignatureValidator from '../generated-artifacts/ISignatureValidator.json'; +import * as ITransactions from '../generated-artifacts/ITransactions.json'; +import * as IValidator from '../generated-artifacts/IValidator.json'; +import * as IWallet from '../generated-artifacts/IWallet.json'; +import * as IWrapperFunctions from '../generated-artifacts/IWrapperFunctions.json'; +import * as MultiAssetProxy from '../generated-artifacts/MultiAssetProxy.json'; +import * as ReentrantERC20Token from '../generated-artifacts/ReentrantERC20Token.json'; +import * as TestAssetProxyDispatcher from '../generated-artifacts/TestAssetProxyDispatcher.json'; +import * as TestExchangeInternals from '../generated-artifacts/TestExchangeInternals.json'; +import * as TestLibs from '../generated-artifacts/TestLibs.json'; +import * as TestSignatureValidator from '../generated-artifacts/TestSignatureValidator.json'; +import * as TestStaticCallReceiver from '../generated-artifacts/TestStaticCallReceiver.json'; +import * as Validator from '../generated-artifacts/Validator.json'; +import * as Wallet from '../generated-artifacts/Wallet.json'; +import * as Whitelist from '../generated-artifacts/Whitelist.json'; +export const artifacts = { + ERC20Proxy: ERC20Proxy as ContractArtifact, + ERC721Proxy: ERC721Proxy as ContractArtifact, + MultiAssetProxy: MultiAssetProxy as ContractArtifact, + DummyERC20Token: DummyERC20Token as ContractArtifact, + DummyNoReturnERC20Token: DummyNoReturnERC20Token as ContractArtifact, + ReentrantERC20Token: ReentrantERC20Token as ContractArtifact, + DummyERC721Token: DummyERC721Token as ContractArtifact, + TestLibs: TestLibs as ContractArtifact, + ExchangeWrapper: ExchangeWrapper as ContractArtifact, + Validator: Validator as ContractArtifact, + Wallet: Wallet as ContractArtifact, + Whitelist: Whitelist as ContractArtifact, + Exchange: Exchange as ContractArtifact, + IAssetProxyDispatcher: IAssetProxyDispatcher as ContractArtifact, + IExchange: IExchange as ContractArtifact, + IExchangeCore: IExchangeCore as ContractArtifact, + IMatchOrders: IMatchOrders as ContractArtifact, + ISignatureValidator: ISignatureValidator as ContractArtifact, + ITransactions: ITransactions as ContractArtifact, + IValidator: IValidator as ContractArtifact, + IWallet: IWallet as ContractArtifact, + IWrapperFunctions: IWrapperFunctions as ContractArtifact, + TestAssetProxyDispatcher: TestAssetProxyDispatcher as ContractArtifact, + TestExchangeInternals: TestExchangeInternals as ContractArtifact, + TestSignatureValidator: TestSignatureValidator as ContractArtifact, + TestStaticCallReceiver: TestStaticCallReceiver as ContractArtifact, +}; diff --git a/contracts/exchange/src/artifacts/index.ts b/contracts/exchange/src/artifacts/index.ts deleted file mode 100644 index 798ff17ab..000000000 --- a/contracts/exchange/src/artifacts/index.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { ContractArtifact } from 'ethereum-types'; - -import * as Exchange from '../../generated-artifacts/Exchange.json'; -import * as ExchangeWrapper from '../../generated-artifacts/ExchangeWrapper.json'; -import * as IAssetProxyDispatcher from '../../generated-artifacts/IAssetProxyDispatcher.json'; -import * as IExchange from '../../generated-artifacts/IExchange.json'; -import * as IExchangeCore from '../../generated-artifacts/IExchangeCore.json'; -import * as IMatchOrders from '../../generated-artifacts/IMatchOrders.json'; -import * as ISignatureValidator from '../../generated-artifacts/ISignatureValidator.json'; -import * as ITransactions from '../../generated-artifacts/ITransactions.json'; -import * as IValidator from '../../generated-artifacts/IValidator.json'; -import * as IWallet from '../../generated-artifacts/IWallet.json'; -import * as IWrapperFunctions from '../../generated-artifacts/IWrapperFunctions.json'; -import * as TestAssetProxyDispatcher from '../../generated-artifacts/TestAssetProxyDispatcher.json'; -import * as TestExchangeInternals from '../../generated-artifacts/TestExchangeInternals.json'; -import * as TestSignatureValidator from '../../generated-artifacts/TestSignatureValidator.json'; -import * as TestStaticCallReceiver from '../../generated-artifacts/TestStaticCallReceiver.json'; -import * as Validator from '../../generated-artifacts/Validator.json'; -import * as Wallet from '../../generated-artifacts/Wallet.json'; -import * as Whitelist from '../../generated-artifacts/Whitelist.json'; - -export const artifacts = { - Exchange: Exchange as ContractArtifact, - TestAssetProxyDispatcher: TestAssetProxyDispatcher as ContractArtifact, - TestExchangeInternals: TestExchangeInternals as ContractArtifact, - TestSignatureValidator: TestSignatureValidator as ContractArtifact, - TestStaticCallReceiver: TestStaticCallReceiver as ContractArtifact, - IExchange: IExchange as ContractArtifact, - IExchangeCore: IExchangeCore as ContractArtifact, - IMatchOrders: IMatchOrders as ContractArtifact, - ISignatureValidator: ISignatureValidator as ContractArtifact, - ITransactions: ITransactions as ContractArtifact, - IWrapperFunctions: IWrapperFunctions as ContractArtifact, - IAssetProxyDispatcher: IAssetProxyDispatcher as ContractArtifact, - IValidator: IValidator as ContractArtifact, - IWallet: IWallet as ContractArtifact, - ExchangeWrapper: ExchangeWrapper as ContractArtifact, - Validator: Validator as ContractArtifact, - Wallet: Wallet as ContractArtifact, - Whitelist: Whitelist as ContractArtifact, -}; diff --git a/contracts/exchange/src/wrappers.ts b/contracts/exchange/src/wrappers.ts new file mode 100644 index 000000000..1c1d7fdb4 --- /dev/null +++ b/contracts/exchange/src/wrappers.ts @@ -0,0 +1,31 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +export * from '../generated-wrappers/dummy_erc20_token'; +export * from '../generated-wrappers/dummy_erc721_token'; +export * from '../generated-wrappers/dummy_no_return_erc20_token'; +export * from '../generated-wrappers/erc20_proxy'; +export * from '../generated-wrappers/erc721_proxy'; +export * from '../generated-wrappers/exchange'; +export * from '../generated-wrappers/exchange_wrapper'; +export * from '../generated-wrappers/i_asset_proxy_dispatcher'; +export * from '../generated-wrappers/i_exchange'; +export * from '../generated-wrappers/i_exchange_core'; +export * from '../generated-wrappers/i_match_orders'; +export * from '../generated-wrappers/i_signature_validator'; +export * from '../generated-wrappers/i_transactions'; +export * from '../generated-wrappers/i_validator'; +export * from '../generated-wrappers/i_wallet'; +export * from '../generated-wrappers/i_wrapper_functions'; +export * from '../generated-wrappers/multi_asset_proxy'; +export * from '../generated-wrappers/reentrant_erc20_token'; +export * from '../generated-wrappers/test_asset_proxy_dispatcher'; +export * from '../generated-wrappers/test_exchange_internals'; +export * from '../generated-wrappers/test_libs'; +export * from '../generated-wrappers/test_signature_validator'; +export * from '../generated-wrappers/test_static_call_receiver'; +export * from '../generated-wrappers/validator'; +export * from '../generated-wrappers/wallet'; +export * from '../generated-wrappers/whitelist'; diff --git a/contracts/exchange/src/wrappers/index.ts b/contracts/exchange/src/wrappers/index.ts deleted file mode 100644 index 86e939b56..000000000 --- a/contracts/exchange/src/wrappers/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -export * from '../../generated-wrappers/exchange'; -export * from '../../generated-wrappers/test_asset_proxy_dispatcher'; -export * from '../../generated-wrappers/test_exchange_internals'; -export * from '../../generated-wrappers/test_signature_validator'; -export * from '../../generated-wrappers/test_static_call_receiver'; -export * from '../../generated-wrappers/i_asset_proxy_dispatcher'; -export * from '../../generated-wrappers/i_exchange'; -export * from '../../generated-wrappers/i_exchange_core'; -export * from '../../generated-wrappers/i_match_orders'; -export * from '../../generated-wrappers/i_signature_validator'; -export * from '../../generated-wrappers/i_transactions'; -export * from '../../generated-wrappers/i_wrapper_functions'; -export * from '../../generated-wrappers/i_validator'; -export * from '../../generated-wrappers/i_wallet'; -export * from '../../generated-wrappers/exchange_wrapper'; -export * from '../../generated-wrappers/validator'; -export * from '../../generated-wrappers/wallet'; -export * from '../../generated-wrappers/whitelist'; diff --git a/contracts/exchange/test/core.ts b/contracts/exchange/test/core.ts index 74161cc73..7e61ef7ac 100644 --- a/contracts/exchange/test/core.ts +++ b/contracts/exchange/test/core.ts @@ -1,19 +1,4 @@ -import { - artifacts as proxyArtifacts, - ERC20ProxyContract, - ERC20Wrapper, - ERC721ProxyContract, - ERC721Wrapper, - MultiAssetProxyContract, -} from '@0x/contracts-asset-proxy'; -import { - artifacts as erc20Artifacts, - DummyERC20TokenContract, - DummyERC20TokenTransferEventArgs, - DummyNoReturnERC20TokenContract, - ReentrantERC20TokenContract, -} from '@0x/contracts-erc20'; -import { DummyERC721TokenContract } from '@0x/contracts-erc721'; +import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; import { chaiSetup, constants, @@ -39,9 +24,17 @@ import * as _ from 'lodash'; import { artifacts, + DummyERC20TokenContract, + DummyERC20TokenTransferEventArgs, + DummyERC721TokenContract, + DummyNoReturnERC20TokenContract, + ERC20ProxyContract, + ERC721ProxyContract, ExchangeCancelEventArgs, ExchangeContract, ExchangeWrapper, + MultiAssetProxyContract, + ReentrantERC20TokenContract, TestStaticCallReceiverContract, } from '../src'; @@ -98,7 +91,7 @@ describe('Exchange core', () => { erc20Proxy = await erc20Wrapper.deployProxyAsync(); erc721Proxy = await erc721Wrapper.deployProxyAsync(); multiAssetProxy = await MultiAssetProxyContract.deployFrom0xArtifactAsync( - proxyArtifacts.MultiAssetProxy, + artifacts.MultiAssetProxy, provider, txDefaults, ); @@ -120,7 +113,7 @@ describe('Exchange core', () => { txDefaults, ); reentrantErc20Token = await ReentrantERC20TokenContract.deployFrom0xArtifactAsync( - erc20Artifacts.ReentrantERC20Token, + artifacts.ReentrantERC20Token, provider, txDefaults, exchange.address, @@ -345,7 +338,7 @@ describe('Exchange core', () => { describe('Testing exchange of ERC20 tokens with no return values', () => { before(async () => { noReturnErc20Token = await DummyNoReturnERC20TokenContract.deployFrom0xArtifactAsync( - erc20Artifacts.DummyNoReturnERC20Token, + artifacts.DummyNoReturnERC20Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, diff --git a/contracts/exchange/test/dispatcher.ts b/contracts/exchange/test/dispatcher.ts index a25755936..8263b0402 100644 --- a/contracts/exchange/test/dispatcher.ts +++ b/contracts/exchange/test/dispatcher.ts @@ -1,11 +1,4 @@ -import { - artifacts as proxyArtifacts, - ERC20ProxyContract, - ERC20Wrapper, - ERC721ProxyContract, - ERC721Wrapper, -} from '@0x/contracts-asset-proxy'; -import { DummyERC20TokenContract } from '@0x/contracts-erc20'; +import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; import { chaiSetup, constants, @@ -25,6 +18,9 @@ import * as _ from 'lodash'; import { artifacts, + DummyERC20TokenContract, + ERC20ProxyContract, + ERC721ProxyContract, TestAssetProxyDispatcherAssetProxyRegisteredEventArgs, TestAssetProxyDispatcherContract, } from '../src'; @@ -131,7 +127,7 @@ describe('AssetProxyDispatcher', () => { expect(proxyAddress).to.be.equal(erc20Proxy.address); // Deploy a new version of the ERC20 Transfer Proxy contract const newErc20TransferProxy = await ERC20ProxyContract.deployFrom0xArtifactAsync( - proxyArtifacts.ERC20Proxy, + artifacts.ERC20Proxy, provider, txDefaults, ); diff --git a/contracts/exchange/test/match_orders.ts b/contracts/exchange/test/match_orders.ts index d17025ddd..98fea67ea 100644 --- a/contracts/exchange/test/match_orders.ts +++ b/contracts/exchange/test/match_orders.ts @@ -1,6 +1,4 @@ -import { ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, ERC721Wrapper } from '@0x/contracts-asset-proxy'; -import { artifacts as erc20Artifacts, DummyERC20TokenContract, ReentrantERC20TokenContract } from '@0x/contracts-erc20'; -import { DummyERC721TokenContract } from '@0x/contracts-erc721'; +import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; import { chaiSetup, constants, @@ -20,7 +18,18 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import * as chai from 'chai'; import * as _ from 'lodash'; -import { artifacts, ExchangeContract, ExchangeWrapper, MatchOrderTester, TestExchangeInternalsContract } from '../src'; +import { + artifacts, + DummyERC20TokenContract, + DummyERC721TokenContract, + ERC20ProxyContract, + ERC721ProxyContract, + ExchangeContract, + ExchangeWrapper, + MatchOrderTester, + ReentrantERC20TokenContract, + TestExchangeInternalsContract, +} from '../src'; const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); chaiSetup.configure(); @@ -131,7 +140,7 @@ describe('matchOrders', () => { ); reentrantErc20Token = await ReentrantERC20TokenContract.deployFrom0xArtifactAsync( - erc20Artifacts.ReentrantERC20Token, + artifacts.ReentrantERC20Token, provider, txDefaults, exchange.address, diff --git a/contracts/exchange/test/signature_validator.ts b/contracts/exchange/test/signature_validator.ts index 89eac4ddb..33510e50c 100644 --- a/contracts/exchange/test/signature_validator.ts +++ b/contracts/exchange/test/signature_validator.ts @@ -1,4 +1,3 @@ -import { artifacts as erc20Artifacts } from '@0x/contracts-erc20'; import { addressUtils, chaiSetup, @@ -78,7 +77,7 @@ describe('MixinSignatureValidator', () => { provider, txDefaults, ); - signatureValidatorLogDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc20Artifacts }); + signatureValidatorLogDecoder = new LogDecoder(web3Wrapper, artifacts); await web3Wrapper.awaitTransactionSuccessAsync( await signatureValidator.setSignatureValidatorApproval.sendTransactionAsync(testValidator.address, true, { from: signerAddress, diff --git a/contracts/exchange/test/transactions.ts b/contracts/exchange/test/transactions.ts index 613953493..4f8c07579 100644 --- a/contracts/exchange/test/transactions.ts +++ b/contracts/exchange/test/transactions.ts @@ -8,14 +8,13 @@ import { OrderFactory, orderUtils, provider, - SignedTransaction, TransactionFactory, txDefaults, web3Wrapper, } from '@0x/contracts-test-utils'; import { BlockchainLifecycle } from '@0x/dev-utils'; import { assetDataUtils, generatePseudoRandomSalt } from '@0x/order-utils'; -import { OrderWithoutExchangeAddress, RevertReason, SignedOrder } from '@0x/types'; +import { OrderWithoutExchangeAddress, RevertReason, SignedOrder, SignedZeroExTransaction } from '@0x/types'; import { BigNumber } from '@0x/utils'; import * as chai from 'chai'; import * as _ from 'lodash'; @@ -41,7 +40,7 @@ describe('Exchange transactions', () => { let erc20Balances: ERC20BalancesByOwner; let signedOrder: SignedOrder; - let signedTx: SignedTransaction; + let signedTx: SignedZeroExTransaction; let orderWithoutExchangeAddress: OrderWithoutExchangeAddress; let orderFactory: OrderFactory; let makerTransactionFactory: TransactionFactory; diff --git a/contracts/exchange/test/utils/exchange_wrapper.ts b/contracts/exchange/test/utils/exchange_wrapper.ts index eca535c65..535e3bcf2 100644 --- a/contracts/exchange/test/utils/exchange_wrapper.ts +++ b/contracts/exchange/test/utils/exchange_wrapper.ts @@ -1,14 +1,5 @@ -import { artifacts as erc20Artifacts } from '@0x/contracts-erc20'; -import { artifacts as erc721Artifacts } from '@0x/contracts-erc721'; -import { - FillResults, - formatters, - LogDecoder, - OrderInfo, - orderUtils, - SignedTransaction, -} from '@0x/contracts-test-utils'; -import { SignedOrder } from '@0x/types'; +import { FillResults, formatters, LogDecoder, OrderInfo, orderUtils } from '@0x/contracts-test-utils'; +import { SignedOrder, SignedZeroExTransaction } from '@0x/types'; import { AbiEncoder, BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { MethodAbi, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; @@ -25,7 +16,7 @@ export class ExchangeWrapper { constructor(exchangeContract: ExchangeContract, provider: Provider) { this._exchange = exchangeContract; this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...erc20Artifacts, ...erc721Artifacts }); + this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts); } public async fillOrderAsync( signedOrder: SignedOrder, @@ -206,7 +197,7 @@ export class ExchangeWrapper { return tx; } public async executeTransactionAsync( - signedTx: SignedTransaction, + signedTx: SignedZeroExTransaction, from: string, ): Promise<TransactionReceiptWithDecodedLogs> { const txHash = await this._exchange.executeTransaction.sendTransactionAsync( diff --git a/contracts/exchange/test/utils/fill_order_combinatorial_utils.ts b/contracts/exchange/test/utils/fill_order_combinatorial_utils.ts index 26b168909..00ca8a9fc 100644 --- a/contracts/exchange/test/utils/fill_order_combinatorial_utils.ts +++ b/contracts/exchange/test/utils/fill_order_combinatorial_utils.ts @@ -1,5 +1,4 @@ import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; -import { artifacts as libsArtifacts, TestLibsContract } from '@0x/contracts-exchange-libs'; import { AllowanceAmountScenario, AssetDataScenario, @@ -33,7 +32,7 @@ import { LogWithDecodedArgs, Provider, TxData } from 'ethereum-types'; import * as _ from 'lodash'; import 'make-promises-safe'; -import { artifacts, ExchangeContract, ExchangeFillEventArgs } from '../../src'; +import { artifacts, ExchangeContract, ExchangeFillEventArgs, TestLibsContract } from '../../src'; import { AssetWrapper } from './asset_wrapper'; import { ExchangeWrapper } from './exchange_wrapper'; @@ -129,11 +128,7 @@ export async function fillOrderCombinatorialUtilsFactoryAsync( exchangeContract.address, ); - const testLibsContract = await TestLibsContract.deployFrom0xArtifactAsync( - libsArtifacts.TestLibs, - provider, - txDefaults, - ); + const testLibsContract = await TestLibsContract.deployFrom0xArtifactAsync(artifacts.TestLibs, provider, txDefaults); const fillOrderCombinatorialUtils = new FillOrderCombinatorialUtils( orderFactory, diff --git a/contracts/exchange/test/wrapper.ts b/contracts/exchange/test/wrapper.ts index 62a0d426f..5476ac99d 100644 --- a/contracts/exchange/test/wrapper.ts +++ b/contracts/exchange/test/wrapper.ts @@ -1,6 +1,4 @@ -import { ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, ERC721Wrapper } from '@0x/contracts-asset-proxy'; -import { artifacts as erc20Artifacts, DummyERC20TokenContract, ReentrantERC20TokenContract } from '@0x/contracts-erc20'; -import { DummyERC721TokenContract } from '@0x/contracts-erc721'; +import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; import { chaiSetup, constants, @@ -22,7 +20,16 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import * as chai from 'chai'; import * as _ from 'lodash'; -import { artifacts, ExchangeContract, ExchangeWrapper } from '../src'; +import { + artifacts, + DummyERC20TokenContract, + DummyERC721TokenContract, + ERC20ProxyContract, + ERC721ProxyContract, + ExchangeContract, + ExchangeWrapper, + ReentrantERC20TokenContract, +} from '../src'; chaiSetup.configure(); const expect = chai.expect; @@ -107,7 +114,7 @@ describe('Exchange wrappers', () => { ); reentrantErc20Token = await ReentrantERC20TokenContract.deployFrom0xArtifactAsync( - erc20Artifacts.ReentrantERC20Token, + artifacts.ReentrantERC20Token, provider, txDefaults, exchange.address, diff --git a/contracts/exchange/tsconfig.json b/contracts/exchange/tsconfig.json index b0fcd1771..35ca3d933 100644 --- a/contracts/exchange/tsconfig.json +++ b/contracts/exchange/tsconfig.json @@ -1,30 +1,34 @@ { "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib", - "rootDir": ".", - "resolveJsonModule": true - }, + "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ - "./generated-artifacts/IAssetProxyDispatcher.json", - "./generated-artifacts/IExchange.json", - "./generated-artifacts/IExchangeCore.json", - "./generated-artifacts/IMatchOrders.json", - "./generated-artifacts/ISignatureValidator.json", - "./generated-artifacts/ITransactions.json", - "./generated-artifacts/IValidator.json", - "./generated-artifacts/IWallet.json", - "./generated-artifacts/IWrapperFunctions.json", - "./generated-artifacts/Exchange.json", - "./generated-artifacts/TestAssetProxyDispatcher.json", - "./generated-artifacts/TestExchangeInternals.json", - "./generated-artifacts/TestSignatureValidator.json", - "./generated-artifacts/TestStaticCallReceiver.json", - "./generated-artifacts/ExchangeWrapper.json", - "./generated-artifacts/Validator.json", - "./generated-artifacts/Wallet.json", - "./generated-artifacts/Whitelist.json" + "generated-artifacts/DummyERC20Token.json", + "generated-artifacts/DummyERC721Token.json", + "generated-artifacts/DummyNoReturnERC20Token.json", + "generated-artifacts/ERC20Proxy.json", + "generated-artifacts/ERC721Proxy.json", + "generated-artifacts/Exchange.json", + "generated-artifacts/ExchangeWrapper.json", + "generated-artifacts/IAssetProxyDispatcher.json", + "generated-artifacts/IExchange.json", + "generated-artifacts/IExchangeCore.json", + "generated-artifacts/IMatchOrders.json", + "generated-artifacts/ISignatureValidator.json", + "generated-artifacts/ITransactions.json", + "generated-artifacts/IValidator.json", + "generated-artifacts/IWallet.json", + "generated-artifacts/IWrapperFunctions.json", + "generated-artifacts/MultiAssetProxy.json", + "generated-artifacts/ReentrantERC20Token.json", + "generated-artifacts/TestAssetProxyDispatcher.json", + "generated-artifacts/TestExchangeInternals.json", + "generated-artifacts/TestLibs.json", + "generated-artifacts/TestSignatureValidator.json", + "generated-artifacts/TestStaticCallReceiver.json", + "generated-artifacts/Validator.json", + "generated-artifacts/Wallet.json", + "generated-artifacts/Whitelist.json" ], "exclude": ["./deploy/solc/solc_bin"] } diff --git a/contracts/extensions/CHANGELOG.json b/contracts/extensions/CHANGELOG.json index 16ec073aa..8a1335c51 100644 --- a/contracts/extensions/CHANGELOG.json +++ b/contracts/extensions/CHANGELOG.json @@ -1,14 +1,28 @@ [ { - "version": "3.0.0", + "version": "2.0.3", "changes": [ { - "note": "Move Forwarder contract into new package", - "pr": 1539 - }, + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "version": "2.0.2", + "changes": [ { - "note": "Nest extensions under src directory", - "pr": 1539 + "note": "Fake publish to enable pinning" + } + ], + "timestamp": 1549504360 + }, + { + "timestamp": 1549452781, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" } ] }, @@ -18,8 +32,17 @@ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 + }, + { + "note": "Move Forwarder contract into new package", + "pr": 1539 + }, + { + "note": "Nest extensions under src directory", + "pr": 1539 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547747677, diff --git a/contracts/extensions/CHANGELOG.md b/contracts/extensions/CHANGELOG.md index 94ffdfb67..34137efdb 100644 --- a/contracts/extensions/CHANGELOG.md +++ b/contracts/extensions/CHANGELOG.md @@ -5,6 +5,24 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.2 - _February 7, 2019_ + + * Fake publish to enable pinning + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + * Move Forwarder contract into new package (#1539) + * Nest extensions under src directory (#1539) + ## v1.2.3 - _January 17, 2019_ * Dependencies updated diff --git a/contracts/extensions/compiler.json b/contracts/extensions/compiler.json index 91e0bd429..41fd582ad 100644 --- a/contracts/extensions/compiler.json +++ b/contracts/extensions/compiler.json @@ -3,10 +3,7 @@ "contractsDir": "./contracts", "useDockerisedSolc": true, "compilerSettings": { - "optimizer": { - "enabled": true, - "runs": 1000000 - }, + "optimizer": { "enabled": true, "runs": 1000000 }, "outputSelection": { "*": { "*": [ @@ -19,5 +16,17 @@ } } }, - "contracts": ["BalanceThresholdFilter", "DutchAuction", "OrderMatcher", "OrderValidator"] + "contracts": [ + "@0x/contracts-asset-proxy/contracts/src/ERC20Proxy.sol", + "@0x/contracts-asset-proxy/contracts/src/ERC721Proxy.sol", + "@0x/contracts-erc20/contracts/src/WETH9.sol", + "@0x/contracts-erc20/contracts/test/DummyERC20Token.sol", + "@0x/contracts-erc721/contracts/test/DummyERC721Token.sol", + "@0x/contracts-exchange/contracts/examples/ExchangeWrapper.sol", + "@0x/contracts-exchange/contracts/src/Exchange.sol", + "src/BalanceThresholdFilter/BalanceThresholdFilter.sol", + "src/DutchAuction/DutchAuction.sol", + "src/OrderMatcher/OrderMatcher.sol", + "src/OrderValidator/OrderValidator.sol" + ] } diff --git a/contracts/extensions/package.json b/contracts/extensions/package.json index ad829033f..831a3398a 100644 --- a/contracts/extensions/package.json +++ b/contracts/extensions/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-extensions", - "version": "1.2.3", + "version": "2.0.3", "engines": { "node": ">=6.12" }, @@ -29,10 +29,12 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", + "contracts:gen": "contracts-gen", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "generated-artifacts/@(BalanceThresholdFilter|DutchAuction|OrderMatcher|OrderValidator).json" + "abis": "./generated-artifacts/@(BalanceThresholdFilter|DummyERC20Token|DummyERC721Token|DutchAuction|ERC20Proxy|ERC721Proxy|Exchange|ExchangeWrapper|OrderMatcher|OrderValidator|WETH9).json", + "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { "type": "git", @@ -44,12 +46,13 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.22", - "@0x/contract-wrappers": "^5.0.1", - "@0x/contracts-test-utils": "^2.0.1", - "@0x/dev-utils": "^1.0.24", - "@0x/sol-compiler": "^2.0.2", - "@0x/tslint-config": "^2.0.2", + "@0x/abi-gen": "^2.0.2", + "@0x/contract-wrappers": "^7.0.2", + "@0x/contracts-gen": "^1.0.1", + "@0x/contracts-test-utils": "^3.0.3", + "@0x/dev-utils": "^2.0.2", + "@0x/sol-compiler": "^3.0.2", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "@types/node": "*", "chai": "^4.0.1", @@ -65,20 +68,20 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/base-contract": "^3.0.13", - "@0x/contracts-asset-proxy": "1.0.0", - "@0x/contracts-exchange-libs": "1.0.0", - "@0x/contracts-exchange": "1.0.0", - "@0x/contracts-erc20": "1.0.0", - "@0x/contracts-erc721": "1.0.0", - "@0x/contracts-utils": "3.0.0", - "@0x/order-utils": "^3.1.2", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "ethereum-types": "^1.1.6", - "lodash": "^4.17.5" + "@0x/base-contract": "^4.0.2", + "@0x/contracts-asset-proxy": "1.0.2", + "@0x/contracts-erc20": "1.0.2", + "@0x/contracts-erc721": "1.0.2", + "@0x/contracts-exchange": "1.0.2", + "@0x/contracts-exchange-libs": "1.0.2", + "@0x/contracts-utils": "2.0.1", + "@0x/order-utils": "^6.0.1", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "ethereum-types": "^2.0.0", + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/contracts/extensions/src/artifacts.ts b/contracts/extensions/src/artifacts.ts new file mode 100644 index 000000000..efa5c859c --- /dev/null +++ b/contracts/extensions/src/artifacts.ts @@ -0,0 +1,31 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +import { ContractArtifact } from 'ethereum-types'; + +import * as BalanceThresholdFilter from '../generated-artifacts/BalanceThresholdFilter.json'; +import * as DummyERC20Token from '../generated-artifacts/DummyERC20Token.json'; +import * as DummyERC721Token from '../generated-artifacts/DummyERC721Token.json'; +import * as DutchAuction from '../generated-artifacts/DutchAuction.json'; +import * as ERC20Proxy from '../generated-artifacts/ERC20Proxy.json'; +import * as ERC721Proxy from '../generated-artifacts/ERC721Proxy.json'; +import * as Exchange from '../generated-artifacts/Exchange.json'; +import * as ExchangeWrapper from '../generated-artifacts/ExchangeWrapper.json'; +import * as OrderMatcher from '../generated-artifacts/OrderMatcher.json'; +import * as OrderValidator from '../generated-artifacts/OrderValidator.json'; +import * as WETH9 from '../generated-artifacts/WETH9.json'; +export const artifacts = { + ERC20Proxy: ERC20Proxy as ContractArtifact, + ERC721Proxy: ERC721Proxy as ContractArtifact, + WETH9: WETH9 as ContractArtifact, + DummyERC20Token: DummyERC20Token as ContractArtifact, + DummyERC721Token: DummyERC721Token as ContractArtifact, + ExchangeWrapper: ExchangeWrapper as ContractArtifact, + Exchange: Exchange as ContractArtifact, + BalanceThresholdFilter: BalanceThresholdFilter as ContractArtifact, + DutchAuction: DutchAuction as ContractArtifact, + OrderMatcher: OrderMatcher as ContractArtifact, + OrderValidator: OrderValidator as ContractArtifact, +}; diff --git a/contracts/extensions/src/artifacts/index.ts b/contracts/extensions/src/artifacts/index.ts deleted file mode 100644 index f2aee4908..000000000 --- a/contracts/extensions/src/artifacts/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ContractArtifact } from 'ethereum-types'; - -import * as BalanceThresholdFilter from '../../generated-artifacts/BalanceThresholdFilter.json'; -import * as DutchAuction from '../../generated-artifacts/DutchAuction.json'; -import * as OrderMatcher from '../../generated-artifacts/OrderMatcher.json'; -import * as OrderValidator from '../../generated-artifacts/OrderValidator.json'; - -export const artifacts = { - BalanceThresholdFilter: BalanceThresholdFilter as ContractArtifact, - DutchAuction: DutchAuction as ContractArtifact, - OrderMatcher: OrderMatcher as ContractArtifact, - OrderValidator: OrderValidator as ContractArtifact, -}; diff --git a/contracts/extensions/src/wrappers.ts b/contracts/extensions/src/wrappers.ts new file mode 100644 index 000000000..1a67d2ee3 --- /dev/null +++ b/contracts/extensions/src/wrappers.ts @@ -0,0 +1,16 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +export * from '../generated-wrappers/balance_threshold_filter'; +export * from '../generated-wrappers/dummy_erc20_token'; +export * from '../generated-wrappers/dummy_erc721_token'; +export * from '../generated-wrappers/dutch_auction'; +export * from '../generated-wrappers/erc20_proxy'; +export * from '../generated-wrappers/erc721_proxy'; +export * from '../generated-wrappers/exchange'; +export * from '../generated-wrappers/exchange_wrapper'; +export * from '../generated-wrappers/order_matcher'; +export * from '../generated-wrappers/order_validator'; +export * from '../generated-wrappers/weth9'; diff --git a/contracts/extensions/src/wrappers/index.ts b/contracts/extensions/src/wrappers/index.ts deleted file mode 100644 index eed198524..000000000 --- a/contracts/extensions/src/wrappers/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from '../../generated-wrappers/balance_threshold_filter'; -export * from '../../generated-wrappers/dutch_auction'; -export * from '../../generated-wrappers/order_matcher'; -export * from '../../generated-wrappers/order_validator'; diff --git a/contracts/extensions/test/balance_threshold_filter.ts b/contracts/extensions/test/balance_threshold_filter.ts index c79a72f5a..34eb319de 100644 --- a/contracts/extensions/test/balance_threshold_filter.ts +++ b/contracts/extensions/test/balance_threshold_filter.ts @@ -1,3 +1,4 @@ +import { ExchangeWrapper } from '@0x/contracts-exchange'; import { BlockchainLifecycle } from '@0x/dev-utils'; import { assetDataUtils } from '@0x/order-utils'; import { Order, RevertReason, SignedOrder } from '@0x/types'; @@ -9,7 +10,6 @@ import * as _ from 'lodash'; import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; import { DummyERC20TokenContract } from '@0x/contracts-erc20'; -import { artifacts as exchangeArtifacts, ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange'; import { chaiSetup, constants, @@ -24,7 +24,7 @@ import { web3Wrapper, } from '@0x/contracts-test-utils'; -import { artifacts, BalanceThresholdFilterContract, BalanceThresholdWrapper } from '../src'; +import { artifacts, BalanceThresholdFilterContract, BalanceThresholdWrapper, ExchangeContract } from '../src'; chaiSetup.configure(); const expect = chai.expect; @@ -127,7 +127,7 @@ describe(ContractName.BalanceThresholdFilter, () => { await erc20Wrapper.setBalancesAndAllowancesAsync(); // Deploy Exchange contract exchangeInstance = await ExchangeContract.deployFrom0xArtifactAsync( - exchangeArtifacts.Exchange, + artifacts.Exchange, provider, txDefaults, zrxAssetData, diff --git a/contracts/extensions/test/dutch_auction.ts b/contracts/extensions/test/dutch_auction.ts index 34ff25c3d..efe813ffc 100644 --- a/contracts/extensions/test/dutch_auction.ts +++ b/contracts/extensions/test/dutch_auction.ts @@ -1,8 +1,6 @@ import { DutchAuctionWrapper } from '@0x/contract-wrappers'; import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; -import { artifacts as erc20Artifacts, DummyERC20TokenContract, WETH9Contract } from '@0x/contracts-erc20'; -import { DummyERC721TokenContract } from '@0x/contracts-erc721'; -import { artifacts as exchangeArtifacts, ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange'; +import { ExchangeWrapper } from '@0x/contracts-exchange'; import { chaiSetup, constants, @@ -23,7 +21,15 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import * as chai from 'chai'; import * as _ from 'lodash'; -import { artifacts, DutchAuctionContract, DutchAuctionTestWrapper } from '../src'; +import { + artifacts, + DummyERC20TokenContract, + DummyERC721TokenContract, + DutchAuctionContract, + DutchAuctionTestWrapper, + ExchangeContract, + WETH9Contract, +} from '../src'; chaiSetup.configure(); const expect = chai.expect; @@ -82,12 +88,12 @@ describe(ContractName.DutchAuction, () => { const erc721Balances = await erc721Wrapper.getBalancesAsync(); erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address]; - wethContract = await WETH9Contract.deployFrom0xArtifactAsync(erc20Artifacts.WETH9, provider, txDefaults); + wethContract = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults); erc20Wrapper.addDummyTokenContract(wethContract as any); const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address); const exchangeInstance = await ExchangeContract.deployFrom0xArtifactAsync( - exchangeArtifacts.Exchange, + artifacts.Exchange, provider, txDefaults, zrxAssetData, diff --git a/contracts/extensions/test/order_matcher.ts b/contracts/extensions/test/order_matcher.ts index 0b2f9ddbb..d726de8e0 100644 --- a/contracts/extensions/test/order_matcher.ts +++ b/contracts/extensions/test/order_matcher.ts @@ -1,17 +1,5 @@ -import { - artifacts as proxyArtifacts, - ERC20ProxyContract, - ERC20Wrapper, - ERC721ProxyContract, -} from '@0x/contracts-asset-proxy'; -import { artifacts as erc20Artifacts, DummyERC20TokenContract } from '@0x/contracts-erc20'; -import { artifacts as erc721Artifacts, DummyERC721TokenContract } from '@0x/contracts-erc721'; -import { - artifacts as exchangeArtifacts, - ExchangeContract, - ExchangeFillEventArgs, - ExchangeWrapper, -} from '@0x/contracts-exchange'; +import { ERC20Wrapper } from '@0x/contracts-asset-proxy'; +import { ExchangeWrapper } from '@0x/contracts-exchange'; import { chaiSetup, constants, @@ -34,7 +22,16 @@ import * as chai from 'chai'; import { LogWithDecodedArgs } from 'ethereum-types'; import * as _ from 'lodash'; -import { artifacts, OrderMatcherContract } from '../src'; +import { + artifacts, + DummyERC20TokenContract, + DummyERC721TokenContract, + ERC20ProxyContract, + ERC721ProxyContract, + ExchangeContract, + ExchangeFillEventArgs, + OrderMatcherContract, +} from '../src'; const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); chaiSetup.configure(); @@ -104,14 +101,10 @@ describe('OrderMatcher', () => { erc20Proxy = await erc20Wrapper.deployProxyAsync(); await erc20Wrapper.setBalancesAndAllowancesAsync(); // Deploy ERC721 proxy - erc721Proxy = await ERC721ProxyContract.deployFrom0xArtifactAsync( - proxyArtifacts.ERC721Proxy, - provider, - txDefaults, - ); + erc721Proxy = await ERC721ProxyContract.deployFrom0xArtifactAsync(artifacts.ERC721Proxy, provider, txDefaults); // Depoy exchange exchange = await ExchangeContract.deployFrom0xArtifactAsync( - exchangeArtifacts.Exchange, + artifacts.Exchange, provider, txDefaults, assetDataUtils.encodeERC20AssetData(zrxToken.address), @@ -200,7 +193,7 @@ describe('OrderMatcher', () => { describe('constructor', () => { it('should revert if assetProxy is unregistered', async () => { const exchangeInstance = await ExchangeContract.deployFrom0xArtifactAsync( - exchangeArtifacts.Exchange, + artifacts.Exchange, provider, txDefaults, constants.NULL_BYTES, @@ -454,7 +447,7 @@ describe('OrderMatcher', () => { signedOrderLeft.signature, signedOrderRight.signature, ); - const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc20Artifacts, ...exchangeArtifacts }); + const logDecoder = new LogDecoder(web3Wrapper, artifacts); const txReceipt = await logDecoder.getTxWithDecodedLogsAsync( await web3Wrapper.sendTransactionAsync({ data, @@ -492,7 +485,7 @@ describe('OrderMatcher', () => { signedOrderLeft.signature, signedOrderRight.signature, ); - const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc20Artifacts, ...exchangeArtifacts }); + const logDecoder = new LogDecoder(web3Wrapper, artifacts); const txReceipt = await logDecoder.getTxWithDecodedLogsAsync( await web3Wrapper.sendTransactionAsync({ data, @@ -729,7 +722,7 @@ describe('OrderMatcher', () => { }); it('should allow owner to withdraw ERC721 tokens', async () => { const erc721Token = await DummyERC721TokenContract.deployFrom0xArtifactAsync( - erc721Artifacts.DummyERC721Token, + artifacts.DummyERC721Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, @@ -774,7 +767,7 @@ describe('OrderMatcher', () => { }); it('should be able to approve an ERC721 token by passing in allowance = 1', async () => { const erc721Token = await DummyERC721TokenContract.deployFrom0xArtifactAsync( - erc721Artifacts.DummyERC721Token, + artifacts.DummyERC721Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, @@ -791,7 +784,7 @@ describe('OrderMatcher', () => { }); it('should be able to approve an ERC721 token by passing in allowance > 1', async () => { const erc721Token = await DummyERC721TokenContract.deployFrom0xArtifactAsync( - erc721Artifacts.DummyERC721Token, + artifacts.DummyERC721Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, diff --git a/contracts/extensions/test/order_validator.ts b/contracts/extensions/test/order_validator.ts index 88dae14fb..ec31cafbc 100644 --- a/contracts/extensions/test/order_validator.ts +++ b/contracts/extensions/test/order_validator.ts @@ -1,7 +1,5 @@ -import { ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, ERC721Wrapper } from '@0x/contracts-asset-proxy'; -import { DummyERC20TokenContract } from '@0x/contracts-erc20'; -import { DummyERC721TokenContract } from '@0x/contracts-erc721'; -import { artifacts as exchangeArtifacts, ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange'; +import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; +import { ExchangeWrapper } from '@0x/contracts-exchange'; import { chaiSetup, constants, @@ -18,7 +16,15 @@ import { BigNumber } from '@0x/utils'; import * as chai from 'chai'; import * as _ from 'lodash'; -import { artifacts, OrderValidatorContract } from '../src'; +import { + artifacts, + DummyERC20TokenContract, + DummyERC721TokenContract, + ERC20ProxyContract, + ERC721ProxyContract, + ExchangeContract, + OrderValidatorContract, +} from '../src'; chaiSetup.configure(); const expect = chai.expect; @@ -74,7 +80,7 @@ describe('OrderValidator', () => { const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address); exchange = await ExchangeContract.deployFrom0xArtifactAsync( - exchangeArtifacts.Exchange, + artifacts.Exchange, provider, txDefaults, zrxAssetData, diff --git a/contracts/extensions/test/utils/balance_threshold_wrapper.ts b/contracts/extensions/test/utils/balance_threshold_wrapper.ts index 3178d992e..ab59c5688 100644 --- a/contracts/extensions/test/utils/balance_threshold_wrapper.ts +++ b/contracts/extensions/test/utils/balance_threshold_wrapper.ts @@ -1,6 +1,3 @@ -import { artifacts as erc20Artifacts } from '@0x/contracts-erc20'; -import { artifacts as erc721Artifacts } from '@0x/contracts-erc721'; -import { artifacts as exchangeArtifacts, ExchangeContract } from '@0x/contracts-exchange'; import { FillResults, formatters, @@ -15,8 +12,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; -import { BalanceThresholdFilterContract } from '../../generated-wrappers/balance_threshold_filter'; -import { artifacts } from '../../src/artifacts'; +import { artifacts, BalanceThresholdFilterContract, ExchangeContract } from '../../src'; export class BalanceThresholdWrapper { private readonly _balanceThresholdFilter: BalanceThresholdFilterContract; @@ -34,12 +30,7 @@ export class BalanceThresholdWrapper { this._exchange = exchangeContract; this._signerTransactionFactory = signerTransactionFactory; this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, { - ...artifacts, - ...erc20Artifacts, - ...erc721Artifacts, - ...exchangeArtifacts, - }); + this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts); } public async fillOrderAsync( signedOrder: SignedOrder, @@ -227,7 +218,7 @@ export class BalanceThresholdWrapper { from: string, ): Promise<TransactionReceiptWithDecodedLogs> { const params = orderUtils.createMatchOrders(signedOrderLeft, signedOrderRight); - const data = await this._exchange.matchOrders.getABIEncodedTransactionData( + const data = this._exchange.matchOrders.getABIEncodedTransactionData( params.left, params.right, params.leftSignature, diff --git a/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts b/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts index 5899ffcac..06cdc21d5 100644 --- a/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts +++ b/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts @@ -1,6 +1,3 @@ -import { artifacts as erc20Artifacts } from '@0x/contracts-erc20'; -import { artifacts as erc721Artifacts } from '@0x/contracts-erc721'; -import { artifacts as exchangeArtifacts } from '@0x/contracts-exchange'; import { LogDecoder } from '@0x/contracts-test-utils'; import { DutchAuctionDetails, SignedOrder } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; @@ -18,12 +15,7 @@ export class DutchAuctionTestWrapper { constructor(contractInstance: DutchAuctionContract, provider: Provider) { this._dutchAuctionContract = contractInstance; this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, { - ...artifacts, - ...erc20Artifacts, - ...erc721Artifacts, - ...exchangeArtifacts, - }); + this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts); } /** * Matches the buy and sell orders at an amount given the following: the current block time, the auction diff --git a/contracts/extensions/tsconfig.json b/contracts/extensions/tsconfig.json index 0c06c6902..b424bfa04 100644 --- a/contracts/extensions/tsconfig.json +++ b/contracts/extensions/tsconfig.json @@ -1,16 +1,19 @@ { "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib", - "rootDir": ".", - "resolveJsonModule": true - }, + "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ - "./generated-artifacts/BalanceThresholdFilter.json", - "./generated-artifacts/DutchAuction.json", - "./generated-artifacts/OrderMatcher.json", - "./generated-artifacts/OrderValidator.json" + "generated-artifacts/BalanceThresholdFilter.json", + "generated-artifacts/DummyERC20Token.json", + "generated-artifacts/DummyERC721Token.json", + "generated-artifacts/DutchAuction.json", + "generated-artifacts/ERC20Proxy.json", + "generated-artifacts/ERC721Proxy.json", + "generated-artifacts/Exchange.json", + "generated-artifacts/ExchangeWrapper.json", + "generated-artifacts/OrderMatcher.json", + "generated-artifacts/OrderValidator.json", + "generated-artifacts/WETH9.json" ], "exclude": ["./deploy/solc/solc_bin"] } diff --git a/contracts/multisig/CHANGELOG.json b/contracts/multisig/CHANGELOG.json index 0fd8833c9..0c1b52f2f 100644 --- a/contracts/multisig/CHANGELOG.json +++ b/contracts/multisig/CHANGELOG.json @@ -1,14 +1,28 @@ [ { - "version": "3.0.0", + "version": "2.0.3", "changes": [ { - "note": "Add AssetProxyOwner contract", - "pr": 1539 - }, + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "version": "2.0.2", + "changes": [ { - "note": "Rename multisig directory to src", - "pr": 1539 + "note": "Fake publish to enable pinning" + } + ], + "timestamp": 1549504360 + }, + { + "timestamp": 1549452781, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" } ] }, @@ -18,8 +32,17 @@ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 + }, + { + "note": "Add AssetProxyOwner contract", + "pr": 1539 + }, + { + "note": "Rename multisig directory to src", + "pr": 1539 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547747677, diff --git a/contracts/multisig/CHANGELOG.md b/contracts/multisig/CHANGELOG.md index 59d0804da..7c7b0ae4a 100644 --- a/contracts/multisig/CHANGELOG.md +++ b/contracts/multisig/CHANGELOG.md @@ -5,6 +5,24 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.2 - _February 7, 2019_ + + * Fake publish to enable pinning + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + * Add AssetProxyOwner contract (#1539) + * Rename multisig directory to src (#1539) + ## v1.0.6 - _January 17, 2019_ * Dependencies updated diff --git a/contracts/multisig/compiler.json b/contracts/multisig/compiler.json index ae3905238..336a9ed7b 100644 --- a/contracts/multisig/compiler.json +++ b/contracts/multisig/compiler.json @@ -3,10 +3,7 @@ "contractsDir": "./contracts", "useDockerisedSolc": true, "compilerSettings": { - "optimizer": { - "enabled": true, - "runs": 1000000 - }, + "optimizer": { "enabled": true, "runs": 1000000 }, "outputSelection": { "*": { "*": [ @@ -20,10 +17,11 @@ } }, "contracts": [ - "AssetProxyOwner", - "MultiSigWallet", - "MultiSigWalletWithTimeLock", - "TestAssetProxyOwner", - "TestRejectEther" + "@0x/contracts-asset-proxy/contracts/src/MixinAuthorizable.sol", + "src/AssetProxyOwner.sol", + "src/MultiSigWallet.sol", + "src/MultiSigWalletWithTimeLock.sol", + "test/TestAssetProxyOwner.sol", + "test/TestRejectEther.sol" ] } diff --git a/contracts/multisig/package.json b/contracts/multisig/package.json index cbdd96fd8..f3774c409 100644 --- a/contracts/multisig/package.json +++ b/contracts/multisig/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-multisig", - "version": "1.0.6", + "version": "2.0.3", "engines": { "node": ">=6.12" }, @@ -29,10 +29,12 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", + "contracts:gen": "contracts-gen", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "generated-artifacts/@(AssetProxyOwner|MultiSigWallet|MultiSigWalletWithTimeLock|TestAssetProxyOwner|TestRejectEther).json" + "abis": "./generated-artifacts/@(AssetProxyOwner|MixinAuthorizable|MultiSigWallet|MultiSigWalletWithTimeLock|TestAssetProxyOwner|TestRejectEther).json", + "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { "type": "git", @@ -44,11 +46,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/multisig/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.22", - "@0x/contracts-test-utils": "^2.0.1", - "@0x/dev-utils": "^1.0.24", - "@0x/sol-compiler": "^2.0.2", - "@0x/tslint-config": "^2.0.2", + "@0x/abi-gen": "^2.0.2", + "@0x/contracts-gen": "^1.0.1", + "@0x/contracts-test-utils": "^3.0.3", + "@0x/dev-utils": "^2.0.2", + "@0x/sol-compiler": "^3.0.2", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "@types/node": "*", "chai": "^4.0.1", @@ -64,15 +67,15 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/base-contract": "^3.0.13", - "@0x/contracts-asset-proxy": "1.0.0", - "@0x/contracts-erc20": "1.0.0", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "ethereum-types": "^1.1.6", - "lodash": "^4.17.5" + "@0x/base-contract": "^4.0.2", + "@0x/contracts-asset-proxy": "1.0.2", + "@0x/contracts-erc20": "1.0.2", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "ethereum-types": "^2.0.0", + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/contracts/multisig/src/artifacts.ts b/contracts/multisig/src/artifacts.ts new file mode 100644 index 000000000..7d8a85884 --- /dev/null +++ b/contracts/multisig/src/artifacts.ts @@ -0,0 +1,21 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +import { ContractArtifact } from 'ethereum-types'; + +import * as AssetProxyOwner from '../generated-artifacts/AssetProxyOwner.json'; +import * as MixinAuthorizable from '../generated-artifacts/MixinAuthorizable.json'; +import * as MultiSigWallet from '../generated-artifacts/MultiSigWallet.json'; +import * as MultiSigWalletWithTimeLock from '../generated-artifacts/MultiSigWalletWithTimeLock.json'; +import * as TestAssetProxyOwner from '../generated-artifacts/TestAssetProxyOwner.json'; +import * as TestRejectEther from '../generated-artifacts/TestRejectEther.json'; +export const artifacts = { + MixinAuthorizable: MixinAuthorizable as ContractArtifact, + AssetProxyOwner: AssetProxyOwner as ContractArtifact, + MultiSigWallet: MultiSigWallet as ContractArtifact, + MultiSigWalletWithTimeLock: MultiSigWalletWithTimeLock as ContractArtifact, + TestAssetProxyOwner: TestAssetProxyOwner as ContractArtifact, + TestRejectEther: TestRejectEther as ContractArtifact, +}; diff --git a/contracts/multisig/src/artifacts/index.ts b/contracts/multisig/src/artifacts/index.ts deleted file mode 100644 index 326d79000..000000000 --- a/contracts/multisig/src/artifacts/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ContractArtifact } from 'ethereum-types'; - -import * as AssetProxyOwner from '../../generated-artifacts/AssetProxyOwner.json'; -import * as MultiSigWallet from '../../generated-artifacts/MultiSigWallet.json'; -import * as MultiSigWalletWithTimeLock from '../../generated-artifacts/MultiSigWalletWithTimeLock.json'; -import * as TestAssetProxyOwner from '../../generated-artifacts/TestAssetProxyOwner.json'; -import * as TestRejectEther from '../../generated-artifacts/TestRejectEther.json'; - -export const artifacts = { - AssetProxyOwner: AssetProxyOwner as ContractArtifact, - MultiSigWallet: MultiSigWallet as ContractArtifact, - MultiSigWalletWithTimeLock: MultiSigWalletWithTimeLock as ContractArtifact, - TestAssetProxyOwner: TestAssetProxyOwner as ContractArtifact, - TestRejectEther: TestRejectEther as ContractArtifact, -}; diff --git a/contracts/multisig/src/wrappers.ts b/contracts/multisig/src/wrappers.ts new file mode 100644 index 000000000..81aab39da --- /dev/null +++ b/contracts/multisig/src/wrappers.ts @@ -0,0 +1,11 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +export * from '../generated-wrappers/asset_proxy_owner'; +export * from '../generated-wrappers/mixin_authorizable'; +export * from '../generated-wrappers/multi_sig_wallet'; +export * from '../generated-wrappers/multi_sig_wallet_with_time_lock'; +export * from '../generated-wrappers/test_asset_proxy_owner'; +export * from '../generated-wrappers/test_reject_ether'; diff --git a/contracts/multisig/src/wrappers/index.ts b/contracts/multisig/src/wrappers/index.ts deleted file mode 100644 index 43ab25704..000000000 --- a/contracts/multisig/src/wrappers/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from '../../generated-wrappers/asset_proxy_owner'; -export * from '../../generated-wrappers/multi_sig_wallet'; -export * from '../../generated-wrappers/multi_sig_wallet_with_time_lock'; -export * from '../../generated-wrappers/test_asset_proxy_owner'; -export * from '../../generated-wrappers/test_reject_ether'; diff --git a/contracts/multisig/test/asset_proxy_owner.ts b/contracts/multisig/test/asset_proxy_owner.ts index 62081554b..7bf4069cb 100644 --- a/contracts/multisig/test/asset_proxy_owner.ts +++ b/contracts/multisig/test/asset_proxy_owner.ts @@ -1,4 +1,3 @@ -import { artifacts as proxyArtifacts, MixinAuthorizableContract } from '@0x/contracts-asset-proxy'; import { chaiSetup, constants, @@ -26,6 +25,7 @@ import { AssetProxyOwnerExecutionFailureEventArgs, AssetProxyOwnerSubmissionEventArgs, AssetProxyOwnerWrapper, + MixinAuthorizableContract, TestAssetProxyOwnerContract, } from '../src'; @@ -58,12 +58,12 @@ describe('AssetProxyOwner', () => { notOwner = accounts[3]; const initialOwner = accounts[0]; erc20Proxy = await MixinAuthorizableContract.deployFrom0xArtifactAsync( - proxyArtifacts.MixinAuthorizable, + artifacts.MixinAuthorizable, provider, txDefaults, ); erc721Proxy = await MixinAuthorizableContract.deployFrom0xArtifactAsync( - proxyArtifacts.MixinAuthorizable, + artifacts.MixinAuthorizable, provider, txDefaults, ); diff --git a/contracts/multisig/test/utils/asset_proxy_owner_wrapper.ts b/contracts/multisig/test/utils/asset_proxy_owner_wrapper.ts index b6040d8e3..d5aaaf519 100644 --- a/contracts/multisig/test/utils/asset_proxy_owner_wrapper.ts +++ b/contracts/multisig/test/utils/asset_proxy_owner_wrapper.ts @@ -1,5 +1,3 @@ -import { artifacts as proxyArtifacts } from '@0x/contracts-asset-proxy'; -import { artifacts as erc20Artifacts } from '@0x/contracts-erc20'; import { LogDecoder } from '@0x/contracts-test-utils'; import { BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; @@ -16,7 +14,7 @@ export class AssetProxyOwnerWrapper { constructor(assetproxyOwnerContract: AssetProxyOwnerContract, provider: Provider) { this._assetProxyOwner = assetproxyOwnerContract; this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...erc20Artifacts, ...proxyArtifacts }); + this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts); } public async submitTransactionAsync( destination: string, diff --git a/contracts/multisig/tsconfig.json b/contracts/multisig/tsconfig.json index ad1707e43..094f89413 100644 --- a/contracts/multisig/tsconfig.json +++ b/contracts/multisig/tsconfig.json @@ -1,17 +1,14 @@ { "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib", - "rootDir": ".", - "resolveJsonModule": true - }, + "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ - "./generated-artifacts/AssetProxyOwner.json", - "./generated-artifacts/MultiSigWallet.json", - "./generated-artifacts/MultiSigWalletWithTimeLock.json", - "./generated-artifacts/TestAssetProxyOwner.json", - "./generated-artifacts/TestRejectEther.json" + "generated-artifacts/AssetProxyOwner.json", + "generated-artifacts/MixinAuthorizable.json", + "generated-artifacts/MultiSigWallet.json", + "generated-artifacts/MultiSigWalletWithTimeLock.json", + "generated-artifacts/TestAssetProxyOwner.json", + "generated-artifacts/TestRejectEther.json" ], "exclude": ["./deploy/solc/solc_bin"] } diff --git a/contracts/test-utils/CHANGELOG.json b/contracts/test-utils/CHANGELOG.json index ae1575e43..812bff732 100644 --- a/contracts/test-utils/CHANGELOG.json +++ b/contracts/test-utils/CHANGELOG.json @@ -1,12 +1,44 @@ [ { + "version": "3.0.3", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "version": "3.0.2", + "changes": [ + { + "note": "Fake publish to enable pinning" + } + ], + "timestamp": 1549504360 + }, + { + "timestamp": 1549452781, + "version": "3.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "3.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 + }, + { + "note": "Import `ZeroExTransaction` type instead of using type defined in this package", + "pr": 1576 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547747677, diff --git a/contracts/test-utils/CHANGELOG.md b/contracts/test-utils/CHANGELOG.md index 2ed0524a6..b3fc98ab6 100644 --- a/contracts/test-utils/CHANGELOG.md +++ b/contracts/test-utils/CHANGELOG.md @@ -5,6 +5,23 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v3.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v3.0.2 - _February 7, 2019_ + + * Fake publish to enable pinning + +## v3.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v3.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + * Import `ZeroExTransaction` type instead of using type defined in this package (#1576) + ## v2.0.1 - _January 17, 2019_ * Dependencies updated diff --git a/contracts/test-utils/package.json b/contracts/test-utils/package.json index 262b8c7cd..b379f470a 100644 --- a/contracts/test-utils/package.json +++ b/contracts/test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-test-utils", - "version": "2.0.1", + "version": "3.0.3", "engines": { "node": ">=6.12" }, @@ -40,19 +40,19 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/abi-gen": "^1.0.22", - "@0x/dev-utils": "^1.0.24", - "@0x/order-utils": "^3.1.2", - "@0x/sol-compiler": "^2.0.2", - "@0x/sol-coverage": "^1.0.3", - "@0x/sol-profiler": "^1.0.3", - "@0x/sol-trace": "^1.0.3", - "@0x/subproviders": "^2.1.11", - "@0x/tslint-config": "^2.0.2", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "@0x/abi-gen": "^2.0.2", + "@0x/dev-utils": "^2.0.2", + "@0x/order-utils": "^6.0.1", + "@0x/sol-compiler": "^3.0.2", + "@0x/sol-coverage": "^2.0.2", + "@0x/sol-profiler": "^2.0.3", + "@0x/sol-trace": "^2.0.3", + "@0x/subproviders": "^3.0.2", + "@0x/tslint-config": "^3.0.0", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "@types/bn.js": "^4.11.0", "@types/js-combinatorics": "^0.5.29", "@types/lodash": "4.14.104", @@ -62,11 +62,11 @@ "chai-as-promised": "^7.1.0", "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "ethereumjs-util": "^5.1.1", "ethers": "~4.0.4", "js-combinatorics": "^0.5.3", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "make-promises-safe": "^1.1.0" }, "publishConfig": { diff --git a/contracts/test-utils/src/index.ts b/contracts/test-utils/src/index.ts index 7880de0bf..5ac927e47 100644 --- a/contracts/test-utils/src/index.ts +++ b/contracts/test-utils/src/index.ts @@ -31,7 +31,6 @@ export { MarketBuyOrders, MarketSellOrders, ERC721TokenIdsByOwner, - SignedTransaction, OrderStatus, AllowanceAmountScenario, AssetDataScenario, diff --git a/contracts/test-utils/src/transaction_factory.ts b/contracts/test-utils/src/transaction_factory.ts index dbab3ade4..e6cd4c23f 100644 --- a/contracts/test-utils/src/transaction_factory.ts +++ b/contracts/test-utils/src/transaction_factory.ts @@ -1,10 +1,8 @@ -import { eip712Utils, generatePseudoRandomSalt } from '@0x/order-utils'; -import { SignatureType } from '@0x/types'; -import { signTypedDataUtils } from '@0x/utils'; +import { generatePseudoRandomSalt, transactionHashUtils } from '@0x/order-utils'; +import { SignatureType, SignedZeroExTransaction } from '@0x/types'; import * as ethUtil from 'ethereumjs-util'; import { signingUtils } from './signing_utils'; -import { SignedTransaction } from './types'; export class TransactionFactory { private readonly _signerBuff: Buffer; @@ -15,23 +13,25 @@ export class TransactionFactory { this._exchangeAddress = exchangeAddress; this._signerBuff = ethUtil.privateToAddress(this._privateKey); } - public newSignedTransaction(data: string, signatureType: SignatureType = SignatureType.EthSign): SignedTransaction { + public newSignedTransaction( + data: string, + signatureType: SignatureType = SignatureType.EthSign, + ): SignedZeroExTransaction { const salt = generatePseudoRandomSalt(); const signerAddress = `0x${this._signerBuff.toString('hex')}`; - const executeTransactionData = { + const transaction = { salt, signerAddress, data, + verifyingContractAddress: this._exchangeAddress, }; - const typedData = eip712Utils.createZeroExTransactionTypedData(executeTransactionData, this._exchangeAddress); - const eip712MessageBuffer = signTypedDataUtils.generateTypedDataHash(typedData); - const signature = signingUtils.signMessage(eip712MessageBuffer, this._privateKey, signatureType); - const signedTx = { - exchangeAddress: this._exchangeAddress, + const transactionHashBuffer = transactionHashUtils.getTransactionHashBuffer(transaction); + const signature = signingUtils.signMessage(transactionHashBuffer, this._privateKey, signatureType); + const signedTransaction = { + ...transaction, signature: `0x${signature.toString('hex')}`, - ...executeTransactionData, }; - return signedTx; + return signedTransaction; } } diff --git a/contracts/test-utils/src/types.ts b/contracts/test-utils/src/types.ts index 60cb2b102..16c3a9f3d 100644 --- a/contracts/test-utils/src/types.ts +++ b/contracts/test-utils/src/types.ts @@ -107,14 +107,6 @@ export enum ContractName { BalanceThresholdFilter = 'BalanceThresholdFilter', } -export interface SignedTransaction { - exchangeAddress: string; - salt: BigNumber; - signerAddress: string; - data: string; - signature: string; -} - export interface TransferAmountsByMatchOrders { // Left Maker amountBoughtByLeftMaker: BigNumber; diff --git a/contracts/utils/CHANGELOG.json b/contracts/utils/CHANGELOG.json index 94434b803..bc887914b 100644 --- a/contracts/utils/CHANGELOG.json +++ b/contracts/utils/CHANGELOG.json @@ -1,27 +1,28 @@ [ { - "version": "3.0.0", + "version": "2.0.3", "changes": [ { - "note": "Add LibAddressArray contract", - "pr": 1539 - }, - { - "note": "Do not nest contracts in redundant directories", - "pr": 1539 - }, + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "version": "2.0.2", + "changes": [ { - "note": "Rename utils directory to src", - "pr": 1539 + "note": "Fake publish to enable pinning" } - ] + ], + "timestamp": 1549504360 }, { + "timestamp": 1549452781, "version": "2.0.1", "changes": [ { - "note": "Fix imports in `TestConstants` and `TestLibBytes` to be relative. This way they show up correctly in coverage reports", - "pr": 1535 + "note": "Dependencies updated" } ] }, @@ -31,8 +32,25 @@ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 + }, + { + "note": "Fix imports in `TestConstants` and `TestLibBytes` to be relative. This way they show up correctly in coverage reports", + "pr": 1535 + }, + { + "note": "Add LibAddressArray contract", + "pr": 1539 + }, + { + "note": "Do not nest contracts in redundant directories", + "pr": 1539 + }, + { + "note": "Rename utils directory to src", + "pr": 1539 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547747677, diff --git a/contracts/utils/CHANGELOG.md b/contracts/utils/CHANGELOG.md index 59d0804da..dd0b91a61 100644 --- a/contracts/utils/CHANGELOG.md +++ b/contracts/utils/CHANGELOG.md @@ -5,6 +5,26 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.2 - _February 7, 2019_ + + * Fake publish to enable pinning + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + * Fix imports in `TestConstants` and `TestLibBytes` to be relative. This way they show up correctly in coverage reports (#1535) + * Add LibAddressArray contract (#1539) + * Do not nest contracts in redundant directories (#1539) + * Rename utils directory to src (#1539) + ## v1.0.6 - _January 17, 2019_ * Dependencies updated diff --git a/contracts/utils/compiler.json b/contracts/utils/compiler.json index 7473ea6d1..a54f547df 100644 --- a/contracts/utils/compiler.json +++ b/contracts/utils/compiler.json @@ -3,10 +3,7 @@ "contractsDir": "./contracts", "useDockerisedSolc": true, "compilerSettings": { - "optimizer": { - "enabled": true, - "runs": 1000000 - }, + "optimizer": { "enabled": true, "runs": 1000000 }, "outputSelection": { "*": { "*": [ @@ -19,5 +16,13 @@ } } }, - "contracts": ["TestConstants", "TestLibBytes", "LibBytes", "Ownable", "IOwnable", "ReentrancyGuard", "SafeMath"] + "contracts": [ + "src/LibBytes.sol", + "src/Ownable.sol", + "src/ReentrancyGuard.sol", + "src/SafeMath.sol", + "src/interfaces/IOwnable.sol", + "test/TestConstants.sol", + "test/TestLibBytes.sol" + ] } diff --git a/contracts/utils/package.json b/contracts/utils/package.json index 33d94cc33..91abc8043 100644 --- a/contracts/utils/package.json +++ b/contracts/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-utils", - "version": "3.0.0", + "version": "2.0.3", "engines": { "node": ">=6.12" }, @@ -29,10 +29,12 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", + "contracts:gen": "contracts-gen", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "generated-artifacts/@(IOwnable|Ownable|LibBytes|ReentrancyGuard|SafeMath|TestConstants|TestLibBytes).json" + "abis": "./generated-artifacts/@(IOwnable|LibBytes|Ownable|ReentrancyGuard|SafeMath|TestConstants|TestLibBytes).json", + "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { "type": "git", @@ -44,14 +46,15 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/utils/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.22", - "@0x/contracts-test-utils": "^2.0.1", - "@0x/dev-utils": "^1.0.24", - "@0x/sol-compiler": "^2.0.2", - "@0x/tslint-config": "^2.0.2", + "@0x/abi-gen": "^2.0.2", + "@0x/contracts-gen": "^1.0.1", + "@0x/contracts-test-utils": "^3.0.3", + "@0x/dev-utils": "^2.0.2", + "@0x/sol-compiler": "^3.0.2", + "@0x/tslint-config": "^3.0.0", + "@types/bn.js": "^4.11.0", "@types/lodash": "4.14.104", "@types/node": "*", - "@types/bn.js": "^4.11.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", "chai-bignumber": "^3.0.0", @@ -65,16 +68,16 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/base-contract": "^3.0.13", - "@0x/order-utils": "^3.1.2", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "@0x/base-contract": "^4.0.2", + "@0x/order-utils": "^6.0.1", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "bn.js": "^4.11.8", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "ethereumjs-util": "^5.1.1", - "lodash": "^4.17.5" + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/contracts/utils/src/artifacts.ts b/contracts/utils/src/artifacts.ts new file mode 100644 index 000000000..15a1abedf --- /dev/null +++ b/contracts/utils/src/artifacts.ts @@ -0,0 +1,23 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +import { ContractArtifact } from 'ethereum-types'; + +import * as IOwnable from '../generated-artifacts/IOwnable.json'; +import * as LibBytes from '../generated-artifacts/LibBytes.json'; +import * as Ownable from '../generated-artifacts/Ownable.json'; +import * as ReentrancyGuard from '../generated-artifacts/ReentrancyGuard.json'; +import * as SafeMath from '../generated-artifacts/SafeMath.json'; +import * as TestConstants from '../generated-artifacts/TestConstants.json'; +import * as TestLibBytes from '../generated-artifacts/TestLibBytes.json'; +export const artifacts = { + LibBytes: LibBytes as ContractArtifact, + Ownable: Ownable as ContractArtifact, + ReentrancyGuard: ReentrancyGuard as ContractArtifact, + SafeMath: SafeMath as ContractArtifact, + IOwnable: IOwnable as ContractArtifact, + TestConstants: TestConstants as ContractArtifact, + TestLibBytes: TestLibBytes as ContractArtifact, +}; diff --git a/contracts/utils/src/artifacts/index.ts b/contracts/utils/src/artifacts/index.ts deleted file mode 100644 index a5c2b215c..000000000 --- a/contracts/utils/src/artifacts/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ContractArtifact } from 'ethereum-types'; - -import * as IOwnable from '../../generated-artifacts/IOwnable.json'; -import * as LibBytes from '../../generated-artifacts/LibBytes.json'; -import * as Ownable from '../../generated-artifacts/Ownable.json'; -import * as ReentrancyGuard from '../../generated-artifacts/ReentrancyGuard.json'; -import * as SafeMath from '../../generated-artifacts/SafeMath.json'; -import * as TestConstants from '../../generated-artifacts/TestConstants.json'; -import * as TestLibBytes from '../../generated-artifacts/TestLibBytes.json'; - -export const artifacts = { - TestConstants: TestConstants as ContractArtifact, - TestLibBytes: TestLibBytes as ContractArtifact, - IOwnable: IOwnable as ContractArtifact, - LibBytes: LibBytes as ContractArtifact, - Ownable: Ownable as ContractArtifact, - SafeMath: SafeMath as ContractArtifact, - ReentrancyGuard: ReentrancyGuard as ContractArtifact, -}; diff --git a/contracts/utils/src/wrappers.ts b/contracts/utils/src/wrappers.ts new file mode 100644 index 000000000..8748cb074 --- /dev/null +++ b/contracts/utils/src/wrappers.ts @@ -0,0 +1,12 @@ +/* + * ----------------------------------------------------------------------------- + * Warning: This file is auto-generated by contracts-gen. Don't edit manually. + * ----------------------------------------------------------------------------- + */ +export * from '../generated-wrappers/i_ownable'; +export * from '../generated-wrappers/lib_bytes'; +export * from '../generated-wrappers/ownable'; +export * from '../generated-wrappers/reentrancy_guard'; +export * from '../generated-wrappers/safe_math'; +export * from '../generated-wrappers/test_constants'; +export * from '../generated-wrappers/test_lib_bytes'; diff --git a/contracts/utils/src/wrappers/index.ts b/contracts/utils/src/wrappers/index.ts deleted file mode 100644 index 823b7fa4b..000000000 --- a/contracts/utils/src/wrappers/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '../../generated-wrappers/test_constants'; -export * from '../../generated-wrappers/test_lib_bytes'; diff --git a/contracts/utils/tsconfig.json b/contracts/utils/tsconfig.json index 68251e6b0..efd71ff93 100644 --- a/contracts/utils/tsconfig.json +++ b/contracts/utils/tsconfig.json @@ -1,19 +1,15 @@ { "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib", - "rootDir": ".", - "resolveJsonModule": true - }, + "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ - "./generated-artifacts/TestConstants.json", - "./generated-artifacts/TestLibBytes.json", - "./generated-artifacts/IOwnable.json", - "./generated-artifacts/Ownable.json", - "./generated-artifacts/LibBytes.json", - "./generated-artifacts/SafeMath.json", - "./generated-artifacts/ReentrancyGuard.json" + "generated-artifacts/IOwnable.json", + "generated-artifacts/LibBytes.json", + "generated-artifacts/Ownable.json", + "generated-artifacts/ReentrancyGuard.json", + "generated-artifacts/SafeMath.json", + "generated-artifacts/TestConstants.json", + "generated-artifacts/TestLibBytes.json" ], "exclude": ["./deploy/solc/solc_bin"] } diff --git a/package.json b/package.json index 62b4c1c36..af32a3c8f 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "contracts/*" ], "scripts": { + "deps_versions:ci": "node ./packages/monorepo-scripts/lib/deps_versions.js", "ganache": "ganache-cli -p 8545 --gasLimit 10000000 --networkId 50 -m \"${npm_package_config_mnemonic}\"", "prettier": "prettier --write '**/*.{ts,tsx,json,md}' --config .prettierrc", "prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}' --config .prettierrc", @@ -31,6 +32,9 @@ "build:ts": "tsc -b", "watch:ts": "tsc -b -w", "clean": "wsrun clean $PKG --fast-exit -r --parallel --exclude-missing", + "contracts:gen": "wsrun contracts:gen $PKG --fast-exit -r --parallel --exclude-missing", + "contracts:compile": "wsrun compile $PKG --fast-exit -r --stages --exclude-missing", + "contracts:watch": "wsrun watch $PKG --parallel --exclude-missing", "remove_node_modules": "lerna clean --yes; rm -rf node_modules", "rebuild": "run-s clean build", "rebuild:no_website": "run-s clean build:no_website", @@ -44,13 +48,15 @@ "config": { "contractsPackages": "@0x/contracts-asset-proxy @0x/contracts-erc20 @0x/contracts-erc721 @0x/contracts-exchange @0x/contracts-exchange-forwarder @0x/contracts-exchange-libs @0x/contracts-extensions @0x/contracts-multisig @0x/contracts-test-utils @0x/contracts-utils", "mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic", - "packagesWithDocPages": "0x.js connect json-schemas subproviders web3-wrapper contract-wrappers order-utils order-watcher sol-compiler sol-coverage sol-profiler sol-trace ethereum-types asset-buyer migrations" + "packagesWithDocPages": "0x.js connect json-schemas subproviders web3-wrapper contract-wrappers order-utils order-watcher sol-compiler sol-coverage sol-profiler sol-trace ethereum-types asset-buyer migrations", + "ignoreDependencyVersions": "@types/styled-components", + "ignoreDependencyVersionsForPackage": "website instant dev-tools-pages" }, "bundlewatch": { "files": [ { "path": "packages/0x.js/_bundles/index.min.js", - "maxSize": "700kB" + "maxSize": "800kB" }, { "path": "packages/instant/umd/instant.js", @@ -78,7 +84,7 @@ "lcov-result-merger": "^3.0.0", "lerna": "^3.0.0-beta.25", "npm-run-all": "^4.1.2", - "prettier": "^1.15.3", + "prettier": "^1.16.3", "source-map-support": "^0.5.6", "typescript": "3.0.1", "wsrun": "^2.2.0" diff --git a/packages/0x.js/CHANGELOG.json b/packages/0x.js/CHANGELOG.json index 20778f8bb..69381d7a0 100644 --- a/packages/0x.js/CHANGELOG.json +++ b/packages/0x.js/CHANGELOG.json @@ -1,12 +1,40 @@ [ { + "version": "4.0.3", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549504360, + "version": "4.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549452781, + "version": "4.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "4.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547747677, diff --git a/packages/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md index b0279f097..7c14fb586 100644 --- a/packages/0x.js/CHANGELOG.md +++ b/packages/0x.js/CHANGELOG.md @@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v4.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v4.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v4.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v4.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v3.0.3 - _January 17, 2019_ * Dependencies updated diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 64054d288..b02176811 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -1,6 +1,6 @@ { "name": "0x.js", - "version": "3.0.3", + "version": "4.0.3", "engines": { "node": ">=6.12" }, @@ -24,7 +24,7 @@ "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "clean": "shx rm -rf _bundles lib test_temp src/generated_contract_wrappers generated_docs", - "build:umd:prod": "NODE_ENV=production webpack", + "build:umd:prod": "NODE_ENV=production node --max_old_space_size=8192 ../../node_modules/.bin/webpack --mode production", "build:commonjs": "tsc -b", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, @@ -42,11 +42,11 @@ }, "license": "Apache-2.0", "devDependencies": { - "@0x/abi-gen-wrappers": "^2.2.0", - "@0x/contract-addresses": "^2.2.0", - "@0x/dev-utils": "^1.0.24", - "@0x/migrations": "^2.4.0", - "@0x/tslint-config": "^2.0.2", + "@0x/abi-gen-wrappers": "^3.0.2", + "@0x/contract-addresses": "^2.2.1", + "@0x/dev-utils": "^2.0.2", + "@0x/migrations": "^3.0.3", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/node": "*", @@ -72,20 +72,20 @@ "webpack": "^4.20.2" }, "dependencies": { - "@0x/assert": "^1.0.23", - "@0x/base-contract": "^3.0.13", - "@0x/contract-wrappers": "^5.0.1", - "@0x/order-utils": "^3.1.2", - "@0x/order-watcher": "^2.4.3", - "@0x/subproviders": "^2.1.11", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "@0x/assert": "^2.0.2", + "@0x/base-contract": "^4.0.2", + "@0x/contract-wrappers": "^7.0.2", + "@0x/order-utils": "^6.0.1", + "@0x/order-watcher": "^3.0.3", + "@0x/subproviders": "^3.0.2", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "@types/web3-provider-engine": "^14.0.0", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "ethers": "~4.0.4", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "web3-provider-engine": "14.0.6" }, "publishConfig": { diff --git a/packages/abi-gen-templates/CHANGELOG.json b/packages/abi-gen-templates/CHANGELOG.json index 7d444d0ca..94afa8db1 100644 --- a/packages/abi-gen-templates/CHANGELOG.json +++ b/packages/abi-gen-templates/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/abi-gen-templates/CHANGELOG.md b/packages/abi-gen-templates/CHANGELOG.md index 5dd6d03e0..cdaee6264 100644 --- a/packages/abi-gen-templates/CHANGELOG.md +++ b/packages/abi-gen-templates/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.0.2 - _January 15, 2019_ * Dependencies updated diff --git a/packages/abi-gen-templates/package.json b/packages/abi-gen-templates/package.json index af66aeba0..dfa9248c7 100644 --- a/packages/abi-gen-templates/package.json +++ b/packages/abi-gen-templates/package.json @@ -1,6 +1,6 @@ { "name": "@0x/abi-gen-templates", - "version": "1.0.2", + "version": "2.0.0", "engines": { "node": ">=6.12" }, diff --git a/packages/abi-gen-wrappers/CHANGELOG.json b/packages/abi-gen-wrappers/CHANGELOG.json index c604302b5..a7793c5d5 100644 --- a/packages/abi-gen-wrappers/CHANGELOG.json +++ b/packages/abi-gen-wrappers/CHANGELOG.json @@ -1,12 +1,31 @@ [ { + "version": "3.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "3.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "3.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "version": "2.2.0", diff --git a/packages/abi-gen-wrappers/CHANGELOG.md b/packages/abi-gen-wrappers/CHANGELOG.md index 294f39439..93e11736c 100644 --- a/packages/abi-gen-wrappers/CHANGELOG.md +++ b/packages/abi-gen-wrappers/CHANGELOG.md @@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v3.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v3.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v3.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v2.2.0 - _January 15, 2019_ * Added `MultiAssetProxy` (#1503) diff --git a/packages/abi-gen-wrappers/package.json b/packages/abi-gen-wrappers/package.json index 842ac024a..c9682e28f 100644 --- a/packages/abi-gen-wrappers/package.json +++ b/packages/abi-gen-wrappers/package.json @@ -1,6 +1,6 @@ { "name": "@0x/abi-gen-wrappers", - "version": "2.2.0", + "version": "3.0.2", "engines": { "node": ">=6.12" }, @@ -30,19 +30,19 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-wrappers/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.22", - "@0x/abi-gen-templates": "^1.0.2", - "@0x/tslint-config": "^2.0.2", - "@0x/types": "^1.5.2", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "ethereum-types": "^1.1.6", + "@0x/abi-gen": "^2.0.2", + "@0x/abi-gen-templates": "^2.0.0", + "@0x/tslint-config": "^3.0.0", + "@0x/types": "^2.0.2", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "ethereum-types": "^2.0.0", "ethers": "~4.0.4", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "shx": "^0.2.2" }, "dependencies": { - "@0x/base-contract": "^3.0.13" + "@0x/base-contract": "^4.0.2" }, "publishConfig": { "access": "public" diff --git a/packages/abi-gen/CHANGELOG.json b/packages/abi-gen/CHANGELOG.json index 173617b65..d7770c06d 100644 --- a/packages/abi-gen/CHANGELOG.json +++ b/packages/abi-gen/CHANGELOG.json @@ -1,12 +1,31 @@ [ { + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/abi-gen/CHANGELOG.md b/packages/abi-gen/CHANGELOG.md index af74218b8..65c914cc9 100644 --- a/packages/abi-gen/CHANGELOG.md +++ b/packages/abi-gen/CHANGELOG.md @@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.0.22 - _January 15, 2019_ * Dependencies updated diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index 7f968893c..d07e0a580 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -1,6 +1,6 @@ { "name": "@0x/abi-gen", - "version": "1.0.22", + "version": "2.0.2", "engines": { "node": ">=6.12" }, @@ -31,13 +31,13 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md", "dependencies": { - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", "chalk": "^2.3.0", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "glob": "^7.1.2", "handlebars": "^4.0.11", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "mkdirp": "^0.5.1", "sleep": "^5.1.1", "tmp": "^0.0.33", @@ -45,18 +45,18 @@ "yargs": "^10.0.3" }, "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/glob": "5.0.35", "@types/handlebars": "^4.0.36", - "@types/mkdirp": "^0.5.1", + "@types/mkdirp": "^0.5.2", "@types/node": "*", "@types/sleep": "^0.0.7", "@types/tmp": "^0.0.33", - "@types/yargs": "^10.0.0", - "chai": "^4.1.2", + "@types/yargs": "^11.0.0", + "chai": "^4.0.1", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", - "mocha": "^5.2.0", + "mocha": "^4.1.0", "npm-run-all": "^4.1.2", "shx": "^0.2.2", "tslint": "5.11.0", diff --git a/packages/assert/CHANGELOG.json b/packages/assert/CHANGELOG.json index 278b7dfa1..e2231a676 100644 --- a/packages/assert/CHANGELOG.json +++ b/packages/assert/CHANGELOG.json @@ -1,12 +1,31 @@ [ { + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/assert/CHANGELOG.md b/packages/assert/CHANGELOG.md index 5a4af165a..682115497 100644 --- a/packages/assert/CHANGELOG.md +++ b/packages/assert/CHANGELOG.md @@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.0.23 - _January 15, 2019_ * Dependencies updated diff --git a/packages/assert/package.json b/packages/assert/package.json index 38481d6f0..551414de3 100644 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -1,6 +1,6 @@ { "name": "@0x/assert", - "version": "1.0.23", + "version": "2.0.2", "engines": { "node": ">=6.12" }, @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/assert/README.md", "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/valid-url": "^1.0.2", @@ -44,10 +44,10 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/json-schemas": "^2.1.7", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "lodash": "^4.17.5", + "@0x/json-schemas": "^3.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "lodash": "^4.17.11", "valid-url": "^1.0.9" }, "publishConfig": { diff --git a/packages/asset-buyer/CHANGELOG.json b/packages/asset-buyer/CHANGELOG.json index 2de603de0..80b02f2c6 100644 --- a/packages/asset-buyer/CHANGELOG.json +++ b/packages/asset-buyer/CHANGELOG.json @@ -1,12 +1,40 @@ [ { + "version": "5.0.3", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549504360, + "version": "5.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549452781, + "version": "5.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "5.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "version": "4.1.0", diff --git a/packages/asset-buyer/CHANGELOG.md b/packages/asset-buyer/CHANGELOG.md index f2a3d2236..c5977e3e4 100644 --- a/packages/asset-buyer/CHANGELOG.md +++ b/packages/asset-buyer/CHANGELOG.md @@ -5,6 +5,26 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v5.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v5.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v5.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v5.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + +## v4.1.0 - _Invalid date_ + + * Adds new public method getLiquidityForAssetDataAsync, and exposes getOrdersAndFillableAmountsAsync as public method (#1512) + ## v4.0.2 - _January 17, 2019_ * Dependencies updated diff --git a/packages/asset-buyer/package.json b/packages/asset-buyer/package.json index 0f79ac06a..391a5d688 100644 --- a/packages/asset-buyer/package.json +++ b/packages/asset-buyer/package.json @@ -1,6 +1,6 @@ { "name": "@0x/asset-buyer", - "version": "4.0.2", + "version": "5.0.3", "engines": { "node": ">=6.12" }, @@ -36,22 +36,22 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/asset-buyer/README.md", "dependencies": { - "@0x/assert": "^1.0.23", - "@0x/connect": "^3.0.13", - "@0x/contract-wrappers": "^5.0.1", - "@0x/json-schemas": "^2.1.7", - "@0x/order-utils": "^3.1.2", - "@0x/subproviders": "^2.1.11", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "ethereum-types": "^1.1.6", - "lodash": "^4.17.5" + "@0x/assert": "^2.0.2", + "@0x/connect": "^4.0.3", + "@0x/contract-wrappers": "^7.0.2", + "@0x/json-schemas": "^3.0.2", + "@0x/order-utils": "^6.0.1", + "@0x/subproviders": "^3.0.2", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "ethereum-types": "^2.0.0", + "lodash": "^4.17.11" }, "devDependencies": { - "@0x/tslint-config": "^2.0.2", - "@types/lodash": "^4.14.116", + "@0x/tslint-config": "^3.0.0", + "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/node": "*", "chai": "^4.0.1", diff --git a/packages/base-contract/CHANGELOG.json b/packages/base-contract/CHANGELOG.json index 63b1fe8f7..d3cf76696 100644 --- a/packages/base-contract/CHANGELOG.json +++ b/packages/base-contract/CHANGELOG.json @@ -1,12 +1,31 @@ [ { + "version": "4.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "4.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "4.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/base-contract/CHANGELOG.md b/packages/base-contract/CHANGELOG.md index 975a56fd4..68de790bc 100644 --- a/packages/base-contract/CHANGELOG.md +++ b/packages/base-contract/CHANGELOG.md @@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v4.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v4.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v4.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v3.0.13 - _January 15, 2019_ * Dependencies updated diff --git a/packages/base-contract/package.json b/packages/base-contract/package.json index db09b16a1..d9970b7f4 100644 --- a/packages/base-contract/package.json +++ b/packages/base-contract/package.json @@ -1,6 +1,6 @@ { "name": "@0x/base-contract", - "version": "3.0.13", + "version": "4.0.2", "engines": { "node": ">=6.12" }, @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/base-contract/README.md", "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "chai": "^4.0.1", "make-promises-safe": "^1.1.0", @@ -40,12 +40,12 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "ethereum-types": "^1.1.6", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "ethereum-types": "^2.0.0", "ethers": "~4.0.4", - "lodash": "^4.17.5" + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index c2f16d96a..d7e557146 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -1,12 +1,40 @@ [ { + "version": "4.0.3", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549504360, + "version": "4.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549452781, + "version": "4.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "4.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/connect/CHANGELOG.md b/packages/connect/CHANGELOG.md index 7556aae72..3094d2251 100644 --- a/packages/connect/CHANGELOG.md +++ b/packages/connect/CHANGELOG.md @@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v4.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v4.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v4.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v4.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v3.0.13 - _January 15, 2019_ * Dependencies updated diff --git a/packages/connect/package.json b/packages/connect/package.json index 15a4c12f1..a9648594c 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -1,6 +1,6 @@ { "name": "@0x/connect", - "version": "3.0.13", + "version": "4.0.3", "engines": { "node": ">=6.12" }, @@ -44,24 +44,24 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md", "dependencies": { - "@0x/assert": "^1.0.23", - "@0x/json-schemas": "^2.1.7", - "@0x/order-utils": "^3.1.2", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "lodash": "^4.17.5", - "query-string": "^5.0.1", + "@0x/assert": "^2.0.2", + "@0x/json-schemas": "^3.0.2", + "@0x/order-utils": "^6.0.1", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "lodash": "^4.17.11", + "query-string": "^6.0.0", "sinon": "^4.0.0", "uuid": "^3.3.2", "websocket": "^1.0.25" }, "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/fetch-mock": "^6.0.3", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", - "@types/query-string": "^5.0.1", + "@types/query-string": "^5.1.0", "@types/sinon": "^2.2.2", "@types/uuid": "^3.4.3", "@types/websocket": "^0.0.39", diff --git a/packages/contract-addresses/CHANGELOG.json b/packages/contract-addresses/CHANGELOG.json index 8800f2f73..c420df69d 100644 --- a/packages/contract-addresses/CHANGELOG.json +++ b/packages/contract-addresses/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "timestamp": 1549373905, + "version": "2.2.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.2.0", "changes": [ { diff --git a/packages/contract-addresses/CHANGELOG.md b/packages/contract-addresses/CHANGELOG.md index 1f3d187a4..deab2b398 100644 --- a/packages/contract-addresses/CHANGELOG.md +++ b/packages/contract-addresses/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.2.1 - _February 5, 2019_ + + * Dependencies updated + ## v2.2.0 - _January 15, 2019_ * Added migration for `MultiAssetProxy` contract (#1503) diff --git a/packages/contract-addresses/package.json b/packages/contract-addresses/package.json index 260322081..84cc052c9 100644 --- a/packages/contract-addresses/package.json +++ b/packages/contract-addresses/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contract-addresses", - "version": "2.2.0", + "version": "2.2.1", "engines": { "node": ">=6.12" }, @@ -29,7 +29,7 @@ "typescript": "3.0.1" }, "dependencies": { - "lodash": "^4.17.5" + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 9cea720c8..73c8e6070 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -1,12 +1,39 @@ [ { - "version": "6.0.1", + "version": "7.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549504360, + "version": "7.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "version": "7.0.0", "changes": [ { "note": "Fix OrderValidatorWrapper constructor to use the correct address", "pr": 1568 + }, + { + "note": "Use new `ZeroExTransaction` interface", + "pr": 1576 + }, + { + "note": "Rename `getTransactionHex` to `getTransactionHashHex`", + "pr": 1576 } - ] + ], + "timestamp": 1549452781 }, { "version": "6.0.0", diff --git a/packages/contract-wrappers/CHANGELOG.md b/packages/contract-wrappers/CHANGELOG.md index 28cbf2ec6..2e174e767 100644 --- a/packages/contract-wrappers/CHANGELOG.md +++ b/packages/contract-wrappers/CHANGELOG.md @@ -5,6 +5,24 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v7.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v7.0.1 - _February 7, 2019_ + + * Dependencies updated + +## v7.0.0 - _February 6, 2019_ + + * Fix OrderValidatorWrapper constructor to use the correct address (#1568) + * Use new `ZeroExTransaction` interface (#1576) + * Rename `getTransactionHex` to `getTransactionHashHex` (#1576) + +## v6.0.0 - _Invalid date_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v5.0.1 - _January 17, 2019_ * Dependencies updated diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index cc7dc1a3e..7ea270eb5 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contract-wrappers", - "version": "5.0.1", + "version": "7.0.2", "description": "Smart TS wrappers for 0x smart contracts", "keywords": [ "0xproject", @@ -37,15 +37,15 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0x/dev-utils": "^1.0.24", - "@0x/migrations": "^2.4.0", - "@0x/subproviders": "^2.1.11", - "@0x/tslint-config": "^2.0.2", + "@0x/dev-utils": "^2.0.2", + "@0x/migrations": "^3.0.3", + "@0x/subproviders": "^3.0.2", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/node": "*", "@types/sinon": "^2.2.2", - "@types/uuid": "^3.4.2", + "@types/uuid": "^3.4.3", "@types/web3-provider-engine": "^14.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", @@ -65,26 +65,26 @@ "web3-provider-engine": "14.0.6" }, "dependencies": { - "@0x/abi-gen-wrappers": "^2.2.0", - "@0x/assert": "^1.0.23", - "@0x/contract-addresses": "^2.2.0", + "@0x/abi-gen-wrappers": "^3.0.2", + "@0x/assert": "^2.0.2", + "@0x/contract-addresses": "^2.2.1", "@0x/contract-artifacts": "^1.3.0", - "@0x/contracts-test-utils": "^2.0.1", - "@0x/fill-scenarios": "^1.1.2", - "@0x/json-schemas": "^2.1.7", - "@0x/order-utils": "^3.1.2", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "ethereum-types": "^1.1.6", + "@0x/contracts-test-utils": "^3.0.3", + "@0x/fill-scenarios": "^2.0.3", + "@0x/json-schemas": "^3.0.2", + "@0x/order-utils": "^6.0.1", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "ethereum-types": "^2.0.0", "ethereumjs-abi": "0.6.5", "ethereumjs-blockstream": "6.0.0", "ethereumjs-util": "^5.1.1", "ethers": "~4.0.4", "js-sha3": "^0.7.0", - "lodash": "^4.17.5", - "uuid": "^3.1.0" + "lodash": "^4.17.11", + "uuid": "^3.3.2" }, "publishConfig": { "access": "public" diff --git a/packages/contract-wrappers/src/utils/transaction_encoder.ts b/packages/contract-wrappers/src/utils/transaction_encoder.ts index 0cf08a8fe..307487a9b 100644 --- a/packages/contract-wrappers/src/utils/transaction_encoder.ts +++ b/packages/contract-wrappers/src/utils/transaction_encoder.ts @@ -1,9 +1,9 @@ import { ExchangeContract } from '@0x/abi-gen-wrappers'; import { schemas } from '@0x/json-schemas'; -import { eip712Utils } from '@0x/order-utils'; +import { transactionHashUtils } from '@0x/order-utils'; import { Order, SignedOrder } from '@0x/types'; -import { BigNumber, signTypedDataUtils } from '@0x/utils'; +import { BigNumber } from '@0x/utils'; import _ = require('lodash'); import { assert } from './assert'; @@ -19,23 +19,22 @@ export class TransactionEncoder { this._exchangeInstance = exchangeInstance; } /** - * Encodes the transaction data for use with the Exchange contract. + * Hashes the transaction data for use with the Exchange contract. * @param data The ABI Encoded 0x Exchange method. I.e fillOrder * @param salt A random value to provide uniqueness and prevent replay attacks. * @param signerAddress The address which will sign this transaction. - * @return An unsigned hex encoded transaction for use in 0x Exchange executeTransaction. + * @return The hash of the 0x transaction. */ - public getTransactionHex(data: string, salt: BigNumber, signerAddress: string): string { + public getTransactionHashHex(data: string, salt: BigNumber, signerAddress: string): string { const exchangeAddress = this._getExchangeContract().address; - const executeTransactionData = { + const transaction = { + verifyingContractAddress: exchangeAddress, salt, signerAddress, data, }; - const typedData = eip712Utils.createZeroExTransactionTypedData(executeTransactionData, exchangeAddress); - const eip712MessageBuffer = signTypedDataUtils.generateTypedDataHash(typedData); - const messageHex = `0x${eip712MessageBuffer.toString('hex')}`; - return messageHex; + const hashHex = transactionHashUtils.getTransactionHashHex(transaction); + return hashHex; } /** * Encodes a fillOrder transaction. diff --git a/packages/contract-wrappers/test/exchange_wrapper_test.ts b/packages/contract-wrappers/test/exchange_wrapper_test.ts index a1d60dc6e..acd30495b 100644 --- a/packages/contract-wrappers/test/exchange_wrapper_test.ts +++ b/packages/contract-wrappers/test/exchange_wrapper_test.ts @@ -1,6 +1,6 @@ import { BlockchainLifecycle, callbackErrorReporter } from '@0x/dev-utils'; import { FillScenarios } from '@0x/fill-scenarios'; -import { assetDataUtils, orderHashUtils } from '@0x/order-utils'; +import { assetDataUtils, orderHashUtils, signatureUtils } from '@0x/order-utils'; import { DoneCallback, RevertReason, SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; import * as chai from 'chai'; @@ -368,6 +368,23 @@ describe('ExchangeWrapper', () => { await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); isPreSigned = await contractWrappers.exchange.isPreSignedAsync(hash, signerAddress); expect(isPreSigned).to.be.true(); + + const preSignedSignature = '0x06'; + const isValidSignature = await contractWrappers.exchange.isValidSignatureAsync( + hash, + signerAddress, + preSignedSignature, + ); + expect(isValidSignature).to.be.true(); + + // Test our TS implementation of signature validation + const isValidSignatureInTs = await signatureUtils.isValidSignatureAsync( + provider, + hash, + preSignedSignature, + signerAddress, + ); + expect(isValidSignatureInTs).to.be.true(); }); }); describe('#getVersionAsync', () => { diff --git a/packages/contract-wrappers/test/transaction_encoder_test.ts b/packages/contract-wrappers/test/transaction_encoder_test.ts index ef9eb2cf3..a996b9f08 100644 --- a/packages/contract-wrappers/test/transaction_encoder_test.ts +++ b/packages/contract-wrappers/test/transaction_encoder_test.ts @@ -83,8 +83,8 @@ describe('TransactionEncoder', () => { signerAddress: string = takerAddress, ): Promise<void> => { const salt = generatePseudoRandomSalt(); - const encodedTransaction = encoder.getTransactionHex(data, salt, signerAddress); - const signature = await signatureUtils.ecSignHashAsync(provider, encodedTransaction, signerAddress); + const transactionHash = encoder.getTransactionHashHex(data, salt, signerAddress); + const signature = await signatureUtils.ecSignHashAsync(provider, transactionHash, signerAddress); txHash = await contractWrappers.exchange.executeTransactionAsync( salt, signerAddress, diff --git a/packages/contracts-gen/.npmignore b/packages/contracts-gen/.npmignore new file mode 100644 index 000000000..d645458f6 --- /dev/null +++ b/packages/contracts-gen/.npmignore @@ -0,0 +1,6 @@ +.* +yarn-error.log +/src/ +/scripts/ +tsconfig.json +/lib/monorepo_scripts/ diff --git a/packages/contracts-gen/CHANGELOG.json b/packages/contracts-gen/CHANGELOG.json new file mode 100644 index 000000000..f1a523c30 --- /dev/null +++ b/packages/contracts-gen/CHANGELOG.json @@ -0,0 +1,11 @@ +[ + { + "version": "1.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + } +] diff --git a/packages/contracts-gen/CHANGELOG.md b/packages/contracts-gen/CHANGELOG.md new file mode 100644 index 000000000..e046c6a0a --- /dev/null +++ b/packages/contracts-gen/CHANGELOG.md @@ -0,0 +1,10 @@ +<!-- +changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly. +Edit the package's CHANGELOG.json file only. +--> + +CHANGELOG + +## v1.0.1 - _February 7, 2019_ + + * Dependencies updated diff --git a/packages/contracts-gen/README.md b/packages/contracts-gen/README.md new file mode 100644 index 000000000..feaf9e65f --- /dev/null +++ b/packages/contracts-gen/README.md @@ -0,0 +1,76 @@ +# Contracts Gen + +This package allows you to generate boilerplate TypeScript code and configs for smart contracts packages. + +## Installation + +`yarn add -g @0x/contracts-gen` + +## Usage + +Run it from within your smart contracts packages. + +```bash +contracts-gen +``` + +You should run this tool after each time you move your contracts around to regenerate boilerplate code and configs. + +## What can it generate + +This tool does the following: + +- Reads your `compiler.json`. Specifically the list of smart contracts. +- Creates `wrapper.ts` file which exports all contract wrappers. +- Creates `artifacts.ts` file which exports all contract artifacts. +- Generates list of JSON artifact files in `tsconfig.json` +- Generates a glob for abi-gen in `package.json` + +On top of that - if your `compiler.json` has contracts referenced just by name - it will resolve the name to relative path and put it there. +It also sorts all the lists in it's output leading to smaller and cleaner diffs. + +## Contributing + +We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository. + +Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. + +### Install dependencies + +If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: + +```bash +yarn config set workspaces-experimental true +``` + +Then install dependencies + +```bash +yarn install +``` + +### Build + +To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory: + +```bash +PKG=@0x/contracts-gen yarn build +``` + +Or continuously rebuild on change: + +```bash +PKG=@0x/contracts-gen yarn watch +``` + +### Clean + +```bash +yarn clean +``` + +### Lint + +```bash +yarn lint +``` diff --git a/packages/contracts-gen/bin/contracts-gen.js b/packages/contracts-gen/bin/contracts-gen.js new file mode 100755 index 000000000..ec6ab4db6 --- /dev/null +++ b/packages/contracts-gen/bin/contracts-gen.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('../lib/src/contracts-gen.js'); diff --git a/packages/contracts-gen/package.json b/packages/contracts-gen/package.json new file mode 100644 index 000000000..fdf22ab45 --- /dev/null +++ b/packages/contracts-gen/package.json @@ -0,0 +1,49 @@ +{ + "name": "@0x/contracts-gen", + "version": "1.0.1", + "engines": { + "node": ">=6.12" + }, + "description": "Generates boilerplate code for smart contracts packages", + "main": "lib/src/index.js", + "types": "lib/src/index.d.ts", + "scripts": { + "lint": "tslint --format stylish --project .", + "clean": "shx rm -rf lib", + "build": "tsc -b", + "build:ci": "yarn build" + }, + "bin": { + "contracts-gen": "bin/contracts-gen.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/0xProject/0x-monorepo.git" + }, + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/0xProject/0x-monorepo/issues" + }, + "homepage": "https://github.com/0xProject/0x-monorepo/packages/contracts-gen/README.md", + "dependencies": { + "@0x/sol-resolver": "^2.0.2", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "ethereum-types": "^2.0.0", + "lodash": "^4.17.11", + "prettier": "^1.16.3", + "to-snake-case": "^1.0.0" + }, + "devDependencies": { + "@0x/tslint-config": "^3.0.0", + "@types/node": "*", + "@types/prettier": "^1.15.2", + "shx": "^0.2.2", + "tslint": "5.11.0", + "typescript": "3.0.1" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/contracts-gen/src/contracts-gen.ts b/packages/contracts-gen/src/contracts-gen.ts new file mode 100644 index 000000000..0160a8204 --- /dev/null +++ b/packages/contracts-gen/src/contracts-gen.ts @@ -0,0 +1,175 @@ +#!/usr/bin/env node + +import { NameResolver } from '@0x/sol-resolver'; +import { PackageJSON } from '@0x/types'; +import { logUtils } from '@0x/utils'; +import { CompilerOptions } from 'ethereum-types'; +import * as fs from 'fs'; +import * as _ from 'lodash'; +import * as path from 'path'; +import * as prettier from 'prettier'; +import toSnakeCase = require('to-snake-case'); + +const SOLIDITY_EXTENSION = '.sol'; +const DEFAULT_ARTIFACTS_DIR = 'artifacts'; +const DEFAULT_CONTRACTS_DIR = 'contracts'; +const DEFAULT_WRAPPERS_DIR = 'generated-wrappers'; +const AUTO_GENERATED_BANNER = `/* +* ----------------------------------------------------------------------------- +* Warning: This file is auto-generated by contracts-gen. Don't edit manually. +* ----------------------------------------------------------------------------- +*/`; +const AUTO_GENERATED_BANNER_FOR_LISTS = `This list is auto-generated by contracts-gen. Don't edit manually.`; + +(async () => { + const packageDir = process.cwd(); + const compilerJSON = readJSONFile<CompilerOptions>('compiler.json'); + const contracts = compilerJSON.contracts; + const contractsDir = compilerJSON.contractsDir || DEFAULT_CONTRACTS_DIR; + const artifactsDir = compilerJSON.artifactsDir || DEFAULT_ARTIFACTS_DIR; + const wrappersDir = DEFAULT_WRAPPERS_DIR; + if (!_.isArray(contracts)) { + throw new Error('Unable to run the generator bacause contracts key in compiler.json is not of type array'); + } + const prettierConfig = await prettier.resolveConfig(packageDir); + generateCompilerJSONContractsList(contracts, contractsDir, prettierConfig); + generateArtifactsTs(contracts, artifactsDir, prettierConfig); + generateWrappersTs(contracts, wrappersDir, prettierConfig); + generateTsConfigJSONFilesList(contracts, artifactsDir, prettierConfig); + generatePackageJSONABIConfig(contracts, artifactsDir, prettierConfig); + process.exit(0); +})().catch(err => { + logUtils.log(err); + process.exit(1); +}); + +function generateCompilerJSONContractsList( + contracts: string[], + contractsDir: string, + prettierConfig: prettier.Options | null, +): void { + const COMPILER_JSON_FILE_PATH = 'compiler.json'; + const compilerJSON = readJSONFile<CompilerOptions>(COMPILER_JSON_FILE_PATH); + compilerJSON.contracts = _.map(contracts, contract => { + if (contract.endsWith(SOLIDITY_EXTENSION)) { + // If it's already a relative path - NO-OP. + return contract; + } else { + // If it's just a contract name - resolve it and rewrite. + return new NameResolver(contractsDir).resolve(contract).path; + } + }); + compilerJSON.contracts = _.sortBy(compilerJSON.contracts); + const compilerJSONString = JSON.stringify(compilerJSON); + const formattedCompilerJSON = prettier.format(compilerJSONString, { + ...prettierConfig, + filepath: COMPILER_JSON_FILE_PATH, + }); + fs.writeFileSync(COMPILER_JSON_FILE_PATH, formattedCompilerJSON); +} + +function generateArtifactsTs(contracts: string[], artifactsDir: string, prettierConfig: prettier.Options | null): void { + const imports = _.map(contracts, contract => { + const contractName = path.basename(contract, SOLIDITY_EXTENSION); + const importPath = path.join('..', artifactsDir, `${contractName}.json`); + return `import * as ${contractName} from '${importPath}';`; + }); + const sortedImports = _.sortBy(imports); + const artifacts = _.map(contracts, contract => { + const contractName = path.basename(contract, SOLIDITY_EXTENSION); + if (contractName === 'ZRXToken') { + // HACK(albrow): "as any" hack still required here because ZRXToken does not + // conform to the v2 artifact type. + return `${contractName}: (${contractName} as any) as ContractArtifact,`; + } else { + return `${contractName}: ${contractName} as ContractArtifact,`; + } + }); + const artifactsTs = ` + ${AUTO_GENERATED_BANNER} + import { ContractArtifact } from 'ethereum-types'; + + ${sortedImports.join('\n')} + export const artifacts = {${artifacts.join('\n')}}; + `; + const ARTIFACTS_TS_FILE_PATH = 'src/artifacts.ts'; + const formattedArtifactsTs = prettier.format(artifactsTs, { ...prettierConfig, filepath: ARTIFACTS_TS_FILE_PATH }); + fs.writeFileSync(ARTIFACTS_TS_FILE_PATH, formattedArtifactsTs); +} + +function generateWrappersTs(contracts: string[], wrappersDir: string, prettierConfig: prettier.Options | null): void { + const imports = _.map(contracts, contract => { + const contractName = path.basename(contract, SOLIDITY_EXTENSION); + const outputFileName = makeOutputFileName(contractName); + const exportPath = path.join('..', wrappersDir, outputFileName); + return `export * from '${exportPath}';`; + }); + const sortedImports = _.sortBy(imports); + const wrappersTs = ` + ${AUTO_GENERATED_BANNER} + ${sortedImports.join('\n')} + `; + const WRAPPERS_TS_FILE_PATH = 'src/wrappers.ts'; + const formattedArtifactsTs = prettier.format(wrappersTs, { ...prettierConfig, filepath: WRAPPERS_TS_FILE_PATH }); + fs.writeFileSync(WRAPPERS_TS_FILE_PATH, formattedArtifactsTs); +} + +function generateTsConfigJSONFilesList( + contracts: string[], + artifactsDir: string, + prettierConfig: prettier.Options | null, +): void { + const TS_CONFIG_FILE_PATH = 'tsconfig.json'; + const tsConfig = readJSONFile<any>(TS_CONFIG_FILE_PATH); + tsConfig.files = _.map(contracts, contract => { + const contractName = path.basename(contract, SOLIDITY_EXTENSION); + const artifactPath = path.join(artifactsDir, `${contractName}.json`); + return artifactPath; + }); + tsConfig.files = _.sortBy(tsConfig.files); + const tsConfigString = JSON.stringify(tsConfig); + const formattedTsConfig = prettier.format(tsConfigString, { ...prettierConfig, filepath: TS_CONFIG_FILE_PATH }); + fs.writeFileSync(TS_CONFIG_FILE_PATH, formattedTsConfig); +} + +function generatePackageJSONABIConfig( + contracts: string[], + artifactsDir: string, + prettierConfig: prettier.Options | null, +): void { + let packageJSON = readJSONFile<PackageJSON>('package.json'); + const contractNames = _.map(contracts, contract => { + const contractName = path.basename(contract, SOLIDITY_EXTENSION); + return contractName; + }); + const sortedContractNames = _.sortBy(contractNames); + packageJSON = { + ...packageJSON, + config: { + ...packageJSON.config, + 'abis:comment': AUTO_GENERATED_BANNER_FOR_LISTS, + abis: `${artifactsDir}/@(${sortedContractNames.join('|')}).json`, + }, + }; + const PACKAGE_JSON_FILE_PATH = 'package.json'; + const packageJSONString = JSON.stringify(packageJSON); + const formattedPackageJSON = prettier.format(packageJSONString, { + ...prettierConfig, + filepath: PACKAGE_JSON_FILE_PATH, + }); + fs.writeFileSync(PACKAGE_JSON_FILE_PATH, formattedPackageJSON); +} + +function makeOutputFileName(name: string): string { + let fileName = toSnakeCase(name); + // HACK: Snake case doesn't make a lot of sense for abbreviated names but we can't reliably detect abbreviations + // so we special-case the abbreviations we use. + fileName = fileName.replace('z_r_x', 'zrx').replace('e_r_c', 'erc'); + return fileName; +} + +function readJSONFile<T>(filePath: string): T { + const JSONString = fs.readFileSync(filePath, 'utf8'); + const parsed: T = JSON.parse(JSONString); + return parsed; +} diff --git a/packages/contracts-gen/src/index.ts b/packages/contracts-gen/src/index.ts new file mode 100644 index 000000000..c5f4b01f1 --- /dev/null +++ b/packages/contracts-gen/src/index.ts @@ -0,0 +1,6 @@ +/** + * This module is a CLI tool. As soon as you run it - it starts doing stuff. + * At the same time - our installation tests assume that you can import package without causing side effects. + * That's why our main entry point it empty. No side effects. But our secondary entry point - contracts-gen.ts is a CLI tool and starts running as soon as you import/run it. + */ +export {}; diff --git a/packages/contracts-gen/tsconfig.json b/packages/contracts-gen/tsconfig.json new file mode 100644 index 000000000..233008d61 --- /dev/null +++ b/packages/contracts-gen/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig", + "compilerOptions": { + "outDir": "lib", + "rootDir": "." + }, + "include": ["./src/**/*"] +} diff --git a/packages/contracts-gen/tslint.json b/packages/contracts-gen/tslint.json new file mode 100644 index 000000000..dd9053357 --- /dev/null +++ b/packages/contracts-gen/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": ["@0x/tslint-config"] +} diff --git a/packages/dev-tools-pages/assets/index.html b/packages/dev-tools-pages/assets/index.html index 5ab1a45f1..da7778343 100644 --- a/packages/dev-tools-pages/assets/index.html +++ b/packages/dev-tools-pages/assets/index.html @@ -1,14 +1,70 @@ <!DOCTYPE html> <html lang="en"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta http-equiv="X-UA-Compatible" content="ie=edge"> - <link rel="preload" href="/fonts/MaisonNeue-Book-subset.woff2" as="font" type="font/woff2" crossorigin> - <link rel="preload" href="/fonts/MaisonNeue-Bold-subset.woff2" as="font" type="font/woff2" crossorigin> - <title><%= htmlWebpackPlugin.options.title %></title> -</head> -<body> - <div id="app"></div> -</body> -</html>
\ No newline at end of file + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <meta http-equiv="X-UA-Compatible" content="ie=edge" /> + <link rel="preload" href="/fonts/MaisonNeue-Book-subset.woff2" as="font" type="font/woff2" crossorigin /> + <link rel="preload" href="/fonts/MaisonNeue-Bold-subset.woff2" as="font" type="font/woff2" crossorigin /> + <title><%= htmlWebpackPlugin.options.title %></title> + </head> + <body> + <!-- Heap SDK --> + <script type="text/javascript"> + if ('<%= htmlWebpackPlugin.options.environment %>' !== 'development') { + (window.heap = window.heap || []), + (heap.load = function(e, t) { + (window.heap.appid = e), (window.heap.config = t = t || {}); + var r = t.forceSSL || 'https:' === document.location.protocol, + a = document.createElement('script'); + (a.type = 'text/javascript'), + (a.async = !0), + (a.src = (r ? 'https:' : 'http:') + '//cdn.heapanalytics.com/js/heap-' + e + '.js'); + var n = document.getElementsByTagName('script')[0]; + n.parentNode.insertBefore(a, n); + for ( + var o = function(e) { + return function() { + heap.push([e].concat(Array.prototype.slice.call(arguments, 0))); + }; + }, + p = [ + 'addEventProperties', + 'addUserProperties', + 'clearEventProperties', + 'identify', + 'resetIdentity', + 'removeEventProperty', + 'setEventProperties', + 'track', + 'unsetEventProperty', + ], + c = 0; + c < p.length; + c++ + ) + heap[p[c]] = o(p[c]); + }); + heap.load('<%= htmlWebpackPlugin.options.heapAnalyticsId %>'); + } + </script> + <!-- Global site tag (gtag.js) - Google Analytics --> + <script + async + src="https://www.googletagmanager.com/gtag/js?id=<%= htmlWebpackPlugin.options.googleAnalyticsId %>" + ></script> + <script> + if ('<%= htmlWebpackPlugin.options.environment %>' !== 'development') { + window.dataLayer = window.dataLayer || []; + function gtag() { + dataLayer.push(arguments); + } + gtag('js', new Date()); + + gtag('config', '<%= htmlWebpackPlugin.options.googleAnalyticsId %>'); + } + </script> + <!-- End Google Analytics --> + <div id="app"></div> + </body> +</html> diff --git a/packages/dev-tools-pages/package.json b/packages/dev-tools-pages/package.json index feab72856..80ff16a44 100644 --- a/packages/dev-tools-pages/package.json +++ b/packages/dev-tools-pages/package.json @@ -1,6 +1,6 @@ { "name": "@0x/dev-tools-pages", - "version": "0.0.14", + "version": "0.0.18", "engines": { "node": ">=6.12" }, @@ -26,7 +26,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@0x/react-shared": "^1.1.2", + "@0x/react-shared": "^2.0.3", "basscss": "^8.0.3", "bowser": "^1.9.3", "highlight.js": "^9.13.1", @@ -46,7 +46,7 @@ "@types/node": "*", "@types/react": "^16.4.2", "@types/react-dom": "^16.0.7", - "@types/react-loadable": "^5.4.1", + "@types/react-loadable": "^5.4.2", "@types/react-lottie": "^1.2.0", "@types/react-router-dom": "^4.0.4", "@types/react-tabs": "^2.3.0", diff --git a/packages/dev-tools-pages/pages.js b/packages/dev-tools-pages/pages.js index 488c2ecd7..62a022603 100644 --- a/packages/dev-tools-pages/pages.js +++ b/packages/dev-tools-pages/pages.js @@ -15,6 +15,8 @@ const pages = [ 'twitter:site': '@0xproject', 'twitter:image': '/images/og-compiler.png', }, + googleAnalyticsId: 'UA-98720122-4', + heapAnalyticsId: '3772819976', }, { title: 'sol-coverage', @@ -32,6 +34,8 @@ const pages = [ 'twitter:site': '@0xproject', 'twitter:image': '/images/og-cov.png', }, + googleAnalyticsId: 'UA-98720122-3', + heapAnalyticsId: '3386971671', }, { title: 'sol-profiler', @@ -49,6 +53,8 @@ const pages = [ 'twitter:site': '@0xproject', 'twitter:image': '/images/og-profiler.png', }, + googleAnalyticsId: 'UA-98720122-5', + heapAnalyticsId: '3776009943', }, { title: 'sol-trace', @@ -66,6 +72,8 @@ const pages = [ 'twitter:site': '@0xproject', 'twitter:image': '/images/og-trace.png', }, + googleAnalyticsId: 'UA-98720122-6', + heapAnalyticsId: '4172106583', }, ]; diff --git a/packages/dev-tools-pages/webpack.config.js b/packages/dev-tools-pages/webpack.config.js index ef2f98cf2..ae70fd83e 100644 --- a/packages/dev-tools-pages/webpack.config.js +++ b/packages/dev-tools-pages/webpack.config.js @@ -82,7 +82,10 @@ const config = { module.exports = (_env, argv) => { let plugins = [ new CleanWebpackPlugin('public'), - ...pages.map(p => new HtmlWebpackPlugin(p)), + ...pages.map(p => { + p.environment = argv.mode; + return new HtmlWebpackPlugin(p); + }), new CopyWebpackPlugin([ { from: 'assets/crawl.html', to: 'index.html' }, { from: 'assets/fonts', to: 'fonts' }, diff --git a/packages/dev-utils/CHANGELOG.json b/packages/dev-utils/CHANGELOG.json index d05e41d2d..ce6cfede5 100644 --- a/packages/dev-utils/CHANGELOG.json +++ b/packages/dev-utils/CHANGELOG.json @@ -1,12 +1,31 @@ [ { + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/dev-utils/CHANGELOG.md b/packages/dev-utils/CHANGELOG.md index 958fded86..41e2ca88a 100644 --- a/packages/dev-utils/CHANGELOG.md +++ b/packages/dev-utils/CHANGELOG.md @@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.0.24 - _January 15, 2019_ * Dependencies updated diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 4ab1d6439..89298f4db 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0x/dev-utils", - "version": "1.0.24", + "version": "2.0.2", "engines": { "node": ">=6.12" }, @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/dev-utils/README.md", "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "make-promises-safe": "^1.1.0", @@ -41,15 +41,15 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/subproviders": "^2.1.11", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "@0x/subproviders": "^3.0.2", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "@types/web3-provider-engine": "^14.0.0", "chai": "^4.0.1", - "ethereum-types": "^1.1.6", - "lodash": "^4.17.5" + "ethereum-types": "^2.0.0", + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/packages/ethereum-types/CHANGELOG.json b/packages/ethereum-types/CHANGELOG.json index c106d43a9..4a75b4c9a 100644 --- a/packages/ethereum-types/CHANGELOG.json +++ b/packages/ethereum-types/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/ethereum-types/CHANGELOG.md b/packages/ethereum-types/CHANGELOG.md index c1857495d..45a82478e 100644 --- a/packages/ethereum-types/CHANGELOG.md +++ b/packages/ethereum-types/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.1.6 - _January 15, 2019_ * Dependencies updated diff --git a/packages/ethereum-types/package.json b/packages/ethereum-types/package.json index bd3748058..5f3ea2189 100644 --- a/packages/ethereum-types/package.json +++ b/packages/ethereum-types/package.json @@ -1,6 +1,6 @@ { "name": "ethereum-types", - "version": "1.1.6", + "version": "2.0.0", "engines": { "node": ">=6.12" }, @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/ethereum-types/README.md", "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", "tslint": "5.11.0", diff --git a/packages/fill-scenarios/CHANGELOG.json b/packages/fill-scenarios/CHANGELOG.json index beffdd097..8615d137b 100644 --- a/packages/fill-scenarios/CHANGELOG.json +++ b/packages/fill-scenarios/CHANGELOG.json @@ -1,12 +1,40 @@ [ { + "version": "2.0.3", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549504360, + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549452781, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/fill-scenarios/CHANGELOG.md b/packages/fill-scenarios/CHANGELOG.md index 7df8b5ab3..e87652e7d 100644 --- a/packages/fill-scenarios/CHANGELOG.md +++ b/packages/fill-scenarios/CHANGELOG.md @@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.1.2 - _January 15, 2019_ * Dependencies updated diff --git a/packages/fill-scenarios/package.json b/packages/fill-scenarios/package.json index d882aba76..523bc07c1 100644 --- a/packages/fill-scenarios/package.json +++ b/packages/fill-scenarios/package.json @@ -1,6 +1,6 @@ { "name": "@0x/fill-scenarios", - "version": "1.1.2", + "version": "2.0.3", "description": "0x order fill scenario generator", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -20,7 +20,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/fill-scenarios/README.md", "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/lodash": "4.14.104", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", @@ -28,17 +28,17 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/abi-gen-wrappers": "^2.2.0", - "@0x/base-contract": "^3.0.13", + "@0x/abi-gen-wrappers": "^3.0.2", + "@0x/base-contract": "^4.0.2", "@0x/contract-artifacts": "^1.3.0", - "@0x/order-utils": "^3.1.2", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "ethereum-types": "^1.1.6", + "@0x/order-utils": "^6.0.1", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "ethereum-types": "^2.0.0", "ethers": "~4.0.4", - "lodash": "^4.17.5" + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/packages/instant/package.json b/packages/instant/package.json index f7e15a3e0..0fe45e963 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -1,6 +1,6 @@ { "name": "@0x/instant", - "version": "1.0.8", + "version": "1.0.12", "engines": { "node": ">=6.12" }, @@ -42,50 +42,50 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/instant/README.md", "dependencies": { - "@0x/assert": "^1.0.23", - "@0x/asset-buyer": "^4.0.2", - "@0x/json-schemas": "^2.1.7", - "@0x/order-utils": "^3.1.2", - "@0x/subproviders": "^2.1.11", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "@0x/assert": "^2.0.2", + "@0x/asset-buyer": "^5.0.3", + "@0x/json-schemas": "^3.0.2", + "@0x/order-utils": "^6.0.1", + "@0x/subproviders": "^3.0.2", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "babel-runtime": "^6.26.0", "bowser": "^1.9.4", "copy-to-clipboard": "^3.0.8", - "ethereum-types": "^1.1.6", - "lodash": "^4.17.5", - "polished": "^2.2.0", + "ethereum-types": "^2.0.0", + "lodash": "^4.17.11", + "polished": "^1.9.2", "react": "^16.5.2", "react-dom": "^16.5.2", "react-redux": "^5.0.7", "redux": "^4.0.0", "redux-devtools-extension": "^2.13.5", "rollbar": "^2.5.0", - "styled-components": "^4.0.2", + "styled-components": "^4.1.1", "ts-optchain": "^0.1.1" }, "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@static/discharge": "https://github.com/0xProject/discharge.git", "@types/enzyme": "^3.1.14", "@types/enzyme-adapter-react-16": "^1.0.3", "@types/jest": "^23.3.5", - "@types/lodash": "^4.14.116", + "@types/lodash": "4.14.104", "@types/node": "*", - "@types/react": "^16.4.16", - "@types/react-dom": "^16.0.8", + "@types/react": "16.4.16", + "@types/react-dom": "16.0.6", "@types/react-redux": "^6.0.9", "@types/redux": "^3.6.0", "@types/styled-components": "4.0.1", "awesome-typescript-loader": "^5.2.1", "babel-loader": "^7.1.5", - "babel-preset-env": "^1.7.0", - "babel-plugin-transform-runtime": "^6.23.0", "babel-plugin-transform-es3-member-expression-literals": "^6.22.0", "babel-plugin-transform-es3-property-literals": "^6.22.0", "babel-plugin-transform-object-assign": "^6.22.0", + "babel-plugin-transform-runtime": "^6.23.0", + "babel-preset-env": "^1.7.0", "dotenv-cli": "^1.4.0", "enzyme": "^3.6.0", "enzyme-adapter-react-16": "^1.5.0", @@ -103,7 +103,7 @@ "typedoc": "0.13.0", "typescript": "3.0.1", "webpack": "^4.20.2", - "webpack-cli": "^3.1.1", + "webpack-cli": "3.1.2", "webpack-dev-server": "^3.1.9" }, "publishConfig": { diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json index 66de84299..a6ae0160f 100644 --- a/packages/json-schemas/CHANGELOG.json +++ b/packages/json-schemas/CHANGELOG.json @@ -1,12 +1,35 @@ [ { + "version": "3.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "3.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "3.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 + }, + { + "note": "Add `verifyingContractAddress` to `zeroExTransactionSchema`", + "pr": 1576 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/json-schemas/CHANGELOG.md b/packages/json-schemas/CHANGELOG.md index 4e562d9e8..91426a687 100644 --- a/packages/json-schemas/CHANGELOG.md +++ b/packages/json-schemas/CHANGELOG.md @@ -5,6 +5,19 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v3.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v3.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v3.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + * Add `verifyingContractAddress` to `zeroExTransactionSchema` (#1576) + ## v2.1.7 - _January 15, 2019_ * Dependencies updated diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json index cd515a747..0c101aa28 100644 --- a/packages/json-schemas/package.json +++ b/packages/json-schemas/package.json @@ -1,6 +1,6 @@ { "name": "@0x/json-schemas", - "version": "2.1.7", + "version": "3.0.2", "engines": { "node": ">=6.12" }, @@ -39,14 +39,14 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md", "dependencies": { - "@0x/typescript-typings": "^3.0.8", + "@0x/typescript-typings": "^4.0.0", "@types/node": "*", "jsonschema": "^1.2.0", "lodash.values": "^4.3.0" }, "devDependencies": { - "@0x/tslint-config": "^2.0.2", - "@0x/utils": "^3.0.1", + "@0x/tslint-config": "^3.0.0", + "@0x/utils": "^4.0.3", "@types/lodash.foreach": "^4.5.3", "@types/lodash.values": "^4.3.3", "@types/mocha": "^2.2.42", diff --git a/packages/json-schemas/schemas/zero_ex_transaction_schema.json b/packages/json-schemas/schemas/zero_ex_transaction_schema.json index 0c714f14d..ffdf1f229 100644 --- a/packages/json-schemas/schemas/zero_ex_transaction_schema.json +++ b/packages/json-schemas/schemas/zero_ex_transaction_schema.json @@ -1,10 +1,11 @@ { "id": "/zeroExTransactionSchema", "properties": { + "verifyingContractAddress": { "$ref": "/addressSchema" }, "data": { "$ref": "/hexSchema" }, "signerAddress": { "$ref": "/addressSchema" }, "salt": { "$ref": "/wholeNumberSchema" } }, - "required": ["data", "salt", "signerAddress"], + "required": ["verifyingContractAddress", "data", "salt", "signerAddress"], "type": "object" } diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json index 3b082f075..3afe8eb8c 100644 --- a/packages/metacoin/package.json +++ b/packages/metacoin/package.json @@ -1,6 +1,6 @@ { "name": "@0x/metacoin", - "version": "0.0.36", + "version": "0.0.39", "engines": { "node": ">=6.12" }, @@ -24,33 +24,34 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test:coverage", - "compile": "sol-compiler compile" + "compile": "sol-compiler", + "watch": "sol-compiler -w" }, "author": "", "license": "Apache-2.0", "dependencies": { - "@0x/abi-gen": "^1.0.22", - "@0x/abi-gen-templates": "^1.0.2", - "@0x/base-contract": "^3.0.13", - "@0x/sol-coverage": "^1.0.3", - "@0x/sol-profiler": "^1.0.3", - "@0x/sol-trace": "^1.0.3", - "@0x/subproviders": "^2.1.11", - "@0x/tslint-config": "^2.0.2", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", - "@types/mocha": "^5.2.2", + "@0x/abi-gen": "^2.0.2", + "@0x/abi-gen-templates": "^2.0.0", + "@0x/base-contract": "^4.0.2", + "@0x/sol-coverage": "^2.0.2", + "@0x/sol-profiler": "^2.0.3", + "@0x/sol-trace": "^2.0.3", + "@0x/subproviders": "^3.0.2", + "@0x/tslint-config": "^3.0.0", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", + "@types/mocha": "^2.2.42", "copyfiles": "^2.0.0", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "ethers": "~4.0.4", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "run-s": "^0.0.0" }, "devDependencies": { - "@0x/dev-utils": "^1.0.24", - "@0x/sol-compiler": "^2.0.2", + "@0x/dev-utils": "^2.0.2", + "@0x/sol-compiler": "^3.0.2", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", "chai-bignumber": "^3.0.0", diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index ffda41e10..9d7c22b7c 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -1,5 +1,32 @@ [ { + "version": "3.0.3", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549504360, + "version": "3.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549452781, + "version": "3.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "3.0.0", "changes": [ { @@ -18,7 +45,8 @@ "note": "Convert `from` to lower case when passed in via cli", "pr": 1533 } - ] + ], + "timestamp": 1549373905 }, { "version": "2.4.0", diff --git a/packages/migrations/CHANGELOG.md b/packages/migrations/CHANGELOG.md index 6c9a84018..b39732ef4 100644 --- a/packages/migrations/CHANGELOG.md +++ b/packages/migrations/CHANGELOG.md @@ -5,6 +5,25 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v3.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v3.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v3.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v3.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + * Removed `owner` in Migrations (#1533) + * `txDefaults` parameter now requires the `from` field (#1533) + * Convert `from` to lower case when passed in via cli (#1533) + ## v2.4.0 - _January 15, 2019_ * Added migrations for `MultiAssetProxy` contract (#1503) diff --git a/packages/migrations/package.json b/packages/migrations/package.json index 3ca4e8d6b..91476d322 100644 --- a/packages/migrations/package.json +++ b/packages/migrations/package.json @@ -1,6 +1,6 @@ { "name": "@0x/migrations", - "version": "2.4.0", + "version": "3.0.3", "engines": { "node": ">=6.12" }, @@ -35,10 +35,10 @@ }, "license": "Apache-2.0", "devDependencies": { - "@0x/dev-utils": "^1.0.24", - "@0x/tslint-config": "^2.0.2", - "@0x/types": "^1.5.2", - "@types/yargs": "^10.0.0", + "@0x/dev-utils": "^2.0.2", + "@0x/tslint-config": "^3.0.0", + "@0x/types": "^2.0.2", + "@types/yargs": "^11.0.0", "make-promises-safe": "^1.1.0", "npm-run-all": "^4.1.2", "shx": "^0.2.2", @@ -48,20 +48,20 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/abi-gen-wrappers": "^2.2.0", - "@0x/base-contract": "^3.0.13", - "@0x/contract-addresses": "^2.2.0", + "@0x/abi-gen-wrappers": "^3.0.2", + "@0x/base-contract": "^4.0.2", + "@0x/contract-addresses": "^2.2.1", "@0x/contract-artifacts": "^1.3.0", - "@0x/order-utils": "^3.1.2", - "@0x/sol-compiler": "^2.0.2", - "@0x/subproviders": "^2.1.11", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "@0x/order-utils": "^6.0.1", + "@0x/sol-compiler": "^3.0.2", + "@0x/subproviders": "^3.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "@ledgerhq/hw-app-eth": "^4.3.0", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "ethers": "~4.0.4", - "lodash": "^4.17.5" + "lodash": "^4.17.11" }, "optionalDependencies": { "@ledgerhq/hw-transport-node-hid": "^4.3.0" diff --git a/packages/monorepo-scripts/package.json b/packages/monorepo-scripts/package.json index 187a80c93..3e9a972c2 100644 --- a/packages/monorepo-scripts/package.json +++ b/packages/monorepo-scripts/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@0x/monorepo-scripts", - "version": "1.0.19", + "version": "1.0.23", "engines": { "node": ">=6.12" }, @@ -32,13 +32,13 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/monorepo-scripts/README.md", "devDependencies": { - "@types/glob": "^5.0.33", + "@types/glob": "5.0.35", "@types/mkdirp": "^0.5.2", "@types/node": "*", "@types/opn": "^5.1.0", "@types/rimraf": "^2.0.2", "@types/semver": "5.5.0", - "@types/yargs": "^10.0.0", + "@types/yargs": "^11.0.0", "depcheck": "^0.6.9", "make-promises-safe": "^1.1.0", "npm-run-all": "^4.1.2", @@ -47,7 +47,8 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/utils": "^3.0.1", + "@0x/types": "^2.0.2", + "@0x/utils": "^4.0.3", "@lerna/batch-packages": "^3.0.0-beta.18", "@types/depcheck": "^0.6.0", "async-child-process": "^1.1.1", @@ -55,7 +56,7 @@ "es6-promisify": "^5.0.0", "glob": "^7.1.2", "isomorphic-fetch": "2.2.1", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "mkdirp": "^0.5.1", "moment": "2.21.0", "opn": "^5.3.0", diff --git a/packages/monorepo-scripts/src/deps_versions.ts b/packages/monorepo-scripts/src/deps_versions.ts index 1053906b7..bb7e50f51 100644 --- a/packages/monorepo-scripts/src/deps_versions.ts +++ b/packages/monorepo-scripts/src/deps_versions.ts @@ -1,9 +1,9 @@ #!/usr/bin/env node +import { PackageJSON, PackageJSONConfig } from '@0x/types'; import chalk from 'chalk'; -import * as fs from 'fs'; import { sync as globSync } from 'glob'; -import * as _ from 'lodash'; +import * as path from 'path'; import { utils } from './utils/utils'; @@ -17,40 +17,85 @@ interface VersionsByDependency { [depName: string]: Versions; } -const PACKAGE_JSON_GLOB = '../*/package.json'; +interface ParsedDependencies { + ignored: VersionsByDependency; + included: VersionsByDependency; +} + +const PACKAGE_JSON_GLOB = '../../*/package.json'; + +const config = utils.readJSONFile<PackageJSON>(path.join(__dirname, '../../../package.json')) + .config as PackageJSONConfig; // tslint:disable-line no-unnecessary-type-assertion +const dependenciesWithIgnoredVersions: string[] = (config.ignoreDependencyVersions as string).split(' '); +const packagesWithIgnoredVersions: string[] = (config.ignoreDependencyVersionsForPackage as string).split(' '); + +if (require.main === module) { + const dependencies = parseDependencies(); + const ignoredMultiples = getDependenciesWithMultipleVersions(dependencies.ignored); + const multiples = getDependenciesWithMultipleVersions(dependencies.included); + printVersionsByDependency(multiples); + utils.log(`├── ${chalk.bold('IGNORED')}`); + printVersionsByDependency(ignoredMultiples); + if (Object.keys(multiples).length !== 0) { + utils.log( + `Some dependencies have multiple versions. Please fix by trying to find compatible versions. As a last resort, you can add space-separated exceptions to root package.json config.ignoreDependencyVersions`, + ); + process.exit(1); + } +} -// tslint:disable:no-unused-variable -function getDependencies(path: string): Dependencies { - const file = fs.readFileSync(path).toString(); - const parsed = JSON.parse(file); +function getDependencies(_path: string): Dependencies { + const packageJSON = utils.readJSONFile<PackageJSON>(_path); const dependencies = { - ...parsed.dependencies, - ...parsed.devDependencies, + ...packageJSON.dependencies, + ...packageJSON.devDependencies, }; return dependencies; } -const files = globSync(PACKAGE_JSON_GLOB); -const versionsByDependency: VersionsByDependency = {}; -files.map(path => { - const [_1, packageName, _2] = path.split('/'); - const dependencies = getDependencies(path); - _.map(dependencies, (version: string, depName: string) => { - if (_.isUndefined(versionsByDependency[depName])) { - versionsByDependency[depName] = {}; - } - versionsByDependency[depName][packageName] = version; +function parseDependencies(): ParsedDependencies { + const files = globSync(path.join(__dirname, PACKAGE_JSON_GLOB)); + const parsedDependencies: ParsedDependencies = { + ignored: {}, + included: {}, + }; + files.map(_path => { + const pathParts = _path.split('/'); + const packageName = pathParts[pathParts.length - 2]; + const packageCategory = packagesWithIgnoredVersions.includes(packageName) ? 'ignored' : 'included'; + const dependencies = getDependencies(_path); + Object.keys(dependencies).forEach((depName: string) => { + const category = dependenciesWithIgnoredVersions.includes(depName) ? 'ignored' : packageCategory; + if (parsedDependencies[category][depName] === undefined) { + parsedDependencies[category][depName] = {}; + } + const version = dependencies[depName]; + parsedDependencies[category][depName][packageName] = version; + }); }); -}); + return parsedDependencies; +} + +function getDependenciesWithMultipleVersions(versionsByDependency: VersionsByDependency): VersionsByDependency { + return Object.keys(versionsByDependency) + .filter((depName: string) => hasMultipleVersions(versionsByDependency[depName])) + .reduce<VersionsByDependency>((obj, depName: string) => { + obj[depName] = versionsByDependency[depName]; + return obj; + }, {}); +} -_.map(versionsByDependency, (versions: Versions, depName: string) => { - if (_.uniq(_.values(versions)).length === 1) { - delete versionsByDependency[depName]; - } else { +function printVersionsByDependency(versionsByDependency: VersionsByDependency): void { + Object.keys(versionsByDependency).forEach((depName: string) => { + const versions: Versions = versionsByDependency[depName]; utils.log(chalk.bold(depName)); - _.map(versions, (version: string, packageName: string) => { - utils.log(`├── ${packageName} -> ${version}`); + Object.keys(versions).forEach((packageName: string) => { + utils.log(`├── ${packageName} -> ${versions[packageName]}`); }); - } -}); -// tslint:disable:no-unused-variable + }); +} + +function hasMultipleVersions(versions: Versions): boolean { + const uniques = new Set(Object.values(versions)); + return uniques.size > 1; +} diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts index 105d87dcd..ddb2811f2 100644 --- a/packages/monorepo-scripts/src/publish.ts +++ b/packages/monorepo-scripts/src/publish.ts @@ -1,8 +1,8 @@ #!/usr/bin/env node +import { PackageJSON } from '@0x/types'; import { logUtils } from '@0x/utils'; import * as promisify from 'es6-promisify'; -import * as fs from 'fs'; import * as _ from 'lodash'; import * as moment from 'moment'; import opn = require('opn'); @@ -141,8 +141,8 @@ async function publishImagesToDockerHubAsync(allUpdatedPackages: Package[]): Pro function getPackagesWithDocs(allUpdatedPackages: Package[]): Package[] { const rootPackageJsonPath = `${constants.monorepoRootPath}/package.json`; - const rootPackageJson = JSON.parse(fs.readFileSync(rootPackageJsonPath).toString()); - const packagesWithDocPagesStringIfExist = _.get(rootPackageJson, 'config.packagesWithDocPages', undefined); + const rootPackageJSON = utils.readJSONFile<PackageJSON>(rootPackageJsonPath); + const packagesWithDocPagesStringIfExist = _.get(rootPackageJSON, 'config.packagesWithDocPages', undefined); if (_.isUndefined(packagesWithDocPagesStringIfExist)) { return []; // None to generate & publish } diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts index 822f48967..ec145cd32 100644 --- a/packages/monorepo-scripts/src/test_installation.ts +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -8,7 +8,7 @@ import { exec as execAsync } from 'promisify-child-process'; import * as rimraf from 'rimraf'; import { promisify } from 'util'; -import { Package } from './types'; +import { Changelog, Package } from './types'; import { utils } from './utils/utils'; // Packages might not be runnable if they are command-line tools or only run in browsers. @@ -100,7 +100,7 @@ async function testInstallPackageAsync( installablePackage: Package, ): Promise<void> { const changelogPath = path.join(installablePackage.location, 'CHANGELOG.json'); - const lastChangelogVersion = JSON.parse(fs.readFileSync(changelogPath).toString())[0].version; + const lastChangelogVersion = utils.readJSONFile<Changelog>(changelogPath)[0].version; const packageName = installablePackage.packageJson.name; utils.log(`Testing ${packageName}@${lastChangelogVersion}`); const packageDirName = path.join(...`${packageName}-test`.split('/')); diff --git a/packages/monorepo-scripts/src/types.ts b/packages/monorepo-scripts/src/types.ts index 4af4fd257..e285d9082 100644 --- a/packages/monorepo-scripts/src/types.ts +++ b/packages/monorepo-scripts/src/types.ts @@ -1,3 +1,5 @@ +import { PackageJSON } from '@0x/types'; + export interface UpdatedPackage { name: string; version: string; @@ -34,21 +36,6 @@ export interface GitTagsByPackageName { [packageName: string]: string[]; } -export interface PackageJSON { - private?: boolean; - version: string; - name: string; - main?: string; - scripts?: { [command: string]: string }; - config?: { - postpublish?: { - assets?: string[]; - docOmitExports?: string[]; - dockerHubRepo?: string; - }; - }; -} - export interface Package { location: string; packageJson: PackageJSON; diff --git a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts index 1a4294e9c..c0e86ad44 100644 --- a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts +++ b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts @@ -1,3 +1,4 @@ +import { PackageJSON } from '@0x/types'; import { existsSync, readFileSync, writeFileSync } from 'fs'; import * as _ from 'lodash'; import * as path from 'path'; @@ -6,7 +7,7 @@ import * as ts from 'typescript'; import { constants } from '../constants'; import { docGenConfigs } from '../doc_gen_configs'; -import { ExportInfo, ExportNameToTypedocNames, ExportPathToExportedItems, PackageJSON } from '../types'; +import { ExportInfo, ExportNameToTypedocNames, ExportPathToExportedItems } from '../types'; import { utils } from './utils'; diff --git a/packages/monorepo-scripts/src/utils/utils.ts b/packages/monorepo-scripts/src/utils/utils.ts index 28c5658f3..20a6932c3 100644 --- a/packages/monorepo-scripts/src/utils/utils.ts +++ b/packages/monorepo-scripts/src/utils/utils.ts @@ -1,3 +1,4 @@ +import { PackageJSON } from '@0x/types'; import batchPackages = require('@lerna/batch-packages'); import * as fs from 'fs'; import * as _ from 'lodash'; @@ -5,7 +6,7 @@ import { exec as execAsync } from 'promisify-child-process'; import semver = require('semver'); import { constants } from '../constants'; -import { GitTagsByPackageName, Package, PackageJSON, UpdatedPackage } from '../types'; +import { GitTagsByPackageName, Package, UpdatedPackage } from '../types'; import { changelogUtils } from './changelog_utils'; @@ -13,6 +14,11 @@ export const utils = { log(...args: any[]): void { console.log(...args); // tslint:disable-line:no-console }, + readJSONFile<T>(path: string): T { + const JSONString = fs.readFileSync(path, 'utf8'); + const parsed: T = JSON.parse(JSONString); + return parsed; + }, getTopologicallySortedPackages(rootDir: string): Package[] { const packages = utils.getPackages(rootDir); const batchedPackages: PackageJSON[] = _.flatten(batchPackages(_.map(packages, pkg => pkg.packageJson), false)); @@ -23,8 +29,7 @@ export const utils = { return topsortedPackages; }, getPackages(rootDir: string): Package[] { - const rootPackageJsonString = fs.readFileSync(`${rootDir}/package.json`, 'utf8'); - const rootPackageJson = JSON.parse(rootPackageJsonString); + const rootPackageJson = utils.readJSONFile<PackageJSON>(`${rootDir}/package.json`); if (_.isUndefined(rootPackageJson.workspaces)) { throw new Error(`Did not find 'workspaces' key in root package.json`); } @@ -40,8 +45,7 @@ export const utils = { } const pathToPackageJson = `${rootDir}/${workspacePath}${subpackageName}`; try { - const packageJsonString = fs.readFileSync(`${pathToPackageJson}/package.json`, 'utf8'); - const packageJson = JSON.parse(packageJsonString); + const packageJson = utils.readJSONFile<PackageJSON>(`${pathToPackageJson}/package.json`); const pkg = { location: pathToPackageJson, packageJson, diff --git a/packages/order-utils/CHANGELOG.json b/packages/order-utils/CHANGELOG.json index 08d88da5b..0028ea0c7 100644 --- a/packages/order-utils/CHANGELOG.json +++ b/packages/order-utils/CHANGELOG.json @@ -1,12 +1,51 @@ [ { + "version": "6.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "version": "6.0.0", + "changes": { + "note": "Stop exporting the EIP712 schemas" + }, + "timestamp": 1549504360 + }, + { + "version": "5.0.0", + "changes": [ + { + "note": "Add `transactionHashUtils`", + "pr": 1576 + }, + { + "note": "Refactor `eip712Utils` to allow custom domain params", + "pr": 1576 + }, + { + "note": "Export constant EIP712 params", + "pr": 1576 + } + ], + "timestamp": 1549452781 + }, + { "version": "4.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 + }, + { + "note": "Fix preSigned `isSignatureValidAsync` check", + "pr": 1580 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/order-utils/CHANGELOG.md b/packages/order-utils/CHANGELOG.md index c82458f2e..06e6a2839 100644 --- a/packages/order-utils/CHANGELOG.md +++ b/packages/order-utils/CHANGELOG.md @@ -5,6 +5,25 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v6.0.1 - _February 7, 2019_ + + * Dependencies updated + +## v6.0.0 - _February 7, 2019_ + + * undefined + +## v5.0.0 - _February 6, 2019_ + + * Add `transactionHashUtils` (#1576) + * Refactor `eip712Utils` to allow custom domain params (#1576) + * Export constant EIP712 params (#1576) + +## v4.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + * Fix preSigned `isSignatureValidAsync` check (#1580) + ## v3.1.2 - _January 15, 2019_ * Dependencies updated diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index 7a4d4aa84..e2d0bcc98 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0x/order-utils", - "version": "3.1.2", + "version": "6.0.1", "engines": { "node": ">=6.12" }, @@ -35,8 +35,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/order-utils/README.md", "devDependencies": { - "@0x/dev-utils": "^1.0.24", - "@0x/tslint-config": "^2.0.2", + "@0x/dev-utils": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/bn.js": "^4.11.0", "@types/lodash": "4.14.104", "chai": "^4.0.1", @@ -53,22 +53,23 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/abi-gen-wrappers": "^2.2.0", - "@0x/assert": "^1.0.23", - "@0x/base-contract": "^3.0.13", + "@0x/abi-gen-wrappers": "^3.0.2", + "@0x/assert": "^2.0.2", + "@0x/base-contract": "^4.0.2", + "@0x/contract-addresses": "^2.2.1", "@0x/contract-artifacts": "^1.3.0", - "@0x/json-schemas": "^2.1.7", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "@0x/json-schemas": "^3.0.2", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "@types/node": "*", "bn.js": "^4.11.8", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "ethereumjs-abi": "0.6.5", "ethereumjs-util": "^5.1.1", "ethers": "~4.0.4", - "lodash": "^4.17.5" + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/packages/order-utils/src/constants.ts b/packages/order-utils/src/constants.ts index a9a687719..3c93575b3 100644 --- a/packages/order-utils/src/constants.ts +++ b/packages/order-utils/src/constants.ts @@ -68,9 +68,9 @@ export const constants = { SELECTOR_CHAR_LENGTH_WITH_PREFIX: 10, INFINITE_TIMESTAMP_SEC: new BigNumber(2524604400), // Close to infinite ZERO_AMOUNT: new BigNumber(0), - EIP712_DOMAIN_NAME: '0x Protocol', - EIP712_DOMAIN_VERSION: '2', - EIP712_DOMAIN_SCHEMA: { + EXCHANGE_DOMAIN_NAME: '0x Protocol', + EXCHANGE_DOMAIN_VERSION: '2', + DEFAULT_DOMAIN_SCHEMA: { name: 'EIP712Domain', parameters: [ { name: 'name', type: 'string' }, @@ -78,7 +78,7 @@ export const constants = { { name: 'verifyingContract', type: 'address' }, ], }, - EIP712_ORDER_SCHEMA: { + EXCHANGE_ORDER_SCHEMA: { name: 'Order', parameters: [ { name: 'makerAddress', type: 'address' }, @@ -95,7 +95,7 @@ export const constants = { { name: 'takerAssetData', type: 'bytes' }, ], }, - EIP712_ZEROEX_TRANSACTION_SCHEMA: { + EXCHANGE_ZEROEX_TRANSACTION_SCHEMA: { name: 'ZeroExTransaction', parameters: [ { name: 'salt', type: 'uint256' }, diff --git a/packages/order-utils/src/eip712_utils.ts b/packages/order-utils/src/eip712_utils.ts index 385fda989..685fdc8c8 100644 --- a/packages/order-utils/src/eip712_utils.ts +++ b/packages/order-utils/src/eip712_utils.ts @@ -1,6 +1,13 @@ import { assert } from '@0x/assert'; import { schemas } from '@0x/json-schemas'; -import { EIP712Object, EIP712TypedData, EIP712Types, Order, ZeroExTransaction } from '@0x/types'; +import { + EIP712DomainWithDefaultSchema, + EIP712Object, + EIP712TypedData, + EIP712Types, + Order, + ZeroExTransaction, +} from '@0x/types'; import * as _ from 'lodash'; import { constants } from './constants'; @@ -11,26 +18,26 @@ export const eip712Utils = { * @param primaryType The primary type found in message * @param types The additional types for the data in message * @param message The contents of the message - * @param exchangeAddress The address of the exchange contract + * @param domain Domain containing a name (optional), version (optional), and verifying contract address * @return A typed data object */ createTypedData: ( primaryType: string, types: EIP712Types, message: EIP712Object, - exchangeAddress: string, + domain: EIP712DomainWithDefaultSchema, ): EIP712TypedData => { - assert.isETHAddressHex('exchangeAddress', exchangeAddress); + assert.isETHAddressHex('verifyingContractAddress', domain.verifyingContractAddress); assert.isString('primaryType', primaryType); const typedData = { types: { - EIP712Domain: constants.EIP712_DOMAIN_SCHEMA.parameters, + EIP712Domain: constants.DEFAULT_DOMAIN_SCHEMA.parameters, ...types, }, domain: { - name: constants.EIP712_DOMAIN_NAME, - version: constants.EIP712_DOMAIN_VERSION, - verifyingContract: exchangeAddress, + name: _.isUndefined(domain.name) ? constants.EXCHANGE_DOMAIN_NAME : domain.name, + version: _.isUndefined(domain.version) ? constants.EXCHANGE_DOMAIN_VERSION : domain.version, + verifyingContract: domain.verifyingContractAddress, }, message, primaryType, @@ -48,11 +55,14 @@ export const eip712Utils = { const normalizedOrder = _.mapValues(order, value => { return !_.isString(value) ? value.toString() : value; }); + const domain = { + verifyingContractAddress: order.exchangeAddress, + }; const typedData = eip712Utils.createTypedData( - constants.EIP712_ORDER_SCHEMA.name, - { Order: constants.EIP712_ORDER_SCHEMA.parameters }, + constants.EXCHANGE_ORDER_SCHEMA.name, + { Order: constants.EXCHANGE_ORDER_SCHEMA.parameters }, normalizedOrder, - order.exchangeAddress, + domain, ); return typedData; }, @@ -60,23 +70,22 @@ export const eip712Utils = { * Creates an ExecuteTransaction EIP712TypedData object for use with signTypedData and * 0x Exchange executeTransaction. * @param ZeroExTransaction the 0x transaction - * @param exchangeAddress The address of the exchange contract * @return A typed data object */ - createZeroExTransactionTypedData: ( - zeroExTransaction: ZeroExTransaction, - exchangeAddress: string, - ): EIP712TypedData => { - assert.isETHAddressHex('exchangeAddress', exchangeAddress); + createZeroExTransactionTypedData: (zeroExTransaction: ZeroExTransaction): EIP712TypedData => { + assert.isETHAddressHex('verifyingContractAddress', zeroExTransaction.verifyingContractAddress); assert.doesConformToSchema('zeroExTransaction', zeroExTransaction, schemas.zeroExTransactionSchema); const normalizedTransaction = _.mapValues(zeroExTransaction, value => { return !_.isString(value) ? value.toString() : value; }); + const domain = { + verifyingContractAddress: zeroExTransaction.verifyingContractAddress, + }; const typedData = eip712Utils.createTypedData( - constants.EIP712_ZEROEX_TRANSACTION_SCHEMA.name, - { ZeroExTransaction: constants.EIP712_ZEROEX_TRANSACTION_SCHEMA.parameters }, + constants.EXCHANGE_ZEROEX_TRANSACTION_SCHEMA.name, + { ZeroExTransaction: constants.EXCHANGE_ZEROEX_TRANSACTION_SCHEMA.parameters }, normalizedTransaction, - exchangeAddress, + domain, ); return typedData; }, diff --git a/packages/order-utils/src/index.ts b/packages/order-utils/src/index.ts index 2150a02e4..ff37d7088 100644 --- a/packages/order-utils/src/index.ts +++ b/packages/order-utils/src/index.ts @@ -3,6 +3,7 @@ export { signatureUtils } from './signature_utils'; export { generatePseudoRandomSalt } from './salt'; export { assetDataUtils } from './asset_data_utils'; export { marketUtils } from './market_utils'; +export { transactionHashUtils } from './transaction_hash'; export { rateUtils } from './rate_utils'; export { sortingUtils } from './sorting_utils'; export { orderParsingUtils } from './parsing_utils'; @@ -50,7 +51,9 @@ export { EIP712Types, EIP712Object, EIP712ObjectValue, + EIP712DomainWithDefaultSchema, ZeroExTransaction, + SignedZeroExTransaction, } from '@0x/types'; export { OrderError, diff --git a/packages/order-utils/src/order_hash.ts b/packages/order-utils/src/order_hash.ts index c8e9be71e..ce7e6d85f 100644 --- a/packages/order-utils/src/order_hash.ts +++ b/packages/order-utils/src/order_hash.ts @@ -4,6 +4,7 @@ import { signTypedDataUtils } from '@0x/utils'; import * as _ from 'lodash'; import { assert } from './assert'; +import { constants } from './constants'; import { eip712Utils } from './eip712_utils'; const INVALID_TAKER_FORMAT = 'instance.takerAddress is not of a type(s) string'; @@ -34,8 +35,9 @@ export const orderHashUtils = { assert.doesConformToSchema('order', order, schemas.orderSchema, [schemas.hexSchema]); } catch (error) { if (_.includes(error.message, INVALID_TAKER_FORMAT)) { - const errMsg = - 'Order taker must be of type string. If you want anyone to be able to fill an order - pass ZeroEx.NULL_ADDRESS'; + const errMsg = `Order taker must be of type string. If you want anyone to be able to fill an order - pass ${ + constants.NULL_ADDRESS + }`; throw new Error(errMsg); } throw error; @@ -51,6 +53,17 @@ export const orderHashUtils = { * @return A Buffer containing the resulting orderHash from hashing the supplied order */ getOrderHashBuffer(order: SignedOrder | Order): Buffer { + try { + assert.doesConformToSchema('order', order, schemas.orderSchema, [schemas.hexSchema]); + } catch (error) { + if (_.includes(error.message, INVALID_TAKER_FORMAT)) { + const errMsg = `Order taker must be of type string. If you want anyone to be able to fill an order - pass ${ + constants.NULL_ADDRESS + }`; + throw new Error(errMsg); + } + throw error; + } const typedData = eip712Utils.createOrderTypedData(order); const orderHashBuff = signTypedDataUtils.generateTypedDataHash(typedData); return orderHashBuff; diff --git a/packages/order-utils/src/signature_utils.ts b/packages/order-utils/src/signature_utils.ts index 131144d48..efcc146bf 100644 --- a/packages/order-utils/src/signature_utils.ts +++ b/packages/order-utils/src/signature_utils.ts @@ -1,4 +1,5 @@ import { ExchangeContract, IValidatorContract, IWalletContract } from '@0x/abi-gen-wrappers'; +import { getContractAddressesForNetworkOrThrow } from '@0x/contract-addresses'; import * as artifacts from '@0x/contract-artifacts'; import { schemas } from '@0x/json-schemas'; import { ECSignature, Order, SignatureType, SignedOrder, ValidatorSignature } from '@0x/types'; @@ -92,7 +93,14 @@ export const signatureUtils = { assert.isWeb3Provider('provider', provider); assert.isHexString('data', data); assert.isETHAddressHex('signerAddress', signerAddress); - const exchangeContract = new ExchangeContract(artifacts.Exchange.compilerOutput.abi, signerAddress, provider); + const web3Wrapper = new Web3Wrapper(provider); + const networkId = await web3Wrapper.getNetworkIdAsync(); + const addresses = getContractAddressesForNetworkOrThrow(networkId); + const exchangeContract = new ExchangeContract( + artifacts.Exchange.compilerOutput.abi, + addresses.exchange, + provider, + ); const isValid = await exchangeContract.preSigned.callAsync(data, signerAddress); return isValid; }, diff --git a/packages/order-utils/src/transaction_hash.ts b/packages/order-utils/src/transaction_hash.ts new file mode 100644 index 000000000..2b2345af7 --- /dev/null +++ b/packages/order-utils/src/transaction_hash.ts @@ -0,0 +1,46 @@ +import { schemas, SchemaValidator } from '@0x/json-schemas'; +import { SignedZeroExTransaction, ZeroExTransaction } from '@0x/types'; +import { signTypedDataUtils } from '@0x/utils'; +import * as _ from 'lodash'; + +import { assert } from './assert'; +import { eip712Utils } from './eip712_utils'; + +export const transactionHashUtils = { + /** + * Checks if the supplied hex encoded 0x transaction hash is valid. + * Note: Valid means it has the expected format, not that a transaction with the transactionHash exists. + * Use this method when processing transactionHashes submitted as user input. + * @param transactionHash Hex encoded transactionHash. + * @return Whether the supplied transactionHash has the expected format. + */ + isValidTransactionHash(transactionHash: string): boolean { + // Since this method can be called to check if any arbitrary string conforms to an transactionHash's + // format, we only assert that we were indeed passed a string. + assert.isString('transactionHash', transactionHash); + const schemaValidator = new SchemaValidator(); + const isValid = schemaValidator.validate(transactionHash, schemas.orderHashSchema).valid; + return isValid; + }, + /** + * Computes the transactionHash for a supplied 0x transaction. + * @param transaction An object that conforms to the ZeroExTransaction or SignedZeroExTransaction interface definitions. + * @return Hex encoded string transactionHash from hashing the supplied order. + */ + getTransactionHashHex(transaction: ZeroExTransaction | SignedZeroExTransaction): string { + assert.doesConformToSchema('transaction', transaction, schemas.zeroExTransactionSchema, [schemas.hexSchema]); + const transactionHashBuff = transactionHashUtils.getTransactionHashBuffer(transaction); + const transactionHashHex = `0x${transactionHashBuff.toString('hex')}`; + return transactionHashHex; + }, + /** + * Computes the transactionHash for a supplied 0x transaction. + * @param transaction An object that conforms to the ZeroExTransaction or SignedZeroExTransaction interface definitions. + * @return A Buffer containing the resulting transactionHash from hashing the supplied 0x transaction. + */ + getTransactionHashBuffer(transaction: ZeroExTransaction | SignedZeroExTransaction): Buffer { + const typedData = eip712Utils.createZeroExTransactionTypedData(transaction); + const transactionHashBuff = signTypedDataUtils.generateTypedDataHash(typedData); + return transactionHashBuff; + }, +}; diff --git a/packages/order-utils/test/eip712_utils_test.ts b/packages/order-utils/test/eip712_utils_test.ts index a54e49958..c97bed144 100644 --- a/packages/order-utils/test/eip712_utils_test.ts +++ b/packages/order-utils/test/eip712_utils_test.ts @@ -12,33 +12,55 @@ const expect = chai.expect; describe('EIP712 Utils', () => { describe('createTypedData', () => { - it('adds in the EIP712DomainSeparator', () => { + it('adds in the EIP712DomainSeparator with default values', () => { const primaryType = 'Test'; const typedData = eip712Utils.createTypedData( primaryType, { Test: [{ name: 'testValue', type: 'uint256' }] }, { testValue: '1' }, - constants.NULL_ADDRESS, + { verifyingContractAddress: constants.NULL_ADDRESS }, ); expect(typedData.domain).to.not.be.undefined(); expect(typedData.types.EIP712Domain).to.not.be.undefined(); const domainObject = typedData.domain; - expect(domainObject.name).to.eq(constants.EIP712_DOMAIN_NAME); + expect(domainObject.name).to.eq(constants.EXCHANGE_DOMAIN_NAME); + expect(domainObject.version).to.eq(constants.EXCHANGE_DOMAIN_VERSION); + expect(domainObject.verifyingContract).to.eq(constants.NULL_ADDRESS); + expect(typedData.primaryType).to.eq(primaryType); + }); + it('adds in the EIP712DomainSeparator without default values', () => { + const primaryType = 'Test'; + const domainName = 'testDomain'; + const domainVersion = 'testVersion'; + const typedData = eip712Utils.createTypedData( + primaryType, + { Test: [{ name: 'testValue', type: 'uint256' }] }, + { testValue: '1' }, + { name: domainName, version: domainVersion, verifyingContractAddress: constants.NULL_ADDRESS }, + ); + expect(typedData.domain).to.not.be.undefined(); + expect(typedData.types.EIP712Domain).to.not.be.undefined(); + const domainObject = typedData.domain; + expect(domainObject.name).to.eq(domainName); + expect(domainObject.version).to.eq(domainVersion); + expect(domainObject.verifyingContract).to.eq(constants.NULL_ADDRESS); expect(typedData.primaryType).to.eq(primaryType); }); }); - describe('createTypedData', () => { + describe('createZeroExTransactionTypedData', () => { it('adds in the EIP712DomainSeparator', () => { - const typedData = eip712Utils.createZeroExTransactionTypedData( - { - salt: new BigNumber('0'), - data: constants.NULL_BYTES, - signerAddress: constants.NULL_ADDRESS, - }, - constants.NULL_ADDRESS, - ); - expect(typedData.primaryType).to.eq(constants.EIP712_ZEROEX_TRANSACTION_SCHEMA.name); + const typedData = eip712Utils.createZeroExTransactionTypedData({ + salt: new BigNumber('0'), + data: constants.NULL_BYTES, + signerAddress: constants.NULL_ADDRESS, + verifyingContractAddress: constants.NULL_ADDRESS, + }); + expect(typedData.primaryType).to.eq(constants.EXCHANGE_ZEROEX_TRANSACTION_SCHEMA.name); expect(typedData.types.EIP712Domain).to.not.be.undefined(); + const domainObject = typedData.domain; + expect(domainObject.name).to.eq(constants.EXCHANGE_DOMAIN_NAME); + expect(domainObject.version).to.eq(constants.EXCHANGE_DOMAIN_VERSION); + expect(domainObject.verifyingContract).to.eq(constants.NULL_ADDRESS); }); }); }); diff --git a/packages/order-utils/test/order_hash_test.ts b/packages/order-utils/test/order_hash_test.ts index 30fb15a37..514fc2709 100644 --- a/packages/order-utils/test/order_hash_test.ts +++ b/packages/order-utils/test/order_hash_test.ts @@ -54,8 +54,9 @@ describe('Order hashing', () => { ...order, takerAddress: (null as any) as string, }; - const expectedErrorMessage = - 'Order taker must be of type string. If you want anyone to be able to fill an order - pass ZeroEx.NULL_ADDRESS'; + const expectedErrorMessage = `Order taker must be of type string. If you want anyone to be able to fill an order - pass ${ + constants.NULL_ADDRESS + }`; expect(() => orderHashUtils.getOrderHashHex(orderWithInvalidtakerFormat)).to.throw(expectedErrorMessage); }); }); diff --git a/packages/order-utils/test/signature_utils_test.ts b/packages/order-utils/test/signature_utils_test.ts index 937382056..44aa729b3 100644 --- a/packages/order-utils/test/signature_utils_test.ts +++ b/packages/order-utils/test/signature_utils_test.ts @@ -99,6 +99,17 @@ describe('Signature utils', () => { ); expect(isValidSignatureLocal).to.be.true(); }); + + it('should return false if entry not found in `preSigned` mapping', async () => { + const preSignedSignature = '0x06'; + const isValidPreSignature = await signatureUtils.isValidSignatureAsync( + provider, + dataHex, + preSignedSignature, + address, + ); + expect(isValidPreSignature).to.be.false(); + }); }); describe('#isValidECSignature', () => { const signature = { diff --git a/packages/order-utils/test/transaction_hash_test.ts b/packages/order-utils/test/transaction_hash_test.ts new file mode 100644 index 000000000..c7ca33a64 --- /dev/null +++ b/packages/order-utils/test/transaction_hash_test.ts @@ -0,0 +1,56 @@ +import { ZeroExTransaction } from '@0x/types'; +import { BigNumber } from '@0x/utils'; +import * as chai from 'chai'; +import 'mocha'; + +import { transactionHashUtils } from '../src'; + +import { constants } from '../src/constants'; + +import { chaiSetup } from './utils/chai_setup'; + +chaiSetup.configure(); +const expect = chai.expect; + +describe('0x transaction hashing', () => { + describe('#getTransactionHashHex', () => { + const expectedTransactionHash = '0x82c9bb2dcac4f868ec7a15c20ff6175cfc384c20ae6a872aa0342a840f108c2b'; + const fakeVerifyingContractAddress = '0x5e72914535f202659083db3a02c984188fa26e9f'; + const transaction: ZeroExTransaction = { + verifyingContractAddress: fakeVerifyingContractAddress, + signerAddress: constants.NULL_ADDRESS, + salt: new BigNumber(0), + data: constants.NULL_BYTES, + }; + it('calculates the transaction hash', async () => { + const transactionHash = transactionHashUtils.getTransactionHashHex(transaction); + expect(transactionHash).to.be.equal(expectedTransactionHash); + }); + it('calculates the transaction hash if amounts are strings', async () => { + // It's common for developers using javascript to provide the amounts + // as strings. Since we eventually toString() the BigNumber + // before encoding we should result in the same orderHash in this scenario + // tslint:disable-next-line:no-unnecessary-type-assertion + const transactionHash = transactionHashUtils.getTransactionHashHex({ + ...transaction, + salt: '0', + } as any); + expect(transactionHash).to.be.equal(expectedTransactionHash); + }); + }); + describe('#isValidTransactionHash', () => { + it('returns false if the value is not a hex string', () => { + const isValid = transactionHashUtils.isValidTransactionHash('not a hex'); + expect(isValid).to.be.false(); + }); + it('returns false if the length is wrong', () => { + const isValid = transactionHashUtils.isValidTransactionHash('0xdeadbeef'); + expect(isValid).to.be.false(); + }); + it('returns true if order hash is correct', () => { + const orderHashLength = 65; + const isValid = transactionHashUtils.isValidTransactionHash(`0x${Array(orderHashLength).join('0')}`); + expect(isValid).to.be.true(); + }); + }); +}); diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index 585bb48e6..69bcc8d03 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -1,12 +1,40 @@ [ { + "version": "3.0.3", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549504360, + "version": "3.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549452781, + "version": "3.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "3.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547747677, diff --git a/packages/order-watcher/CHANGELOG.md b/packages/order-watcher/CHANGELOG.md index df065866c..7a3ede421 100644 --- a/packages/order-watcher/CHANGELOG.md +++ b/packages/order-watcher/CHANGELOG.md @@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v3.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v3.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v3.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v3.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v2.4.3 - _January 17, 2019_ * Dependencies updated diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 895c64813..209c9bdc5 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -1,6 +1,6 @@ { "name": "@0x/order-watcher", - "version": "2.4.3", + "version": "3.0.3", "description": "An order watcher daemon that watches for order validity", "keywords": [ "0x", @@ -38,10 +38,10 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0x/dev-utils": "^1.0.24", - "@0x/migrations": "^2.4.0", - "@0x/subproviders": "^2.1.11", - "@0x/tslint-config": "^2.0.2", + "@0x/dev-utils": "^2.0.2", + "@0x/migrations": "^3.0.3", + "@0x/subproviders": "^3.0.2", + "@0x/tslint-config": "^3.0.0", "@types/bintrees": "^1.0.2", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", @@ -63,24 +63,24 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/abi-gen-wrappers": "^2.2.0", - "@0x/assert": "^1.0.23", - "@0x/base-contract": "^3.0.13", - "@0x/contract-addresses": "^2.2.0", + "@0x/abi-gen-wrappers": "^3.0.2", + "@0x/assert": "^2.0.2", + "@0x/base-contract": "^4.0.2", + "@0x/contract-addresses": "^2.2.1", "@0x/contract-artifacts": "^1.3.0", - "@0x/contract-wrappers": "^5.0.1", - "@0x/fill-scenarios": "^1.1.2", - "@0x/json-schemas": "^2.1.7", - "@0x/order-utils": "^3.1.2", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "@0x/contract-wrappers": "^7.0.2", + "@0x/fill-scenarios": "^2.0.3", + "@0x/json-schemas": "^3.0.2", + "@0x/order-utils": "^6.0.1", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "bintrees": "^1.0.2", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "ethereumjs-blockstream": "6.0.0", "ethers": "~4.0.4", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "websocket": "^1.0.25" }, "publishConfig": { diff --git a/packages/pipeline/README.md b/packages/pipeline/README.md index 4fc8e0ff9..23113fd9b 100644 --- a/packages/pipeline/README.md +++ b/packages/pipeline/README.md @@ -34,8 +34,10 @@ yarn lint ### Migrations -Create a new migration: `yarn migrate:create --name MigrationNameInCamelCase` +Create a new migration: `yarn migrate:create --name MigrationNameInCamelCase`. + Run migrations: `yarn migrate:run` + Revert the most recent migration (CAUTION: may result in data loss!): `yarn migrate:revert` ## Testing diff --git a/packages/pipeline/package.json b/packages/pipeline/package.json index 908734687..b2ad39a5f 100644 --- a/packages/pipeline/package.json +++ b/packages/pipeline/package.json @@ -1,6 +1,6 @@ { "name": "@0x/pipeline", - "version": "1.0.5", + "version": "1.0.9", "private": true, "description": "Data pipeline for offline analysis", "scripts": { @@ -27,37 +27,37 @@ }, "license": "Apache-2.0", "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/axios": "^0.14.0", "@types/ramda": "^0.25.38", - "chai": "^4.1.2", - "chai-as-promised": "^7.1.1", + "chai": "^4.0.1", + "chai-as-promised": "^7.1.0", "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", - "mocha": "^5.2.0", + "mocha": "^4.1.0", "tslint": "5.11.0", "typescript": "3.0.1" }, "dependencies": { - "@0x/connect": "^3.0.13", - "@0x/contract-addresses": "^2.2.0", + "@0x/connect": "^4.0.3", + "@0x/contract-addresses": "^2.2.1", "@0x/contract-artifacts": "^1.3.0", - "@0x/contract-wrappers": "^3.0.0", - "@0x/dev-utils": "^1.0.24", - "@0x/order-utils": "^3.1.2", - "@0x/subproviders": "^2.1.11", - "@0x/types": "^1.5.2", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "@0x/contract-wrappers": "^7.0.2", + "@0x/dev-utils": "^2.0.2", + "@0x/order-utils": "^6.0.1", + "@0x/subproviders": "^3.0.2", + "@0x/types": "^2.0.2", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "@types/dockerode": "^2.5.9", "@types/p-limit": "^2.0.0", "async-parallel": "^1.2.3", "axios": "^0.18.0", "bottleneck": "^2.13.2", "dockerode": "^2.5.7", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "pg": "^7.5.0", - "prettier": "^1.15.3", + "prettier": "^1.16.3", "ramda": "^0.25.0", "reflect-metadata": "^0.1.12", "sqlite3": "^4.0.2", diff --git a/packages/react-docs/CHANGELOG.json b/packages/react-docs/CHANGELOG.json index 8b418fc11..82e162272 100644 --- a/packages/react-docs/CHANGELOG.json +++ b/packages/react-docs/CHANGELOG.json @@ -1,12 +1,40 @@ [ { + "version": "2.0.3", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549504360, + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549452781, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/react-docs/CHANGELOG.md b/packages/react-docs/CHANGELOG.md index 5ec82b5be..fa8f387c2 100644 --- a/packages/react-docs/CHANGELOG.md +++ b/packages/react-docs/CHANGELOG.md @@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.0.25 - _January 15, 2019_ * Dependencies updated diff --git a/packages/react-docs/package.json b/packages/react-docs/package.json index f8f2b6276..5a91220e0 100644 --- a/packages/react-docs/package.json +++ b/packages/react-docs/package.json @@ -1,6 +1,6 @@ { "name": "@0x/react-docs", - "version": "1.0.25", + "version": "2.0.3", "engines": { "node": ">=6.12" }, @@ -24,19 +24,19 @@ "url": "https://github.com/0xProject/0x-monorepo.git" }, "devDependencies": { - "@0x/dev-utils": "^1.0.24", - "@0x/tslint-config": "^2.0.2", + "@0x/dev-utils": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/compare-versions": "^3.0.0", "@types/styled-components": "4.0.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", - "tslint": "^5.9.1", + "tslint": "5.11.0", "typescript": "3.0.1" }, "dependencies": { - "@0x/react-shared": "^1.1.2", - "@0x/types": "^1.5.2", - "@0x/utils": "^3.0.1", + "@0x/react-shared": "^2.0.3", + "@0x/types": "^2.0.2", + "@0x/utils": "^4.0.3", "@types/lodash": "4.14.104", "@types/material-ui": "^0.20.0", "@types/node": "*", @@ -45,7 +45,7 @@ "@types/react-scroll": "1.5.3", "basscss": "^8.0.3", "compare-versions": "^3.0.1", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "material-ui": "^0.20.0", "react": "^16.5.2", "react-dom": "^16.5.2", @@ -53,7 +53,7 @@ "react-scroll": "0xproject/react-scroll#pr-330-and-replace-state", "react-tooltip": "^3.2.7", "semver": "5.5.0", - "styled-components": "^4.0.1" + "styled-components": "^4.1.1" }, "publishConfig": { "access": "public" diff --git a/packages/react-shared/CHANGELOG.json b/packages/react-shared/CHANGELOG.json index 99a8779ac..9a7284c2a 100644 --- a/packages/react-shared/CHANGELOG.json +++ b/packages/react-shared/CHANGELOG.json @@ -1,12 +1,40 @@ [ { + "version": "2.0.3", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549504360, + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1549452781, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/react-shared/CHANGELOG.md b/packages/react-shared/CHANGELOG.md index e1a5df403..e1de4a765 100644 --- a/packages/react-shared/CHANGELOG.md +++ b/packages/react-shared/CHANGELOG.md @@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.1.2 - _January 15, 2019_ * Dependencies updated diff --git a/packages/react-shared/package.json b/packages/react-shared/package.json index 4be4742b0..d93eb1436 100644 --- a/packages/react-shared/package.json +++ b/packages/react-shared/package.json @@ -1,6 +1,6 @@ { "name": "@0x/react-shared", - "version": "1.1.2", + "version": "2.0.3", "engines": { "node": ">=6.12" }, @@ -25,19 +25,19 @@ "url": "https://github.com/0xProject/0x-monorepo.git" }, "devDependencies": { - "@0x/dev-utils": "^1.0.24", - "@0x/tslint-config": "^2.0.2", + "@0x/dev-utils": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", - "tslint": "^5.9.1", + "tslint": "5.11.0", "typescript": "3.0.1" }, "dependencies": { - "@0x/types": "^1.5.2", + "@0x/types": "^2.0.2", "@material-ui/core": "^3.0.1", "@types/is-mobile": "0.3.0", "@types/lodash": "4.14.104", - "@types/material-ui": "0.18.0", + "@types/material-ui": "^0.20.0", "@types/node": "*", "@types/react": "*", "@types/react-dom": "*", @@ -48,15 +48,15 @@ "basscss": "^8.0.3", "change-case": "^3.0.2", "is-mobile": "^0.2.2", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "material-ui": "^0.20.0", "react": "^16.5.2", "react-dom": "^16.5.2", - "react-highlight": "0xproject/react-highlight#fix/react-version", + "react-highlight": "0xproject/react-highlight#react-peer-deps", "react-markdown": "^3.2.2", - "react-router-dom": "^4.1.1", + "react-router-dom": "^4.3.1", "react-scroll": "0xproject/react-scroll#pr-330-and-replace-state", - "styled-components": "^4.0.1", + "styled-components": "^4.1.1", "valid-url": "^1.0.9" }, "publishConfig": { diff --git a/packages/react-shared/src/components/markdown_paragraph_block.tsx b/packages/react-shared/src/components/markdown_paragraph_block.tsx index eeaef8571..9ed44ed07 100644 --- a/packages/react-shared/src/components/markdown_paragraph_block.tsx +++ b/packages/react-shared/src/components/markdown_paragraph_block.tsx @@ -6,5 +6,9 @@ import { colors } from '../utils/colors'; export interface MarkdownParagraphBlockProps {} export const MarkdownParagraphBlock: React.StatelessComponent<MarkdownParagraphBlockProps> = ({ children }) => { - return <span style={{ color: colors.greyTheme, lineHeight: '26px' }}>{children}</span>; + return ( + <span style={{ color: colors.greyTheme, lineHeight: '26px', display: 'block', paddingBottom: 15 }}> + {children} + </span> + ); }; diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json index 672939a4a..ed9c45245 100644 --- a/packages/sol-compiler/CHANGELOG.json +++ b/packages/sol-compiler/CHANGELOG.json @@ -1,12 +1,44 @@ [ { + "version": "3.0.2", + "changes": [ + { + "note": "Fix a bug when smart recompilation wasn't working because of remappings", + "pr": 1575 + }, + { + "note": "Fix a bug that made `opts` required instead of optional", + "pr": 1596 + }, + { + "note": "Remove `bin_paths` and fetch the list of Solidity compilers from Github", + "pr": 1596 + }, + { + "note": "Fix a bug causing `ast` and `legacyAST` to not be added to the artifacts even when requested", + "pr": 1596 + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "3.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "3.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/sol-compiler/CHANGELOG.md b/packages/sol-compiler/CHANGELOG.md index dfcec1fa7..016509028 100644 --- a/packages/sol-compiler/CHANGELOG.md +++ b/packages/sol-compiler/CHANGELOG.md @@ -5,6 +5,21 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v3.0.2 - _February 7, 2019_ + + * Fix a bug when smart recompilation wasn't working because of remappings (#1575) + * Fix a bug that made `opts` required instead of optional (#1596) + * Remove `bin_paths` and fetch the list of Solidity compilers from Github (#1596) + * Fix a bug causing `ast` and `legacyAST` to not be added to the artifacts even when requested (#1596) + +## v3.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v3.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v2.0.2 - _January 15, 2019_ * Dependencies updated diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json index 0b53cffd5..3344c0b38 100644 --- a/packages/sol-compiler/package.json +++ b/packages/sol-compiler/package.json @@ -1,6 +1,6 @@ { "name": "@0x/sol-compiler", - "version": "2.0.2", + "version": "3.0.2", "engines": { "node": ">=6.12" }, @@ -42,13 +42,13 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-compiler/README.md", "devDependencies": { - "@0x/dev-utils": "^1.0.24", - "@0x/tslint-config": "^2.0.2", + "@0x/dev-utils": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/chokidar": "^1.7.5", "@types/mkdirp": "^0.5.2", "@types/pluralize": "^0.0.29", "@types/require-from-string": "^1.2.0", - "@types/semver": "^5.5.0", + "@types/semver": "5.5.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", "chai-bignumber": "^3.0.0", @@ -67,19 +67,19 @@ "zeppelin-solidity": "1.8.0" }, "dependencies": { - "@0x/assert": "^1.0.23", - "@0x/json-schemas": "^2.1.7", - "@0x/sol-resolver": "^1.2.3", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "@0x/assert": "^2.0.2", + "@0x/json-schemas": "^3.0.2", + "@0x/sol-resolver": "^2.0.2", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "@types/yargs": "^11.0.0", "chalk": "^2.3.0", "chokidar": "^2.0.4", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "ethereumjs-util": "^5.1.1", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "mkdirp": "^0.5.1", "pluralize": "^7.0.0", "require-from-string": "^2.0.1", diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index efee3eb8a..afa4cc5bb 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -21,7 +21,6 @@ import * as semver from 'semver'; import solc = require('solc'); import { compilerOptionsSchema } from './schemas/compiler_options_schema'; -import { binPaths } from './solc/bin_paths'; import { addHexPrefixToContractBytecode, compileDockerAsync, @@ -29,6 +28,7 @@ import { createDirIfDoesNotExistAsync, getContractArtifactIfExistsAsync, getDependencyNameToPackagePath, + getSolcJSReleasesAsync, getSourcesWithDependencies, getSourceTreeHash, makeContractPathsRelative, @@ -96,12 +96,12 @@ export class Compiler { * @return An instance of the Compiler class. */ constructor(opts?: CompilerOptions) { - assert.doesConformToSchema('opts', opts, compilerOptionsSchema); + const passedOpts = opts || {}; + assert.doesConformToSchema('opts', passedOpts, compilerOptionsSchema); // TODO: Look for config file in parent directories if not found in current directory const config: CompilerOptions = fs.existsSync(CONFIG_FILE) ? JSON.parse(fs.readFileSync(CONFIG_FILE).toString()) : {}; - const passedOpts = opts || {}; assert.doesConformToSchema('compiler.json', config, compilerOptionsSchema); this._contractsDir = path.resolve(passedOpts.contractsDir || config.contractsDir || DEFAULT_CONTRACTS_DIR); this._solcVersionIfExists = passedOpts.solcVersion || config.solcVersion; @@ -195,9 +195,7 @@ export class Compiler { path.basename(contractSource.path, constants.SOLIDITY_FILE_EXTENSION), ); } else { - contractNamesToCompile = this._specifiedContracts.map(specifiedContract => - path.basename(specifiedContract, constants.SOLIDITY_FILE_EXTENSION), - ); + return this._specifiedContracts; } return contractNamesToCompile; } @@ -213,16 +211,14 @@ export class Compiler { // map contract paths to data about them for later verification and persistence const contractPathToData: ContractPathToData = {}; + const solcJSReleases = await getSolcJSReleasesAsync(); const resolvedContractSources = []; for (const contractName of contractNames) { const spyResolver = new SpyResolver(this._resolver); const contractSource = spyResolver.resolve(contractName); - const sourceTreeHashHex = getSourceTreeHash( - spyResolver, - path.join(this._contractsDir, contractSource.path), - ).toString('hex'); + const sourceTreeHashHex = getSourceTreeHash(spyResolver, contractSource.path).toString('hex'); const contractData = { - contractName, + contractName: path.basename(contractName, constants.SOLIDITY_FILE_EXTENSION), currentArtifactIfExists: await getContractArtifactIfExistsAsync(this._artifactsDir, contractName), sourceTreeHashHex: `0x${sourceTreeHashHex}`, }; @@ -231,7 +227,7 @@ export class Compiler { } contractPathToData[contractSource.path] = contractData; const solcVersion = _.isUndefined(this._solcVersionIfExists) - ? semver.maxSatisfying(_.keys(binPaths), parseSolidityVersionRange(contractSource.source)) + ? semver.maxSatisfying(_.keys(solcJSReleases), parseSolidityVersionRange(contractSource.source)) : this._solcVersionIfExists; const isFirstContractWithThisVersion = _.isUndefined(versionToInputs[solcVersion]); if (isFirstContractWithThisVersion) { @@ -277,7 +273,7 @@ export class Compiler { fullSolcVersion = versionCommandOutputParts[versionCommandOutputParts.length - 1].trim(); compilerOutput = await compileDockerAsync(solcVersion, input.standardInput); } else { - fullSolcVersion = binPaths[solcVersion]; + fullSolcVersion = solcJSReleases[solcVersion]; compilerOutput = await compileSolcJSAsync(solcVersion, input.standardInput); } if (!_.isUndefined(compilerOutput.errors)) { @@ -329,7 +325,10 @@ export class Compiler { } else { const currentArtifact = contractData.currentArtifactIfExists as ContractArtifact; const isUserOnLatestVersion = currentArtifact.schemaVersion === constants.LATEST_ARTIFACT_VERSION; - const didCompilerSettingsChange = !_.isEqual(currentArtifact.compiler.settings, this._compilerSettings); + const didCompilerSettingsChange = !_.isEqual( + _.omit(currentArtifact.compiler.settings, 'remappings'), + _.omit(this._compilerSettings, 'remappings'), + ); const didSourceChange = currentArtifact.sourceTreeHashHex !== contractData.sourceTreeHashHex; return !isUserOnLatestVersion || didCompilerSettingsChange || didSourceChange; } diff --git a/packages/sol-compiler/src/solc/bin_paths.ts b/packages/sol-compiler/src/solc/bin_paths.ts deleted file mode 100644 index b653c0926..000000000 --- a/packages/sol-compiler/src/solc/bin_paths.ts +++ /dev/null @@ -1,52 +0,0 @@ -export interface BinaryPaths { - [key: string]: string; -} - -export const binPaths: BinaryPaths = { - '0.5.2': 'soljson-v0.5.2+commit.1df8f40c.js', - '0.5.1': 'soljson-v0.5.1+commit.c8a2cb62.js', - '0.5.0': 'soljson-v0.5.0+commit.1d4f565a.js', - '0.4.25': 'soljson-v0.4.25+commit.59dbf8f1.js', - '0.4.24': 'soljson-v0.4.24+commit.e67f0147.js', - '0.4.23': 'soljson-v0.4.23+commit.124ca40d.js', - '0.4.22': 'soljson-v0.4.22+commit.4cb486ee.js', - '0.4.21': 'soljson-v0.4.21+commit.dfe3193c.js', - '0.4.20': 'soljson-v0.4.20+commit.3155dd80.js', - '0.4.19': 'soljson-v0.4.19+commit.c4cbbb05.js', - '0.4.18': 'soljson-v0.4.18+commit.9cf6e910.js', - '0.4.17': 'soljson-v0.4.17+commit.bdeb9e52.js', - '0.4.16': 'soljson-v0.4.16+commit.d7661dd9.js', - '0.4.15': 'soljson-v0.4.15+commit.bbb8e64f.js', - '0.4.14': 'soljson-v0.4.14+commit.c2215d46.js', - '0.4.13': 'soljson-v0.4.13+commit.fb4cb1a.js', - '0.4.12': 'soljson-v0.4.12+commit.194ff033.js', - '0.4.11': 'soljson-v0.4.11+commit.68ef5810.js', - '0.4.10': 'soljson-v0.4.10+commit.f0d539ae.js', - '0.4.9': 'soljson-v0.4.9+commit.364da425.js', - '0.4.8': 'soljson-v0.4.8+commit.60cc1668.js', - '0.4.7': 'soljson-v0.4.7+commit.822622cf.js', - '0.4.6': 'soljson-v0.4.6+commit.2dabbdf0.js', - '0.4.5': 'soljson-v0.4.5+commit.b318366e.js', - '0.4.4': 'soljson-v0.4.4+commit.4633f3de.js', - '0.4.3': 'soljson-v0.4.3+commit.2353da71.js', - '0.4.2': 'soljson-v0.4.2+commit.af6afb04.js', - '0.4.1': 'soljson-v0.4.1+commit.4fc6fc2c.js', - '0.4.0': 'soljson-v0.4.0+commit.acd334c9.js', - '0.3.6': 'soljson-v0.3.6+commit.3fc68da.js', - '0.3.5': 'soljson-v0.3.5+commit.5f97274.js', - '0.3.4': 'soljson-v0.3.4+commit.7dab890.js', - '0.3.3': 'soljson-v0.3.3+commit.4dc1cb1.js', - '0.3.2': 'soljson-v0.3.2+commit.81ae2a7.js', - '0.3.1': 'soljson-v0.3.1+commit.c492d9b.js', - '0.3.0': 'soljson-v0.3.0+commit.11d6736.js', - '0.2.2': 'soljson-v0.2.2+commit.ef92f56.js', - '0.2.1': 'soljson-v0.2.1+commit.91a6b35.js', - '0.2.0': 'soljson-v0.2.0+commit.4dc2445.js', - '0.1.7': 'soljson-v0.1.7+commit.b4e666c.js', - '0.1.6': 'soljson-v0.1.6+commit.d41f8b7.js', - '0.1.5': 'soljson-v0.1.5+commit.23865e3.js', - '0.1.4': 'soljson-v0.1.4+commit.5f6c3cd.js', - '0.1.3': 'soljson-v0.1.3+commit.28f561.js', - '0.1.2': 'soljson-v0.1.2+commit.d0d36e3.js', - '0.1.1': 'soljson-v0.1.1+commit.6ff4cd6.js', -}; diff --git a/packages/sol-compiler/src/utils/compiler.ts b/packages/sol-compiler/src/utils/compiler.ts index c75f76dac..28049e453 100644 --- a/packages/sol-compiler/src/utils/compiler.ts +++ b/packages/sol-compiler/src/utils/compiler.ts @@ -9,11 +9,9 @@ import * as path from 'path'; import * as requireFromString from 'require-from-string'; import * as solc from 'solc'; -import { binPaths } from '../solc/bin_paths'; - import { constants } from './constants'; import { fsWrapper } from './fs_wrapper'; -import { CompilationError } from './types'; +import { BinaryPaths, CompilationError } from './types'; /** * Gets contract data on network or returns if an artifact does not exist. @@ -26,7 +24,10 @@ export async function getContractArtifactIfExistsAsync( contractName: string, ): Promise<ContractArtifact | void> { let contractArtifact; - const currentArtifactPath = `${artifactsDir}/${contractName}.json`; + const currentArtifactPath = `${artifactsDir}/${path.basename( + contractName, + constants.SOLIDITY_FILE_EXTENSION, + )}.json`; try { const opts = { encoding: 'utf8', @@ -116,6 +117,20 @@ export function parseDependencies(contractSource: ContractSource): string[] { return dependencies; } +let solcJSReleasesCache: BinaryPaths | undefined; + +/** + * Fetches the list of available solidity compilers + */ +export async function getSolcJSReleasesAsync(): Promise<BinaryPaths> { + if (_.isUndefined(solcJSReleasesCache)) { + const versionList = await fetch('https://ethereum.github.io/solc-bin/bin/list.json'); + const versionListJSON = await versionList.json(); + solcJSReleasesCache = versionListJSON.releases; + } + return solcJSReleasesCache as BinaryPaths; +} + /** * Compiles the contracts and prints errors/warnings * @param solcVersion Version of a solc compiler @@ -236,7 +251,7 @@ export function getSourcesWithDependencies( contractPath: string, fullSources: { [sourceName: string]: { id: number } }, ): { sourceCodes: { [sourceName: string]: string }; sources: { [sourceName: string]: { id: number } } } { - const sources = { [contractPath]: { id: fullSources[contractPath].id } }; + const sources = { [contractPath]: fullSources[contractPath] }; const sourceCodes = { [contractPath]: resolver.resolve(contractPath).source }; recursivelyGatherDependencySources( resolver, @@ -316,7 +331,8 @@ function recursivelyGatherDependencySources( * @param solcVersion The compiler version. e.g. 0.5.0 */ export async function getSolcJSAsync(solcVersion: string): Promise<solc.SolcInstance> { - const fullSolcVersion = binPaths[solcVersion]; + const solcJSReleases = await getSolcJSReleasesAsync(); + const fullSolcVersion = solcJSReleases[solcVersion]; if (_.isUndefined(fullSolcVersion)) { throw new Error(`${solcVersion} is not a known compiler version`); } diff --git a/packages/sol-compiler/src/utils/types.ts b/packages/sol-compiler/src/utils/types.ts index 64328899d..f756c51bb 100644 --- a/packages/sol-compiler/src/utils/types.ts +++ b/packages/sol-compiler/src/utils/types.ts @@ -13,6 +13,10 @@ export interface ContractSourceData { [contractName: string]: ContractSpecificSourceData; } +export interface BinaryPaths { + [key: string]: string; +} + export interface ContractSpecificSourceData { solcVersionRange: string; sourceHash: Buffer; diff --git a/packages/sol-compiler/test/compiler_test.ts b/packages/sol-compiler/test/compiler_test.ts index 464aa8bb6..cae6bce05 100644 --- a/packages/sol-compiler/test/compiler_test.ts +++ b/packages/sol-compiler/test/compiler_test.ts @@ -23,6 +23,9 @@ describe('#Compiler', function(): void { contractsDir, contracts: constants.contracts, }; + it('should create a Compiler with empty opts', async () => { + const _compiler = new Compiler(); // tslint:disable-line no-unused-variable + }); it('should create an Exchange artifact with the correct unlinked binary', async () => { compilerOpts.contracts = ['Exchange']; diff --git a/packages/sol-coverage/CHANGELOG.json b/packages/sol-coverage/CHANGELOG.json index 550ca2feb..dc5ae1a53 100644 --- a/packages/sol-coverage/CHANGELOG.json +++ b/packages/sol-coverage/CHANGELOG.json @@ -1,12 +1,31 @@ [ { + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547747677, diff --git a/packages/sol-coverage/CHANGELOG.md b/packages/sol-coverage/CHANGELOG.md index 18c1719bf..1af9b9f26 100644 --- a/packages/sol-coverage/CHANGELOG.md +++ b/packages/sol-coverage/CHANGELOG.md @@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.0.3 - _January 17, 2019_ * Dependencies updated diff --git a/packages/sol-coverage/package.json b/packages/sol-coverage/package.json index 805e2e670..6724a03df 100644 --- a/packages/sol-coverage/package.json +++ b/packages/sol-coverage/package.json @@ -1,6 +1,6 @@ { "name": "@0x/sol-coverage", - "version": "1.0.3", + "version": "2.0.2", "engines": { "node": ">=6.12" }, @@ -29,14 +29,14 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-coverage/README.md", "dependencies": { - "@0x/sol-tracing-utils": "^4.0.1", - "@0x/subproviders": "^2.1.11", - "@0x/typescript-typings": "^3.0.8", - "ethereum-types": "^1.1.6", - "lodash": "^4.17.5" + "@0x/sol-tracing-utils": "^6.0.2", + "@0x/subproviders": "^3.0.2", + "@0x/typescript-typings": "^4.0.0", + "ethereum-types": "^2.0.0", + "lodash": "^4.17.11" }, "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/node": "*", "npm-run-all": "^4.1.2", "nyc": "^11.0.1", diff --git a/packages/sol-doc/CHANGELOG.json b/packages/sol-doc/CHANGELOG.json index 662915faf..d9d0ddfa2 100644 --- a/packages/sol-doc/CHANGELOG.json +++ b/packages/sol-doc/CHANGELOG.json @@ -1,12 +1,31 @@ [ { + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/sol-doc/CHANGELOG.md b/packages/sol-doc/CHANGELOG.md index 1a60b5f89..06ea1d7b4 100644 --- a/packages/sol-doc/CHANGELOG.md +++ b/packages/sol-doc/CHANGELOG.md @@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.0.14 - _January 15, 2019_ * Dependencies updated diff --git a/packages/sol-doc/package.json b/packages/sol-doc/package.json index 179f45e81..c413e248f 100644 --- a/packages/sol-doc/package.json +++ b/packages/sol-doc/package.json @@ -1,6 +1,6 @@ { "name": "@0x/sol-doc", - "version": "1.0.14", + "version": "2.0.2", "description": "Solidity documentation generator", "main": "lib/src/index.js", "types": "lib/src/index.d.js", @@ -25,22 +25,22 @@ "author": "F. Eugene Aumson", "license": "Apache-2.0", "dependencies": { - "@0x/sol-compiler": "^2.0.2", - "@0x/types": "^1.5.2", - "@0x/utils": "^3.0.1", - "ethereum-types": "^1.1.6", + "@0x/sol-compiler": "^3.0.2", + "@0x/types": "^2.0.2", + "@0x/utils": "^4.0.3", + "ethereum-types": "^2.0.0", "ethereumjs-util": "^5.1.1", - "lodash": "^4.17.10", - "yargs": "^12.0.2" + "lodash": "^4.17.11", + "yargs": "^10.0.3" }, "devDependencies": { - "@0x/tslint-config": "^2.0.2", - "chai": "^4.1.2", + "@0x/tslint-config": "^3.0.0", + "chai": "^4.0.1", "chai-as-promised": "^7.1.0", "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", - "mocha": "^5.2.0", + "mocha": "^4.1.0", "shx": "^0.2.2", "source-map-support": "^0.5.0", "tslint": "5.11.0" diff --git a/packages/sol-profiler/CHANGELOG.json b/packages/sol-profiler/CHANGELOG.json index fc928b516..89f3f7171 100644 --- a/packages/sol-profiler/CHANGELOG.json +++ b/packages/sol-profiler/CHANGELOG.json @@ -1,12 +1,31 @@ [ { + "version": "2.0.3", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.0.1", "changes": [ { "note": "Fix a bug when some parts of the profiling report were missing because of the coverage ignore lines", "pr": 1535 } - ] + ], + "timestamp": 1549373905 }, { "version": "2.0.0", diff --git a/packages/sol-profiler/CHANGELOG.md b/packages/sol-profiler/CHANGELOG.md index 18c1719bf..bf9e59e54 100644 --- a/packages/sol-profiler/CHANGELOG.md +++ b/packages/sol-profiler/CHANGELOG.md @@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.2 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.1 - _February 5, 2019_ + + * Fix a bug when some parts of the profiling report were missing because of the coverage ignore lines (#1535) + +## v2.0.0 - _Invalid date_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.0.3 - _January 17, 2019_ * Dependencies updated diff --git a/packages/sol-profiler/package.json b/packages/sol-profiler/package.json index 4fe2928c7..cce49e22e 100644 --- a/packages/sol-profiler/package.json +++ b/packages/sol-profiler/package.json @@ -1,6 +1,6 @@ { "name": "@0x/sol-profiler", - "version": "1.0.3", + "version": "2.0.3", "engines": { "node": ">=6.12" }, @@ -29,14 +29,14 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-profiler/README.md", "dependencies": { - "@0x/sol-tracing-utils": "^4.0.1", - "@0x/subproviders": "^2.1.11", - "@0x/typescript-typings": "^3.0.8", - "ethereum-types": "^1.1.6", - "lodash": "^4.17.5" + "@0x/sol-tracing-utils": "^6.0.2", + "@0x/subproviders": "^3.0.2", + "@0x/typescript-typings": "^4.0.0", + "ethereum-types": "^2.0.0", + "lodash": "^4.17.11" }, "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/node": "*", "npm-run-all": "^4.1.2", "shx": "^0.2.2", diff --git a/packages/sol-resolver/CHANGELOG.json b/packages/sol-resolver/CHANGELOG.json index f5a005fd4..9c02b9148 100644 --- a/packages/sol-resolver/CHANGELOG.json +++ b/packages/sol-resolver/CHANGELOG.json @@ -1,12 +1,31 @@ [ { + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/sol-resolver/CHANGELOG.md b/packages/sol-resolver/CHANGELOG.md index a48561cc3..f23c55ea8 100644 --- a/packages/sol-resolver/CHANGELOG.md +++ b/packages/sol-resolver/CHANGELOG.md @@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.2.3 - _January 15, 2019_ * Dependencies updated diff --git a/packages/sol-resolver/package.json b/packages/sol-resolver/package.json index 0518cde95..aeb0c6bfc 100644 --- a/packages/sol-resolver/package.json +++ b/packages/sol-resolver/package.json @@ -1,6 +1,6 @@ { "name": "@0x/sol-resolver", - "version": "1.2.3", + "version": "2.0.2", "engines": { "node": ">=6.12" }, @@ -23,16 +23,16 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/resolver/README.md", "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", "tslint": "5.11.0", "typescript": "3.0.1" }, "dependencies": { - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "lodash": "^4.17.5" + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/packages/sol-trace/CHANGELOG.json b/packages/sol-trace/CHANGELOG.json index b633b3d21..c786a56a3 100644 --- a/packages/sol-trace/CHANGELOG.json +++ b/packages/sol-trace/CHANGELOG.json @@ -1,12 +1,31 @@ [ { + "version": "2.0.3", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.0.1", "changes": [ { "note": "Improve error messages when unable to find matching bytecode", "pr": 1558 } - ] + ], + "timestamp": 1549373905 }, { "version": "2.0.0", diff --git a/packages/sol-trace/CHANGELOG.md b/packages/sol-trace/CHANGELOG.md index 18c1719bf..bcb75c423 100644 --- a/packages/sol-trace/CHANGELOG.md +++ b/packages/sol-trace/CHANGELOG.md @@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.2 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.1 - _February 5, 2019_ + + * Improve error messages when unable to find matching bytecode (#1558) + +## v2.0.0 - _Invalid date_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.0.3 - _January 17, 2019_ * Dependencies updated diff --git a/packages/sol-trace/package.json b/packages/sol-trace/package.json index 25e81a82a..b65a8b002 100644 --- a/packages/sol-trace/package.json +++ b/packages/sol-trace/package.json @@ -1,6 +1,6 @@ { "name": "@0x/sol-trace", - "version": "1.0.3", + "version": "2.0.3", "engines": { "node": ">=6.12" }, @@ -29,17 +29,17 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-trace/README.md", "dependencies": { - "@0x/sol-tracing-utils": "^4.0.1", - "@0x/subproviders": "^2.1.11", - "@0x/typescript-typings": "^3.0.8", + "@0x/sol-tracing-utils": "^6.0.2", + "@0x/subproviders": "^3.0.2", + "@0x/typescript-typings": "^4.0.0", "chalk": "^2.3.0", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "ethereumjs-util": "^5.1.1", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "loglevel": "^1.6.1" }, "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/loglevel": "^1.5.3", "@types/node": "*", "npm-run-all": "^4.1.2", diff --git a/packages/sol-tracing-utils/CHANGELOG.json b/packages/sol-tracing-utils/CHANGELOG.json index 89a5b6876..911cf6c1f 100644 --- a/packages/sol-tracing-utils/CHANGELOG.json +++ b/packages/sol-tracing-utils/CHANGELOG.json @@ -1,5 +1,23 @@ [ { + "version": "6.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "6.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "6.0.0", "changes": [ { @@ -25,8 +43,17 @@ { "note": "Improve error messages when unable to find matching bytecode", "pr": 1558 + }, + { + "note": "Fix default gas limit for fake txs in `TraceCollectionSubprovider`", + "pr": 1583 + }, + { + "note": "Fix a big when we were not intercepting `eth_sendRawTransaction`", + "pr": 1584 } - ] + ], + "timestamp": 1549373905 }, { "version": "5.0.0", diff --git a/packages/sol-tracing-utils/CHANGELOG.md b/packages/sol-tracing-utils/CHANGELOG.md index 9bffb2a6d..6f9fa5615 100644 --- a/packages/sol-tracing-utils/CHANGELOG.md +++ b/packages/sol-tracing-utils/CHANGELOG.md @@ -5,6 +5,29 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v6.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v6.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v6.0.0 - _February 5, 2019_ + + * `SolCompilerArtifactAdapter` now uses `SolResolver` under the hood which allows to resolve `NPM` dependencies properly (#1535) + * Cache the `utils.getContractDataIfExists` leading to faster execution (#1535) + * `SolCompilerArtifactAdapter` now doesn't return the `ContractData` for interfaces (#1535) + * Print resasonable error message on bytecode collision (#1535) + * Fix the bug in `ASTVisitor` causing the 'cannot read property `range` of `null`' error (#1557) + * Improve error messages when unable to find matching bytecode (#1558) + * Fix default gas limit for fake txs in `TraceCollectionSubprovider` (#1583) + * Fix a big when we were not intercepting `eth_sendRawTransaction` (#1584) + +## v5.0.0 - _Invalid date_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v4.0.1 - _January 17, 2019_ * Fix a bug where a custom `Geth` tracer didn't return stack entries for `DELEGATECALL` (#1521) diff --git a/packages/sol-tracing-utils/package.json b/packages/sol-tracing-utils/package.json index 929c73b84..8bccb237d 100644 --- a/packages/sol-tracing-utils/package.json +++ b/packages/sol-tracing-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0x/sol-tracing-utils", - "version": "4.0.1", + "version": "6.0.2", "engines": { "node": ">=6.12" }, @@ -42,20 +42,21 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-tracing-utils/README.md", "dependencies": { - "@0x/dev-utils": "^1.0.24", - "@0x/sol-compiler": "^2.0.2", - "@0x/sol-resolver": "^1.2.3", - "@0x/subproviders": "^2.1.11", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "@0x/dev-utils": "^2.0.2", + "@0x/sol-compiler": "^3.0.2", + "@0x/sol-resolver": "^2.0.2", + "@0x/subproviders": "^3.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "@types/solidity-parser-antlr": "^0.2.0", - "ethereum-types": "^1.1.6", + "chalk": "^2.3.0", + "ethereum-types": "^2.0.0", "ethereumjs-util": "^5.1.1", + "ethers": "~4.0.4", "glob": "^7.1.2", - "chalk": "^2.3.0", "istanbul": "^0.4.5", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "loglevel": "^1.6.1", "mkdirp": "^0.5.1", "rimraf": "^2.6.2", @@ -63,10 +64,10 @@ "solidity-parser-antlr": "^0.2.12" }, "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/istanbul": "^0.4.30", "@types/loglevel": "^1.5.3", - "@types/mkdirp": "^0.5.1", + "@types/mkdirp": "^0.5.2", "@types/mocha": "^2.2.42", "@types/node": "*", "@types/rimraf": "^2.0.2", diff --git a/packages/sol-tracing-utils/src/trace_collection_subprovider.ts b/packages/sol-tracing-utils/src/trace_collection_subprovider.ts index 5118921fa..7fde1f9b8 100644 --- a/packages/sol-tracing-utils/src/trace_collection_subprovider.ts +++ b/packages/sol-tracing-utils/src/trace_collection_subprovider.ts @@ -3,6 +3,7 @@ import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0x/subprovi import { logUtils } from '@0x/utils'; import { CallDataRPC, marshaller, Web3Wrapper } from '@0x/web3-wrapper'; import { JSONRPCRequestPayload, Provider, TxData } from 'ethereum-types'; +import { utils } from 'ethers'; import * as _ from 'lodash'; import { Lock } from 'semaphore-async-await'; @@ -96,6 +97,18 @@ export abstract class TraceCollectionSubprovider extends Subprovider { } return; + case 'eth_sendRawTransaction': + if (!this._config.shouldCollectTransactionTraces) { + next(); + } else { + const txData = utils.parseTransaction(payload.params[0]); + if (txData.to === null) { + txData.to = constants.NEW_CONTRACT; + } + next(logAsyncErrors(this._onTransactionSentAsync.bind(this, txData))); + } + return; + case 'eth_call': if (!this._config.shouldCollectCallTraces) { next(); @@ -180,13 +193,13 @@ export abstract class TraceCollectionSubprovider extends Subprovider { cb(); } private async _recordCallOrGasEstimateTraceAsync(callData: Partial<CallDataRPC>): Promise<void> { - // We don't want other transactions to be exeucted during snashotting period, that's why we lock the + // We don't want other transactions to be executed during snashotting period, that's why we lock the // transaction execution for all transactions except our fake ones. await this._lock.acquire(); const blockchainLifecycle = new BlockchainLifecycle(this._web3Wrapper); await blockchainLifecycle.startAsync(); const fakeTxData = { - gas: BLOCK_GAS_LIMIT.toString(16), // tslint:disable-line:custom-no-magic-numbers + gas: `0x${BLOCK_GAS_LIMIT.toString(16)}`, // tslint:disable-line:custom-no-magic-numbers isFakeTransaction: true, // This transaction (and only it) is allowed to come through when the lock is locked ...callData, from: callData.from || this._defaultFromAddress, diff --git a/packages/sra-spec/CHANGELOG.json b/packages/sra-spec/CHANGELOG.json index e22a3b0e4..05ea49243 100644 --- a/packages/sra-spec/CHANGELOG.json +++ b/packages/sra-spec/CHANGELOG.json @@ -1,12 +1,31 @@ [ { + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/sra-spec/CHANGELOG.md b/packages/sra-spec/CHANGELOG.md index 5fe40ccb4..ce7a09708 100644 --- a/packages/sra-spec/CHANGELOG.md +++ b/packages/sra-spec/CHANGELOG.md @@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v1.0.16 - _January 15, 2019_ * Dependencies updated diff --git a/packages/sra-spec/package.json b/packages/sra-spec/package.json index 9c4c0a24f..28cf15938 100644 --- a/packages/sra-spec/package.json +++ b/packages/sra-spec/package.json @@ -1,6 +1,6 @@ { "name": "@0x/sra-spec", - "version": "1.0.16", + "version": "2.0.2", "engines": { "node": ">=6.12" }, @@ -35,20 +35,20 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sra-spec/README.md", "dependencies": { - "@0x/json-schemas": "^2.1.7", + "@0x/json-schemas": "^3.0.2", "@loopback/openapi-v3-types": "^0.8.2" }, "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/mocha": "^2.2.42", - "@types/node": "^10.5.3", + "@types/node": "*", "chai": "^4.0.1", "chokidar-cli": "^1.2.0", "copyfiles": "^2.0.0", "dirty-chai": "^2.0.1", "discharge": "^0.7.1", - "mocha": "^4.0.1", - "npm-run-all": "^4.1.3", + "mocha": "^4.1.0", + "npm-run-all": "^4.1.2", "nyc": "^11.0.1", "redoc-cli": "^0.6.1", "shx": "^0.2.2", diff --git a/packages/subproviders/CHANGELOG.json b/packages/subproviders/CHANGELOG.json index ffb9740cd..3d5bade1f 100644 --- a/packages/subproviders/CHANGELOG.json +++ b/packages/subproviders/CHANGELOG.json @@ -1,5 +1,23 @@ [ { + "version": "3.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "3.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "3.0.0", "changes": [ { @@ -10,7 +28,8 @@ "note": "Update ganache-core to v2.3.3", "pr": 1518 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/subproviders/CHANGELOG.md b/packages/subproviders/CHANGELOG.md index 16457ee2b..b3dfa757a 100644 --- a/packages/subproviders/CHANGELOG.md +++ b/packages/subproviders/CHANGELOG.md @@ -5,6 +5,19 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v3.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v3.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v3.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + * Update ganache-core to v2.3.3 (#1518) + ## v2.1.11 - _January 15, 2019_ * Dependencies updated diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json index b54cc11db..a783bb5a2 100644 --- a/packages/subproviders/package.json +++ b/packages/subproviders/package.json @@ -1,6 +1,6 @@ { "name": "@0x/subproviders", - "version": "2.1.11", + "version": "3.0.2", "engines": { "node": ">=6.12" }, @@ -29,11 +29,11 @@ } }, "dependencies": { - "@0x/assert": "^1.0.23", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "@0x/assert": "^2.0.2", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "@ledgerhq/hw-app-eth": "^4.3.0", "@ledgerhq/hw-transport-u2f": "4.24.0", "@types/eth-lightwallet": "^3.0.0", @@ -43,18 +43,18 @@ "bip39": "^2.5.0", "bn.js": "^4.11.8", "eth-lightwallet": "^3.0.1", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "ethereumjs-tx": "^1.3.5", "ethereumjs-util": "^5.1.1", "ganache-core": "^2.3.3", "hdkey": "^0.7.1", "json-rpc-error": "2.0.0", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "semaphore-async-await": "^1.5.1", "web3-provider-engine": "14.0.6" }, "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/bip39": "^2.4.0", "@types/bn.js": "^4.11.0", "@types/ethereumjs-tx": "^1.0.0", diff --git a/packages/testnet-faucets/package.json b/packages/testnet-faucets/package.json index da7477be4..c529d4975 100644 --- a/packages/testnet-faucets/package.json +++ b/packages/testnet-faucets/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@0x/testnet-faucets", - "version": "1.0.64", + "version": "1.0.68", "engines": { "node": ">=6.12" }, @@ -18,21 +18,21 @@ "author": "Fabio Berger", "license": "Apache-2.0", "dependencies": { - "0x.js": "^3.0.3", - "@0x/subproviders": "^2.1.11", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "0x.js": "^4.0.3", + "@0x/subproviders": "^3.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "body-parser": "^1.17.1", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "ethereumjs-tx": "^1.3.5", "ethereumjs-util": "^5.1.1", "express": "^4.15.2", - "lodash": "^4.17.5", - "rollbar": "^0.6.5" + "lodash": "^4.17.11", + "rollbar": "^2.5.0" }, "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/body-parser": "^1.16.1", "@types/express": "^4.0.35", "@types/lodash": "4.14.104", diff --git a/packages/tslint-config/CHANGELOG.json b/packages/tslint-config/CHANGELOG.json index 34ea6aa6b..884a5b46f 100644 --- a/packages/tslint-config/CHANGELOG.json +++ b/packages/tslint-config/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/tslint-config/CHANGELOG.md b/packages/tslint-config/CHANGELOG.md index 37d287c10..5719f28a6 100644 --- a/packages/tslint-config/CHANGELOG.md +++ b/packages/tslint-config/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v3.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v2.0.2 - _January 15, 2019_ * Dependencies updated diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json index f90321edb..b5846a5aa 100644 --- a/packages/tslint-config/package.json +++ b/packages/tslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@0x/tslint-config", - "version": "2.0.2", + "version": "3.0.0", "engines": { "node": ">=6.12" }, @@ -40,7 +40,7 @@ "typescript": "3.0.1" }, "dependencies": { - "lodash": "^4.17.5", + "lodash": "^4.17.11", "tslint": "5.11.0", "tslint-eslint-rules": "5.4.0", "tslint-react": "^3.2.0", diff --git a/packages/types/CHANGELOG.json b/packages/types/CHANGELOG.json index 7a6d205ee..8f2bf967a 100644 --- a/packages/types/CHANGELOG.json +++ b/packages/types/CHANGELOG.json @@ -1,12 +1,39 @@ [ { + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.0.0", "changes": [ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 + }, + { + "note": "Update `ZeroExTransaction` type and add `SignedZeroExTransaction` type", + "pr": 1576 + }, + { + "note": "Add `EIP712DomainWithDefaultSchema` type", + "pr": 1576 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index ac27d9096..a2bc34dee 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -5,6 +5,20 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v2.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v2.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + * Update `ZeroExTransaction` type and add `SignedZeroExTransaction` type (#1576) + * Add `EIP712DomainWithDefaultSchema` type (#1576) + ## v1.5.2 - _January 15, 2019_ * Dependencies updated diff --git a/packages/types/package.json b/packages/types/package.json index 440f05423..951251c58 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@0x/types", - "version": "1.5.2", + "version": "2.0.2", "engines": { "node": ">=6.12" }, @@ -23,7 +23,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/types/README.md", "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", "tslint": "5.11.0", @@ -32,7 +32,7 @@ "dependencies": { "@types/node": "*", "bignumber.js": "~8.0.2", - "ethereum-types": "^1.1.6" + "ethereum-types": "^2.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 49f788fb0..b3a083999 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -45,11 +45,16 @@ export interface SignedOrder extends Order { * ZeroExTransaction for use with 0x Exchange executeTransaction */ export interface ZeroExTransaction { + verifyingContractAddress: string; salt: BigNumber; signerAddress: string; data: string; } +export interface SignedZeroExTransaction extends ZeroExTransaction { + signature: string; +} + /** * Elliptic Curve signature */ @@ -685,3 +690,33 @@ export interface DutchAuctionDetails { currentAmount: BigNumber; currentTimeSeconds: BigNumber; } + +export interface PackageJSONConfig { + postpublish?: { + assets?: string[]; + docOmitExports?: string[]; + dockerHubRepo?: string; + }; + 'abis:comment'?: string; + abis?: string; + ignoreDependencyVersions?: string; + ignoreDependencyVersionsForPackage?: string; +} + +export interface PackageJSON { + private?: boolean; + version: string; + name: string; + main?: string; + scripts?: { [command: string]: string }; + config?: PackageJSONConfig; + dependencies?: { [dependencyName: string]: string }; + devDependencies?: { [dependencyName: string]: string }; + workspaces?: string[]; +} + +export interface EIP712DomainWithDefaultSchema { + name?: string; + version?: string; + verifyingContractAddress: string; +} diff --git a/packages/typescript-typings/CHANGELOG.json b/packages/typescript-typings/CHANGELOG.json index e3ae60231..708911720 100644 --- a/packages/typescript-typings/CHANGELOG.json +++ b/packages/typescript-typings/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/typescript-typings/CHANGELOG.md b/packages/typescript-typings/CHANGELOG.md index 8f23cce14..a879b1cf5 100644 --- a/packages/typescript-typings/CHANGELOG.md +++ b/packages/typescript-typings/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v4.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v3.0.8 - _January 15, 2019_ * Dependencies updated diff --git a/packages/typescript-typings/package.json b/packages/typescript-typings/package.json index 01cab8c63..f135e6f91 100644 --- a/packages/typescript-typings/package.json +++ b/packages/typescript-typings/package.json @@ -1,6 +1,6 @@ { "name": "@0x/typescript-typings", - "version": "3.0.8", + "version": "4.0.0", "engines": { "node": ">=6.12" }, @@ -27,7 +27,7 @@ "@types/bn.js": "^4.11.0", "@types/react": "*", "bignumber.js": "~8.0.2", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "popper.js": "1.14.3" }, "devDependencies": { diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index 0fb199e58..9ce2a4c52 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,5 +1,43 @@ [ { + "version": "4.0.4", + "changes": [ + { + "note": "Cleaner signature parsing", + "pr": 1592 + } + ] + }, + { + "version": "4.0.3", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "version": "4.0.2", + "changes": [ + { + "note": "ABI Decode NULL for all data types", + "pr": 1587 + } + ], + "timestamp": 1549452781 + }, + { + "version": "4.0.1", + "changes": [ + { + "note": "ABI Decode NULL as False", + "pr": 1582 + } + ], + "timestamp": 1549373905 + }, + { "version": "4.0.0", "changes": [ { diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index ed3f00158..4772bbb86 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v4.0.3 - _February 7, 2019_ + + * Dependencies updated + +## v4.0.2 - _February 6, 2019_ + + * ABI Decode NULL for all data types (#1587) + +## v4.0.1 - _February 5, 2019_ + + * ABI Decode NULL as False (#1582) + +## v4.0.0 - _Invalid date_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + ## v3.0.1 - _January 15, 2019_ * Dependencies updated diff --git a/packages/utils/package.json b/packages/utils/package.json index b6be39210..86fecbc7c 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0x/utils", - "version": "3.0.1", + "version": "4.0.3", "engines": { "node": ">=6.12" }, @@ -28,7 +28,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md", "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/detect-node": "2.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", @@ -44,19 +44,19 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", "@types/node": "*", "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~8.0.2", - "chalk": "^2.4.1", + "chalk": "^2.3.0", "detect-node": "2.0.3", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "ethereumjs-util": "^5.1.1", "ethers": "~4.0.4", - "isomorphic-fetch": "^2.2.1", + "isomorphic-fetch": "2.2.1", "js-sha3": "^0.7.0", - "lodash": "^4.17.5" + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/packages/utils/src/abi_encoder/abstract_data_types/data_type.ts b/packages/utils/src/abi_encoder/abstract_data_types/data_type.ts index f23324721..db4f02b89 100644 --- a/packages/utils/src/abi_encoder/abstract_data_types/data_type.ts +++ b/packages/utils/src/abi_encoder/abstract_data_types/data_type.ts @@ -47,7 +47,8 @@ export abstract class DataType { const hasSelector = !_.isUndefined(selector); const rawCalldata = new RawCalldata(calldata, hasSelector); const rules_ = _.isUndefined(rules) ? constants.DEFAULT_DECODING_RULES : rules; - const value = this.generateValue(rawCalldata, rules_); + const value = + rawCalldata.getSizeInBytes() > 0 ? this.generateValue(rawCalldata, rules_) : this.getDefaultValue(rules_); return value; } @@ -71,6 +72,7 @@ export abstract class DataType { public abstract generateCalldataBlock(value: any, parentBlock?: CalldataBlock): CalldataBlock; public abstract generateValue(calldata: RawCalldata, rules: DecodingRules): any; + public abstract getDefaultValue(rules?: DecodingRules): any; public abstract getSignatureType(): string; public abstract isStatic(): boolean; } diff --git a/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts b/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts index 2c6c4b0f6..d45088482 100644 --- a/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts +++ b/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts @@ -97,6 +97,27 @@ export abstract class AbstractSetDataType extends DataType { return isStatic; } + public getDefaultValue(rules?: DecodingRules): any[] | object { + let defaultValue: any[] | object; + if (this._isArray && _.isUndefined(this._arrayLength)) { + defaultValue = []; + } else if (!_.isUndefined(rules) && rules.shouldConvertStructsToObjects && !this._isArray) { + defaultValue = {}; + _.each(this._memberIndexByName, (idx: number, key: string) => { + const member = this._members[idx]; + const memberValue = member.getDefaultValue(); + (defaultValue as { [key: string]: any })[key] = memberValue; + }); + } else { + defaultValue = []; + _.each(this._members, (member: DataType, idx: number) => { + const memberValue = member.getDefaultValue(); + (defaultValue as any[]).push(memberValue); + }); + } + return defaultValue; + } + protected _generateCalldataBlockFromArray(value: any[], parentBlock?: CalldataBlock): SetCalldataBlock { // Sanity check: if the set has a defined length then `value` must have the same length. if (!_.isUndefined(this._arrayLength) && value.length !== this._arrayLength) { diff --git a/packages/utils/src/abi_encoder/calldata/raw_calldata.ts b/packages/utils/src/abi_encoder/calldata/raw_calldata.ts index 189841989..dbc9d4942 100644 --- a/packages/utils/src/abi_encoder/calldata/raw_calldata.ts +++ b/packages/utils/src/abi_encoder/calldata/raw_calldata.ts @@ -79,4 +79,9 @@ export class RawCalldata { public getSelector(): string { return this._selector; } + + public getSizeInBytes(): number { + const sizeInBytes = this._value.byteLength; + return sizeInBytes; + } } diff --git a/packages/utils/src/abi_encoder/evm_data_type_factory.ts b/packages/utils/src/abi_encoder/evm_data_type_factory.ts index 268649148..8e477f856 100644 --- a/packages/utils/src/abi_encoder/evm_data_type_factory.ts +++ b/packages/utils/src/abi_encoder/evm_data_type_factory.ts @@ -2,7 +2,7 @@ import { DataItem, MethodAbi } from 'ethereum-types'; import * as _ from 'lodash'; -import { generateDataItemsFromSignature } from './utils/signature_parser'; +import { generateDataItemFromSignature } from './utils/signature_parser'; import { DataType } from './abstract_data_types/data_type'; import { DataTypeFactory } from './abstract_data_types/interfaces'; @@ -134,32 +134,87 @@ export class EvmDataTypeFactory implements DataTypeFactory { /** * Convenience function for creating a DataType from different inputs. - * @param input A single or set of DataItem or a DataType signature. - * A signature in the form of '<type>' is interpreted as a `DataItem` - * For example, 'string' is interpreted as {type: 'string'} - * A signature in the form '(<type1>, <type2>, ..., <typen>)' is interpreted as `DataItem[]` - * For eaxmple, '(string, uint256)' is interpreted as [{type: 'string'}, {type: 'uint256'}] + * @param input A single or set of DataItem or a signature for an EVM data type. * @return DataType corresponding to input. */ export function create(input: DataItem | DataItem[] | string): DataType { - // Handle different types of input - const isSignature = typeof input === 'string'; - const isTupleSignature = isSignature && (input as string).startsWith('('); - const shouldParseAsTuple = isTupleSignature || _.isArray(input); - // Create input `dataItem` + const dataItem = consolidateDataItemsIntoSingle(input); + const dataType = EvmDataTypeFactory.getInstance().create(dataItem); + return dataType; +} + +/** + * Convenience function to aggregate a single input or a set of inputs into a single DataItem. + * An array of data items is grouped into a single tuple. + * @param input A single data item; a set of data items; a signature. + * @return A single data item corresponding to input. + */ +function consolidateDataItemsIntoSingle(input: DataItem | DataItem[] | string): DataItem { let dataItem: DataItem; - if (shouldParseAsTuple) { - const dataItems = isSignature ? generateDataItemsFromSignature(input as string) : (input as DataItem[]); + if (_.isArray(input)) { + const dataItems = input as DataItem[]; dataItem = { name: '', type: 'tuple', components: dataItems, }; } else { - dataItem = isSignature ? generateDataItemsFromSignature(input as string)[0] : (input as DataItem); + dataItem = _.isString(input) ? generateDataItemFromSignature(input) : (input as DataItem); } - // Create data type - const dataType = EvmDataTypeFactory.getInstance().create(dataItem); + return dataItem; +} + +/** + * Convenience function for creating a Method encoder from different inputs. + * @param methodName name of method. + * @param input A single data item; a set of data items; a signature; or an array of signatures (optional). + * @param output A single data item; a set of data items; a signature; or an array of signatures (optional). + * @return Method corresponding to input. + */ +export function createMethod( + methodName: string, + input?: DataItem | DataItem[] | string | string[], + output?: DataItem | DataItem[] | string | string[], +): Method { + const methodInput = _.isUndefined(input) ? [] : consolidateDataItemsIntoArray(input); + const methodOutput = _.isUndefined(output) ? [] : consolidateDataItemsIntoArray(output); + const methodAbi: MethodAbi = { + name: methodName, + inputs: methodInput, + outputs: methodOutput, + type: 'function', + // default fields not used by ABI + constant: false, + payable: false, + stateMutability: 'nonpayable', + }; + const dataType = new Method(methodAbi); return dataType; } + +/** + * Convenience function that aggregates a single input or a set of inputs into an array of DataItems. + * @param input A single data item; a set of data items; a signature; or an array of signatures. + * @return Array of data items corresponding to input. + */ +function consolidateDataItemsIntoArray(input: DataItem | DataItem[] | string | string[]): DataItem[] { + let dataItems: DataItem[]; + if (_.isArray(input) && _.isEmpty(input)) { + dataItems = []; + } else if (_.isArray(input) && _.isString(input[0])) { + dataItems = []; + _.each(input as string[], (signature: string) => { + const dataItem = generateDataItemFromSignature(signature); + dataItems.push(dataItem); + }); + } else if (_.isArray(input)) { + dataItems = input as DataItem[]; + } else if (typeof input === 'string') { + const dataItem = generateDataItemFromSignature(input); + dataItems = [dataItem]; + } else { + dataItems = [input as DataItem]; + } + return dataItems; +} /* tslint:enable no-construct */ diff --git a/packages/utils/src/abi_encoder/evm_data_types/address.ts b/packages/utils/src/abi_encoder/evm_data_types/address.ts index 2278830eb..7e92d3888 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/address.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/address.ts @@ -12,6 +12,7 @@ export class AddressDataType extends AbstractBlobDataType { private static readonly _ADDRESS_SIZE_IN_BYTES = 20; private static readonly _DECODED_ADDRESS_OFFSET_IN_BYTES = constants.EVM_WORD_WIDTH_IN_BYTES - AddressDataType._ADDRESS_SIZE_IN_BYTES; + private static readonly _DEFAULT_VALUE = '0x0000000000000000000000000000000000000000'; public static matchType(type: string): boolean { return type === SolidityTypes.Address; @@ -43,6 +44,10 @@ export class AddressDataType extends AbstractBlobDataType { return valueLowercase; } + public getDefaultValue(): string { + return AddressDataType._DEFAULT_VALUE; + } + public getSignatureType(): string { return SolidityTypes.Address; } diff --git a/packages/utils/src/abi_encoder/evm_data_types/bool.ts b/packages/utils/src/abi_encoder/evm_data_types/bool.ts index 23298bc88..24887c509 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/bool.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/bool.ts @@ -10,6 +10,7 @@ import { constants } from '../utils/constants'; export class BoolDataType extends AbstractBlobDataType { private static readonly _SIZE_KNOWN_AT_COMPILE_TIME: boolean = true; + private static readonly _DEFAULT_VALUE: boolean = false; public static matchType(type: string): boolean { return type === SolidityTypes.Bool; @@ -36,7 +37,8 @@ export class BoolDataType extends AbstractBlobDataType { public decodeValue(calldata: RawCalldata): boolean { const valueBuf = calldata.popWord(); const valueHex = ethUtil.bufferToHex(valueBuf); - const valueNumber = new BigNumber(valueHex, constants.HEX_BASE); + // Hack @hysz: there are some cases where `false` is encoded as 0x instead of 0x0. + const valueNumber = valueHex === '0x' ? new BigNumber(0) : new BigNumber(valueHex, constants.HEX_BASE); if (!(valueNumber.isEqualTo(0) || valueNumber.isEqualTo(1))) { throw new Error(`Failed to decode boolean. Expected 0x0 or 0x1, got ${valueHex}`); } @@ -46,6 +48,10 @@ export class BoolDataType extends AbstractBlobDataType { return value; } + public getDefaultValue(): boolean { + return BoolDataType._DEFAULT_VALUE; + } + public getSignatureType(): string { return SolidityTypes.Bool; } diff --git a/packages/utils/src/abi_encoder/evm_data_types/dynamic_bytes.ts b/packages/utils/src/abi_encoder/evm_data_types/dynamic_bytes.ts index fa38b63c0..7a49a84b4 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/dynamic_bytes.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/dynamic_bytes.ts @@ -9,6 +9,7 @@ import { constants } from '../utils/constants'; export class DynamicBytesDataType extends AbstractBlobDataType { private static readonly _SIZE_KNOWN_AT_COMPILE_TIME: boolean = false; + private static readonly _DEFAULT_VALUE = '0x'; public static matchType(type: string): boolean { return type === SolidityTypes.Bytes; @@ -65,6 +66,10 @@ export class DynamicBytesDataType extends AbstractBlobDataType { return value; } + public getDefaultValue(): string { + return DynamicBytesDataType._DEFAULT_VALUE; + } + public getSignatureType(): string { return SolidityTypes.Bytes; } diff --git a/packages/utils/src/abi_encoder/evm_data_types/int.ts b/packages/utils/src/abi_encoder/evm_data_types/int.ts index f8be1f778..02278f666 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/int.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/int.ts @@ -15,6 +15,7 @@ export class IntDataType extends AbstractBlobDataType { private static readonly _SIZE_KNOWN_AT_COMPILE_TIME: boolean = true; private static readonly _MAX_WIDTH: number = 256; private static readonly _DEFAULT_WIDTH: number = IntDataType._MAX_WIDTH; + private static readonly _DEFAULT_VALUE = new BigNumber(0); private readonly _width: number; private readonly _minValue: BigNumber; private readonly _maxValue: BigNumber; @@ -50,13 +51,20 @@ export class IntDataType extends AbstractBlobDataType { public decodeValue(calldata: RawCalldata): BigNumber | number { const valueBuf = calldata.popWord(); const value = EncoderMath.safeDecodeNumericValue(valueBuf, this._minValue, this._maxValue); - const numberOfBytesInUint8 = 8; - if (this._width === numberOfBytesInUint8) { + if (this._width === constants.NUMBER_OF_BYTES_IN_INT8) { return value.toNumber(); } return value; } + public getDefaultValue(): BigNumber | number { + const defaultValue = IntDataType._DEFAULT_VALUE; + if (this._width === constants.NUMBER_OF_BYTES_IN_INT8) { + return defaultValue.toNumber(); + } + return defaultValue; + } + public getSignatureType(): string { return `${SolidityTypes.Int}${this._width}`; } diff --git a/packages/utils/src/abi_encoder/evm_data_types/method.ts b/packages/utils/src/abi_encoder/evm_data_types/method.ts index c852a0fdf..93746fa00 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/method.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/method.ts @@ -65,6 +65,11 @@ export class MethodDataType extends AbstractSetDataType { return this._methodSelector; } + public getReturnValueDataItem(): DataItem { + const returnValueDataItem = this._returnDataType.getDataItem(); + return returnValueDataItem; + } + private _computeSignature(): string { const memberSignature = this._computeSignatureOfMembers(); const methodSignature = `${this.getDataItem().name}${memberSignature}`; diff --git a/packages/utils/src/abi_encoder/evm_data_types/pointer.ts b/packages/utils/src/abi_encoder/evm_data_types/pointer.ts index 250db7c64..50f68f5ea 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/pointer.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/pointer.ts @@ -18,4 +18,9 @@ export class PointerDataType extends AbstractPointerDataType { public getSignature(isDetailed?: boolean): string { return this._destination.getSignature(isDetailed); } + + public getDefaultValue(): any { + const defaultValue = this._destination.getDefaultValue(); + return defaultValue; + } } diff --git a/packages/utils/src/abi_encoder/evm_data_types/static_bytes.ts b/packages/utils/src/abi_encoder/evm_data_types/static_bytes.ts index cbf1957d7..a965f6796 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/static_bytes.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/static_bytes.ts @@ -58,6 +58,13 @@ export class StaticBytesDataType extends AbstractBlobDataType { return value; } + public getDefaultValue(): string { + const valueBufPadded = constants.EMPTY_EVM_WORD_BUFFER; + const valueBuf = valueBufPadded.slice(0, this._width); + const value = ethUtil.bufferToHex(valueBuf); + return value; + } + private _sanityCheckValue(value: string | Buffer): void { if (typeof value === 'string') { if (!_.startsWith(value, '0x')) { diff --git a/packages/utils/src/abi_encoder/evm_data_types/string.ts b/packages/utils/src/abi_encoder/evm_data_types/string.ts index 97ac46442..f54d739b4 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/string.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/string.ts @@ -9,6 +9,7 @@ import { constants } from '../utils/constants'; export class StringDataType extends AbstractBlobDataType { private static readonly _SIZE_KNOWN_AT_COMPILE_TIME: boolean = false; + private static readonly _DEFAULT_VALUE = ''; public static matchType(type: string): boolean { return type === SolidityTypes.String; @@ -52,6 +53,10 @@ export class StringDataType extends AbstractBlobDataType { return value; } + public getDefaultValue(): string { + return StringDataType._DEFAULT_VALUE; + } + public getSignatureType(): string { return SolidityTypes.String; } diff --git a/packages/utils/src/abi_encoder/evm_data_types/uint.ts b/packages/utils/src/abi_encoder/evm_data_types/uint.ts index a82aa789e..d530606b9 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/uint.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/uint.ts @@ -16,6 +16,7 @@ export class UIntDataType extends AbstractBlobDataType { private static readonly _MAX_WIDTH: number = 256; private static readonly _DEFAULT_WIDTH: number = UIntDataType._MAX_WIDTH; private static readonly _MIN_VALUE = new BigNumber(0); + private static readonly _DEFAULT_VALUE = new BigNumber(0); private readonly _width: number; private readonly _maxValue: BigNumber; @@ -49,13 +50,20 @@ export class UIntDataType extends AbstractBlobDataType { public decodeValue(calldata: RawCalldata): BigNumber | number { const valueBuf = calldata.popWord(); const value = EncoderMath.safeDecodeNumericValue(valueBuf, UIntDataType._MIN_VALUE, this._maxValue); - const numberOfBytesInUint8 = 8; - if (this._width === numberOfBytesInUint8) { + if (this._width === constants.NUMBER_OF_BYTES_IN_UINT8) { return value.toNumber(); } return value; } + public getDefaultValue(): BigNumber | number { + const defaultValue = UIntDataType._DEFAULT_VALUE; + if (this._width === constants.NUMBER_OF_BYTES_IN_UINT8) { + return defaultValue.toNumber(); + } + return defaultValue; + } + public getSignatureType(): string { return `${SolidityTypes.Uint}${this._width}`; } diff --git a/packages/utils/src/abi_encoder/index.ts b/packages/utils/src/abi_encoder/index.ts index cfacfe075..976bac8e6 100644 --- a/packages/utils/src/abi_encoder/index.ts +++ b/packages/utils/src/abi_encoder/index.ts @@ -12,5 +12,6 @@ export { Tuple, UInt, create, + createMethod, } from './evm_data_type_factory'; export { DataType } from './abstract_data_types/data_type'; diff --git a/packages/utils/src/abi_encoder/utils/constants.ts b/packages/utils/src/abi_encoder/utils/constants.ts index fc586f295..b45b5b8e8 100644 --- a/packages/utils/src/abi_encoder/utils/constants.ts +++ b/packages/utils/src/abi_encoder/utils/constants.ts @@ -1,3 +1,5 @@ +import * as ethUtil from 'ethereumjs-util'; + import { DecodingRules, EncodingRules } from './rules'; export const constants = { @@ -14,4 +16,8 @@ export const constants = { DEFAULT_DECODING_RULES: { shouldConvertStructsToObjects: true } as DecodingRules, DEFAULT_ENCODING_RULES: { shouldOptimize: true, shouldAnnotate: false } as EncodingRules, /* tslint:enable no-object-literal-type-assertion */ + EMPTY_EVM_WORD_STRING: '0x0000000000000000000000000000000000000000000000000000000000000000', + EMPTY_EVM_WORD_BUFFER: ethUtil.toBuffer('0x0000000000000000000000000000000000000000000000000000000000000000'), + NUMBER_OF_BYTES_IN_UINT8: 8, + NUMBER_OF_BYTES_IN_INT8: 8, }; diff --git a/packages/utils/src/abi_encoder/utils/signature_parser.ts b/packages/utils/src/abi_encoder/utils/signature_parser.ts index 315784cea..d3996bf8e 100644 --- a/packages/utils/src/abi_encoder/utils/signature_parser.ts +++ b/packages/utils/src/abi_encoder/utils/signature_parser.ts @@ -1,101 +1,88 @@ import { DataItem } from 'ethereum-types'; import * as _ from 'lodash'; +interface Node { + name: string; + value: string; + children: Node[]; + parent?: Node; +} + +function parseNode(node: Node): DataItem { + const components: DataItem[] = []; + _.each(node.children, (child: Node) => { + const component = parseNode(child); + components.push(component); + }); + const dataItem: DataItem = { + name: node.name, + type: node.value, + }; + if (!_.isEmpty(components)) { + dataItem.components = components; + } + return dataItem; +} + /** - * Returns an array of DataItem's corresponding to the input signature. - * A signature can be in two forms: '<DataItem.type>' or '(<DataItem1.type>, <DataItem2.type>, ...) - * An example of the first form would be 'address' or 'uint256' - * An example of the second form would be '(address, uint256)' - * Signatures can also include a name field, for example: 'foo address' or '(foo address, bar uint256)' - * @param signature of input DataItems - * @return DataItems derived from input signature + * Returns a DataItem corresponding to the input signature. + * A signature can be in two forms: `type` or `(type_1,type_2,...,type_n)` + * An example of the first form would be 'address' or 'uint256[]' or 'bytes[5][]' + * An example of the second form would be '(address,uint256)' or '(address,uint256)[]' + * @param signature of input DataItem. + * @return DataItem derived from input signature. */ -export function generateDataItemsFromSignature(signature: string): DataItem[] { - let trimmedSignature = signature; - if (signature.startsWith('(')) { - if (!signature.endsWith(')')) { - throw new Error(`Failed to generate data item. Must end with ')'`); - } - trimmedSignature = signature.substr(1, signature.length - 2); +export function generateDataItemFromSignature(signature: string): DataItem { + // No data item corresponds to an empty signature + if (_.isEmpty(signature)) { + throw new Error(`Cannot parse data item from empty signature, ''`); } - trimmedSignature += ','; - let isCurrTokenArray = false; - let currTokenArrayModifier = ''; - let isParsingArrayModifier = false; - let currToken = ''; - let parenCount = 0; - let currTokenName = ''; - const dataItems: DataItem[] = []; - for (const char of trimmedSignature) { - // Tokenize the type string while keeping track of parentheses. + // Create a parse tree for data item + let node: Node = { + name: '', + value: '', + children: [], + }; + for (const char of signature) { switch (char) { case '(': - parenCount += 1; - currToken += char; + const child = { + name: '', + value: '', + children: [], + parent: node, + }; + node.value = 'tuple'; + node.children.push(child); + node = child; break; + case ')': - parenCount -= 1; - currToken += char; + node = node.parent as Node; break; - case '[': - if (parenCount === 0) { - isParsingArrayModifier = true; - isCurrTokenArray = true; - currTokenArrayModifier += '['; - } else { - currToken += char; - } - break; - case ']': - if (parenCount === 0) { - isParsingArrayModifier = false; - currTokenArrayModifier += ']'; - } else { - currToken += char; - } + + case ',': + const sibling = { + name: '', + value: '', + children: [], + parent: node.parent, + }; + (node.parent as Node).children.push(sibling); + node = sibling; break; + case ' ': - if (parenCount === 0) { - currTokenName = currToken; - currToken = ''; - } else { - currToken += char; - } + node.name = node.value; + node.value = ''; break; - case ',': - if (parenCount === 0) { - // Generate new DataItem from token - const components = currToken.startsWith('(') ? generateDataItemsFromSignature(currToken) : []; - const isTuple = !_.isEmpty(components); - const dataItem: DataItem = { name: currTokenName, type: '' }; - if (isTuple) { - dataItem.type = 'tuple'; - dataItem.components = components; - } else { - dataItem.type = currToken; - } - if (isCurrTokenArray) { - dataItem.type += currTokenArrayModifier; - } - dataItems.push(dataItem); - // reset token state - currTokenName = ''; - currToken = ''; - isCurrTokenArray = false; - currTokenArrayModifier = ''; - break; - } else { - currToken += char; - break; - } + default: - if (isParsingArrayModifier) { - currTokenArrayModifier += char; - } else { - currToken += char; - } + node.value += char; break; } } - return dataItems; + // Interpret data item from parse tree + const dataItem = parseNode(node); + return dataItem; } diff --git a/packages/utils/test/abi_encoder/abi_samples/return_value_abis.ts b/packages/utils/test/abi_encoder/abi_samples/return_value_abis.ts index ac2124011..ad07b3d24 100644 --- a/packages/utils/test/abi_encoder/abi_samples/return_value_abis.ts +++ b/packages/utils/test/abi_encoder/abi_samples/return_value_abis.ts @@ -97,3 +97,28 @@ export const mixedStaticAndDynamicReturnValues: MethodAbi = { stateMutability: 'nonpayable', type: 'function', }; + +export const structuredReturnValue: MethodAbi = { + constant: false, + inputs: [], + name: 'fillOrder', + outputs: [ + { + components: [ + { + name: 'makerAssetFilledAmount', + type: 'uint256', + }, + { + name: 'takerAssetFilledAmount', + type: 'uint256', + }, + ], + name: 'fillResults', + type: 'tuple', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', +}; diff --git a/packages/utils/test/abi_encoder/evm_data_types_test.ts b/packages/utils/test/abi_encoder/evm_data_types_test.ts index 4814ce28b..c80290207 100644 --- a/packages/utils/test/abi_encoder/evm_data_types_test.ts +++ b/packages/utils/test/abi_encoder/evm_data_types_test.ts @@ -11,6 +11,7 @@ const expect = chai.expect; describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => { const encodingRules: AbiEncoder.EncodingRules = { shouldOptimize: false }; // optimizer is tested separately. + const nullEncodedArgs = '0x'; describe('Array', () => { it('Fixed size; Static elements', async () => { // Create DataType object @@ -27,7 +28,7 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => { const decodedArgs = dataType.decode(encodedArgs); expect(decodedArgs).to.be.deep.equal(args); // Validate signature - const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true)); + const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(false)); const argsEncodedFromSignature = dataTypeFromSignature.encode(args); expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs); }); @@ -207,6 +208,51 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => { dataType.encode(args, encodingRules); }).to.throw('Tried to assign NaN value'); }); + it('Should decode NULL to default values (Fixed size; Static elements)', async () => { + // Create DataType object + const testDataItem = { name: 'testArray', type: 'int[2]' }; + const dataType = new AbiEncoder.Array(testDataItem); + const args = [new BigNumber(0), new BigNumber(0)]; + // Decode Encoded Args and validate result + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); + it('Should decode NULL to default values (Dynamic size; Static elements)', async () => { + // Create DataType object + const testDataItem = { name: 'testArray', type: 'int[]' }; + const dataType = new AbiEncoder.Array(testDataItem); + const args: BigNumber[] = []; + // Decode Encoded Args and validate result + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); + it('Should decode NULL to default values (Fixed size; Dynamic elements)', async () => { + // Create DataType object + const testDataItem = { name: 'testArray', type: 'string[2]' }; + const dataType = new AbiEncoder.Array(testDataItem); + const args = ['', '']; + // Decode Encoded Args and validate result + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); + it('Should decode NULL to default values (Dynamic size; Dynamic elements)', async () => { + // Create DataType object + const testDataItem = { name: 'testArray', type: 'string[]' }; + const dataType = new AbiEncoder.Array(testDataItem); + const args: string[] = []; + // Decode Encoded Args and validate result + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); + it('Should decode NULL to default values (Dynamic Size; Multidimensional; Dynamic Elements)', async () => { + // Create DataType object + const testDataItem = { name: 'testArray', type: 'bytes[][]' }; + const dataType = new AbiEncoder.Array(testDataItem); + const args: string[][] = []; + // Decode Encoded Args and validate result + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); }); describe('Tuple', () => { @@ -407,6 +453,46 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => { dataType.encode(args, encodingRules); }).to.throw('Could not assign tuple to object: missing key \'field_2\' in object {"field_1":"-5"}'); }); + it('Should decode NULL to default values (static elements only)', async () => { + // Create DataType object + const testDataItem = { + name: 'Tuple', + type: 'tuple', + components: [{ name: 'field_1', type: 'int32' }, { name: 'field_2', type: 'bool' }], + }; + const dataType = new AbiEncoder.Tuple(testDataItem); + // Construct args to be encoded + const args = { field_1: new BigNumber(0), field_2: false }; + // Decode Encoded Args and validate result + const decodingRules: AbiEncoder.DecodingRules = { shouldConvertStructsToObjects: true }; + const decodedArgs = dataType.decode(nullEncodedArgs, decodingRules); + expect(decodedArgs).to.be.deep.equal(args); + }); + it('Should decode NULL to default values (static and dynamic elements)', async () => { + // Create DataType object + const testDataItem = { + name: 'Tuple', + type: 'tuple', + components: [ + { name: 'field_1', type: 'int32' }, + { name: 'field_2', type: 'string' }, + { name: 'field_3', type: 'bool' }, + { name: 'field_4', type: 'bytes' }, + ], + }; + const dataType = new AbiEncoder.Tuple(testDataItem); + // Construct args to be encoded + const args = { + field_1: new BigNumber(0), + field_2: '', + field_3: false, + field_4: '0x', + }; + // Decode Encoded Args and validate result + const decodingRules: AbiEncoder.DecodingRules = { shouldConvertStructsToObjects: true }; + const decodedArgs = dataType.decode(nullEncodedArgs, decodingRules); + expect(decodedArgs).to.be.deep.equal(args); + }); }); describe('Address', () => { @@ -450,6 +536,15 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => { dataType.encode(args, encodingRules); }).to.throw(`Invalid address: '${args}'`); }); + it('Should decode NULL to default value of address zero', async () => { + // Create DataType object + const testDataItem = { name: 'Address', type: 'address' }; + const dataType = new AbiEncoder.Address(testDataItem); + const args = '0x0000000000000000000000000000000000000000'; + // Decode Encoded Args and validate result + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); }); describe('Bool', () => { @@ -489,6 +584,15 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => { const argsEncodedFromSignature = dataTypeFromSignature.encode(args); expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs); }); + it('Should decode NULL to default value of False', async () => { + // Create DataType object + const testDataItem = { name: 'Boolean', type: 'bool' }; + const dataType = new AbiEncoder.Bool(testDataItem); + const args = false; + // Decode Encoded Args and validate result + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); }); describe('Integer', () => { @@ -687,6 +791,15 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => { dataType.encode(args, encodingRules); }).to.throw(); }); + it('Should decode NULL to default value of 0', async () => { + // Create DataType object + const testDataItem = { name: 'Integer (256)', type: 'int' }; + const dataType = new AbiEncoder.Int(testDataItem); + const args = new BigNumber(0); + // Decode Encoded Args and validate result + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); }); describe('Unsigned Integer', () => { @@ -849,6 +962,15 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => { dataType.encode(args, encodingRules); }).to.throw(); }); + it('Should decode NULL to default value of 0', async () => { + // Create DataType object + const testDataItem = { name: 'Unsigned Integer (256)', type: 'uint' }; + const dataType = new AbiEncoder.UInt(testDataItem); + const args = new BigNumber(0); + // Decode Encoded Args and validate result + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); }); describe('Static Bytes', () => { @@ -1012,6 +1134,33 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => { dataType.encode(args, encodingRules); }).to.throw('Tried to assign 0x010, which is contains a half-byte. Use full bytes only.'); }); + it('Should decode NULL to default value - Single Byte (byte)', async () => { + // Create DataType object + const testDataItem = { name: 'Static Byte', type: 'byte' }; + const dataType = new AbiEncoder.StaticBytes(testDataItem); + const args = '0x00'; + // Decode Encoded Args and validate result + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); + it('Should decode NULL to default value - 4 Bytes (bytes4)', async () => { + // Create DataType object + const testDataItem = { name: 'Static Bytes4', type: 'bytes4' }; + const dataType = new AbiEncoder.StaticBytes(testDataItem); + const args = '0x00000000'; + // Decode Encoded Args and validate result + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); + it('Should decode NULL to default value - 32 Bytes (bytes32)', async () => { + // Create DataType object + const testDataItem = { name: 'Static Bytes32', type: 'bytes32' }; + const dataType = new AbiEncoder.StaticBytes(testDataItem); + const args = '0x0000000000000000000000000000000000000000000000000000000000000000'; + // Decode Encoded Args and validate result + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); }); describe('Dynamic Bytes', () => { @@ -1099,6 +1248,15 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => { dataType.encode(args, encodingRules); }).to.throw('Tried to assign 0x010, which is contains a half-byte. Use full bytes only.'); }); + it('Should decode NULL to empty byte array', async () => { + // Create DataType object + const testDataItem = { name: 'Dynamic Bytes', type: 'bytes' }; + const dataType = new AbiEncoder.DynamicBytes(testDataItem); + const args = '0x'; + // Decode Encoded Args and validate result + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); }); describe('String', () => { @@ -1164,5 +1322,14 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => { const argsEncodedFromSignature = dataTypeFromSignature.encode(args); expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs); }); + it('Should decode NULL to empty string', async () => { + // Create DataType object + const testDataItem = { name: 'String', type: 'string' }; + const dataType = new AbiEncoder.String(testDataItem); + // Decode Encoded Args and validate result + const args = ''; + const decodedArgs = dataType.decode(nullEncodedArgs); + expect(decodedArgs).to.be.deep.equal(args); + }); }); }); diff --git a/packages/utils/test/abi_encoder/return_values_test.ts b/packages/utils/test/abi_encoder/return_values_test.ts index 308d11ee5..ccdac510d 100644 --- a/packages/utils/test/abi_encoder/return_values_test.ts +++ b/packages/utils/test/abi_encoder/return_values_test.ts @@ -1,7 +1,7 @@ import * as chai from 'chai'; import 'mocha'; -import { AbiEncoder } from '../../src/'; +import { AbiEncoder, BigNumber } from '../../src/'; import { chaiSetup } from '../utils/chai_setup'; import * as ReturnValueAbis from './abi_samples/return_value_abis'; @@ -11,67 +11,194 @@ const expect = chai.expect; describe('ABI Encoder: Return Value Encoding/Decoding', () => { const encodingRules: AbiEncoder.EncodingRules = { shouldOptimize: false }; // optimizer is tested separately. - it('No Return Value', async () => { - // Decode return value - const method = new AbiEncoder.Method(ReturnValueAbis.noReturnValues); - const returnValue = '0x'; - const decodedReturnValue = method.decodeReturnValues(returnValue, { shouldConvertStructsToObjects: false }); - const expectedDecodedReturnValue: any[] = []; - expect(decodedReturnValue).to.be.deep.equal(expectedDecodedReturnValue); - }); - it('Single static return value', async () => { - // Generate Return Value - const method = new AbiEncoder.Method(ReturnValueAbis.singleStaticReturnValue); - const returnValue = ['0x01020304']; - const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { - shouldConvertStructsToObjects: false, - }); - // Validate decoded return value - expect(decodedReturnValue).to.be.deep.equal(returnValue); - }); - it('Multiple static return values', async () => { - // Generate Return Value - const method = new AbiEncoder.Method(ReturnValueAbis.multipleStaticReturnValues); - const returnValue = ['0x01020304', '0x05060708']; - const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { - shouldConvertStructsToObjects: false, - }); - // Validate decoded return value - expect(decodedReturnValue).to.be.deep.equal(returnValue); - }); - it('Single dynamic return value', async () => { - // Generate Return Value - const method = new AbiEncoder.Method(ReturnValueAbis.singleDynamicReturnValue); - const returnValue = ['0x01020304']; - const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { - shouldConvertStructsToObjects: false, - }); - // Validate decoded return value - expect(decodedReturnValue).to.be.deep.equal(returnValue); - }); - it('Multiple dynamic return values', async () => { - // Generate Return Value - const method = new AbiEncoder.Method(ReturnValueAbis.multipleDynamicReturnValues); - const returnValue = ['0x01020304', '0x05060708']; - const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { - shouldConvertStructsToObjects: false, - }); - // Validate decoded return value - expect(decodedReturnValue).to.be.deep.equal(returnValue); + const nullEncodedReturnValue = '0x'; + describe('Standard encoding/decoding', () => { + it('No Return Value', async () => { + // Decode return value + const method = new AbiEncoder.Method(ReturnValueAbis.noReturnValues); + const returnValue = '0x'; + const decodedReturnValue = method.decodeReturnValues(returnValue, { shouldConvertStructsToObjects: false }); + const expectedDecodedReturnValue: any[] = []; + expect(decodedReturnValue).to.be.deep.equal(expectedDecodedReturnValue); + }); + it('Single static return value', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.singleStaticReturnValue); + const returnValue = ['0x01020304']; + const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue); + }); + it('Multiple static return values', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.multipleStaticReturnValues); + const returnValue = ['0x01020304', '0x05060708']; + const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue); + }); + it('Single dynamic return value', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.singleDynamicReturnValue); + const returnValue = ['0x01020304']; + const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue); + }); + it('Multiple dynamic return values', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.multipleDynamicReturnValues); + const returnValue = ['0x01020304', '0x05060708']; + const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue); + }); + it('Mixed static/dynamic return values', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.mixedStaticAndDynamicReturnValues); + const returnValue = ['0x01020304', '0x05060708']; + const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue); + }); + it('Should decode NULL as default value (single; static)', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.singleStaticReturnValue); + const returnValue = ['0x00000000']; + + const decodedReturnValue = method.decodeReturnValues(nullEncodedReturnValue, { + shouldConvertStructsToObjects: false, + }); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue); + }); + it('Should decode NULL as default value (multiple; static)', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.multipleStaticReturnValues); + const returnValue = ['0x00000000', '0x00000000']; + const decodedReturnValue = method.decodeReturnValues(nullEncodedReturnValue, { + shouldConvertStructsToObjects: false, + }); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue); + }); + it('Should decode NULL as default value (single; dynamic)', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.singleDynamicReturnValue); + const returnValue = ['0x']; + const decodedReturnValue = method.decodeReturnValues(nullEncodedReturnValue, { + shouldConvertStructsToObjects: false, + }); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue); + }); }); - it('Mixed static/dynamic return values', async () => { - // Generate Return Value - const method = new AbiEncoder.Method(ReturnValueAbis.mixedStaticAndDynamicReturnValues); - const returnValue = ['0x01020304', '0x05060708']; - const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { - shouldConvertStructsToObjects: false, - }); - // Validate decoded return value - expect(decodedReturnValue).to.be.deep.equal(returnValue); + + describe('Strict encoding/decoding', () => { + it('No Return Value', async () => { + // Decode return value + const method = new AbiEncoder.Method(ReturnValueAbis.noReturnValues); + const returnValue = '0x'; + const decodedReturnValue = method.strictDecodeReturnValue<void>(returnValue); + const expectedDecodedReturnValue = undefined; + expect(decodedReturnValue).to.be.deep.equal(expectedDecodedReturnValue); + }); + it('Single static return value', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.singleStaticReturnValue); + const returnValue = ['0x01020304']; + const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); + const decodedReturnValue = method.strictDecodeReturnValue<string>(encodedReturnValue); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue[0]); + }); + it('Multiple static return values', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.multipleStaticReturnValues); + const returnValue = ['0x01020304', '0x05060708']; + const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); + const decodedReturnValue = method.strictDecodeReturnValue<[string, string]>(encodedReturnValue); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue); + }); + it('Single dynamic return value', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.singleDynamicReturnValue); + const returnValue = ['0x01020304']; + const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); + const decodedReturnValue = method.strictDecodeReturnValue<string>(encodedReturnValue); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue[0]); + }); + it('Multiple dynamic return values', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.multipleDynamicReturnValues); + const returnValue = ['0x01020304', '0x05060708']; + const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); + const decodedReturnValue = method.strictDecodeReturnValue<[string, string]>(encodedReturnValue); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue); + }); + it('Struct should include fields', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.structuredReturnValue); + const returnValue = { + fillResults: { + makerAssetFilledAmount: new BigNumber(50), + takerAssetFilledAmount: new BigNumber(40), + }, + }; + const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); + const decodedReturnValue = method.strictDecodeReturnValue<{ + makerAssetFilledAmount: BigNumber; + takerAssetFilledAmount: BigNumber; + }>(encodedReturnValue); + // Validate decoded return value + // Note that only the contents of `fillResults`, not the key itself, is decoded. + // This is by design, as only a struct's contents are encoded and returned by a funciton call. + expect(decodedReturnValue).to.be.deep.equal(returnValue.fillResults); + }); + it('Should decode NULL as default value (single; static)', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.singleStaticReturnValue); + const returnValue = '0x00000000'; + const encodedReturnValue = '0x'; + const decodedReturnValue = method.strictDecodeReturnValue<string>(encodedReturnValue); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue); + }); + it('Should decode NULL as default value (multiple; static)', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.multipleStaticReturnValues); + const returnValue = ['0x00000000', '0x00000000']; + const encodedReturnValue = '0x'; + const decodedReturnValue = method.strictDecodeReturnValue<[string, string]>(encodedReturnValue); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue); + }); + it('Should decode NULL as default value (single; dynamic)', async () => { + // Generate Return Value + const method = new AbiEncoder.Method(ReturnValueAbis.singleDynamicReturnValue); + const returnValue = '0x'; + const encodedReturnValue = '0x'; + const decodedReturnValue = method.strictDecodeReturnValue<string>(encodedReturnValue); + // Validate decoded return value + expect(decodedReturnValue).to.be.deep.equal(returnValue); + }); }); }); diff --git a/packages/utils/test/abi_encoder/signature_test.ts b/packages/utils/test/abi_encoder/signature_test.ts new file mode 100644 index 000000000..cee6fa5e5 --- /dev/null +++ b/packages/utils/test/abi_encoder/signature_test.ts @@ -0,0 +1,393 @@ +import * as chai from 'chai'; +import 'mocha'; + +import { AbiEncoder } from '../../src'; +import { chaiSetup } from '../utils/chai_setup'; + +chaiSetup.configure(); +const expect = chai.expect; + +describe('ABI Encoder: Signatures', () => { + describe('Single type', () => { + it('Elementary', async () => { + const signature = 'uint256'; + const dataType = AbiEncoder.create(signature); + const dataTypeId = dataType.getDataItem().type; + expect(dataTypeId).to.be.equal('uint256'); + expect(dataType.getSignature()).to.be.equal(signature); + }); + it('Array', async () => { + const signature = 'string[]'; + const dataType = AbiEncoder.create(signature); + const dataItem = dataType.getDataItem(); + const expectedDataItem = { + name: '', + type: 'string[]', + }; + expect(dataItem).to.be.deep.equal(expectedDataItem); + expect(dataType.getSignature()).to.be.equal(signature); + }); + it('Multidimensional Array', async () => { + // Decode return value + const signature = 'uint256[4][][5]'; + const dataType = AbiEncoder.create(signature); + const dataTypeId = dataType.getDataItem().type; + expect(dataTypeId).to.be.equal(signature); + expect(dataType.getSignature()).to.be.equal(signature); + }); + it('Tuple with single element', async () => { + const signature = '(uint256)'; + const dataType = AbiEncoder.create(signature); + const dataItem = dataType.getDataItem(); + const expectedDataItem = { + name: '', + type: 'tuple', + components: [ + { + name: '', + type: 'uint256', + }, + ], + }; + expect(dataItem).to.be.deep.equal(expectedDataItem); + expect(dataType.getSignature()).to.be.equal(signature); + }); + it('Tuple with multiple elements', async () => { + const signature = '(uint256,string,bytes4)'; + const dataType = AbiEncoder.create(signature); + const dataItem = dataType.getDataItem(); + const expectedDataItem = { + name: '', + type: 'tuple', + components: [ + { + name: '', + type: 'uint256', + }, + { + name: '', + type: 'string', + }, + { + name: '', + type: 'bytes4', + }, + ], + }; + expect(dataItem).to.be.deep.equal(expectedDataItem); + expect(dataType.getSignature()).to.be.equal(signature); + }); + it('Tuple with nested array and nested tuple', async () => { + const signature = '(uint256[],(bytes),string[4],bytes4)'; + const dataType = AbiEncoder.create(signature); + const dataItem = dataType.getDataItem(); + const expectedDataItem = { + name: '', + type: 'tuple', + components: [ + { + name: '', + type: 'uint256[]', + }, + { + name: '', + type: 'tuple', + components: [ + { + name: '', + type: 'bytes', + }, + ], + }, + { + name: '', + type: 'string[4]', + }, + { + name: '', + type: 'bytes4', + }, + ], + }; + expect(dataItem).to.be.deep.equal(expectedDataItem); + expect(dataType.getSignature()).to.be.equal(signature); + }); + it('Array of complex tuples', async () => { + const signature = '(uint256[],(bytes),string[4],bytes4)[5][4][]'; + const dataType = AbiEncoder.create(signature); + const dataItem = dataType.getDataItem(); + const expectedDataItem = { + name: '', + type: 'tuple[5][4][]', + components: [ + { + name: '', + type: 'uint256[]', + }, + { + name: '', + type: 'tuple', + components: [ + { + name: '', + type: 'bytes', + }, + ], + }, + { + name: '', + type: 'string[4]', + }, + { + name: '', + type: 'bytes4', + }, + ], + }; + expect(dataItem).to.be.deep.equal(expectedDataItem); + expect(dataType.getSignature()).to.be.equal(signature); + }); + }); + + describe('Function', () => { + it('No inputs and no outputs', async () => { + // create encoder + const functionName = 'foo'; + const dataType = AbiEncoder.createMethod(functionName); + // create expected values + const expectedSignature = 'foo()'; + const expectedInputDataItem = { + name: 'foo', + type: 'method', + components: [], + }; + const expectedOutputDataItem = { + name: 'foo', + type: 'tuple', + components: [], + }; + // check expected values + expect(dataType.getSignature()).to.be.equal(expectedSignature); + expect(dataType.getDataItem()).to.be.deep.equal(expectedInputDataItem); + expect(dataType.getReturnValueDataItem()).to.be.deep.equal(expectedOutputDataItem); + }); + it('No inputs and no outputs (empty arrays as input)', async () => { + // create encoder + const functionName = 'foo'; + const dataType = AbiEncoder.createMethod(functionName, [], []); + // create expected values + const expectedSignature = 'foo()'; + const expectedInputDataItem = { + name: 'foo', + type: 'method', + components: [], + }; + const expectedOutputDataItem = { + name: 'foo', + type: 'tuple', + components: [], + }; + // check expected values + expect(dataType.getSignature()).to.be.equal(expectedSignature); + expect(dataType.getDataItem()).to.be.deep.equal(expectedInputDataItem); + expect(dataType.getReturnValueDataItem()).to.be.deep.equal(expectedOutputDataItem); + }); + it('Single DataItem input and single DataItem output', async () => { + // create encoder + const functionName = 'foo'; + const inputDataItem = { + name: 'input', + type: 'uint256', + }; + const outputDataItem = { + name: 'output', + type: 'string', + }; + const dataType = AbiEncoder.createMethod(functionName, inputDataItem, outputDataItem); + // create expected values + const expectedSignature = 'foo(uint256)'; + const expectedInputDataItem = { + name: 'foo', + type: 'method', + components: [inputDataItem], + }; + const expectedOutputDataItem = { + name: 'foo', + type: 'tuple', + components: [outputDataItem], + }; + // check expected values + expect(dataType.getSignature()).to.be.equal(expectedSignature); + expect(dataType.getDataItem()).to.be.deep.equal(expectedInputDataItem); + expect(dataType.getReturnValueDataItem()).to.be.deep.equal(expectedOutputDataItem); + }); + it('Single signature input and single signature output', async () => { + // create encoder + const functionName = 'foo'; + const inputSignature = 'uint256'; + const outputSignature = 'string'; + const dataType = AbiEncoder.createMethod(functionName, inputSignature, outputSignature); + // create expected values + const expectedSignature = 'foo(uint256)'; + const expectedInputDataItem = { + name: 'foo', + type: 'method', + components: [ + { + name: '', + type: 'uint256', + }, + ], + }; + const expectedOutputDataItem = { + name: 'foo', + type: 'tuple', + components: [ + { + name: '', + type: 'string', + }, + ], + }; + // check expected values + expect(dataType.getSignature()).to.be.equal(expectedSignature); + expect(dataType.getDataItem()).to.be.deep.equal(expectedInputDataItem); + expect(dataType.getReturnValueDataItem()).to.be.deep.equal(expectedOutputDataItem); + }); + it('Single signature tuple input and single signature tuple output', async () => { + // create encoder + const functionName = 'foo'; + const inputSignature = '(uint256,bytes[][4])'; + const outputSignature = '(string,uint32)'; + const dataType = AbiEncoder.createMethod(functionName, inputSignature, outputSignature); + // create expected values + const expectedSignature = 'foo((uint256,bytes[][4]))'; + const expectedInputDataItem = { + name: 'foo', + type: 'method', + components: [ + { + name: '', + type: 'tuple', + components: [ + { + name: '', + type: 'uint256', + }, + { + name: '', + type: 'bytes[][4]', + }, + ], + }, + ], + }; + const expectedOutputDataItem = { + name: 'foo', + type: 'tuple', + components: [ + { + name: '', + type: 'tuple', + components: [ + { + name: '', + type: 'string', + }, + { + name: '', + type: 'uint32', + }, + ], + }, + ], + }; + // check expected values + expect(dataType.getSignature()).to.be.equal(expectedSignature); + expect(dataType.getDataItem()).to.be.deep.equal(expectedInputDataItem); + expect(dataType.getReturnValueDataItem()).to.be.deep.equal(expectedOutputDataItem); + }); + it('Mutiple DataItem input and multiple DataItem output', async () => { + // create encoder + const functionName = 'foo'; + const inputDataItems = [ + { + name: '', + type: 'uint256', + }, + { + name: '', + type: 'bytes[][4]', + }, + ]; + const outputDataItems = [ + { + name: '', + type: 'string', + }, + { + name: '', + type: 'uint32', + }, + ]; + const dataType = AbiEncoder.createMethod(functionName, inputDataItems, outputDataItems); + // create expected values + const expectedSignature = 'foo(uint256,bytes[][4])'; + const expectedInputDataItem = { + name: 'foo', + type: 'method', + components: inputDataItems, + }; + const expectedOutputDataItem = { + name: 'foo', + type: 'tuple', + components: outputDataItems, + }; + // check expected values + expect(dataType.getSignature()).to.be.equal(expectedSignature); + expect(dataType.getDataItem()).to.be.deep.equal(expectedInputDataItem); + expect(dataType.getReturnValueDataItem()).to.be.deep.equal(expectedOutputDataItem); + }); + it('Multiple signature input and multiple signature output', async () => { + // create encoder + const functionName = 'foo'; + const inputSignatures = ['uint256', 'bytes[][4]']; + const outputSignatures = ['string', 'uint32']; + const dataType = AbiEncoder.createMethod(functionName, inputSignatures, outputSignatures); + // create expected values + const expectedSignature = 'foo(uint256,bytes[][4])'; + const expectedInputDataItem = { + name: 'foo', + type: 'method', + components: [ + { + name: '', + type: 'uint256', + }, + { + name: '', + type: 'bytes[][4]', + }, + ], + }; + const expectedOutputDataItem = { + name: 'foo', + type: 'tuple', + components: [ + { + name: '', + type: 'string', + }, + { + name: '', + type: 'uint32', + }, + ], + }; + // check expected values + expect(dataType.getSignature()).to.be.equal(expectedSignature); + expect(dataType.getDataItem()).to.be.deep.equal(expectedInputDataItem); + expect(dataType.getReturnValueDataItem()).to.be.deep.equal(expectedOutputDataItem); + }); + }); +}); diff --git a/packages/utils/test/abi_encoder/signature_tests.ts b/packages/utils/test/abi_encoder/signature_tests.ts deleted file mode 100644 index e69de29bb..000000000 --- a/packages/utils/test/abi_encoder/signature_tests.ts +++ /dev/null diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index 4a639f662..49dbe5a64 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -1,5 +1,23 @@ [ { + "version": "4.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1549547375 + }, + { + "timestamp": 1549452781, + "version": "4.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "4.0.0", "changes": [ { @@ -10,7 +28,8 @@ "note": "Update ganache-core to v2.3.3", "pr": 1518 } - ] + ], + "timestamp": 1549373905 }, { "timestamp": 1547561734, diff --git a/packages/web3-wrapper/CHANGELOG.md b/packages/web3-wrapper/CHANGELOG.md index 5850c5474..461d55a26 100644 --- a/packages/web3-wrapper/CHANGELOG.md +++ b/packages/web3-wrapper/CHANGELOG.md @@ -5,6 +5,19 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v4.0.2 - _February 7, 2019_ + + * Dependencies updated + +## v4.0.1 - _February 6, 2019_ + + * Dependencies updated + +## v4.0.0 - _February 5, 2019_ + + * Upgrade the bignumber.js to v8.0.2 (#1517) + * Update ganache-core to v2.3.3 (#1518) + ## v3.2.4 - _January 15, 2019_ * Dependencies updated diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json index f28cc36ca..d28a9894f 100644 --- a/packages/web3-wrapper/package.json +++ b/packages/web3-wrapper/package.json @@ -1,6 +1,6 @@ { "name": "@0x/web3-wrapper", - "version": "3.2.4", + "version": "4.0.2", "engines": { "node": ">=6.12" }, @@ -36,7 +36,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-wrapper/README.md", "devDependencies": { - "@0x/tslint-config": "^2.0.2", + "@0x/tslint-config": "^3.0.0", "@types/ganache-core": "^2.1.2", "@types/lodash": "4.14.104", "chai": "^4.0.1", @@ -54,14 +54,14 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/assert": "^1.0.23", - "@0x/json-schemas": "^2.1.7", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "ethereum-types": "^1.1.6", + "@0x/assert": "^2.0.2", + "@0x/json-schemas": "^3.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "ethereum-types": "^2.0.0", "ethereumjs-util": "^5.1.1", "ethers": "~4.0.4", - "lodash": "^4.17.5" + "lodash": "^4.17.11" }, "publishConfig": { "access": "public" diff --git a/packages/website/less/all.less b/packages/website/less/all.less index 5d1dccc98..d288b182b 100644 --- a/packages/website/less/all.less +++ b/packages/website/less/all.less @@ -88,13 +88,6 @@ code { color: #1d5cde; // linkBlue } - h1, - h2, - h3, - h4 { - padding-top: 15px; - } - p, blockquote, ol, diff --git a/packages/website/package.json b/packages/website/package.json index ce7ed395f..165ce5725 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "@0x/website", - "version": "0.0.67", + "version": "0.0.71", "engines": { "node": ">=6.12" }, @@ -20,18 +20,18 @@ "author": "Fabio Berger", "license": "Apache-2.0", "dependencies": { - "@0x/asset-buyer": "^4.0.2", - "@0x/contract-addresses": "^2.2.0", - "@0x/contract-wrappers": "^5.0.1", - "@0x/json-schemas": "^2.1.7", - "@0x/order-utils": "^3.1.2", - "@0x/react-docs": "^1.0.25", - "@0x/react-shared": "^1.1.2", - "@0x/subproviders": "^2.1.11", - "@0x/types": "^1.5.2", - "@0x/typescript-typings": "^3.0.8", - "@0x/utils": "^3.0.1", - "@0x/web3-wrapper": "^3.2.4", + "@0x/asset-buyer": "^5.0.3", + "@0x/contract-addresses": "^2.2.1", + "@0x/contract-wrappers": "^7.0.2", + "@0x/json-schemas": "^3.0.2", + "@0x/order-utils": "^6.0.1", + "@0x/react-docs": "^2.0.3", + "@0x/react-shared": "^2.0.3", + "@0x/subproviders": "^3.0.2", + "@0x/types": "^2.0.2", + "@0x/typescript-typings": "^4.0.0", + "@0x/utils": "^4.0.3", + "@0x/web3-wrapper": "^4.0.2", "@reach/dialog": "^0.1.2", "@types/react-lazyload": "^2.3.1", "@types/react-loadable": "^5.4.2", @@ -42,12 +42,12 @@ "blockies": "^0.0.2", "bowser": "^1.9.3", "deep-equal": "^1.0.1", - "ethereum-types": "^1.1.6", + "ethereum-types": "^2.0.0", "ethereumjs-util": "^5.1.1", "find-versions": "^2.0.0", "jsonschema": "^1.2.0", "less": "^2.7.2", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "material-ui": "^0.20.0", "moment": "2.21.0", "numeral": "^2.0.6", @@ -97,7 +97,7 @@ "@types/rc-slider": "^8.6.0", "@types/react": "^16.7.7", "@types/react-copy-to-clipboard": "^4.2.0", - "@types/react-dom": "^16.0.7", + "@types/react-dom": "^16.0.6", "@types/react-helmet": "^5.0.6", "@types/react-redux": "^4.4.37", "@types/react-scroll": "1.5.3", diff --git a/packages/website/ts/components/mobileNav.tsx b/packages/website/ts/components/mobileNav.tsx index d43bbe50e..1aa826755 100644 --- a/packages/website/ts/components/mobileNav.tsx +++ b/packages/website/ts/components/mobileNav.tsx @@ -6,6 +6,7 @@ import { Link } from 'react-router-dom'; import { WrapGrid, WrapProps } from 'ts/components/newLayout'; import { WebsitePaths } from 'ts/types'; +import { constants } from 'ts/utils/constants'; interface Props { isToggled: boolean; @@ -41,7 +42,7 @@ export class MobileNav extends React.PureComponent<Props> { <Link to={WebsitePaths.AboutMission}>About</Link> </li> <li> - <a href="https://blog.0xproject.com/latest" target="_blank"> + <a href={constants.URL_BLOG} target="_blank"> Blog </a> </li> diff --git a/packages/website/ts/utils/constants.ts b/packages/website/ts/utils/constants.ts index ada8de549..03c1a0b83 100644 --- a/packages/website/ts/utils/constants.ts +++ b/packages/website/ts/utils/constants.ts @@ -74,7 +74,7 @@ export const constants = { URL_ANGELLIST: 'https://angel.co/0xproject/jobs', URL_APACHE_LICENSE: 'http://www.apache.org/licenses/LICENSE-2.0', URL_BITLY_API: 'https://api-ssl.bitly.com', - URL_BLOG: 'https://blog.0xproject.com/latest', + URL_BLOG: 'https://blog.0xproject.com', URL_DISCOURSE_FORUM: 'https://forum.0x.org', URL_ECOSYSTEM_APPLY: 'https://0x.smapply.io/', URL_ECOSYSTEM_BLOG_POST: 'https://blog.0xproject.com/announcing-the-0x-ecosystem-acceleration-program-89d1cb89d565', diff --git a/python-packages/json_schemas/src/zero_ex/json_schemas/schemas/zero_ex_transaction_schema.json b/python-packages/json_schemas/src/zero_ex/json_schemas/schemas/zero_ex_transaction_schema.json index 0c714f14d..ffdf1f229 100644 --- a/python-packages/json_schemas/src/zero_ex/json_schemas/schemas/zero_ex_transaction_schema.json +++ b/python-packages/json_schemas/src/zero_ex/json_schemas/schemas/zero_ex_transaction_schema.json @@ -1,10 +1,11 @@ { "id": "/zeroExTransactionSchema", "properties": { + "verifyingContractAddress": { "$ref": "/addressSchema" }, "data": { "$ref": "/hexSchema" }, "signerAddress": { "$ref": "/addressSchema" }, "salt": { "$ref": "/wholeNumberSchema" } }, - "required": ["data", "salt", "signerAddress"], + "required": ["verifyingContractAddress", "data", "salt", "signerAddress"], "type": "object" } diff --git a/tsconfig.json b/tsconfig.json index 0a063c85b..bfa83503e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -40,6 +40,7 @@ { "path": "./packages/contract-addresses" }, { "path": "./packages/contract-artifacts" }, { "path": "./packages/contract-wrappers" }, + { "path": "./packages/contracts-gen" }, { "path": "./packages/dev-utils" }, { "path": "./packages/ethereum-types" }, { "path": "./packages/fill-scenarios" }, @@ -472,79 +472,120 @@ npmlog "^4.1.2" write-file-atomic "^2.3.0" -"@0x/abi-gen-wrappers@^1.0.2": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@0x/abi-gen-wrappers/-/abi-gen-wrappers-1.1.0.tgz#d4e4f10699b5da6bcfadc3842f165fc59f686e09" - dependencies: - "@0x/base-contract" "^3.0.7" +"@0x/contracts-asset-proxy@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@0x/contracts-asset-proxy/-/contracts-asset-proxy-1.0.2.tgz#48a432a52a019ee632e50456f2687c85a5b57535" + dependencies: + "@0x/base-contract" "^4.0.1" + "@0x/contracts-erc20" "^1.0.2" + "@0x/contracts-erc721" "^1.0.2" + "@0x/contracts-test-utils" "^3.0.1" + "@0x/contracts-utils" "^2.0.1" + "@0x/order-utils" "^5.0.0" + "@0x/types" "^2.0.1" + "@0x/typescript-typings" "^4.0.0" + "@0x/utils" "^4.0.2" + "@0x/web3-wrapper" "^4.0.1" + ethereum-types "^2.0.0" + lodash "^4.17.5" -"@0x/contract-addresses@^1.1.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@0x/contract-addresses/-/contract-addresses-1.2.0.tgz#aa5001d73adb1ec9cc58ab4f6e0cac0acc4ad0a8" - dependencies: +"@0x/contracts-erc20@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@0x/contracts-erc20/-/contracts-erc20-1.0.2.tgz#67cfefd4458b262d575bb1b07f63bc3dfed4daeb" + dependencies: + "@0x/base-contract" "^4.0.1" + "@0x/contracts-exchange-libs" "^1.0.2" + "@0x/contracts-utils" "^2.0.1" + "@0x/types" "^2.0.1" + "@0x/typescript-typings" "^4.0.0" + "@0x/utils" "^4.0.2" + "@0x/web3-wrapper" "^4.0.1" + ethereum-types "^2.0.0" lodash "^4.17.5" -"@0x/contract-wrappers@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@0x/contract-wrappers/-/contract-wrappers-3.0.1.tgz#e25f5812595d994ff66e36aa2aa99eb53becfc7c" - dependencies: - "@0x/abi-gen-wrappers" "^1.0.2" - "@0x/assert" "^1.0.15" - "@0x/contract-addresses" "^1.1.0" - "@0x/contract-artifacts" "^1.1.0" - "@0x/fill-scenarios" "^1.0.9" - "@0x/json-schemas" "^2.0.1" - "@0x/order-utils" "^2.0.1" - "@0x/types" "^1.2.1" - "@0x/typescript-typings" "^3.0.4" - "@0x/utils" "^2.0.4" - "@0x/web3-wrapper" "^3.1.1" - ethereum-types "^1.1.2" - ethereumjs-blockstream "6.0.0" +"@0x/contracts-erc721@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@0x/contracts-erc721/-/contracts-erc721-1.0.2.tgz#e7309ae57de266bb9c4947de50ba16a89203ad08" + dependencies: + "@0x/base-contract" "^4.0.1" + "@0x/contracts-utils" "^2.0.1" + "@0x/types" "^2.0.1" + "@0x/typescript-typings" "^4.0.0" + "@0x/utils" "^4.0.2" + "@0x/web3-wrapper" "^4.0.1" + ethereum-types "^2.0.0" + lodash "^4.17.5" + +"@0x/contracts-exchange-libs@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@0x/contracts-exchange-libs/-/contracts-exchange-libs-1.0.2.tgz#0682c01cdb3e36100bda0ffbdf9badb5b8a01fc4" + dependencies: + "@0x/base-contract" "^4.0.1" + "@0x/contracts-utils" "^2.0.1" + "@0x/order-utils" "^5.0.0" + "@0x/types" "^2.0.1" + "@0x/typescript-typings" "^4.0.0" + "@0x/utils" "^4.0.2" + "@0x/web3-wrapper" "^4.0.1" + ethereum-types "^2.0.0" + lodash "^4.17.5" + +"@0x/contracts-exchange@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@0x/contracts-exchange/-/contracts-exchange-1.0.2.tgz#4c02378b26a7bf6324e16a41f2851c43fed82c63" + dependencies: + "@0x/base-contract" "^4.0.1" + "@0x/contracts-asset-proxy" "^1.0.2" + "@0x/contracts-erc20" "^1.0.2" + "@0x/contracts-erc721" "^1.0.2" + "@0x/contracts-exchange-libs" "^1.0.2" + "@0x/contracts-test-utils" "^3.0.1" + "@0x/contracts-utils" "^2.0.1" + "@0x/order-utils" "^5.0.0" + "@0x/types" "^2.0.1" + "@0x/typescript-typings" "^4.0.0" + "@0x/utils" "^4.0.2" + "@0x/web3-wrapper" "^4.0.1" + ethereum-types "^2.0.0" ethereumjs-util "^5.1.1" - ethers "~4.0.4" - js-sha3 "^0.7.0" lodash "^4.17.5" - uuid "^3.1.0" -"@0x/order-utils@^2.0.1": +"@0x/contracts-utils@2.0.1": version "2.0.1" - resolved "https://registry.yarnpkg.com/@0x/order-utils/-/order-utils-2.0.1.tgz#8c46d7aeb9e2cce54a0822824c12427cbe5f7eb4" - dependencies: - "@0x/abi-gen-wrappers" "^1.0.2" - "@0x/assert" "^1.0.15" - "@0x/base-contract" "^3.0.3" - "@0x/contract-artifacts" "^1.1.0" - "@0x/json-schemas" "^2.0.1" - "@0x/types" "^1.2.1" - "@0x/typescript-typings" "^3.0.4" - "@0x/utils" "^2.0.4" - "@0x/web3-wrapper" "^3.1.1" - "@types/node" "*" + resolved "https://registry.yarnpkg.com/@0x/contracts-utils/-/contracts-utils-2.0.1.tgz#32e298ab5e6edb045c37294063ff928b629db0a4" + dependencies: + "@0x/base-contract" "^4.0.1" + "@0x/order-utils" "^5.0.0" + "@0x/types" "^2.0.1" + "@0x/typescript-typings" "^4.0.0" + "@0x/utils" "^4.0.2" + "@0x/web3-wrapper" "^4.0.1" bn.js "^4.11.8" - ethereum-types "^1.1.2" - ethereumjs-abi "0.6.5" + ethereum-types "^2.0.0" ethereumjs-util "^5.1.1" - ethers "~4.0.4" lodash "^4.17.5" -"@0x/utils@^2.0.4": - version "2.1.1" - resolved "https://registry.npmjs.org/@0x/utils/-/utils-2.1.1.tgz#0a79f9ce6207a8a7ff0751366e618d0f6b9d903f" - dependencies: - "@0x/types" "^1.5.0" - "@0x/typescript-typings" "^3.0.6" +"@0x/order-utils@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@0x/order-utils/-/order-utils-5.0.0.tgz#7f43e0310ace31738895881501c8dda9c3a3aefa" + dependencies: + "@0x/abi-gen-wrappers" "^3.0.1" + "@0x/assert" "^2.0.1" + "@0x/base-contract" "^4.0.1" + "@0x/contract-addresses" "^2.2.1" + "@0x/contract-artifacts" "^1.3.0" + "@0x/json-schemas" "^3.0.1" + "@0x/types" "^2.0.1" + "@0x/typescript-typings" "^4.0.0" + "@0x/utils" "^4.0.2" + "@0x/web3-wrapper" "^4.0.1" "@types/node" "*" - abortcontroller-polyfill "^1.1.9" - bignumber.js "~4.1.0" - chalk "^2.4.1" - detect-node "2.0.3" - ethereum-types "^1.1.4" + bn.js "^4.11.8" + ethereum-types "^2.0.0" + ethereumjs-abi "0.6.5" ethereumjs-util "^5.1.1" ethers "~4.0.4" - isomorphic-fetch "^2.2.1" - js-sha3 "^0.7.0" - lodash "^4.17.5" + lodash "^4.17.11" "@0xproject/npm-cli-login@^0.0.11": version "0.0.11" @@ -564,12 +605,6 @@ dependencies: "@babel/types" "^7.0.0" -"@babel/helper-module-imports@^7.0.0": - version "7.0.0" - resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" - dependencies: - "@babel/types" "^7.0.0" - "@babel/highlight@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" @@ -610,16 +645,6 @@ dependencies: "@emotion/memoize" "^0.6.6" -"@emotion/is-prop-valid@^0.7.3": - version "0.7.3" - resolved "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.7.3.tgz#a6bf4fa5387cbba59d44e698a4680f481a8da6cc" - dependencies: - "@emotion/memoize" "0.7.1" - -"@emotion/memoize@0.7.1": - version "0.7.1" - resolved "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.1.tgz#e93c13942592cf5ef01aa8297444dc192beee52f" - "@emotion/memoize@^0.6.6": version "0.6.6" resolved "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.6.6.tgz#004b98298d04c7ca3b4f50ca2035d4f60d2eed1b" @@ -1434,7 +1459,7 @@ dependencies: "@types/ethereum-protocol" "*" -"@types/glob@*", "@types/glob@5.0.35", "@types/glob@^5.0.33": +"@types/glob@*", "@types/glob@5.0.35": version "5.0.35" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-5.0.35.tgz#1ae151c802cece940443b5ac246925c85189f32a" dependencies: @@ -1513,7 +1538,7 @@ version "4.14.104" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.104.tgz#53ee2357fa2e6e68379341d92eb2ecea4b11bb80" -"@types/lodash@^4.14.110", "@types/lodash@^4.14.116": +"@types/lodash@^4.14.110": version "4.14.116" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.116.tgz#5ccf215653e3e8c786a58390751033a9adca0eb9" @@ -1525,13 +1550,6 @@ version "0.4.0" resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.4.0.tgz#057a6165703e7419217f8ffc6887747f980b6315" -"@types/material-ui@0.18.0": - version "0.18.0" - resolved "https://registry.yarnpkg.com/@types/material-ui/-/material-ui-0.18.0.tgz#f3abc5431df8faa4592233c6c5377f2843eb807f" - dependencies: - "@types/react" "*" - "@types/react-addons-linked-state-mixin" "*" - "@types/material-ui@^0.20.0": version "0.20.8" resolved "https://registry.npmjs.org/@types/material-ui/-/material-ui-0.20.8.tgz#76e46f9accc48944f532c3b1038a2b46214454fa" @@ -1547,7 +1565,7 @@ version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" -"@types/mkdirp@^0.5.1", "@types/mkdirp@^0.5.2": +"@types/mkdirp@^0.5.2": version "0.5.2" resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" dependencies: @@ -1557,10 +1575,6 @@ version "2.2.48" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.48.tgz#3523b126a0b049482e1c3c11877460f76622ffab" -"@types/mocha@^5.2.2": - version "5.2.3" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.3.tgz#11f3a5629d67cd444fa6c94536576244e6a52ea9" - "@types/node@*": version "9.6.5" resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.5.tgz#ee700810fdf49ac1c399fc5980b7559b3e5a381d" @@ -1569,10 +1583,6 @@ version "10.9.4" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.9.4.tgz#0f4cb2dc7c1de6096055357f70179043c33e9897" -"@types/node@^10.5.3": - version "10.5.7" - resolved "https://registry.npmjs.org/@types/node/-/node-10.5.7.tgz#960d9feb3ade2233bcc9843c918d740b4f78a7cf" - "@types/numeral@^0.0.22": version "0.0.22" resolved "https://registry.yarnpkg.com/@types/numeral/-/numeral-0.0.22.tgz#86bef1f0a2d743afdc2ef3168d45f2905e1a0b93" @@ -1591,13 +1601,17 @@ version "0.0.29" resolved "https://registry.yarnpkg.com/@types/pluralize/-/pluralize-0.0.29.tgz#6ffa33ed1fc8813c469b859681d09707eb40d03c" +"@types/prettier@^1.15.2": + version "1.15.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.15.2.tgz#91594ea7cb6f3b1f7ea69f32621246654c7cc231" + "@types/prop-types@*": version "15.5.5" resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.5.5.tgz#17038dd322c2325f5da650a94d5f9974943625e3" dependencies: "@types/react" "*" -"@types/query-string@^5.0.1", "@types/query-string@^5.1.0": +"@types/query-string@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@types/query-string/-/query-string-5.1.0.tgz#7f40cdea49ddafa0ea4f3db35fb6c24d3bfd4dcc" @@ -1630,23 +1644,22 @@ dependencies: "@types/react" "*" -"@types/react-dom@*": +"@types/react-dom@*", "@types/react-dom@16.0.6": version "16.0.6" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.0.6.tgz#f1a65a4e7be8ed5d123f8b3b9eacc913e35a1a3c" dependencies: "@types/node" "*" "@types/react" "*" -"@types/react-dom@^16.0.7": - version "16.0.7" - resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.0.7.tgz#54d0f867a76b90597e8432030d297982f25c20ba" +"@types/react-dom@^16.0.6": + version "16.0.11" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.0.11.tgz#bd10ccb0d9260343f4b9a49d4f7a8330a5c1f081" dependencies: - "@types/node" "*" "@types/react" "*" -"@types/react-dom@^16.0.8": - version "16.0.8" - resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.0.8.tgz#6e1366ed629cadf55860cbfcc25db533f5d2fa7d" +"@types/react-dom@^16.0.7": + version "16.0.7" + resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.0.7.tgz#54d0f867a76b90597e8432030d297982f25c20ba" dependencies: "@types/node" "*" "@types/react" "*" @@ -1663,13 +1676,6 @@ dependencies: "@types/react" "*" -"@types/react-loadable@^5.4.1": - version "5.4.1" - resolved "https://registry.yarnpkg.com/@types/react-loadable/-/react-loadable-5.4.1.tgz#bc76978c6d9039e5808797b5ee35f6ae18b7329f" - dependencies: - "@types/react" "*" - "@types/webpack" "*" - "@types/react-loadable@^5.4.2": version "5.4.3" resolved "https://registry.yarnpkg.com/@types/react-loadable/-/react-loadable-5.4.3.tgz#b3891da6609a869b021319494b27ba85aaa83634" @@ -1740,7 +1746,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^16.4.16": +"@types/react@*", "@types/react@16.4.16": version "16.4.16" resolved "https://registry.npmjs.org/@types/react/-/react-16.4.16.tgz#99f91b1200ae8c2062030402006d3b3c3a177043" dependencies: @@ -1778,7 +1784,7 @@ "@types/glob" "*" "@types/node" "*" -"@types/semver@5.5.0", "@types/semver@^5.5.0": +"@types/semver@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" @@ -1844,7 +1850,7 @@ dependencies: source-map "^0.6.1" -"@types/uuid@^3.4.2", "@types/uuid@^3.4.3": +"@types/uuid@^3.4.3": version "3.4.3" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-3.4.3.tgz#121ace265f5569ce40f4f6d0ff78a338c732a754" dependencies: @@ -1876,10 +1882,6 @@ "@types/events" "*" "@types/node" "*" -"@types/yargs@^10.0.0": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-10.0.2.tgz#cc4ea921877874d1261e2c44b89807bc836e1b12" - "@types/yargs@^11.0.0": version "11.0.0" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-11.0.0.tgz#124b9ed9c65b7091cc36da59ae12cbd47d8745ea" @@ -3678,10 +3680,6 @@ browser-stdout@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.0.6: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" @@ -4070,7 +4068,7 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chai-as-promised@^7.1.0, chai-as-promised@^7.1.1: +chai-as-promised@^7.1.0: version "7.1.1" resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-7.1.1.tgz#08645d825deb8696ee61725dbf590c012eb00ca0" dependencies: @@ -4080,7 +4078,7 @@ chai-bignumber@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/chai-bignumber/-/chai-bignumber-3.0.0.tgz#e90cf1f468355bbb11a9acd051222586cd2648a9" -chai@^4.0.1, chai@^4.1.2: +chai@^4.0.1: version "4.1.2" resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c" dependencies: @@ -4543,10 +4541,6 @@ commander@2.11.0: version "2.11.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" -commander@2.15.1, commander@^2.12.1, commander@^2.8.1: - version "2.15.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" - commander@2.17.x, commander@^2.7.1, commander@~2.17.1: version "2.17.1" resolved "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" @@ -4555,6 +4549,10 @@ commander@2.18.0: version "2.18.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" +commander@^2.12.1, commander@^2.8.1: + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + commander@^2.15.1, commander@^2.18.0: version "2.19.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" @@ -5292,12 +5290,6 @@ debug-log@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" -debug@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" - dependencies: - ms "0.7.1" - debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.6, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -5630,7 +5622,7 @@ diff@3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" -diff@3.5.0, diff@^3.1.0, diff@^3.2.0: +diff@^3.1.0, diff@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" @@ -7920,7 +7912,7 @@ got@^6.7.1: graceful-fs@4.1.15, graceful-fs@^3.0.0, graceful-fs@^4.0.0, graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@~1.2.0: version "4.1.15" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" "graceful-readlink@>= 1.0.0": version "1.0.1" @@ -7930,10 +7922,6 @@ growl@1.10.3: version "1.10.3" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - growly@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" @@ -8246,14 +8234,14 @@ hoek@4.x.x: version "4.2.1" resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" -hoist-non-react-statics@^2.3.0, hoist-non-react-statics@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.0.tgz#d2ca2dfc19c5a91c5a6615ce8e564ef0347e2a40" - hoist-non-react-statics@^2.3.1: version "2.5.5" resolved "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47" +hoist-non-react-statics@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.0.tgz#d2ca2dfc19c5a91c5a6615ce8e564ef0347e2a40" + home-or-tmp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" @@ -9200,7 +9188,7 @@ isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" -isomorphic-fetch@2.2.1, isomorphic-fetch@^2.1.1, isomorphic-fetch@^2.2.1: +isomorphic-fetch@2.2.1, isomorphic-fetch@^2.1.1: version "2.2.1" resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" dependencies: @@ -11115,7 +11103,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" -"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -11230,7 +11218,7 @@ mobx@^4.2.0: version "4.3.1" resolved "https://registry.npmjs.org/mobx/-/mobx-4.3.1.tgz#334e5aab4916b1d43f0faf3605a64b1b4b3ccb8d" -mocha@^4.0.1, mocha@^4.1.0: +mocha@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.1.0.tgz#7d86cfbcf35cb829e2754c32e17355ec05338794" dependencies: @@ -11245,22 +11233,6 @@ mocha@^4.0.1, mocha@^4.1.0: mkdirp "0.5.1" supports-color "4.4.0" -mocha@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" - dependencies: - browser-stdout "1.3.1" - commander "2.15.1" - debug "3.1.0" - diff "3.5.0" - escape-string-regexp "1.0.5" - glob "7.1.2" - growl "1.10.5" - he "1.1.1" - minimatch "3.0.4" - mkdirp "0.5.1" - supports-color "5.4.0" - mock-fs@^4.1.0: version "4.4.2" resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.4.2.tgz#09dec5313f97095a450be6aa2ad8ab6738d63d6b" @@ -11296,10 +11268,6 @@ move-concurrently@^1.0.1: rimraf "^2.5.4" run-queue "^1.0.3" -ms@0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" - ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -11733,7 +11701,7 @@ npm-registry-fetch@^3.0.0, npm-registry-fetch@^3.8.0: make-fetch-happen "^4.0.1" npm-package-arg "^6.1.0" -npm-run-all@^4.1.2, npm-run-all@^4.1.3: +npm-run-all@^4.1.2: version "4.1.3" resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-4.1.3.tgz#49f15b55a66bb4101664ce270cb18e7103f8f185" dependencies: @@ -12603,12 +12571,6 @@ polished@^1.9.3: version "1.9.3" resolved "https://registry.npmjs.org/polished/-/polished-1.9.3.tgz#d61b8a0c4624efe31e2583ff24a358932b6b75e1" -polished@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/polished/-/polished-2.2.0.tgz#5ca7e178cc5352bd7fd1efc45342f7c6d59cc982" - dependencies: - "@babel/runtime" "^7.0.0" - popper.js@1.14.3, popper.js@^1.14.1: version "1.14.3" resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.14.3.tgz#1438f98d046acf7b4d78cd502bf418ac64d4f095" @@ -12950,6 +12912,10 @@ prettier@^1.14.3, prettier@^1.15.3: version "1.15.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.15.3.tgz#1feaac5bdd181237b54dbe65d874e02a1472786a" +prettier@^1.16.3: + version "1.16.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.3.tgz#8c62168453badef702f34b45b6ee899574a6a65d" + pretty-bytes@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-1.0.4.tgz#0a22e8210609ad35542f8c8d5d2159aff0751c84" @@ -13495,15 +13461,6 @@ react-dom@^16.3.2: object-assign "^4.1.1" prop-types "^15.6.0" -react-dom@^16.4.2: - version "16.7.0" - resolved "https://registry.npmjs.org/react-dom/-/react-dom-16.7.0.tgz#a17b2a7ca89ee7390bc1ed5eb81783c7461748b8" - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - prop-types "^15.6.2" - scheduler "^0.12.0" - react-dom@^16.5.2: version "16.5.2" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.5.2.tgz#b69ee47aa20bab5327b2b9d7c1fe2a30f2cfa9d7" @@ -13555,9 +13512,9 @@ react-helmet@^5.2.0: prop-types "^15.5.4" react-side-effect "^1.1.0" -react-highlight@0xproject/react-highlight#fix/react-version: +react-highlight@0xproject/react-highlight#react-peer-deps: version "1.0.0" - resolved "https://codeload.github.com/0xproject/react-highlight/tar.gz/699ac4d9529e33520bff4b9bd9c624d21efbba75" + resolved "https://codeload.github.com/0xproject/react-highlight/tar.gz/a70c7631e09508dafc4719cbcc6f121074e1937d" dependencies: highlight.js "^9.11.0" highlightjs-solidity "^1.0.5" @@ -13670,17 +13627,6 @@ react-responsive@^6.0.1: matchmediaquery "^0.3.0" prop-types "^15.6.1" -react-router-dom@^4.1.1: - version "4.2.2" - resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.2.2.tgz#c8a81df3adc58bba8a76782e946cbd4eae649b8d" - dependencies: - history "^4.7.2" - invariant "^2.2.2" - loose-envify "^1.3.1" - prop-types "^15.5.4" - react-router "^4.2.0" - warning "^3.0.0" - react-router-dom@^4.3.1: version "4.3.1" resolved "https://registry.npmjs.org/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6" @@ -13692,18 +13638,6 @@ react-router-dom@^4.3.1: react-router "^4.3.1" warning "^4.0.1" -react-router@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.2.0.tgz#61f7b3e3770daeb24062dae3eedef1b054155986" - dependencies: - history "^4.7.2" - hoist-non-react-statics "^2.3.0" - invariant "^2.2.2" - loose-envify "^1.3.1" - path-to-regexp "^1.7.0" - prop-types "^15.5.4" - warning "^3.0.0" - react-router@^4.3.1: version "4.3.1" resolved "https://registry.npmjs.org/react-router/-/react-router-4.3.1.tgz#aada4aef14c809cb2e686b05cee4742234506c4e" @@ -13830,15 +13764,6 @@ react@^16.3.2: object-assign "^4.1.1" prop-types "^15.6.0" -react@^16.4.2: - version "16.7.0" - resolved "https://registry.npmjs.org/react/-/react-16.7.0.tgz#b674ec396b0a5715873b350446f7ea0802ab6381" - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - prop-types "^15.6.2" - scheduler "^0.12.0" - react@^16.5.2: version "16.5.2" resolved "https://registry.yarnpkg.com/react/-/react-16.5.2.tgz#19f6b444ed139baa45609eee6dc3d318b3895d42" @@ -14278,10 +14203,6 @@ replace-ext@1.0.0, replace-ext@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" -request-ip@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/request-ip/-/request-ip-1.2.3.tgz#66988f0e22406ec4af630d19b573fe4b447c3b49" - request-ip@~2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/request-ip/-/request-ip-2.0.2.tgz#deeae6d4af21768497db8cd05fa37143f8f1257e" @@ -14562,19 +14483,6 @@ rollbar-sourcemap-webpack-plugin@^2.4.0: request "^2.85.0" verror "^1.6.1" -rollbar@^0.6.5: - version "0.6.6" - resolved "https://registry.yarnpkg.com/rollbar/-/rollbar-0.6.6.tgz#8630cff4af967667d06b227f243635ea86dcc5ba" - dependencies: - async "~1.2.1" - debug "2.2.0" - json-stringify-safe "~5.0.0" - lru-cache "~2.2.1" - request-ip "~1.2.3" - uuid "~3.0.0" - optionalDependencies: - decache "^3.0.5" - rollbar@^2.4.7: version "2.4.7" resolved "https://registry.yarnpkg.com/rollbar/-/rollbar-2.4.7.tgz#9b1de1a0fab6b6e63fcfcd322c26081a1d8242e8" @@ -14727,13 +14635,6 @@ schedule@^0.5.0: dependencies: object-assign "^4.1.1" -scheduler@^0.12.0: - version "0.12.0" - resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.12.0.tgz#8ab17699939c0aedc5a196a657743c496538647b" - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - schema-utils@^0.4.4: version "0.4.7" resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz#ba74f597d2be2ea880131746ee17d0a093c68187" @@ -15767,35 +15668,6 @@ styled-components@^3.3.3: stylis-rule-sheet "^0.0.10" supports-color "^3.2.3" -styled-components@^4.0.1: - version "4.1.3" - resolved "https://registry.npmjs.org/styled-components/-/styled-components-4.1.3.tgz#4472447208e618b57e84deaaeb6acd34a5e0fe9b" - dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@emotion/is-prop-valid" "^0.7.3" - "@emotion/unitless" "^0.7.0" - babel-plugin-styled-components ">= 1" - css-to-react-native "^2.2.2" - memoize-one "^4.0.0" - prop-types "^15.5.4" - react-is "^16.6.0" - stylis "^3.5.0" - stylis-rule-sheet "^0.0.10" - supports-color "^5.5.0" - -styled-components@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-4.0.2.tgz#7d4409ada019cdd34c25ba68c4577ea95dbcf0c5" - dependencies: - "@emotion/is-prop-valid" "^0.6.8" - babel-plugin-styled-components ">= 1" - css-to-react-native "^2.2.2" - memoize-one "^4.0.0" - prop-types "^15.5.4" - react-is "^16.3.1" - stylis "^3.5.0" - stylis-rule-sheet "^0.0.10" - styled-components@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-4.1.1.tgz#943922048fae556e286bcbfdd29da4f1399446bc" @@ -15829,12 +15701,6 @@ supports-color@4.4.0: dependencies: has-flag "^2.0.0" -supports-color@5.4.0, supports-color@^5.1.0, supports-color@^5.2.0, supports-color@^5.3.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" - dependencies: - has-flag "^3.0.0" - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -15845,6 +15711,12 @@ supports-color@^3.1.0, supports-color@^3.1.2, supports-color@^3.2.3: dependencies: has-flag "^1.0.0" +supports-color@^5.1.0, supports-color@^5.2.0, supports-color@^5.3.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + dependencies: + has-flag "^3.0.0" + supports-color@^5.5.0: version "5.5.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -16488,30 +16360,13 @@ tslint@5.11.0: tslib "^1.8.0" tsutils "^2.27.2" -tslint@^5.9.1: - version "5.9.1" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.9.1.tgz#1255f87a3ff57eb0b0e1f0e610a8b4748046c9ae" - dependencies: - babel-code-frame "^6.22.0" - builtin-modules "^1.1.1" - chalk "^2.3.0" - commander "^2.12.1" - diff "^3.2.0" - glob "^7.1.1" - js-yaml "^3.7.0" - minimatch "^3.0.4" - resolve "^1.3.2" - semver "^5.3.0" - tslib "^1.8.0" - tsutils "^2.12.1" - tsutils@3.0.0, tsutils@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.0.0.tgz#0c5070a17a0503e056da038c48b5a1870a50a9ad" dependencies: tslib "^1.8.1" -tsutils@^2.12.1, tsutils@^2.13.1, tsutils@^2.27.2: +tsutils@^2.13.1, tsutils@^2.27.2: version "2.29.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" dependencies: @@ -17031,7 +16886,7 @@ uuid@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" -uuid@3.0.x, uuid@~3.0.0: +uuid@3.0.x: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" @@ -17612,7 +17467,7 @@ webpack-bundle-analyzer@^3.0.3: opener "^1.5.1" ws "^6.0.0" -webpack-cli@3.1.2, webpack-cli@^3.1.1: +webpack-cli@3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.1.2.tgz#17d7e01b77f89f884a2bbf9db545f0f6a648e746" dependencies: |