From e7bb5243629e7abe4f7e079aac87b46911cfbc3c Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Tue, 5 Mar 2019 14:28:55 -0800 Subject: [PATCH 1/5] Update dependencies and update solc types --- package.json | 2 +- packages/sol-compiler/package.json | 2 +- packages/typescript-typings/types/solc/index.d.ts | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b89a0e332d..99836a5ed9 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "async-child-process": "^1.1.1", "bundlewatch": "^0.2.1", "coveralls": "^3.0.0", - "ganache-cli": "6.1.8", + "ganache-cli": "6.4.1", "lcov-result-merger": "^3.0.0", "lerna": "^3.0.0-beta.25", "npm-run-all": "^4.1.2", diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json index da35412565..a0d8cbcd04 100644 --- a/packages/sol-compiler/package.json +++ b/packages/sol-compiler/package.json @@ -86,7 +86,7 @@ "pluralize": "^7.0.0", "require-from-string": "^2.0.1", "semver": "5.5.0", - "solc": "^0.5.2", + "solc": "^0.5.5", "source-map-support": "^0.5.0", "web3-eth-abi": "^1.0.0-beta.24", "yargs": "^10.0.3" diff --git a/packages/typescript-typings/types/solc/index.d.ts b/packages/typescript-typings/types/solc/index.d.ts index fefad9f6a4..09370467b5 100644 --- a/packages/typescript-typings/types/solc/index.d.ts +++ b/packages/typescript-typings/types/solc/index.d.ts @@ -66,6 +66,15 @@ declare module 'solc' { optimizer?: { enabled: boolean; runs?: number; + details?: { + peephole?: boolean; + jumpdestRemover?: boolean; + orderLiterals?: boolean; + deduplicate?: boolean; + cse?: boolean; + constantOptimizer?: boolean; + yul?: boolean; + }; }; evmVersion?: 'homestead' | 'tangerineWhistle' | 'spuriousDragon' | 'byzantium' | 'constantinople'; metadata?: { From 87cc1f9415d3160d0c91d904220e615f52ff11b9 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Tue, 5 Mar 2019 14:31:51 -0800 Subject: [PATCH 2/5] Update TEC solidity versions --- contracts/coordinator/compiler.json | 11 ++++++++++- contracts/coordinator/contracts/src/Coordinator.sol | 2 +- .../src/MixinCoordinatorApprovalVerifier.sol | 2 +- .../contracts/src/MixinCoordinatorCore.sol | 2 +- .../contracts/src/MixinSignatureValidator.sol | 2 +- .../src/interfaces/ICoordinatorApprovalVerifier.sol | 2 +- .../contracts/src/interfaces/ICoordinatorCore.sol | 2 +- .../contracts/src/interfaces/ISignatureValidator.sol | 2 +- .../contracts/src/interfaces/ITransactions.sol | 2 +- .../coordinator/contracts/src/libs/LibConstants.sol | 2 +- .../contracts/src/libs/LibCoordinatorApproval.sol | 2 +- .../contracts/src/libs/LibEIP712Domain.sol | 2 +- .../contracts/src/libs/LibZeroExTransaction.sol | 2 +- .../src/mixins/MCoordinatorApprovalVerifier.sol | 2 +- .../contracts/src/mixins/MSignatureValidator.sol | 2 +- contracts/coordinator/contracts/test/TestLibs.sol | 2 +- contracts/coordinator/contracts/test/TestMixins.sol | 2 +- 17 files changed, 26 insertions(+), 17 deletions(-) diff --git a/contracts/coordinator/compiler.json b/contracts/coordinator/compiler.json index a5f8264110..a21cc145e9 100644 --- a/contracts/coordinator/compiler.json +++ b/contracts/coordinator/compiler.json @@ -4,7 +4,16 @@ "useDockerisedSolc": true, "compilerSettings": { "evmVersion": "byzantium", - "optimizer": { "enabled": true, "runs": 1000000 }, + "optimizer": { + "enabled": true, + "runs": 1000000, + "details": { + "yul": true, + "deduplicate": true, + "cse": true, + "constantOptimizer": true + } + }, "outputSelection": { "*": { "*": [ diff --git a/contracts/coordinator/contracts/src/Coordinator.sol b/contracts/coordinator/contracts/src/Coordinator.sol index 6ad7fb73d7..316ffaac05 100644 --- a/contracts/coordinator/contracts/src/Coordinator.sol +++ b/contracts/coordinator/contracts/src/Coordinator.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.5.3; +pragma solidity 0.5.5; pragma experimental "ABIEncoderV2"; import "./libs/LibConstants.sol"; diff --git a/contracts/coordinator/contracts/src/MixinCoordinatorApprovalVerifier.sol b/contracts/coordinator/contracts/src/MixinCoordinatorApprovalVerifier.sol index a5ad39ae8d..b0d72f73fd 100644 --- a/contracts/coordinator/contracts/src/MixinCoordinatorApprovalVerifier.sol +++ b/contracts/coordinator/contracts/src/MixinCoordinatorApprovalVerifier.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; pragma experimental "ABIEncoderV2"; import "@0x/contracts-exchange-libs/contracts/src/LibExchangeSelectors.sol"; diff --git a/contracts/coordinator/contracts/src/MixinCoordinatorCore.sol b/contracts/coordinator/contracts/src/MixinCoordinatorCore.sol index d5337bfbf2..4000562416 100644 --- a/contracts/coordinator/contracts/src/MixinCoordinatorCore.sol +++ b/contracts/coordinator/contracts/src/MixinCoordinatorCore.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; pragma experimental "ABIEncoderV2"; import "./libs/LibZeroExTransaction.sol"; diff --git a/contracts/coordinator/contracts/src/MixinSignatureValidator.sol b/contracts/coordinator/contracts/src/MixinSignatureValidator.sol index 35070cdc17..5134ce5772 100644 --- a/contracts/coordinator/contracts/src/MixinSignatureValidator.sol +++ b/contracts/coordinator/contracts/src/MixinSignatureValidator.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; import "@0x/contracts-utils/contracts/src/LibBytes.sol"; import "./mixins/MSignatureValidator.sol"; diff --git a/contracts/coordinator/contracts/src/interfaces/ICoordinatorApprovalVerifier.sol b/contracts/coordinator/contracts/src/interfaces/ICoordinatorApprovalVerifier.sol index f8cee23faa..c603e7a4fa 100644 --- a/contracts/coordinator/contracts/src/interfaces/ICoordinatorApprovalVerifier.sol +++ b/contracts/coordinator/contracts/src/interfaces/ICoordinatorApprovalVerifier.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; pragma experimental "ABIEncoderV2"; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; diff --git a/contracts/coordinator/contracts/src/interfaces/ICoordinatorCore.sol b/contracts/coordinator/contracts/src/interfaces/ICoordinatorCore.sol index bd7dded956..e1139dab10 100644 --- a/contracts/coordinator/contracts/src/interfaces/ICoordinatorCore.sol +++ b/contracts/coordinator/contracts/src/interfaces/ICoordinatorCore.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; pragma experimental "ABIEncoderV2"; import "../libs/LibZeroExTransaction.sol"; diff --git a/contracts/coordinator/contracts/src/interfaces/ISignatureValidator.sol b/contracts/coordinator/contracts/src/interfaces/ISignatureValidator.sol index 394d0681d5..e257a21f82 100644 --- a/contracts/coordinator/contracts/src/interfaces/ISignatureValidator.sol +++ b/contracts/coordinator/contracts/src/interfaces/ISignatureValidator.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; contract ISignatureValidator { diff --git a/contracts/coordinator/contracts/src/interfaces/ITransactions.sol b/contracts/coordinator/contracts/src/interfaces/ITransactions.sol index 2efcdc9d65..58c983f2c3 100644 --- a/contracts/coordinator/contracts/src/interfaces/ITransactions.sol +++ b/contracts/coordinator/contracts/src/interfaces/ITransactions.sol @@ -15,7 +15,7 @@ limitations under the License. */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; contract ITransactions { diff --git a/contracts/coordinator/contracts/src/libs/LibConstants.sol b/contracts/coordinator/contracts/src/libs/LibConstants.sol index dc66eb1821..947ca59270 100644 --- a/contracts/coordinator/contracts/src/libs/LibConstants.sol +++ b/contracts/coordinator/contracts/src/libs/LibConstants.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; import "../interfaces/ITransactions.sol"; diff --git a/contracts/coordinator/contracts/src/libs/LibCoordinatorApproval.sol b/contracts/coordinator/contracts/src/libs/LibCoordinatorApproval.sol index 591ff18d32..a8f11074ec 100644 --- a/contracts/coordinator/contracts/src/libs/LibCoordinatorApproval.sol +++ b/contracts/coordinator/contracts/src/libs/LibCoordinatorApproval.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; import "./LibEIP712Domain.sol"; diff --git a/contracts/coordinator/contracts/src/libs/LibEIP712Domain.sol b/contracts/coordinator/contracts/src/libs/LibEIP712Domain.sol index 7106cdf5e9..0db46911ec 100644 --- a/contracts/coordinator/contracts/src/libs/LibEIP712Domain.sol +++ b/contracts/coordinator/contracts/src/libs/LibEIP712Domain.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; contract LibEIP712Domain { diff --git a/contracts/coordinator/contracts/src/libs/LibZeroExTransaction.sol b/contracts/coordinator/contracts/src/libs/LibZeroExTransaction.sol index 67dc7a1c72..dd25f12ff2 100644 --- a/contracts/coordinator/contracts/src/libs/LibZeroExTransaction.sol +++ b/contracts/coordinator/contracts/src/libs/LibZeroExTransaction.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; import "./LibEIP712Domain.sol"; diff --git a/contracts/coordinator/contracts/src/mixins/MCoordinatorApprovalVerifier.sol b/contracts/coordinator/contracts/src/mixins/MCoordinatorApprovalVerifier.sol index 85063c8d9c..d8e217279b 100644 --- a/contracts/coordinator/contracts/src/mixins/MCoordinatorApprovalVerifier.sol +++ b/contracts/coordinator/contracts/src/mixins/MCoordinatorApprovalVerifier.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; pragma experimental "ABIEncoderV2"; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; diff --git a/contracts/coordinator/contracts/src/mixins/MSignatureValidator.sol b/contracts/coordinator/contracts/src/mixins/MSignatureValidator.sol index cacb8d57eb..df75435e4c 100644 --- a/contracts/coordinator/contracts/src/mixins/MSignatureValidator.sol +++ b/contracts/coordinator/contracts/src/mixins/MSignatureValidator.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; import "../interfaces/ISignatureValidator.sol"; diff --git a/contracts/coordinator/contracts/test/TestLibs.sol b/contracts/coordinator/contracts/test/TestLibs.sol index f789ccf3c3..430af6ac9d 100644 --- a/contracts/coordinator/contracts/test/TestLibs.sol +++ b/contracts/coordinator/contracts/test/TestLibs.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity 0.5.5; pragma experimental "ABIEncoderV2"; import "../src/libs/LibCoordinatorApproval.sol"; diff --git a/contracts/coordinator/contracts/test/TestMixins.sol b/contracts/coordinator/contracts/test/TestMixins.sol index 693b732f4e..f79a6b7c7d 100644 --- a/contracts/coordinator/contracts/test/TestMixins.sol +++ b/contracts/coordinator/contracts/test/TestMixins.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.5.3; +pragma solidity 0.5.5; pragma experimental "ABIEncoderV2"; import "../src/MixinSignatureValidator.sol"; From d35a053efdc8f49815ca80be0c278475c6af5238 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Thu, 7 Mar 2019 14:56:59 -0800 Subject: [PATCH 3/5] Update remaining contract Solidity versions to 0.5.5 --- contracts/asset-proxy/compiler.json | 16 ++-- contracts/asset-proxy/package.json | 2 +- contracts/asset-proxy/src/artifacts.ts | 10 --- contracts/asset-proxy/src/wrappers.ts | 5 -- contracts/asset-proxy/test/proxies.ts | 24 +++--- .../asset-proxy/test/utils/erc20_wrapper.ts | 5 +- .../asset-proxy/test/utils/erc721_wrapper.ts | 5 +- contracts/coordinator/test/coordinator.ts | 3 +- contracts/erc20/compiler.json | 14 +++- contracts/erc20/contracts/src/ERC20Token.sol | 2 +- .../contracts/src/MintableERC20Token.sol | 2 +- .../src/UnlimitedAllowanceERC20Token.sol | 2 +- .../contracts/src/interfaces/IERC20Token.sol | 2 +- .../contracts/src/interfaces/IEtherToken.sol | 2 +- .../erc20/contracts/test/DummyERC20Token.sol | 6 +- .../test/DummyMultipleReturnERC20Token.sol | 6 +- .../test/DummyNoReturnERC20Token.sol | 6 +- contracts/erc20/package.json | 4 +- contracts/erc20/src/artifacts.ts | 2 - contracts/erc20/src/wrappers.ts | 1 - contracts/erc721/compiler.json | 11 ++- .../erc721/contracts/src/ERC721Token.sol | 4 +- .../contracts/src/MintableERC721Token.sol | 2 +- .../src/interfaces/IERC721Receiver.sol | 4 +- .../contracts/src/interfaces/IERC721Token.sol | 4 +- .../contracts/test/DummyERC721Receiver.sol | 4 +- .../contracts/test/DummyERC721Token.sol | 6 +- .../contracts/test/InvalidERC721Receiver.sol | 4 +- contracts/erc721/package.json | 2 +- contracts/exchange-forwarder/compiler.json | 19 +++-- contracts/exchange-forwarder/package.json | 4 +- contracts/exchange-forwarder/src/artifacts.ts | 8 -- contracts/exchange-forwarder/src/wrappers.ts | 4 - .../exchange-forwarder/test/forwarder.ts | 19 ++--- .../test/utils/forwarder_wrapper.ts | 10 ++- contracts/exchange-libs/compiler.json | 11 ++- .../contracts/src/LibAbiEncoder.sol | 2 +- .../contracts/src/LibAssetProxyErrors.sol | 2 +- .../contracts/src/LibConstants.sol | 2 +- .../exchange-libs/contracts/src/LibEIP712.sol | 2 +- .../contracts/src/LibExchangeErrors.sol | 2 +- .../contracts/src/LibExchangeSelectors.sol | 2 +- .../contracts/src/LibFillResults.sol | 2 +- .../exchange-libs/contracts/src/LibMath.sol | 2 +- .../exchange-libs/contracts/src/LibOrder.sol | 2 +- .../exchange-libs/contracts/test/TestLibs.sol | 2 +- contracts/exchange/compiler.json | 22 +++--- .../contracts/examples/ExchangeWrapper.sol | 4 +- .../exchange/contracts/examples/Validator.sol | 4 +- .../exchange/contracts/examples/Wallet.sol | 4 +- .../exchange/contracts/examples/Whitelist.sol | 4 +- contracts/exchange/contracts/src/Exchange.sol | 4 +- .../src/MixinAssetProxyDispatcher.sol | 12 ++- .../contracts/src/MixinExchangeCore.sol | 2 +- .../contracts/src/MixinMatchOrders.sol | 2 +- .../contracts/src/MixinSignatureValidator.sol | 8 +- .../contracts/src/MixinTransactions.sol | 10 ++- .../contracts/src/MixinWrapperFunctions.sol | 2 +- .../contracts/src/interfaces/IAssetProxy.sol | 43 +++++++++++ .../src/interfaces/IAssetProxyDispatcher.sol | 2 +- .../contracts/src/interfaces/IExchange.sol | 2 +- .../src/interfaces/IExchangeCore.sol | 2 +- .../contracts/src/interfaces/IMatchOrders.sol | 3 +- .../src/interfaces/ISignatureValidator.sol | 4 +- .../src/interfaces/ITransactions.sol | 7 +- .../contracts/src/interfaces/IValidator.sol | 4 +- .../contracts/src/interfaces/IWallet.sol | 4 +- .../src/interfaces/IWrapperFunctions.sol | 2 +- .../src/mixins/MAssetProxyDispatcher.sol | 2 +- .../contracts/src/mixins/MExchangeCore.sol | 2 +- .../contracts/src/mixins/MMatchOrders.sol | 3 +- .../src/mixins/MSignatureValidator.sol | 6 +- .../contracts/src/mixins/MTransactions.sol | 3 +- .../src/mixins/MWrapperFunctions.sol | 2 +- .../contracts/test/ReentrantERC20Token.sol | 6 +- .../test/TestAssetProxyDispatcher.sol | 2 +- .../contracts/test/TestExchangeInternals.sol | 2 +- .../contracts/test/TestSignatureValidator.sol | 2 +- .../contracts/test/TestStaticCallReceiver.sol | 6 +- contracts/exchange/package.json | 4 +- contracts/exchange/test/core.ts | 10 ++- contracts/exchange/test/dispatcher.ts | 9 +-- contracts/exchange/test/match_orders.ts | 11 +-- contracts/exchange/test/transactions.ts | 3 +- contracts/exchange/test/wrapper.ts | 11 +-- contracts/extensions/compiler.json | 15 ++-- .../BalanceThresholdFilter.sol | 2 +- .../MixinBalanceThresholdFilterCore.sol | 9 ++- .../MixinExchangeCalldata.sol | 20 +++-- .../IBalanceThresholdFilterCore.sol | 6 +- .../interfaces/IThresholdAsset.sol | 2 +- .../mixins/MBalanceThresholdFilterCore.sol | 5 +- .../mixins/MExchangeCalldata.sol | 7 +- .../src/DutchAuction/DutchAuction.sol | 6 +- .../src/OrderMatcher/MixinAssets.sol | 8 +- .../src/OrderMatcher/MixinMatchOrders.sol | 2 +- .../src/OrderMatcher/OrderMatcher.sol | 2 +- .../src/OrderMatcher/interfaces/IAssets.sol | 6 +- .../OrderMatcher/interfaces/IMatchOrders.sol | 2 +- .../OrderMatcher/interfaces/IOrderMatcher.sol | 2 +- .../src/OrderMatcher/libs/LibConstants.sol | 2 +- .../src/OrderMatcher/mixins/MAssets.sol | 2 +- .../src/OrderValidator/OrderValidator.sol | 2 +- contracts/extensions/package.json | 6 +- contracts/extensions/src/artifacts.ts | 8 -- contracts/extensions/src/wrappers.ts | 4 - contracts/extensions/test/dutch_auction.ts | 9 +-- contracts/extensions/test/order_matcher.ts | 17 +++-- contracts/extensions/test/order_validator.ts | 11 +-- .../test/utils/dutch_auction_test_wrapper.ts | 3 +- contracts/multisig/compiler.json | 12 ++- contracts/multisig/src/artifacts.ts | 2 - contracts/multisig/src/wrappers.ts | 1 - contracts/multisig/test/asset_proxy_owner.ts | 6 +- .../test/utils/asset_proxy_owner_wrapper.ts | 3 +- contracts/utils/compiler.json | 11 ++- .../utils/contracts/src/LibAddressArray.sol | 2 +- contracts/utils/contracts/src/LibBytes.sol | 2 +- contracts/utils/contracts/src/Ownable.sol | 2 +- .../utils/contracts/src/ReentrancyGuard.sol | 2 +- contracts/utils/contracts/src/SafeMath.sol | 2 +- .../contracts/src/interfaces/IOwnable.sol | 2 +- .../utils/contracts/test/TestConstants.sol | 2 +- .../utils/contracts/test/TestLibBytes.sol | 2 +- yarn.lock | 75 ++++++++++++++++++- 125 files changed, 453 insertions(+), 321 deletions(-) create mode 100644 contracts/exchange/contracts/src/interfaces/IAssetProxy.sol rename contracts/{erc20 => exchange}/contracts/test/ReentrantERC20Token.sol (98%) diff --git a/contracts/asset-proxy/compiler.json b/contracts/asset-proxy/compiler.json index e1e8f48f74..873e2db477 100644 --- a/contracts/asset-proxy/compiler.json +++ b/contracts/asset-proxy/compiler.json @@ -5,7 +5,16 @@ "isOfflineMode": false, "compilerSettings": { "evmVersion": "byzantium", - "optimizer": { "enabled": true, "runs": 1000000 }, + "optimizer": { + "enabled": true, + "runs": 1000000, + "details": { + "yul": true, + "deduplicate": true, + "cse": true, + "constantOptimizer": true + } + }, "outputSelection": { "*": { "*": [ @@ -19,11 +28,6 @@ } }, "contracts": [ - "@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", diff --git a/contracts/asset-proxy/package.json b/contracts/asset-proxy/package.json index a06782a9cc..2ab998dc74 100644 --- a/contracts/asset-proxy/package.json +++ b/contracts/asset-proxy/package.json @@ -33,7 +33,7 @@ "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "./generated-artifacts/@(DummyERC20Token|DummyERC721Receiver|DummyERC721Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|ERC20Proxy|ERC721Proxy|IAssetData|IAssetProxy|IAuthorizable|MixinAuthorizable|MultiAssetProxy).json", + "abis": "./generated-artifacts/@(ERC20Proxy|ERC721Proxy|IAssetData|IAssetProxy|IAuthorizable|MixinAuthorizable|MultiAssetProxy).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { diff --git a/contracts/asset-proxy/src/artifacts.ts b/contracts/asset-proxy/src/artifacts.ts index d82c0537e2..4cef199512 100644 --- a/contracts/asset-proxy/src/artifacts.ts +++ b/contracts/asset-proxy/src/artifacts.ts @@ -5,11 +5,6 @@ */ 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'; @@ -18,11 +13,6 @@ 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, diff --git a/contracts/asset-proxy/src/wrappers.ts b/contracts/asset-proxy/src/wrappers.ts index f8cd342c0b..06fa9dedc9 100644 --- a/contracts/asset-proxy/src/wrappers.ts +++ b/contracts/asset-proxy/src/wrappers.ts @@ -3,11 +3,6 @@ * 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'; diff --git a/contracts/asset-proxy/test/proxies.ts b/contracts/asset-proxy/test/proxies.ts index c2f9653aa2..1d3fe5a601 100644 --- a/contracts/asset-proxy/test/proxies.ts +++ b/contracts/asset-proxy/test/proxies.ts @@ -1,3 +1,15 @@ +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, @@ -18,12 +30,6 @@ import * as _ from 'lodash'; import { artifacts, - DummyERC20TokenContract, - DummyERC20TokenTransferEventArgs, - DummyERC721ReceiverContract, - DummyERC721TokenContract, - DummyMultipleReturnERC20TokenContract, - DummyNoReturnERC20TokenContract, ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, @@ -148,7 +154,7 @@ describe('Asset Transfer Proxies', () => { constants.DUMMY_TOKEN_DECIMALS, ); noReturnErc20Token = await DummyNoReturnERC20TokenContract.deployFrom0xArtifactAsync( - artifacts.DummyNoReturnERC20Token, + erc20Artifacts.DummyNoReturnERC20Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, @@ -157,7 +163,7 @@ describe('Asset Transfer Proxies', () => { constants.DUMMY_TOKEN_TOTAL_SUPPLY, ); multipleReturnErc20Token = await DummyMultipleReturnERC20TokenContract.deployFrom0xArtifactAsync( - artifacts.DummyMultipleReturnERC20Token, + erc20Artifacts.DummyMultipleReturnERC20Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, @@ -198,7 +204,7 @@ describe('Asset Transfer Proxies', () => { // Deploy and configure ERC721 tokens and receiver [erc721TokenA, erc721TokenB] = await erc721Wrapper.deployDummyTokensAsync(); erc721Receiver = await DummyERC721ReceiverContract.deployFrom0xArtifactAsync( - artifacts.DummyERC721Receiver, + erc721Artifacts.DummyERC721Receiver, provider, txDefaults, ); diff --git a/contracts/asset-proxy/test/utils/erc20_wrapper.ts b/contracts/asset-proxy/test/utils/erc20_wrapper.ts index 600d6f955e..6e726b6385 100644 --- a/contracts/asset-proxy/test/utils/erc20_wrapper.ts +++ b/contracts/asset-proxy/test/utils/erc20_wrapper.ts @@ -1,3 +1,4 @@ +import { artifacts as erc20Artifacts, 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'; @@ -5,7 +6,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import { ZeroExProvider } from 'ethereum-types'; import * as _ from 'lodash'; -import { artifacts, DummyERC20TokenContract, ERC20ProxyContract } from '../../src'; +import { artifacts, ERC20ProxyContract } from '../../src'; export class ERC20Wrapper { private readonly _tokenOwnerAddresses: string[]; @@ -36,7 +37,7 @@ export class ERC20Wrapper { for (let i = 0; i < numberToDeploy; i++) { this._dummyTokenContracts.push( await DummyERC20TokenContract.deployFrom0xArtifactAsync( - artifacts.DummyERC20Token, + erc20Artifacts.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 1c78431440..aa94d5df84 100644 --- a/contracts/asset-proxy/test/utils/erc721_wrapper.ts +++ b/contracts/asset-proxy/test/utils/erc721_wrapper.ts @@ -1,3 +1,4 @@ +import { artifacts as erc721Artifacts, 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'; @@ -5,7 +6,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import { ZeroExProvider } from 'ethereum-types'; import * as _ from 'lodash'; -import { artifacts, DummyERC721TokenContract, ERC721ProxyContract } from '../../src'; +import { artifacts, ERC721ProxyContract } from '../../src'; export class ERC721Wrapper { private readonly _tokenOwnerAddresses: string[]; @@ -28,7 +29,7 @@ export class ERC721Wrapper { for (const i of _.times(constants.NUM_DUMMY_ERC721_TO_DEPLOY)) { this._dummyTokenContracts.push( await DummyERC721TokenContract.deployFrom0xArtifactAsync( - artifacts.DummyERC721Token, + erc721Artifacts.DummyERC721Token, this._provider, txDefaults, constants.DUMMY_TOKEN_NAME, diff --git a/contracts/coordinator/test/coordinator.ts b/contracts/coordinator/test/coordinator.ts index 408efcce8d..6215213652 100644 --- a/contracts/coordinator/test/coordinator.ts +++ b/contracts/coordinator/test/coordinator.ts @@ -1,4 +1,5 @@ -import { DummyERC20TokenContract, ERC20ProxyContract, ERC20Wrapper } from '@0x/contracts-asset-proxy'; +import { ERC20ProxyContract, ERC20Wrapper } from '@0x/contracts-asset-proxy'; +import { DummyERC20TokenContract } from '@0x/contracts-erc20'; import { artifacts as exchangeArtifacts, ExchangeCancelEventArgs, diff --git a/contracts/erc20/compiler.json b/contracts/erc20/compiler.json index 0ae2534dac..3801c903a7 100644 --- a/contracts/erc20/compiler.json +++ b/contracts/erc20/compiler.json @@ -5,7 +5,16 @@ "isOfflineMode": false, "compilerSettings": { "evmVersion": "byzantium", - "optimizer": { "enabled": true, "runs": 1000000 }, + "optimizer": { + "enabled": true, + "runs": 1000000, + "details": { + "yul": true, + "deduplicate": true, + "cse": true, + "constantOptimizer": true + } + }, "outputSelection": { "*": { "*": [ @@ -28,7 +37,6 @@ "src/interfaces/IEtherToken.sol", "test/DummyERC20Token.sol", "test/DummyMultipleReturnERC20Token.sol", - "test/DummyNoReturnERC20Token.sol", - "test/ReentrantERC20Token.sol" + "test/DummyNoReturnERC20Token.sol" ] } diff --git a/contracts/erc20/contracts/src/ERC20Token.sol b/contracts/erc20/contracts/src/ERC20Token.sol index b6e9d0f9f1..a629133b7e 100644 --- a/contracts/erc20/contracts/src/ERC20Token.sol +++ b/contracts/erc20/contracts/src/ERC20Token.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "./interfaces/IERC20Token.sol"; diff --git a/contracts/erc20/contracts/src/MintableERC20Token.sol b/contracts/erc20/contracts/src/MintableERC20Token.sol index 1108db53d7..2dce22f8c0 100644 --- a/contracts/erc20/contracts/src/MintableERC20Token.sol +++ b/contracts/erc20/contracts/src/MintableERC20Token.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "@0x/contracts-utils/contracts/src/SafeMath.sol"; import "./UnlimitedAllowanceERC20Token.sol"; diff --git a/contracts/erc20/contracts/src/UnlimitedAllowanceERC20Token.sol b/contracts/erc20/contracts/src/UnlimitedAllowanceERC20Token.sol index 3a43c250d3..b9b228007a 100644 --- a/contracts/erc20/contracts/src/UnlimitedAllowanceERC20Token.sol +++ b/contracts/erc20/contracts/src/UnlimitedAllowanceERC20Token.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "./ERC20Token.sol"; diff --git a/contracts/erc20/contracts/src/interfaces/IERC20Token.sol b/contracts/erc20/contracts/src/interfaces/IERC20Token.sol index 9f9b895855..180bca457b 100644 --- a/contracts/erc20/contracts/src/interfaces/IERC20Token.sol +++ b/contracts/erc20/contracts/src/interfaces/IERC20Token.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; contract IERC20Token { diff --git a/contracts/erc20/contracts/src/interfaces/IEtherToken.sol b/contracts/erc20/contracts/src/interfaces/IEtherToken.sol index cb07cae6f6..dd14ae1c97 100644 --- a/contracts/erc20/contracts/src/interfaces/IEtherToken.sol +++ b/contracts/erc20/contracts/src/interfaces/IEtherToken.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "./IERC20Token.sol"; diff --git a/contracts/erc20/contracts/test/DummyERC20Token.sol b/contracts/erc20/contracts/test/DummyERC20Token.sol index 39e739a916..1212d082c8 100644 --- a/contracts/erc20/contracts/test/DummyERC20Token.sol +++ b/contracts/erc20/contracts/test/DummyERC20Token.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; import "@0x/contracts-utils/contracts/src/Ownable.sol"; import "../src/MintableERC20Token.sol"; @@ -32,8 +32,8 @@ contract DummyERC20Token is uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000; constructor ( - string _name, - string _symbol, + string memory _name, + string memory _symbol, uint256 _decimals, uint256 _totalSupply ) diff --git a/contracts/erc20/contracts/test/DummyMultipleReturnERC20Token.sol b/contracts/erc20/contracts/test/DummyMultipleReturnERC20Token.sol index 733d4437ec..fa24e1410e 100644 --- a/contracts/erc20/contracts/test/DummyMultipleReturnERC20Token.sol +++ b/contracts/erc20/contracts/test/DummyMultipleReturnERC20Token.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; import "./DummyERC20Token.sol"; @@ -26,8 +26,8 @@ contract DummyMultipleReturnERC20Token is DummyERC20Token { constructor ( - string _name, - string _symbol, + string memory _name, + string memory _symbol, uint256 _decimals, uint256 _totalSupply ) diff --git a/contracts/erc20/contracts/test/DummyNoReturnERC20Token.sol b/contracts/erc20/contracts/test/DummyNoReturnERC20Token.sol index e16825a16b..ff13815ca2 100644 --- a/contracts/erc20/contracts/test/DummyNoReturnERC20Token.sol +++ b/contracts/erc20/contracts/test/DummyNoReturnERC20Token.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; import "./DummyERC20Token.sol"; @@ -26,8 +26,8 @@ contract DummyNoReturnERC20Token is DummyERC20Token { constructor ( - string _name, - string _symbol, + string memory _name, + string memory _symbol, uint256 _decimals, uint256 _totalSupply ) diff --git a/contracts/erc20/package.json b/contracts/erc20/package.json index 4b93dec2a4..c84f95948d 100644 --- a/contracts/erc20/package.json +++ b/contracts/erc20/package.json @@ -68,8 +68,8 @@ }, "dependencies": { "@0x/base-contract": "^5.0.2", - "@0x/contracts-exchange-libs": "1.0.2", - "@0x/contracts-utils": "2.0.1", + "@0x/contracts-exchange-libs": "^1.1.3", + "@0x/contracts-utils": "^2.0.8", "@0x/types": "^2.1.1", "@0x/typescript-typings": "^4.1.0", "@0x/utils": "^4.2.2", diff --git a/contracts/erc20/src/artifacts.ts b/contracts/erc20/src/artifacts.ts index c97a73195e..c63fc8e0dc 100644 --- a/contracts/erc20/src/artifacts.ts +++ b/contracts/erc20/src/artifacts.ts @@ -12,7 +12,6 @@ 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'; @@ -27,5 +26,4 @@ export const artifacts = { DummyERC20Token: DummyERC20Token as ContractArtifact, DummyMultipleReturnERC20Token: DummyMultipleReturnERC20Token as ContractArtifact, DummyNoReturnERC20Token: DummyNoReturnERC20Token as ContractArtifact, - ReentrantERC20Token: ReentrantERC20Token as ContractArtifact, }; diff --git a/contracts/erc20/src/wrappers.ts b/contracts/erc20/src/wrappers.ts index 40193e7d86..3a85ee3d2b 100644 --- a/contracts/erc20/src/wrappers.ts +++ b/contracts/erc20/src/wrappers.ts @@ -10,7 +10,6 @@ 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/erc721/compiler.json b/contracts/erc721/compiler.json index 6cf38d7d15..94d4494e2e 100644 --- a/contracts/erc721/compiler.json +++ b/contracts/erc721/compiler.json @@ -5,7 +5,16 @@ "isOfflineMode": false, "compilerSettings": { "evmVersion": "byzantium", - "optimizer": { "enabled": true, "runs": 1000000 }, + "optimizer": { + "enabled": true, + "runs": 1000000, + "details": { + "yul": true, + "deduplicate": true, + "cse": true, + "constantOptimizer": true + } + }, "outputSelection": { "*": { "*": [ diff --git a/contracts/erc721/contracts/src/ERC721Token.sol b/contracts/erc721/contracts/src/ERC721Token.sol index 32f70ccf8d..2ee76387e7 100644 --- a/contracts/erc721/contracts/src/ERC721Token.sol +++ b/contracts/erc721/contracts/src/ERC721Token.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "./interfaces/IERC721Token.sol"; import "./interfaces/IERC721Receiver.sol"; @@ -59,7 +59,7 @@ contract ERC721Token is address _from, address _to, uint256 _tokenId, - bytes _data + bytes calldata _data ) external { diff --git a/contracts/erc721/contracts/src/MintableERC721Token.sol b/contracts/erc721/contracts/src/MintableERC721Token.sol index 27326d8575..a406a305fe 100644 --- a/contracts/erc721/contracts/src/MintableERC721Token.sol +++ b/contracts/erc721/contracts/src/MintableERC721Token.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "./ERC721Token.sol"; diff --git a/contracts/erc721/contracts/src/interfaces/IERC721Receiver.sol b/contracts/erc721/contracts/src/interfaces/IERC721Receiver.sol index c3ad35ede5..89783ccafd 100644 --- a/contracts/erc721/contracts/src/interfaces/IERC721Receiver.sol +++ b/contracts/erc721/contracts/src/interfaces/IERC721Receiver.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; contract IERC721Receiver { @@ -37,7 +37,7 @@ contract IERC721Receiver { address _operator, address _from, uint256 _tokenId, - bytes _data + bytes calldata _data ) external returns (bytes4); diff --git a/contracts/erc721/contracts/src/interfaces/IERC721Token.sol b/contracts/erc721/contracts/src/interfaces/IERC721Token.sol index 56a3314dfe..6b1fec7def 100644 --- a/contracts/erc721/contracts/src/interfaces/IERC721Token.sol +++ b/contracts/erc721/contracts/src/interfaces/IERC721Token.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; contract IERC721Token { @@ -66,7 +66,7 @@ contract IERC721Token { address _from, address _to, uint256 _tokenId, - bytes _data + bytes calldata _data ) external; diff --git a/contracts/erc721/contracts/test/DummyERC721Receiver.sol b/contracts/erc721/contracts/test/DummyERC721Receiver.sol index b5de01aa5e..c566fb8b07 100644 --- a/contracts/erc721/contracts/test/DummyERC721Receiver.sol +++ b/contracts/erc721/contracts/test/DummyERC721Receiver.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; import "../src/interfaces/IERC721Receiver.sol"; @@ -51,7 +51,7 @@ contract DummyERC721Receiver is address _operator, address _from, uint256 _tokenId, - bytes _data + bytes calldata _data ) external returns (bytes4) diff --git a/contracts/erc721/contracts/test/DummyERC721Token.sol b/contracts/erc721/contracts/test/DummyERC721Token.sol index 41dc8ea18c..b90aff4b51 100644 --- a/contracts/erc721/contracts/test/DummyERC721Token.sol +++ b/contracts/erc721/contracts/test/DummyERC721Token.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; import "../src/MintableERC721Token.sol"; import "@0x/contracts-utils/contracts/src/Ownable.sol"; @@ -31,8 +31,8 @@ contract DummyERC721Token is string public symbol; constructor ( - string _name, - string _symbol + string memory _name, + string memory _symbol ) public { diff --git a/contracts/erc721/contracts/test/InvalidERC721Receiver.sol b/contracts/erc721/contracts/test/InvalidERC721Receiver.sol index ea59dedc51..91bd88b7b2 100644 --- a/contracts/erc721/contracts/test/InvalidERC721Receiver.sol +++ b/contracts/erc721/contracts/test/InvalidERC721Receiver.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; import "../src/interfaces/IERC721Receiver.sol"; @@ -50,7 +50,7 @@ contract InvalidERC721Receiver is address _operator, address _from, uint256 _tokenId, - bytes _data + bytes calldata _data ) external returns (bytes4) diff --git a/contracts/erc721/package.json b/contracts/erc721/package.json index 7f38d222e6..4fd19b07c9 100644 --- a/contracts/erc721/package.json +++ b/contracts/erc721/package.json @@ -68,7 +68,7 @@ }, "dependencies": { "@0x/base-contract": "^5.0.2", - "@0x/contracts-utils": "2.0.1", + "@0x/contracts-utils": "^2.0.8", "@0x/types": "^2.1.1", "@0x/typescript-typings": "^4.1.0", "@0x/utils": "^4.2.2", diff --git a/contracts/exchange-forwarder/compiler.json b/contracts/exchange-forwarder/compiler.json index 4c33fda9c6..d91fba851f 100644 --- a/contracts/exchange-forwarder/compiler.json +++ b/contracts/exchange-forwarder/compiler.json @@ -5,7 +5,16 @@ "isOfflineMode": false, "compilerSettings": { "evmVersion": "byzantium", - "optimizer": { "enabled": true, "runs": 1000000 }, + "optimizer": { + "enabled": true, + "runs": 1000000, + "details": { + "yul": true, + "deduplicate": true, + "cse": true, + "constantOptimizer": true + } + }, "outputSelection": { "*": { "*": [ @@ -18,11 +27,5 @@ } } }, - "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" - ] + "contracts": ["src/Forwarder.sol"] } diff --git a/contracts/exchange-forwarder/package.json b/contracts/exchange-forwarder/package.json index f09f564cd4..dc639c9796 100644 --- a/contracts/exchange-forwarder/package.json +++ b/contracts/exchange-forwarder/package.json @@ -70,8 +70,8 @@ "dependencies": { "@0x/base-contract": "^5.0.2", "@0x/contracts-asset-proxy": "^1.0.9", - "@0x/contracts-erc20": "^1.0.9", - "@0x/contracts-erc721": "^1.0.9", + "@0x/contracts-erc20": "1.0.8", + "@0x/contracts-erc721": "1.0.8", "@0x/contracts-exchange": "1.0.2", "@0x/contracts-exchange-libs": "1.0.2", "@0x/contracts-utils": "2.0.1", diff --git a/contracts/exchange-forwarder/src/artifacts.ts b/contracts/exchange-forwarder/src/artifacts.ts index 94bcdf84a8..8b14c3d6d1 100644 --- a/contracts/exchange-forwarder/src/artifacts.ts +++ b/contracts/exchange-forwarder/src/artifacts.ts @@ -5,15 +5,7 @@ */ 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/wrappers.ts b/contracts/exchange-forwarder/src/wrappers.ts index cbe72c5cfc..e77944402a 100644 --- a/contracts/exchange-forwarder/src/wrappers.ts +++ b/contracts/exchange-forwarder/src/wrappers.ts @@ -3,8 +3,4 @@ * 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/test/forwarder.ts b/contracts/exchange-forwarder/test/forwarder.ts index 3d53c43a56..24c2195633 100644 --- a/contracts/exchange-forwarder/test/forwarder.ts +++ b/contracts/exchange-forwarder/test/forwarder.ts @@ -1,10 +1,7 @@ -import { - DummyERC20TokenContract, - DummyERC721TokenContract, - ERC20Wrapper, - ERC721Wrapper, -} from '@0x/contracts-asset-proxy'; -import { ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange'; +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 { chaiSetup, constants, @@ -26,7 +23,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import * as chai from 'chai'; import { TransactionReceiptWithDecodedLogs } from 'ethereum-types'; -import { artifacts, ForwarderContract, ForwarderWrapper, WETH9Contract } from '../src'; +import { artifacts, ForwarderContract, ForwarderWrapper } from '../src'; chaiSetup.configure(); const expect = chai.expect; @@ -91,14 +88,14 @@ describe(ContractName.Forwarder, () => { const erc721Balances = await erc721Wrapper.getBalancesAsync(); erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address]; - wethContract = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults); + wethContract = await WETH9Contract.deployFrom0xArtifactAsync(erc20Artifacts.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( - artifacts.Exchange, + exchangeArtifacts.Exchange, provider, txDefaults, zrxAssetData, @@ -169,7 +166,7 @@ describe(ContractName.Forwarder, () => { describe('constructor', () => { it('should revert if assetProxy is unregistered', async () => { const exchangeInstance = await ExchangeContract.deployFrom0xArtifactAsync( - artifacts.Exchange, + exchangeArtifacts.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 779a9940c9..383401d33e 100644 --- a/contracts/exchange-forwarder/test/utils/forwarder_wrapper.ts +++ b/contracts/exchange-forwarder/test/utils/forwarder_wrapper.ts @@ -1,3 +1,6 @@ +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, Web3ProviderEngine } from '@0x/contracts-test-utils'; import { SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; @@ -58,7 +61,12 @@ export class ForwarderWrapper { constructor(contractInstance: ForwarderContract, provider: Web3ProviderEngine) { this._forwarderContract = contractInstance; this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts); + this._logDecoder = new LogDecoder(this._web3Wrapper, { + ...artifacts, + ...exchangeArtifacts, + ...erc20Artifacts, + ...erc721Artifacts, + }); } public async marketSellOrdersWithEthAsync( orders: SignedOrder[], diff --git a/contracts/exchange-libs/compiler.json b/contracts/exchange-libs/compiler.json index 229bf94f6e..766403839c 100644 --- a/contracts/exchange-libs/compiler.json +++ b/contracts/exchange-libs/compiler.json @@ -5,7 +5,16 @@ "isOfflineMode": false, "compilerSettings": { "evmVersion": "byzantium", - "optimizer": { "enabled": true, "runs": 1000000 }, + "optimizer": { + "enabled": true, + "runs": 1000000, + "details": { + "yul": true, + "deduplicate": true, + "cse": true, + "constantOptimizer": true + } + }, "outputSelection": { "*": { "*": [ diff --git a/contracts/exchange-libs/contracts/src/LibAbiEncoder.sol b/contracts/exchange-libs/contracts/src/LibAbiEncoder.sol index b8b72ba8eb..b40282b426 100644 --- a/contracts/exchange-libs/contracts/src/LibAbiEncoder.sol +++ b/contracts/exchange-libs/contracts/src/LibAbiEncoder.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "./LibOrder.sol"; diff --git a/contracts/exchange-libs/contracts/src/LibAssetProxyErrors.sol b/contracts/exchange-libs/contracts/src/LibAssetProxyErrors.sol index 1ef0e9cf0e..f1b55c5124 100644 --- a/contracts/exchange-libs/contracts/src/LibAssetProxyErrors.sol +++ b/contracts/exchange-libs/contracts/src/LibAssetProxyErrors.sol @@ -17,7 +17,7 @@ */ // solhint-disable -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; /// @dev This contract documents the revert reasons used in the AssetProxy contracts. diff --git a/contracts/exchange-libs/contracts/src/LibConstants.sol b/contracts/exchange-libs/contracts/src/LibConstants.sol index 2889ffd5d4..ed12b7ca66 100644 --- a/contracts/exchange-libs/contracts/src/LibConstants.sol +++ b/contracts/exchange-libs/contracts/src/LibConstants.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; // solhint-disable max-line-length diff --git a/contracts/exchange-libs/contracts/src/LibEIP712.sol b/contracts/exchange-libs/contracts/src/LibEIP712.sol index e8b71a5091..e38898277a 100644 --- a/contracts/exchange-libs/contracts/src/LibEIP712.sol +++ b/contracts/exchange-libs/contracts/src/LibEIP712.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; contract LibEIP712 { diff --git a/contracts/exchange-libs/contracts/src/LibExchangeErrors.sol b/contracts/exchange-libs/contracts/src/LibExchangeErrors.sol index 68b79be858..1d4ac95d7a 100644 --- a/contracts/exchange-libs/contracts/src/LibExchangeErrors.sol +++ b/contracts/exchange-libs/contracts/src/LibExchangeErrors.sol @@ -17,7 +17,7 @@ */ // solhint-disable -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; /// @dev This contract documents the revert reasons used in the Exchange contract. diff --git a/contracts/exchange-libs/contracts/src/LibExchangeSelectors.sol b/contracts/exchange-libs/contracts/src/LibExchangeSelectors.sol index 355feb442d..4d7015da92 100644 --- a/contracts/exchange-libs/contracts/src/LibExchangeSelectors.sol +++ b/contracts/exchange-libs/contracts/src/LibExchangeSelectors.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; contract LibExchangeSelectors { diff --git a/contracts/exchange-libs/contracts/src/LibFillResults.sol b/contracts/exchange-libs/contracts/src/LibFillResults.sol index f4b9626b0b..a4a0de1eb3 100644 --- a/contracts/exchange-libs/contracts/src/LibFillResults.sol +++ b/contracts/exchange-libs/contracts/src/LibFillResults.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; import "@0x/contracts-utils/contracts/src/SafeMath.sol"; diff --git a/contracts/exchange-libs/contracts/src/LibMath.sol b/contracts/exchange-libs/contracts/src/LibMath.sol index 2a7b388821..54233f4d9a 100644 --- a/contracts/exchange-libs/contracts/src/LibMath.sol +++ b/contracts/exchange-libs/contracts/src/LibMath.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; import "@0x/contracts-utils/contracts/src/SafeMath.sol"; diff --git a/contracts/exchange-libs/contracts/src/LibOrder.sol b/contracts/exchange-libs/contracts/src/LibOrder.sol index d23747c36e..e07a56338b 100644 --- a/contracts/exchange-libs/contracts/src/LibOrder.sol +++ b/contracts/exchange-libs/contracts/src/LibOrder.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; import "./LibEIP712.sol"; diff --git a/contracts/exchange-libs/contracts/test/TestLibs.sol b/contracts/exchange-libs/contracts/test/TestLibs.sol index f17407b78a..1ac628e8c1 100644 --- a/contracts/exchange-libs/contracts/test/TestLibs.sol +++ b/contracts/exchange-libs/contracts/test/TestLibs.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.5.3; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "../src/LibMath.sol"; diff --git a/contracts/exchange/compiler.json b/contracts/exchange/compiler.json index 240a9ecd15..b94694b50c 100644 --- a/contracts/exchange/compiler.json +++ b/contracts/exchange/compiler.json @@ -5,7 +5,16 @@ "isOfflineMode": false, "compilerSettings": { "evmVersion": "byzantium", - "optimizer": { "enabled": true, "runs": 1000000 }, + "optimizer": { + "enabled": true, + "runs": 1000000, + "details": { + "yul": true, + "deduplicate": true, + "cse": true, + "constantOptimizer": true + } + }, "outputSelection": { "*": { "*": [ @@ -19,14 +28,6 @@ } }, "contracts": [ - "@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", @@ -44,6 +45,7 @@ "test/TestAssetProxyDispatcher.sol", "test/TestExchangeInternals.sol", "test/TestSignatureValidator.sol", - "test/TestStaticCallReceiver.sol" + "test/TestStaticCallReceiver.sol", + "test/ReentrantERC20Token.sol" ] } diff --git a/contracts/exchange/contracts/examples/ExchangeWrapper.sol b/contracts/exchange/contracts/examples/ExchangeWrapper.sol index 604f614b52..f8797eabb2 100644 --- a/contracts/exchange/contracts/examples/ExchangeWrapper.sol +++ b/contracts/exchange/contracts/examples/ExchangeWrapper.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "../src/interfaces/IExchange.sol"; @@ -43,7 +43,7 @@ contract ExchangeWrapper { function cancelOrdersUpTo( uint256 targetOrderEpoch, uint256 salt, - bytes makerSignature + bytes calldata makerSignature ) external { diff --git a/contracts/exchange/contracts/examples/Validator.sol b/contracts/exchange/contracts/examples/Validator.sol index 98a10d37f9..86c39cd232 100644 --- a/contracts/exchange/contracts/examples/Validator.sol +++ b/contracts/exchange/contracts/examples/Validator.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; import "../src/interfaces/IValidator.sol"; @@ -44,7 +44,7 @@ contract Validator is function isValidSignature( bytes32 hash, address signerAddress, - bytes signature + bytes calldata signature ) external view diff --git a/contracts/exchange/contracts/examples/Wallet.sol b/contracts/exchange/contracts/examples/Wallet.sol index 17e3dd5ccb..57df916ff0 100644 --- a/contracts/exchange/contracts/examples/Wallet.sol +++ b/contracts/exchange/contracts/examples/Wallet.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; import "../src/interfaces/IWallet.sol"; import "@0x/contracts-utils/contracts/src/LibBytes.sol"; @@ -44,7 +44,7 @@ contract Wallet is /// @return Validity of signature. function isValidSignature( bytes32 hash, - bytes eip712Signature + bytes calldata eip712Signature ) external view diff --git a/contracts/exchange/contracts/examples/Whitelist.sol b/contracts/exchange/contracts/examples/Whitelist.sol index a9db1bb825..626f28f5ea 100644 --- a/contracts/exchange/contracts/examples/Whitelist.sol +++ b/contracts/exchange/contracts/examples/Whitelist.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "../src/interfaces/IExchange.sol"; @@ -69,7 +69,7 @@ contract Whitelist is function isValidSignature( bytes32 hash, address signerAddress, - bytes signature + bytes calldata signature ) external view diff --git a/contracts/exchange/contracts/src/Exchange.sol b/contracts/exchange/contracts/src/Exchange.sol index 541750518d..2643ca1a59 100644 --- a/contracts/exchange/contracts/src/Exchange.sol +++ b/contracts/exchange/contracts/src/Exchange.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity 0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-exchange-libs/contracts/src/LibConstants.sol"; @@ -37,7 +37,7 @@ contract Exchange is MixinAssetProxyDispatcher, MixinWrapperFunctions { - string constant public VERSION = "2.0.1-alpha"; + string constant public VERSION = "3.0.0"; // Mixins are instantiated in the order they are inherited constructor (bytes memory _zrxAssetData) diff --git a/contracts/exchange/contracts/src/MixinAssetProxyDispatcher.sol b/contracts/exchange/contracts/src/MixinAssetProxyDispatcher.sol index c55d6aaec3..e9e6805737 100644 --- a/contracts/exchange/contracts/src/MixinAssetProxyDispatcher.sol +++ b/contracts/exchange/contracts/src/MixinAssetProxyDispatcher.sol @@ -16,11 +16,11 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "@0x/contracts-utils/contracts/src/Ownable.sol"; import "./mixins/MAssetProxyDispatcher.sol"; -import "@0x/contracts-asset-proxy/contracts/src/interfaces/IAssetProxy.sol"; +import "./interfaces/IAssetProxy.sol"; contract MixinAssetProxyDispatcher is @@ -28,7 +28,7 @@ contract MixinAssetProxyDispatcher is MAssetProxyDispatcher { // Mapping from Asset Proxy Id's to their respective Asset Proxy - mapping (bytes4 => IAssetProxy) public assetProxies; + mapping (bytes4 => address) public assetProxies; /// @dev Registers an asset proxy to its asset proxy id. /// Once an asset proxy is registered, it cannot be unregistered. @@ -37,10 +37,8 @@ contract MixinAssetProxyDispatcher is external onlyOwner { - IAssetProxy assetProxyContract = IAssetProxy(assetProxy); - // Ensure that no asset proxy exists with current id. - bytes4 assetProxyId = assetProxyContract.getProxyId(); + bytes4 assetProxyId = IAssetProxy(assetProxy).getProxyId(); address currentAssetProxy = assetProxies[assetProxyId]; require( currentAssetProxy == address(0), @@ -48,7 +46,7 @@ contract MixinAssetProxyDispatcher is ); // Add asset proxy and log registration. - assetProxies[assetProxyId] = assetProxyContract; + assetProxies[assetProxyId] = assetProxy; emit AssetProxyRegistered( assetProxyId, assetProxy diff --git a/contracts/exchange/contracts/src/MixinExchangeCore.sol b/contracts/exchange/contracts/src/MixinExchangeCore.sol index 2e4f717c99..b95d547839 100644 --- a/contracts/exchange/contracts/src/MixinExchangeCore.sol +++ b/contracts/exchange/contracts/src/MixinExchangeCore.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol"; diff --git a/contracts/exchange/contracts/src/MixinMatchOrders.sol b/contracts/exchange/contracts/src/MixinMatchOrders.sol index e848427938..c389399141 100644 --- a/contracts/exchange/contracts/src/MixinMatchOrders.sol +++ b/contracts/exchange/contracts/src/MixinMatchOrders.sol @@ -11,7 +11,7 @@ limitations under the License. */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol"; diff --git a/contracts/exchange/contracts/src/MixinSignatureValidator.sol b/contracts/exchange/contracts/src/MixinSignatureValidator.sol index 421ec666ae..ac1822e1be 100644 --- a/contracts/exchange/contracts/src/MixinSignatureValidator.sol +++ b/contracts/exchange/contracts/src/MixinSignatureValidator.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "@0x/contracts-utils/contracts/src/LibBytes.sol"; import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol"; @@ -46,7 +46,7 @@ contract MixinSignatureValidator is function preSign( bytes32 hash, address signerAddress, - bytes signature + bytes calldata signature ) external { @@ -233,7 +233,7 @@ contract MixinSignatureValidator is function isValidWalletSignature( bytes32 hash, address walletAddress, - bytes signature + bytes memory signature ) internal view @@ -282,7 +282,7 @@ contract MixinSignatureValidator is address validatorAddress, bytes32 hash, address signerAddress, - bytes signature + bytes memory signature ) internal view diff --git a/contracts/exchange/contracts/src/MixinTransactions.sol b/contracts/exchange/contracts/src/MixinTransactions.sol index 6b9b06b0d1..bf455f87c5 100644 --- a/contracts/exchange/contracts/src/MixinTransactions.sol +++ b/contracts/exchange/contracts/src/MixinTransactions.sol @@ -15,7 +15,8 @@ limitations under the License. */ -pragma solidity ^0.4.24; + +pragma solidity ^0.5.5; import "@0x/contracts-exchange-libs/contracts/src/LibExchangeErrors.sol"; import "./mixins/MSignatureValidator.sol"; @@ -43,8 +44,8 @@ contract MixinTransactions is function executeTransaction( uint256 salt, address signerAddress, - bytes data, - bytes signature + bytes calldata data, + bytes calldata signature ) external { @@ -84,8 +85,9 @@ contract MixinTransactions is // Execute transaction transactions[transactionHash] = true; + (bool success,) = address(this).delegatecall(data); require( - address(this).delegatecall(data), + success, "FAILED_EXECUTION" ); diff --git a/contracts/exchange/contracts/src/MixinWrapperFunctions.sol b/contracts/exchange/contracts/src/MixinWrapperFunctions.sol index 911107422e..9c8cf3f2e6 100644 --- a/contracts/exchange/contracts/src/MixinWrapperFunctions.sol +++ b/contracts/exchange/contracts/src/MixinWrapperFunctions.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol"; diff --git a/contracts/exchange/contracts/src/interfaces/IAssetProxy.sol b/contracts/exchange/contracts/src/interfaces/IAssetProxy.sol new file mode 100644 index 0000000000..7059f9d23a --- /dev/null +++ b/contracts/exchange/contracts/src/interfaces/IAssetProxy.sol @@ -0,0 +1,43 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity ^0.5.5; + + +contract IAssetProxy { + + /// @dev Transfers assets. Either succeeds or throws. + /// @param assetData Byte array encoded for the respective asset proxy. + /// @param from Address to transfer asset from. + /// @param to Address to transfer asset to. + /// @param amount Amount of asset to transfer. + function transferFrom( + bytes calldata assetData, + address from, + address to, + uint256 amount + ) + external; + + /// @dev Gets the proxy id associated with the proxy address. + /// @return Proxy id. + function getProxyId() + external + pure + returns (bytes4); +} diff --git a/contracts/exchange/contracts/src/interfaces/IAssetProxyDispatcher.sol b/contracts/exchange/contracts/src/interfaces/IAssetProxyDispatcher.sol index b73881c077..6ae3c1cbe2 100644 --- a/contracts/exchange/contracts/src/interfaces/IAssetProxyDispatcher.sol +++ b/contracts/exchange/contracts/src/interfaces/IAssetProxyDispatcher.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; contract IAssetProxyDispatcher { diff --git a/contracts/exchange/contracts/src/interfaces/IExchange.sol b/contracts/exchange/contracts/src/interfaces/IExchange.sol index 866e4c194d..5d3c0adbbc 100644 --- a/contracts/exchange/contracts/src/interfaces/IExchange.sol +++ b/contracts/exchange/contracts/src/interfaces/IExchange.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "./IExchangeCore.sol"; diff --git a/contracts/exchange/contracts/src/interfaces/IExchangeCore.sol b/contracts/exchange/contracts/src/interfaces/IExchangeCore.sol index f87abb2ad4..ef6db69438 100644 --- a/contracts/exchange/contracts/src/interfaces/IExchangeCore.sol +++ b/contracts/exchange/contracts/src/interfaces/IExchangeCore.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; diff --git a/contracts/exchange/contracts/src/interfaces/IMatchOrders.sol b/contracts/exchange/contracts/src/interfaces/IMatchOrders.sol index fba1da6d90..6920b3a626 100644 --- a/contracts/exchange/contracts/src/interfaces/IMatchOrders.sol +++ b/contracts/exchange/contracts/src/interfaces/IMatchOrders.sol @@ -15,7 +15,8 @@ limitations under the License. */ -pragma solidity ^0.4.24; + +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; diff --git a/contracts/exchange/contracts/src/interfaces/ISignatureValidator.sol b/contracts/exchange/contracts/src/interfaces/ISignatureValidator.sol index c5a4a57e1c..70f78dfb89 100644 --- a/contracts/exchange/contracts/src/interfaces/ISignatureValidator.sol +++ b/contracts/exchange/contracts/src/interfaces/ISignatureValidator.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; contract ISignatureValidator { @@ -28,7 +28,7 @@ contract ISignatureValidator { function preSign( bytes32 hash, address signerAddress, - bytes signature + bytes calldata signature ) external; diff --git a/contracts/exchange/contracts/src/interfaces/ITransactions.sol b/contracts/exchange/contracts/src/interfaces/ITransactions.sol index aaaee389fb..717d0fee76 100644 --- a/contracts/exchange/contracts/src/interfaces/ITransactions.sol +++ b/contracts/exchange/contracts/src/interfaces/ITransactions.sol @@ -15,7 +15,8 @@ limitations under the License. */ -pragma solidity ^0.4.24; + +pragma solidity ^0.5.5; contract ITransactions { @@ -28,8 +29,8 @@ contract ITransactions { function executeTransaction( uint256 salt, address signerAddress, - bytes data, - bytes signature + bytes calldata data, + bytes calldata signature ) external; } diff --git a/contracts/exchange/contracts/src/interfaces/IValidator.sol b/contracts/exchange/contracts/src/interfaces/IValidator.sol index d214e54dd6..e76d23880c 100644 --- a/contracts/exchange/contracts/src/interfaces/IValidator.sol +++ b/contracts/exchange/contracts/src/interfaces/IValidator.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; contract IValidator { @@ -29,7 +29,7 @@ contract IValidator { function isValidSignature( bytes32 hash, address signerAddress, - bytes signature + bytes calldata signature ) external view diff --git a/contracts/exchange/contracts/src/interfaces/IWallet.sol b/contracts/exchange/contracts/src/interfaces/IWallet.sol index c2db4a5b14..f56b3115f2 100644 --- a/contracts/exchange/contracts/src/interfaces/IWallet.sol +++ b/contracts/exchange/contracts/src/interfaces/IWallet.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; contract IWallet { @@ -27,7 +27,7 @@ contract IWallet { /// @return Validity of order signature. function isValidSignature( bytes32 hash, - bytes signature + bytes calldata signature ) external view diff --git a/contracts/exchange/contracts/src/interfaces/IWrapperFunctions.sol b/contracts/exchange/contracts/src/interfaces/IWrapperFunctions.sol index b1afc8895f..9d801711db 100644 --- a/contracts/exchange/contracts/src/interfaces/IWrapperFunctions.sol +++ b/contracts/exchange/contracts/src/interfaces/IWrapperFunctions.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; diff --git a/contracts/exchange/contracts/src/mixins/MAssetProxyDispatcher.sol b/contracts/exchange/contracts/src/mixins/MAssetProxyDispatcher.sol index 0ae555ddad..b53e7166e6 100644 --- a/contracts/exchange/contracts/src/mixins/MAssetProxyDispatcher.sol +++ b/contracts/exchange/contracts/src/mixins/MAssetProxyDispatcher.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "../interfaces/IAssetProxyDispatcher.sol"; diff --git a/contracts/exchange/contracts/src/mixins/MExchangeCore.sol b/contracts/exchange/contracts/src/mixins/MExchangeCore.sol index b5a9c660b5..937c3b1031 100644 --- a/contracts/exchange/contracts/src/mixins/MExchangeCore.sol +++ b/contracts/exchange/contracts/src/mixins/MExchangeCore.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; diff --git a/contracts/exchange/contracts/src/mixins/MMatchOrders.sol b/contracts/exchange/contracts/src/mixins/MMatchOrders.sol index 3dcc9f31b4..bce93614a3 100644 --- a/contracts/exchange/contracts/src/mixins/MMatchOrders.sol +++ b/contracts/exchange/contracts/src/mixins/MMatchOrders.sol @@ -15,7 +15,8 @@ limitations under the License. */ -pragma solidity ^0.4.24; + +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; diff --git a/contracts/exchange/contracts/src/mixins/MSignatureValidator.sol b/contracts/exchange/contracts/src/mixins/MSignatureValidator.sol index c39e84e08e..8f536d8b87 100644 --- a/contracts/exchange/contracts/src/mixins/MSignatureValidator.sol +++ b/contracts/exchange/contracts/src/mixins/MSignatureValidator.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "../interfaces/ISignatureValidator.sol"; @@ -51,7 +51,7 @@ contract MSignatureValidator is function isValidWalletSignature( bytes32 hash, address walletAddress, - bytes signature + bytes memory signature ) internal view @@ -67,7 +67,7 @@ contract MSignatureValidator is address validatorAddress, bytes32 hash, address signerAddress, - bytes signature + bytes memory signature ) internal view diff --git a/contracts/exchange/contracts/src/mixins/MTransactions.sol b/contracts/exchange/contracts/src/mixins/MTransactions.sol index 04a25ccf36..68d6c6a449 100644 --- a/contracts/exchange/contracts/src/mixins/MTransactions.sol +++ b/contracts/exchange/contracts/src/mixins/MTransactions.sol @@ -15,7 +15,8 @@ limitations under the License. */ -pragma solidity ^0.4.24; + +pragma solidity ^0.5.5; import "../interfaces/ITransactions.sol"; diff --git a/contracts/exchange/contracts/src/mixins/MWrapperFunctions.sol b/contracts/exchange/contracts/src/mixins/MWrapperFunctions.sol index df50c6a8e8..337363c9a0 100644 --- a/contracts/exchange/contracts/src/mixins/MWrapperFunctions.sol +++ b/contracts/exchange/contracts/src/mixins/MWrapperFunctions.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; diff --git a/contracts/erc20/contracts/test/ReentrantERC20Token.sol b/contracts/exchange/contracts/test/ReentrantERC20Token.sol similarity index 98% rename from contracts/erc20/contracts/test/ReentrantERC20Token.sol rename to contracts/exchange/contracts/test/ReentrantERC20Token.sol index 0629754c08..d1e3043ee2 100644 --- a/contracts/erc20/contracts/test/ReentrantERC20Token.sol +++ b/contracts/exchange/contracts/test/ReentrantERC20Token.sol @@ -16,12 +16,12 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-utils/contracts/src/LibBytes.sol"; -import "../src/ERC20Token.sol"; -import "@0x/contracts-exchange/contracts/src/interfaces/IExchange.sol"; +import "@0x/contracts-erc20/contracts/src/ERC20Token.sol"; +import "../src/interfaces/IExchange.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; diff --git a/contracts/exchange/contracts/test/TestAssetProxyDispatcher.sol b/contracts/exchange/contracts/test/TestAssetProxyDispatcher.sol index 88155c6ee2..f010334d4a 100644 --- a/contracts/exchange/contracts/test/TestAssetProxyDispatcher.sol +++ b/contracts/exchange/contracts/test/TestAssetProxyDispatcher.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; import "../src/MixinAssetProxyDispatcher.sol"; diff --git a/contracts/exchange/contracts/test/TestExchangeInternals.sol b/contracts/exchange/contracts/test/TestExchangeInternals.sol index dce8e03c0f..078bc21b27 100644 --- a/contracts/exchange/contracts/test/TestExchangeInternals.sol +++ b/contracts/exchange/contracts/test/TestExchangeInternals.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "../src/Exchange.sol"; diff --git a/contracts/exchange/contracts/test/TestSignatureValidator.sol b/contracts/exchange/contracts/test/TestSignatureValidator.sol index 2f95236661..cac4727398 100644 --- a/contracts/exchange/contracts/test/TestSignatureValidator.sol +++ b/contracts/exchange/contracts/test/TestSignatureValidator.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; import "../src/MixinSignatureValidator.sol"; import "../src/MixinTransactions.sol"; diff --git a/contracts/exchange/contracts/test/TestStaticCallReceiver.sol b/contracts/exchange/contracts/test/TestStaticCallReceiver.sol index 23e60b387c..4397051891 100644 --- a/contracts/exchange/contracts/test/TestStaticCallReceiver.sol +++ b/contracts/exchange/contracts/test/TestStaticCallReceiver.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; import "@0x/contracts-erc20/contracts/src/interfaces/IERC20Token.sol"; @@ -34,7 +34,7 @@ contract TestStaticCallReceiver { function isValidSignature( bytes32 hash, address signerAddress, - bytes signature + bytes calldata signature ) external returns (bool isValid) @@ -49,7 +49,7 @@ contract TestStaticCallReceiver { /// @return Validity of order signature. function isValidSignature( bytes32 hash, - bytes signature + bytes calldata signature ) external returns (bool isValid) diff --git a/contracts/exchange/package.json b/contracts/exchange/package.json index 4d11a755fb..d4338b2879 100644 --- a/contracts/exchange/package.json +++ b/contracts/exchange/package.json @@ -71,8 +71,8 @@ "@0x/contracts-asset-proxy": "^1.0.9", "@0x/contracts-erc20": "^1.0.9", "@0x/contracts-erc721": "^1.0.9", - "@0x/contracts-exchange-libs": "1.0.2", - "@0x/contracts-utils": "2.0.1", + "@0x/contracts-exchange-libs": "^1.1.3", + "@0x/contracts-utils": "^2.0.8", "@0x/order-utils": "^7.0.2", "@0x/types": "^2.1.1", "@0x/typescript-typings": "^4.1.0", diff --git a/contracts/exchange/test/core.ts b/contracts/exchange/test/core.ts index 4c8d6d6630..c25f1e5368 100644 --- a/contracts/exchange/test/core.ts +++ b/contracts/exchange/test/core.ts @@ -1,14 +1,16 @@ import { - DummyERC20TokenContract, - DummyERC20TokenTransferEventArgs, - DummyERC721TokenContract, - DummyNoReturnERC20TokenContract, ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, ERC721Wrapper, MultiAssetProxyContract, } from '@0x/contracts-asset-proxy'; +import { + DummyERC20TokenContract, + DummyERC20TokenTransferEventArgs, + DummyNoReturnERC20TokenContract, +} from '@0x/contracts-erc20'; +import { DummyERC721TokenContract } from '@0x/contracts-erc721'; import { chaiSetup, constants, diff --git a/contracts/exchange/test/dispatcher.ts b/contracts/exchange/test/dispatcher.ts index f50483bc78..4ffce7aa7c 100644 --- a/contracts/exchange/test/dispatcher.ts +++ b/contracts/exchange/test/dispatcher.ts @@ -1,10 +1,5 @@ -import { - DummyERC20TokenContract, - ERC20ProxyContract, - ERC20Wrapper, - ERC721ProxyContract, - ERC721Wrapper, -} from '@0x/contracts-asset-proxy'; +import { ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, ERC721Wrapper } from '@0x/contracts-asset-proxy'; +import { DummyERC20TokenContract } from '@0x/contracts-erc20'; import { chaiSetup, constants, diff --git a/contracts/exchange/test/match_orders.ts b/contracts/exchange/test/match_orders.ts index a156c8b81d..b749805379 100644 --- a/contracts/exchange/test/match_orders.ts +++ b/contracts/exchange/test/match_orders.ts @@ -1,11 +1,6 @@ -import { - DummyERC20TokenContract, - DummyERC721TokenContract, - ERC20ProxyContract, - ERC20Wrapper, - ERC721ProxyContract, - ERC721Wrapper, -} from '@0x/contracts-asset-proxy'; +import { ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, ERC721Wrapper } from '@0x/contracts-asset-proxy'; +import { DummyERC20TokenContract } from '@0x/contracts-erc20'; +import { DummyERC721TokenContract } from '@0x/contracts-erc721'; import { chaiSetup, constants, diff --git a/contracts/exchange/test/transactions.ts b/contracts/exchange/test/transactions.ts index d61c792872..4f8c075794 100644 --- a/contracts/exchange/test/transactions.ts +++ b/contracts/exchange/test/transactions.ts @@ -1,4 +1,5 @@ -import { DummyERC20TokenContract, ERC20ProxyContract, ERC20Wrapper } from '@0x/contracts-asset-proxy'; +import { ERC20ProxyContract, ERC20Wrapper } from '@0x/contracts-asset-proxy'; +import { DummyERC20TokenContract } from '@0x/contracts-erc20'; import { chaiSetup, constants, diff --git a/contracts/exchange/test/wrapper.ts b/contracts/exchange/test/wrapper.ts index aeaf6cff1c..573591b1b5 100644 --- a/contracts/exchange/test/wrapper.ts +++ b/contracts/exchange/test/wrapper.ts @@ -1,11 +1,6 @@ -import { - DummyERC20TokenContract, - DummyERC721TokenContract, - ERC20ProxyContract, - ERC20Wrapper, - ERC721ProxyContract, - ERC721Wrapper, -} from '@0x/contracts-asset-proxy'; +import { ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, ERC721Wrapper } from '@0x/contracts-asset-proxy'; +import { DummyERC20TokenContract } from '@0x/contracts-erc20'; +import { DummyERC721TokenContract } from '@0x/contracts-erc721'; import { chaiSetup, constants, diff --git a/contracts/extensions/compiler.json b/contracts/extensions/compiler.json index 02c7518274..e0c5844f60 100644 --- a/contracts/extensions/compiler.json +++ b/contracts/extensions/compiler.json @@ -5,7 +5,16 @@ "isOfflineMode": false, "compilerSettings": { "evmVersion": "byzantium", - "optimizer": { "enabled": true, "runs": 1000000 }, + "optimizer": { + "enabled": true, + "runs": 1000000, + "details": { + "yul": true, + "deduplicate": true, + "cse": true, + "constantOptimizer": true + } + }, "outputSelection": { "*": { "*": [ @@ -19,11 +28,7 @@ } }, "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", diff --git a/contracts/extensions/contracts/src/BalanceThresholdFilter/BalanceThresholdFilter.sol b/contracts/extensions/contracts/src/BalanceThresholdFilter/BalanceThresholdFilter.sol index b6e14525df..af61b95d0c 100644 --- a/contracts/extensions/contracts/src/BalanceThresholdFilter/BalanceThresholdFilter.sol +++ b/contracts/extensions/contracts/src/BalanceThresholdFilter/BalanceThresholdFilter.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; import "@0x/contracts-exchange/contracts/src/interfaces/IExchange.sol"; import "./interfaces/IThresholdAsset.sol"; diff --git a/contracts/extensions/contracts/src/BalanceThresholdFilter/MixinBalanceThresholdFilterCore.sol b/contracts/extensions/contracts/src/BalanceThresholdFilter/MixinBalanceThresholdFilterCore.sol index 68dabafeba..3b2853503b 100644 --- a/contracts/extensions/contracts/src/BalanceThresholdFilter/MixinBalanceThresholdFilterCore.sol +++ b/contracts/extensions/contracts/src/BalanceThresholdFilter/MixinBalanceThresholdFilterCore.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "@0x/contracts-exchange-libs/contracts/src/LibExchangeSelectors.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; @@ -57,8 +57,8 @@ contract MixinBalanceThresholdFilterCore is function executeTransaction( uint256 salt, address signerAddress, - bytes signedExchangeTransaction, - bytes signature + bytes calldata signedExchangeTransaction, + bytes calldata signature ) external { @@ -92,7 +92,8 @@ contract MixinBalanceThresholdFilterCore is /// @param signerAddress Address of transaction signer. /// @return addressesToValidate Array of addresses to validate. function getAddressesToValidate(address signerAddress) - internal pure + internal + pure returns (address[] memory addressesToValidate) { bytes4 exchangeFunctionSelector = bytes4(exchangeCalldataload(0)); diff --git a/contracts/extensions/contracts/src/BalanceThresholdFilter/MixinExchangeCalldata.sol b/contracts/extensions/contracts/src/BalanceThresholdFilter/MixinExchangeCalldata.sol index f2c0caa579..b325d2877b 100644 --- a/contracts/extensions/contracts/src/BalanceThresholdFilter/MixinExchangeCalldata.sol +++ b/contracts/extensions/contracts/src/BalanceThresholdFilter/MixinExchangeCalldata.sol @@ -17,7 +17,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "./mixins/MExchangeCalldata.sol"; import "@0x/contracts-utils/contracts/src/LibAddressArray.sol"; @@ -34,7 +34,8 @@ contract MixinExchangeCalldata is /// @param offset Offset into the Exchange calldata. /// @return value Corresponding 32 byte value stored at `offset`. function exchangeCalldataload(uint256 offset) - internal pure + internal + pure returns (bytes32 value) { assembly { @@ -58,7 +59,8 @@ contract MixinExchangeCalldata is /// @param offset Offset into the Exchange calldata (minus the 4 byte selector) /// @return value Corresponding 32 byte value stored at `offset` + 4. function loadExchangeData(uint256 offset) - internal pure + internal + pure returns (bytes32 value) { value = exchangeCalldataload(offset + 4); @@ -70,12 +72,13 @@ contract MixinExchangeCalldata is /// @param orderParamIndex Index of the order in the Exchange function's signature. /// @return makerAddress The extracted maker address. function loadMakerAddressFromOrder(uint256 orderParamIndex) - internal pure + internal + pure returns (address makerAddress) { uint256 orderOffsetInBytes = orderParamIndex * 32; uint256 orderPtr = uint256(loadExchangeData(orderOffsetInBytes)); - makerAddress = address(loadExchangeData(orderPtr)); + makerAddress = address(uint256(loadExchangeData(orderPtr))); return makerAddress; } @@ -84,8 +87,9 @@ contract MixinExchangeCalldata is /// @param orderArrayParamIndex Index of the order array in the Exchange function's signature /// @return makerAddresses The extracted maker addresses. function loadMakerAddressesFromOrderArray(uint256 orderArrayParamIndex) - internal pure - returns (address[] makerAddresses) + internal + pure + returns (address[] memory makerAddresses) { uint256 orderArrayOffsetInBytes = orderArrayParamIndex * 32; uint256 orderArrayPtr = uint256(loadExchangeData(orderArrayOffsetInBytes)); @@ -95,7 +99,7 @@ contract MixinExchangeCalldata is uint256 orderArrayElementEndPtr = orderArrayElementPtr + orderArrayLengthInBytes; for (uint orderPtrOffset = orderArrayElementPtr; orderPtrOffset < orderArrayElementEndPtr; orderPtrOffset += 32) { uint256 orderPtr = uint256(loadExchangeData(orderPtrOffset)); - address makerAddress = address(loadExchangeData(orderPtr + orderArrayElementPtr)); + address makerAddress = address(uint256(loadExchangeData(orderPtr + orderArrayElementPtr))); makerAddresses = makerAddresses.append(makerAddress); } return makerAddresses; diff --git a/contracts/extensions/contracts/src/BalanceThresholdFilter/interfaces/IBalanceThresholdFilterCore.sol b/contracts/extensions/contracts/src/BalanceThresholdFilter/interfaces/IBalanceThresholdFilterCore.sol index 4a1bf1fb29..3a4488b916 100644 --- a/contracts/extensions/contracts/src/BalanceThresholdFilter/interfaces/IBalanceThresholdFilterCore.sol +++ b/contracts/extensions/contracts/src/BalanceThresholdFilter/interfaces/IBalanceThresholdFilterCore.sol @@ -17,7 +17,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; contract IBalanceThresholdFilterCore { @@ -48,8 +48,8 @@ contract IBalanceThresholdFilterCore { function executeTransaction( uint256 salt, address signerAddress, - bytes signedExchangeTransaction, - bytes signature + bytes calldata signedExchangeTransaction, + bytes calldata signature ) external; } diff --git a/contracts/extensions/contracts/src/BalanceThresholdFilter/interfaces/IThresholdAsset.sol b/contracts/extensions/contracts/src/BalanceThresholdFilter/interfaces/IThresholdAsset.sol index f78f9c2deb..db85d8f2d3 100644 --- a/contracts/extensions/contracts/src/BalanceThresholdFilter/interfaces/IThresholdAsset.sol +++ b/contracts/extensions/contracts/src/BalanceThresholdFilter/interfaces/IThresholdAsset.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; contract IThresholdAsset { diff --git a/contracts/extensions/contracts/src/BalanceThresholdFilter/mixins/MBalanceThresholdFilterCore.sol b/contracts/extensions/contracts/src/BalanceThresholdFilter/mixins/MBalanceThresholdFilterCore.sol index 1c840136ba..a208e42e79 100644 --- a/contracts/extensions/contracts/src/BalanceThresholdFilter/mixins/MBalanceThresholdFilterCore.sol +++ b/contracts/extensions/contracts/src/BalanceThresholdFilter/mixins/MBalanceThresholdFilterCore.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "@0x/contracts-exchange/contracts/src/interfaces/IExchange.sol"; import "../interfaces/IThresholdAsset.sol"; @@ -49,6 +49,7 @@ contract MBalanceThresholdFilterCore is /// @param signerAddress Address of transaction signer. /// @return addressesToValidate Array of addresses to validate. function getAddressesToValidate(address signerAddress) - internal pure + internal + pure returns (address[] memory addressesToValidate); } diff --git a/contracts/extensions/contracts/src/BalanceThresholdFilter/mixins/MExchangeCalldata.sol b/contracts/extensions/contracts/src/BalanceThresholdFilter/mixins/MExchangeCalldata.sol index 40536d820c..9f08784c4a 100644 --- a/contracts/extensions/contracts/src/BalanceThresholdFilter/mixins/MExchangeCalldata.sol +++ b/contracts/extensions/contracts/src/BalanceThresholdFilter/mixins/MExchangeCalldata.sol @@ -17,7 +17,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; contract MExchangeCalldata { @@ -51,6 +51,7 @@ contract MExchangeCalldata { /// @param orderArrayParamIndex Index of the order array in the Exchange function's signature /// @return makerAddresses The extracted maker addresses. function loadMakerAddressesFromOrderArray(uint256 orderArrayParamIndex) - internal pure - returns (address[] makerAddresses); + internal + pure + returns (address[] memory makerAddresses); } diff --git a/contracts/extensions/contracts/src/DutchAuction/DutchAuction.sol b/contracts/extensions/contracts/src/DutchAuction/DutchAuction.sol index 7631880c06..4af0d38f78 100644 --- a/contracts/extensions/contracts/src/DutchAuction/DutchAuction.sol +++ b/contracts/extensions/contracts/src/DutchAuction/DutchAuction.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-exchange/contracts/src/interfaces/IExchange.sol"; @@ -139,9 +139,7 @@ contract DutchAuction is /// @dev Calculates the Auction Details for the given order /// @param order The sell order /// @return AuctionDetails - function getAuctionDetails( - LibOrder.Order memory order - ) + function getAuctionDetails(LibOrder.Order memory order) public returns (AuctionDetails memory auctionDetails) { diff --git a/contracts/extensions/contracts/src/OrderMatcher/MixinAssets.sol b/contracts/extensions/contracts/src/OrderMatcher/MixinAssets.sol index 65b36ea65e..6131d27c12 100644 --- a/contracts/extensions/contracts/src/OrderMatcher/MixinAssets.sol +++ b/contracts/extensions/contracts/src/OrderMatcher/MixinAssets.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "@0x/contracts-utils/contracts/src/LibBytes.sol"; import "@0x/contracts-utils/contracts/src/Ownable.sol"; @@ -39,7 +39,7 @@ contract MixinAssets is /// @param assetData Byte array encoded for the respective asset proxy. /// @param amount Amount of asset to withdraw. function withdrawAsset( - bytes assetData, + bytes calldata assetData, uint256 amount ) external @@ -52,7 +52,7 @@ contract MixinAssets is /// @param assetData Byte array encoded for the respective asset proxy. /// @param amount Amount of asset to approve for respective proxy. function approveAssetProxy( - bytes assetData, + bytes calldata assetData, uint256 amount ) external @@ -104,7 +104,7 @@ contract MixinAssets is // Transfer tokens. // We do a raw call so we can check the success separate // from the return data. - bool success = token.call(abi.encodeWithSelector( + (bool success,) = token.call(abi.encodeWithSelector( ERC20_TRANSFER_SELECTOR, msg.sender, amount diff --git a/contracts/extensions/contracts/src/OrderMatcher/MixinMatchOrders.sol b/contracts/extensions/contracts/src/OrderMatcher/MixinMatchOrders.sol index baf41f6509..55dae91a04 100644 --- a/contracts/extensions/contracts/src/OrderMatcher/MixinMatchOrders.sol +++ b/contracts/extensions/contracts/src/OrderMatcher/MixinMatchOrders.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "./libs/LibConstants.sol"; diff --git a/contracts/extensions/contracts/src/OrderMatcher/OrderMatcher.sol b/contracts/extensions/contracts/src/OrderMatcher/OrderMatcher.sol index 89a7f3c55f..4ecf961e76 100644 --- a/contracts/extensions/contracts/src/OrderMatcher/OrderMatcher.sol +++ b/contracts/extensions/contracts/src/OrderMatcher/OrderMatcher.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-utils/contracts/src/Ownable.sol"; diff --git a/contracts/extensions/contracts/src/OrderMatcher/interfaces/IAssets.sol b/contracts/extensions/contracts/src/OrderMatcher/interfaces/IAssets.sol index 9fcc0023ad..c06c053dcb 100644 --- a/contracts/extensions/contracts/src/OrderMatcher/interfaces/IAssets.sol +++ b/contracts/extensions/contracts/src/OrderMatcher/interfaces/IAssets.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; contract IAssets { @@ -27,7 +27,7 @@ contract IAssets { /// @param assetData Byte array encoded for the respective asset proxy. /// @param amount Amount of asset to withdraw. function withdrawAsset( - bytes assetData, + bytes calldata assetData, uint256 amount ) external; @@ -36,7 +36,7 @@ contract IAssets { /// @param assetData Byte array encoded for the respective asset proxy. /// @param amount Amount of asset to approve for respective proxy. function approveAssetProxy( - bytes assetData, + bytes calldata assetData, uint256 amount ) external; diff --git a/contracts/extensions/contracts/src/OrderMatcher/interfaces/IMatchOrders.sol b/contracts/extensions/contracts/src/OrderMatcher/interfaces/IMatchOrders.sol index 7e4a88df84..80b08f578e 100644 --- a/contracts/extensions/contracts/src/OrderMatcher/interfaces/IMatchOrders.sol +++ b/contracts/extensions/contracts/src/OrderMatcher/interfaces/IMatchOrders.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; diff --git a/contracts/extensions/contracts/src/OrderMatcher/interfaces/IOrderMatcher.sol b/contracts/extensions/contracts/src/OrderMatcher/interfaces/IOrderMatcher.sol index 5e5125dea3..ca00e15ef5 100644 --- a/contracts/extensions/contracts/src/OrderMatcher/interfaces/IOrderMatcher.sol +++ b/contracts/extensions/contracts/src/OrderMatcher/interfaces/IOrderMatcher.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "@0x/contract-utils/contracts/src/interfaces/IOwnable.sol"; import "./IMatchOrders.sol"; diff --git a/contracts/extensions/contracts/src/OrderMatcher/libs/LibConstants.sol b/contracts/extensions/contracts/src/OrderMatcher/libs/LibConstants.sol index 77b72398fb..84ab046dbf 100644 --- a/contracts/extensions/contracts/src/OrderMatcher/libs/LibConstants.sol +++ b/contracts/extensions/contracts/src/OrderMatcher/libs/LibConstants.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "@0x/contracts-exchange/contracts/src/interfaces/IExchange.sol"; diff --git a/contracts/extensions/contracts/src/OrderMatcher/mixins/MAssets.sol b/contracts/extensions/contracts/src/OrderMatcher/mixins/MAssets.sol index 6ea7a32907..3c730939d5 100644 --- a/contracts/extensions/contracts/src/OrderMatcher/mixins/MAssets.sol +++ b/contracts/extensions/contracts/src/OrderMatcher/mixins/MAssets.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity ^0.5.5; import "../interfaces/IAssets.sol"; diff --git a/contracts/extensions/contracts/src/OrderValidator/OrderValidator.sol b/contracts/extensions/contracts/src/OrderValidator/OrderValidator.sol index 3297a980f7..81888f3312 100644 --- a/contracts/extensions/contracts/src/OrderValidator/OrderValidator.sol +++ b/contracts/extensions/contracts/src/OrderValidator/OrderValidator.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "@0x/contracts-exchange/contracts/src/interfaces/IExchange.sol"; diff --git a/contracts/extensions/package.json b/contracts/extensions/package.json index 0c8247919e..c104c84e78 100644 --- a/contracts/extensions/package.json +++ b/contracts/extensions/package.json @@ -72,9 +72,9 @@ "@0x/contracts-asset-proxy": "^1.0.9", "@0x/contracts-erc20": "^1.0.9", "@0x/contracts-erc721": "^1.0.9", - "@0x/contracts-exchange": "1.0.2", - "@0x/contracts-exchange-libs": "1.0.2", - "@0x/contracts-utils": "2.0.1", + "@0x/contracts-exchange": "^1.0.9", + "@0x/contracts-exchange-libs": "^1.1.3", + "@0x/contracts-utils": "^2.0.8", "@0x/order-utils": "^7.0.2", "@0x/types": "^2.1.1", "@0x/typescript-typings": "^4.1.0", diff --git a/contracts/extensions/src/artifacts.ts b/contracts/extensions/src/artifacts.ts index efa5c859c1..07503e8c7b 100644 --- a/contracts/extensions/src/artifacts.ts +++ b/contracts/extensions/src/artifacts.ts @@ -6,22 +6,14 @@ 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, diff --git a/contracts/extensions/src/wrappers.ts b/contracts/extensions/src/wrappers.ts index 1a67d2ee39..170af64789 100644 --- a/contracts/extensions/src/wrappers.ts +++ b/contracts/extensions/src/wrappers.ts @@ -4,11 +4,7 @@ * ----------------------------------------------------------------------------- */ 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'; diff --git a/contracts/extensions/test/dutch_auction.ts b/contracts/extensions/test/dutch_auction.ts index 13727871e7..eb4f953fe6 100644 --- a/contracts/extensions/test/dutch_auction.ts +++ b/contracts/extensions/test/dutch_auction.ts @@ -1,10 +1,7 @@ import { DutchAuctionWrapper } from '@0x/contract-wrappers'; -import { - DummyERC20TokenContract, - DummyERC721TokenContract, - ERC20Wrapper, - ERC721Wrapper, -} from '@0x/contracts-asset-proxy'; +import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; +import { DummyERC20TokenContract } from '@0x/contracts-erc20'; +import { DummyERC721TokenContract } from '@0x/contracts-erc721'; import { ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange'; import { chaiSetup, diff --git a/contracts/extensions/test/order_matcher.ts b/contracts/extensions/test/order_matcher.ts index 091a4c0308..99ec0d06d9 100644 --- a/contracts/extensions/test/order_matcher.ts +++ b/contracts/extensions/test/order_matcher.ts @@ -1,10 +1,11 @@ import { - DummyERC20TokenContract, - DummyERC721TokenContract, + artifacts as proxyArtifacts, ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, } from '@0x/contracts-asset-proxy'; +import { DummyERC20TokenContract } from '@0x/contracts-erc20'; +import { artifacts as erc721Artifacts, DummyERC721TokenContract } from '@0x/contracts-erc721'; import { ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange'; import { chaiSetup, @@ -98,7 +99,11 @@ describe('OrderMatcher', () => { erc20Proxy = await erc20Wrapper.deployProxyAsync(); await erc20Wrapper.setBalancesAndAllowancesAsync(); // Deploy ERC721 proxy - erc721Proxy = await ERC721ProxyContract.deployFrom0xArtifactAsync(artifacts.ERC721Proxy, provider, txDefaults); + erc721Proxy = await ERC721ProxyContract.deployFrom0xArtifactAsync( + proxyArtifacts.ERC721Proxy, + provider, + txDefaults, + ); // Depoy exchange exchange = await ExchangeContract.deployFrom0xArtifactAsync( artifacts.Exchange, @@ -719,7 +724,7 @@ describe('OrderMatcher', () => { }); it('should allow owner to withdraw ERC721 tokens', async () => { const erc721Token = await DummyERC721TokenContract.deployFrom0xArtifactAsync( - artifacts.DummyERC721Token, + erc721Artifacts.DummyERC721Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, @@ -764,7 +769,7 @@ describe('OrderMatcher', () => { }); it('should be able to approve an ERC721 token by passing in allowance = 1', async () => { const erc721Token = await DummyERC721TokenContract.deployFrom0xArtifactAsync( - artifacts.DummyERC721Token, + erc721Artifacts.DummyERC721Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, @@ -781,7 +786,7 @@ describe('OrderMatcher', () => { }); it('should be able to approve an ERC721 token by passing in allowance > 1', async () => { const erc721Token = await DummyERC721TokenContract.deployFrom0xArtifactAsync( - artifacts.DummyERC721Token, + erc721Artifacts.DummyERC721Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, diff --git a/contracts/extensions/test/order_validator.ts b/contracts/extensions/test/order_validator.ts index 335837610f..6bff522896 100644 --- a/contracts/extensions/test/order_validator.ts +++ b/contracts/extensions/test/order_validator.ts @@ -1,11 +1,6 @@ -import { - DummyERC20TokenContract, - DummyERC721TokenContract, - ERC20ProxyContract, - ERC20Wrapper, - ERC721ProxyContract, - ERC721Wrapper, -} from '@0x/contracts-asset-proxy'; +import { ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, ERC721Wrapper } from '@0x/contracts-asset-proxy'; +import { DummyERC20TokenContract } from '@0x/contracts-erc20'; +import { DummyERC721TokenContract } from '@0x/contracts-erc721'; import { ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange'; import { chaiSetup, diff --git a/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts b/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts index 494c6a6052..b8118df40a 100644 --- a/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts +++ b/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts @@ -1,3 +1,4 @@ +import { artifacts as exchangeArtifacts } from '@0x/contracts-exchange'; import { LogDecoder, Web3ProviderEngine } from '@0x/contracts-test-utils'; import { DutchAuctionDetails, SignedOrder } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; @@ -15,7 +16,7 @@ export class DutchAuctionTestWrapper { constructor(contractInstance: DutchAuctionContract, provider: Web3ProviderEngine) { this._dutchAuctionContract = contractInstance; this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts); + this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...exchangeArtifacts }); } /** * Matches the buy and sell orders at an amount given the following: the current block time, the auction diff --git a/contracts/multisig/compiler.json b/contracts/multisig/compiler.json index 449abf82ad..40e31005ac 100644 --- a/contracts/multisig/compiler.json +++ b/contracts/multisig/compiler.json @@ -5,7 +5,16 @@ "isOfflineMode": false, "compilerSettings": { "evmVersion": "byzantium", - "optimizer": { "enabled": true, "runs": 1000000 }, + "optimizer": { + "enabled": true, + "runs": 1000000, + "details": { + "yul": true, + "deduplicate": true, + "cse": true, + "constantOptimizer": true + } + }, "outputSelection": { "*": { "*": [ @@ -19,7 +28,6 @@ } }, "contracts": [ - "@0x/contracts-asset-proxy/contracts/src/MixinAuthorizable.sol", "src/AssetProxyOwner.sol", "src/MultiSigWallet.sol", "src/MultiSigWalletWithTimeLock.sol", diff --git a/contracts/multisig/src/artifacts.ts b/contracts/multisig/src/artifacts.ts index 7d8a85884b..19cee447b0 100644 --- a/contracts/multisig/src/artifacts.ts +++ b/contracts/multisig/src/artifacts.ts @@ -6,13 +6,11 @@ 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, diff --git a/contracts/multisig/src/wrappers.ts b/contracts/multisig/src/wrappers.ts index 81aab39da2..68874699e3 100644 --- a/contracts/multisig/src/wrappers.ts +++ b/contracts/multisig/src/wrappers.ts @@ -4,7 +4,6 @@ * ----------------------------------------------------------------------------- */ 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'; diff --git a/contracts/multisig/test/asset_proxy_owner.ts b/contracts/multisig/test/asset_proxy_owner.ts index 7bf4069cbc..62081554be 100644 --- a/contracts/multisig/test/asset_proxy_owner.ts +++ b/contracts/multisig/test/asset_proxy_owner.ts @@ -1,3 +1,4 @@ +import { artifacts as proxyArtifacts, MixinAuthorizableContract } from '@0x/contracts-asset-proxy'; import { chaiSetup, constants, @@ -25,7 +26,6 @@ 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( - artifacts.MixinAuthorizable, + proxyArtifacts.MixinAuthorizable, provider, txDefaults, ); erc721Proxy = await MixinAuthorizableContract.deployFrom0xArtifactAsync( - artifacts.MixinAuthorizable, + proxyArtifacts.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 13c5472edd..f75d5c952e 100644 --- a/contracts/multisig/test/utils/asset_proxy_owner_wrapper.ts +++ b/contracts/multisig/test/utils/asset_proxy_owner_wrapper.ts @@ -1,3 +1,4 @@ +import { artifacts as proxyArtifacts } from '@0x/contracts-asset-proxy'; import { LogDecoder, Web3ProviderEngine } from '@0x/contracts-test-utils'; import { BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; @@ -14,7 +15,7 @@ export class AssetProxyOwnerWrapper { constructor(assetproxyOwnerContract: AssetProxyOwnerContract, provider: Web3ProviderEngine) { this._assetProxyOwner = assetproxyOwnerContract; this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts); + this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...proxyArtifacts }); } public async submitTransactionAsync( destination: string, diff --git a/contracts/utils/compiler.json b/contracts/utils/compiler.json index 22582d6194..3fd9b1253d 100644 --- a/contracts/utils/compiler.json +++ b/contracts/utils/compiler.json @@ -5,7 +5,16 @@ "isOfflineMode": false, "compilerSettings": { "evmVersion": "byzantium", - "optimizer": { "enabled": true, "runs": 1000000 }, + "optimizer": { + "enabled": true, + "runs": 1000000, + "details": { + "yul": true, + "deduplicate": true, + "cse": true, + "constantOptimizer": true + } + }, "outputSelection": { "*": { "*": [ diff --git a/contracts/utils/contracts/src/LibAddressArray.sol b/contracts/utils/contracts/src/LibAddressArray.sol index 531105a189..0d4ebb544e 100644 --- a/contracts/utils/contracts/src/LibAddressArray.sol +++ b/contracts/utils/contracts/src/LibAddressArray.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; import "./LibBytes.sol"; diff --git a/contracts/utils/contracts/src/LibBytes.sol b/contracts/utils/contracts/src/LibBytes.sol index bc82fa519e..f399a178b3 100644 --- a/contracts/utils/contracts/src/LibBytes.sol +++ b/contracts/utils/contracts/src/LibBytes.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; library LibBytes { diff --git a/contracts/utils/contracts/src/Ownable.sol b/contracts/utils/contracts/src/Ownable.sol index 254986e088..9cb76e92de 100644 --- a/contracts/utils/contracts/src/Ownable.sol +++ b/contracts/utils/contracts/src/Ownable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; import "./interfaces/IOwnable.sol"; diff --git a/contracts/utils/contracts/src/ReentrancyGuard.sol b/contracts/utils/contracts/src/ReentrancyGuard.sol index 9574d07a12..f09334d858 100644 --- a/contracts/utils/contracts/src/ReentrancyGuard.sol +++ b/contracts/utils/contracts/src/ReentrancyGuard.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; contract ReentrancyGuard { diff --git a/contracts/utils/contracts/src/SafeMath.sol b/contracts/utils/contracts/src/SafeMath.sol index 82a5d5d765..f0ef6ec38c 100644 --- a/contracts/utils/contracts/src/SafeMath.sol +++ b/contracts/utils/contracts/src/SafeMath.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; contract SafeMath { diff --git a/contracts/utils/contracts/src/interfaces/IOwnable.sol b/contracts/utils/contracts/src/interfaces/IOwnable.sol index b5de687439..89ccde76cd 100644 --- a/contracts/utils/contracts/src/interfaces/IOwnable.sol +++ b/contracts/utils/contracts/src/interfaces/IOwnable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; contract IOwnable { diff --git a/contracts/utils/contracts/test/TestConstants.sol b/contracts/utils/contracts/test/TestConstants.sol index d58fe535a4..b44fc019fb 100644 --- a/contracts/utils/contracts/test/TestConstants.sol +++ b/contracts/utils/contracts/test/TestConstants.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; import "../src/LibBytes.sol"; diff --git a/contracts/utils/contracts/test/TestLibBytes.sol b/contracts/utils/contracts/test/TestLibBytes.sol index 29000bb788..5890648eba 100644 --- a/contracts/utils/contracts/test/TestLibBytes.sol +++ b/contracts/utils/contracts/test/TestLibBytes.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.5.3; +pragma solidity ^0.5.5; import "../src/LibBytes.sol"; diff --git a/yarn.lock b/yarn.lock index 61f7958fdf..7a1b7347d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -489,6 +489,33 @@ ethers "~4.0.4" lodash "^4.17.11" +"@0x/contracts-erc20@1.0.8": + version "1.0.8" + resolved "https://registry.npmjs.org/@0x/contracts-erc20/-/contracts-erc20-1.0.8.tgz#882f3acf1a44148800d9bef692aa377627df9ace" + dependencies: + "@0x/base-contract" "^5.0.1" + "@0x/contracts-exchange-libs" "1.0.2" + "@0x/contracts-utils" "2.0.1" + "@0x/types" "^2.1.1" + "@0x/typescript-typings" "^4.1.0" + "@0x/utils" "^4.2.1" + "@0x/web3-wrapper" "^6.0.1" + ethereum-types "^2.1.0" + lodash "^4.17.11" + +"@0x/contracts-erc721@1.0.8": + version "1.0.8" + resolved "https://registry.npmjs.org/@0x/contracts-erc721/-/contracts-erc721-1.0.8.tgz#d3746c26eec57662654557121601b5bb81085637" + dependencies: + "@0x/base-contract" "^5.0.1" + "@0x/contracts-utils" "2.0.1" + "@0x/types" "^2.1.1" + "@0x/typescript-typings" "^4.1.0" + "@0x/utils" "^4.2.1" + "@0x/web3-wrapper" "^6.0.1" + ethereum-types "^2.1.0" + lodash "^4.17.11" + "@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" @@ -7471,11 +7498,13 @@ functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" -ganache-cli@6.1.8: - version "6.1.8" - resolved "https://registry.yarnpkg.com/ganache-cli/-/ganache-cli-6.1.8.tgz#49a8a331683a9652183f82ef1378d17e1814fcd3" +ganache-cli@6.4.1: + version "6.4.1" + resolved "https://registry.npmjs.org/ganache-cli/-/ganache-cli-6.4.1.tgz#77c1682883a544dcad160b0e8155e282aefb4f1f" dependencies: - source-map-support "^0.5.3" + bn.js "4.11.8" + source-map-support "0.5.9" + yargs "11.1.0" ganache-core@^2.3.3: version "2.3.3" @@ -13473,6 +13502,15 @@ react-dom@^16.3.2: object-assign "^4.1.1" prop-types "^15.6.0" +react-dom@^16.4.2: + version "16.8.4" + resolved "https://registry.npmjs.org/react-dom/-/react-dom-16.8.4.tgz#1061a8e01a2b3b0c8160037441c3bf00a0e3bc48" + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + scheduler "^0.13.4" + react-dom@^16.5.2: version "16.5.2" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.5.2.tgz#b69ee47aa20bab5327b2b9d7c1fe2a30f2cfa9d7" @@ -13776,6 +13814,15 @@ react@^16.3.2: object-assign "^4.1.1" prop-types "^15.6.0" +react@^16.4.2: + version "16.8.4" + resolved "https://registry.npmjs.org/react/-/react-16.8.4.tgz#fdf7bd9ae53f03a9c4cd1a371432c206be1c4768" + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + scheduler "^0.13.4" + react@^16.5.2: version "16.5.2" resolved "https://registry.yarnpkg.com/react/-/react-16.5.2.tgz#19f6b444ed139baa45609eee6dc3d318b3895d42" @@ -14647,6 +14694,13 @@ schedule@^0.5.0: dependencies: object-assign "^4.1.1" +scheduler@^0.13.4: + version "0.13.4" + resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.13.4.tgz#8fef05e7a3580c76c0364d2df5e550e4c9140298" + 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" @@ -15144,6 +15198,19 @@ solc@^0.5.2: tmp "0.0.33" yargs "^11.0.0" +solc@^0.5.5: + version "0.5.5" + resolved "https://registry.npmjs.org/solc/-/solc-0.5.5.tgz#bdedd988e1a958f48bb8d84df5414f0ae9f62764" + dependencies: + command-exists "^1.2.8" + fs-extra "^0.30.0" + keccak "^1.0.2" + memorystream "^0.3.1" + require-from-string "^2.0.0" + semver "^5.5.0" + tmp "0.0.33" + yargs "^11.0.0" + solhint@^1.4.1: version "1.5.0" resolved "https://registry.yarnpkg.com/solhint/-/solhint-1.5.0.tgz#02a097c0b989b6c6d423629ac8297a9a045ba8bf" From 2f7dd177c12c63e883f3e867678f7698662cffc8 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Thu, 7 Mar 2019 15:17:14 -0800 Subject: [PATCH 4/5] Update CHANGELOGs --- contracts/asset-proxy/CHANGELOG.json | 6 +++++- contracts/erc20/CHANGELOG.json | 6 +++++- contracts/erc721/CHANGELOG.json | 6 +++++- contracts/exchange-forwarder/CHANGELOG.json | 6 +++++- contracts/exchange-libs/CHANGELOG.json | 6 +++++- contracts/exchange/CHANGELOG.json | 10 +++++++++- contracts/extensions/CHANGELOG.json | 10 +++++++++- contracts/multisig/CHANGELOG.json | 6 +++++- contracts/utils/CHANGELOG.json | 6 +++++- packages/typescript-typings/CHANGELOG.json | 9 +++++++++ 10 files changed, 62 insertions(+), 9 deletions(-) diff --git a/contracts/asset-proxy/CHANGELOG.json b/contracts/asset-proxy/CHANGELOG.json index 3e2d10a3c8..59ab099079 100644 --- a/contracts/asset-proxy/CHANGELOG.json +++ b/contracts/asset-proxy/CHANGELOG.json @@ -1,10 +1,14 @@ [ { - "version": "1.0.10", + "version": "2.0.0", "changes": [ { "note": "Set evmVersion to byzantium", "pr": 1678 + }, + { + "note": "Do not reexport external dependencies", + "pr": 1682 } ] }, diff --git a/contracts/erc20/CHANGELOG.json b/contracts/erc20/CHANGELOG.json index cb7ca2d951..7d2d6d8218 100644 --- a/contracts/erc20/CHANGELOG.json +++ b/contracts/erc20/CHANGELOG.json @@ -1,10 +1,14 @@ [ { - "version": "1.0.10", + "version": "2.0.0", "changes": [ { "note": "Set evmVersion to byzantium", "pr": 1678 + }, + { + "note": "Upgrade contracts to Solidity 0.5.5", + "pr": 1682 } ] }, diff --git a/contracts/erc721/CHANGELOG.json b/contracts/erc721/CHANGELOG.json index 84aa0a01f8..f7cfc8b6b5 100644 --- a/contracts/erc721/CHANGELOG.json +++ b/contracts/erc721/CHANGELOG.json @@ -1,10 +1,14 @@ [ { - "version": "1.0.10", + "version": "2.0.0", "changes": [ { "note": "Set evmVersion to byzantium", "pr": 1678 + }, + { + "note": "Upgrade contracts to Solidity 0.5.5", + "pr": 1682 } ] }, diff --git a/contracts/exchange-forwarder/CHANGELOG.json b/contracts/exchange-forwarder/CHANGELOG.json index 483f32a0f6..50d4375ca1 100644 --- a/contracts/exchange-forwarder/CHANGELOG.json +++ b/contracts/exchange-forwarder/CHANGELOG.json @@ -1,10 +1,14 @@ [ { - "version": "1.0.10", + "version": "2.0.0", "changes": [ { "note": "Set evmVersion to byzantium", "pr": 1678 + }, + { + "note": "Do not reexport external dependencies", + "pr": 1682 } ] }, diff --git a/contracts/exchange-libs/CHANGELOG.json b/contracts/exchange-libs/CHANGELOG.json index 96246134f6..23d12e531d 100644 --- a/contracts/exchange-libs/CHANGELOG.json +++ b/contracts/exchange-libs/CHANGELOG.json @@ -1,10 +1,14 @@ [ { - "version": "1.1.4", + "version": "2.0.0", "changes": [ { "note": "Set evmVersion to byzantium", "pr": 1678 + }, + { + "note": "Upgrade contracts to Solidity 0.5.5", + "pr": 1682 } ] }, diff --git a/contracts/exchange/CHANGELOG.json b/contracts/exchange/CHANGELOG.json index 9d28b24f44..76bad01b67 100644 --- a/contracts/exchange/CHANGELOG.json +++ b/contracts/exchange/CHANGELOG.json @@ -1,10 +1,18 @@ [ { - "version": "1.0.10", + "version": "2.0.0", "changes": [ { "note": "Set evmVersion to byzantium", "pr": 1678 + }, + { + "note": "Do not reexport external dependencies", + "pr": 1682 + }, + { + "note": "Upgrade contracts to Solidity 0.5.5", + "pr": 1682 } ] }, diff --git a/contracts/extensions/CHANGELOG.json b/contracts/extensions/CHANGELOG.json index 229dcd5a25..88f6fc4628 100644 --- a/contracts/extensions/CHANGELOG.json +++ b/contracts/extensions/CHANGELOG.json @@ -1,10 +1,18 @@ [ { - "version": "2.0.9", + "version": "3.0.0", "changes": [ { "note": "Set evmVersion to byzantium", "pr": 1678 + }, + { + "note": "Do not reexport external dependencies", + "pr": 1682 + }, + { + "note": "Upgrade contracts to Solidity 0.5.5", + "pr": 1682 } ] }, diff --git a/contracts/multisig/CHANGELOG.json b/contracts/multisig/CHANGELOG.json index f2cecdeab5..de02c953b0 100644 --- a/contracts/multisig/CHANGELOG.json +++ b/contracts/multisig/CHANGELOG.json @@ -1,10 +1,14 @@ [ { - "version": "2.0.9", + "version": "3.0.0", "changes": [ { "note": "Set evmVersion to byzantium", "pr": 1678 + }, + { + "note": "Do not reexport external dependencies", + "pr": 1682 } ] }, diff --git a/contracts/utils/CHANGELOG.json b/contracts/utils/CHANGELOG.json index 8b2d28b03e..11322582b7 100644 --- a/contracts/utils/CHANGELOG.json +++ b/contracts/utils/CHANGELOG.json @@ -1,6 +1,6 @@ [ { - "version": "2.0.9", + "version": "3.0.0", "changes": [ { "note": "Set evmVersion to byzantium", @@ -9,6 +9,10 @@ { "note": "Optimize loops in LibAddressArray", "pr": 1668 + }, + { + "note": "Upgrade contracts to Solidity 0.5.5", + "pr": 1682 } ] }, diff --git a/packages/typescript-typings/CHANGELOG.json b/packages/typescript-typings/CHANGELOG.json index 50cc774d23..1f6372aab5 100644 --- a/packages/typescript-typings/CHANGELOG.json +++ b/packages/typescript-typings/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "4.2.0", + "changes": [ + { + "note": "Add optional types to optimizer settings", + "pr": 1682 + } + ] + }, { "version": "4.1.0", "changes": [ From 22af7963024945cc4765045e6d6a368a11236062 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Thu, 7 Mar 2019 19:36:26 -0800 Subject: [PATCH 5/5] Cleanup --- contracts/asset-proxy/compiler.json | 7 +------ contracts/asset-proxy/test/proxies.ts | 4 ++-- contracts/asset-proxy/tsconfig.json | 5 ----- contracts/coordinator/compiler.json | 7 +------ .../src/registry/CoordinatorRegistry.sol | 3 +-- .../registry/MixinCoordinatorRegistryCore.sol | 3 +-- .../interfaces/ICoordinatorRegistryCore.sol | 3 +-- contracts/erc20/compiler.json | 7 +------ contracts/erc20/package.json | 2 +- contracts/erc20/tsconfig.json | 1 - contracts/erc721/compiler.json | 7 +------ contracts/exchange-forwarder/compiler.json | 7 +------ contracts/exchange-forwarder/package.json | 2 +- contracts/exchange-forwarder/src/artifacts.ts | 4 +--- contracts/exchange-forwarder/tsconfig.json | 8 +------- contracts/exchange-libs/compiler.json | 7 +------ contracts/exchange/compiler.json | 11 +++-------- contracts/exchange/package.json | 2 +- contracts/exchange/src/artifacts.ts | 16 +--------------- contracts/exchange/src/wrappers.ts | 7 ------- contracts/exchange/test/core.ts | 6 ++++-- contracts/exchange/test/dispatcher.ts | 10 ++++++++-- .../exchange/test/utils/exchange_wrapper.ts | 4 +++- .../test/utils/fill_order_combinatorial_utils.ts | 9 +++++++-- contracts/exchange/tsconfig.json | 7 ------- contracts/extensions/compiler.json | 7 +------ contracts/extensions/package.json | 2 +- .../test/utils/dutch_auction_test_wrapper.ts | 7 ++++++- contracts/extensions/tsconfig.json | 4 ---- contracts/multisig/compiler.json | 7 +------ contracts/multisig/package.json | 2 +- contracts/multisig/tsconfig.json | 1 - contracts/utils/compiler.json | 7 +------ packages/ethereum-types/package.json | 2 +- packages/sol-tracing-utils/package.json | 2 +- yarn.lock | 15 +-------------- 36 files changed, 56 insertions(+), 149 deletions(-) diff --git a/contracts/asset-proxy/compiler.json b/contracts/asset-proxy/compiler.json index 873e2db477..13d150d70c 100644 --- a/contracts/asset-proxy/compiler.json +++ b/contracts/asset-proxy/compiler.json @@ -8,12 +8,7 @@ "optimizer": { "enabled": true, "runs": 1000000, - "details": { - "yul": true, - "deduplicate": true, - "cse": true, - "constantOptimizer": true - } + "details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true } }, "outputSelection": { "*": { diff --git a/contracts/asset-proxy/test/proxies.ts b/contracts/asset-proxy/test/proxies.ts index 1d3fe5a601..7977871358 100644 --- a/contracts/asset-proxy/test/proxies.ts +++ b/contracts/asset-proxy/test/proxies.ts @@ -568,7 +568,7 @@ describe('Asset Transfer Proxies', () => { erc721Receiver.address, amount, ); - const logDecoder = new LogDecoder(web3Wrapper, artifacts); + const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc721Artifacts }); const tx = await logDecoder.getTxWithDecodedLogsAsync( await web3Wrapper.sendTransactionAsync({ to: erc721Proxy.address, @@ -760,7 +760,7 @@ describe('Asset Transfer Proxies', () => { inputAmount, ); const erc20Balances = await erc20Wrapper.getBalancesAsync(); - const logDecoder = new LogDecoder(web3Wrapper, artifacts); + const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc20Artifacts }); const tx = await logDecoder.getTxWithDecodedLogsAsync( await web3Wrapper.sendTransactionAsync({ to: multiAssetProxy.address, diff --git a/contracts/asset-proxy/tsconfig.json b/contracts/asset-proxy/tsconfig.json index 526be2c640..aaff338de9 100644 --- a/contracts/asset-proxy/tsconfig.json +++ b/contracts/asset-proxy/tsconfig.json @@ -3,11 +3,6 @@ "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ - "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", diff --git a/contracts/coordinator/compiler.json b/contracts/coordinator/compiler.json index a21cc145e9..40b486d1a7 100644 --- a/contracts/coordinator/compiler.json +++ b/contracts/coordinator/compiler.json @@ -7,12 +7,7 @@ "optimizer": { "enabled": true, "runs": 1000000, - "details": { - "yul": true, - "deduplicate": true, - "cse": true, - "constantOptimizer": true - } + "details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true } }, "outputSelection": { "*": { diff --git a/contracts/coordinator/contracts/src/registry/CoordinatorRegistry.sol b/contracts/coordinator/contracts/src/registry/CoordinatorRegistry.sol index 040cd03b34..5b3a9b0e2b 100644 --- a/contracts/coordinator/contracts/src/registry/CoordinatorRegistry.sol +++ b/contracts/coordinator/contracts/src/registry/CoordinatorRegistry.sol @@ -16,8 +16,7 @@ */ -pragma solidity 0.5.3; -pragma experimental ABIEncoderV2; +pragma solidity 0.5.5; import "./MixinCoordinatorRegistryCore.sol"; diff --git a/contracts/coordinator/contracts/src/registry/MixinCoordinatorRegistryCore.sol b/contracts/coordinator/contracts/src/registry/MixinCoordinatorRegistryCore.sol index b6a2a38db4..e8af2b9f61 100644 --- a/contracts/coordinator/contracts/src/registry/MixinCoordinatorRegistryCore.sol +++ b/contracts/coordinator/contracts/src/registry/MixinCoordinatorRegistryCore.sol @@ -16,8 +16,7 @@ */ -pragma solidity 0.5.3; -pragma experimental ABIEncoderV2; +pragma solidity ^0.5.5; import "./interfaces/ICoordinatorRegistryCore.sol"; diff --git a/contracts/coordinator/contracts/src/registry/interfaces/ICoordinatorRegistryCore.sol b/contracts/coordinator/contracts/src/registry/interfaces/ICoordinatorRegistryCore.sol index 114b926fac..ed9aa944df 100644 --- a/contracts/coordinator/contracts/src/registry/interfaces/ICoordinatorRegistryCore.sol +++ b/contracts/coordinator/contracts/src/registry/interfaces/ICoordinatorRegistryCore.sol @@ -16,8 +16,7 @@ */ -pragma solidity 0.5.3; -pragma experimental ABIEncoderV2; +pragma solidity ^0.5.5; // solhint-disable no-empty-blocks diff --git a/contracts/erc20/compiler.json b/contracts/erc20/compiler.json index 3801c903a7..714ee44df9 100644 --- a/contracts/erc20/compiler.json +++ b/contracts/erc20/compiler.json @@ -8,12 +8,7 @@ "optimizer": { "enabled": true, "runs": 1000000, - "details": { - "yul": true, - "deduplicate": true, - "cse": true, - "constantOptimizer": true - } + "details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true } }, "outputSelection": { "*": { diff --git a/contracts/erc20/package.json b/contracts/erc20/package.json index c84f95948d..3725d02b78 100644 --- a/contracts/erc20/package.json +++ b/contracts/erc20/package.json @@ -33,7 +33,7 @@ "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "./generated-artifacts/@(DummyERC20Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|ERC20Token|IERC20Token|IEtherToken|MintableERC20Token|ReentrantERC20Token|UnlimitedAllowanceERC20Token|WETH9|ZRXToken).json", + "abis": "./generated-artifacts/@(DummyERC20Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|ERC20Token|IERC20Token|IEtherToken|MintableERC20Token|UnlimitedAllowanceERC20Token|WETH9|ZRXToken).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { diff --git a/contracts/erc20/tsconfig.json b/contracts/erc20/tsconfig.json index 74419260a0..51e9e504dc 100644 --- a/contracts/erc20/tsconfig.json +++ b/contracts/erc20/tsconfig.json @@ -10,7 +10,6 @@ "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" diff --git a/contracts/erc721/compiler.json b/contracts/erc721/compiler.json index 94d4494e2e..d7294e62ae 100644 --- a/contracts/erc721/compiler.json +++ b/contracts/erc721/compiler.json @@ -8,12 +8,7 @@ "optimizer": { "enabled": true, "runs": 1000000, - "details": { - "yul": true, - "deduplicate": true, - "cse": true, - "constantOptimizer": true - } + "details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true } }, "outputSelection": { "*": { diff --git a/contracts/exchange-forwarder/compiler.json b/contracts/exchange-forwarder/compiler.json index d91fba851f..deb76ddfa8 100644 --- a/contracts/exchange-forwarder/compiler.json +++ b/contracts/exchange-forwarder/compiler.json @@ -8,12 +8,7 @@ "optimizer": { "enabled": true, "runs": 1000000, - "details": { - "yul": true, - "deduplicate": true, - "cse": true, - "constantOptimizer": true - } + "details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true } }, "outputSelection": { "*": { diff --git a/contracts/exchange-forwarder/package.json b/contracts/exchange-forwarder/package.json index dc639c9796..31777c0df0 100644 --- a/contracts/exchange-forwarder/package.json +++ b/contracts/exchange-forwarder/package.json @@ -33,7 +33,7 @@ "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "./generated-artifacts/@(DummyERC20Token|DummyERC721Token|Exchange|Forwarder|WETH9).json", + "abis": "./generated-artifacts/@(Forwarder).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { diff --git a/contracts/exchange-forwarder/src/artifacts.ts b/contracts/exchange-forwarder/src/artifacts.ts index 8b14c3d6d1..a316777cb3 100644 --- a/contracts/exchange-forwarder/src/artifacts.ts +++ b/contracts/exchange-forwarder/src/artifacts.ts @@ -6,6 +6,4 @@ import { ContractArtifact } from 'ethereum-types'; import * as Forwarder from '../generated-artifacts/Forwarder.json'; -export const artifacts = { - Forwarder: Forwarder as ContractArtifact, -}; +export const artifacts = { Forwarder: Forwarder as ContractArtifact }; diff --git a/contracts/exchange-forwarder/tsconfig.json b/contracts/exchange-forwarder/tsconfig.json index 92c3a0475e..17020ff89e 100644 --- a/contracts/exchange-forwarder/tsconfig.json +++ b/contracts/exchange-forwarder/tsconfig.json @@ -2,12 +2,6 @@ "extends": "../../tsconfig", "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], - "files": [ - "generated-artifacts/DummyERC20Token.json", - "generated-artifacts/DummyERC721Token.json", - "generated-artifacts/Exchange.json", - "generated-artifacts/Forwarder.json", - "generated-artifacts/WETH9.json" - ], + "files": ["generated-artifacts/Forwarder.json"], "exclude": ["./deploy/solc/solc_bin"] } diff --git a/contracts/exchange-libs/compiler.json b/contracts/exchange-libs/compiler.json index 766403839c..8523e1155e 100644 --- a/contracts/exchange-libs/compiler.json +++ b/contracts/exchange-libs/compiler.json @@ -8,12 +8,7 @@ "optimizer": { "enabled": true, "runs": 1000000, - "details": { - "yul": true, - "deduplicate": true, - "cse": true, - "constantOptimizer": true - } + "details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true } }, "outputSelection": { "*": { diff --git a/contracts/exchange/compiler.json b/contracts/exchange/compiler.json index b94694b50c..dfbf86a0bc 100644 --- a/contracts/exchange/compiler.json +++ b/contracts/exchange/compiler.json @@ -8,12 +8,7 @@ "optimizer": { "enabled": true, "runs": 1000000, - "details": { - "yul": true, - "deduplicate": true, - "cse": true, - "constantOptimizer": true - } + "details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true } }, "outputSelection": { "*": { @@ -42,10 +37,10 @@ "src/interfaces/IValidator.sol", "src/interfaces/IWallet.sol", "src/interfaces/IWrapperFunctions.sol", + "test/ReentrantERC20Token.sol", "test/TestAssetProxyDispatcher.sol", "test/TestExchangeInternals.sol", "test/TestSignatureValidator.sol", - "test/TestStaticCallReceiver.sol", - "test/ReentrantERC20Token.sol" + "test/TestStaticCallReceiver.sol" ] } diff --git a/contracts/exchange/package.json b/contracts/exchange/package.json index d4338b2879..69ba190525 100644 --- a/contracts/exchange/package.json +++ b/contracts/exchange/package.json @@ -33,7 +33,7 @@ "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "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": "./generated-artifacts/@(Exchange|ExchangeWrapper|IAssetProxyDispatcher|IExchange|IExchangeCore|IMatchOrders|ISignatureValidator|ITransactions|IValidator|IWallet|IWrapperFunctions|ReentrantERC20Token|TestAssetProxyDispatcher|TestExchangeInternals|TestSignatureValidator|TestStaticCallReceiver|Validator|Wallet|Whitelist).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { diff --git a/contracts/exchange/src/artifacts.ts b/contracts/exchange/src/artifacts.ts index efdacd376e..5928b8a43e 100644 --- a/contracts/exchange/src/artifacts.ts +++ b/contracts/exchange/src/artifacts.ts @@ -5,11 +5,6 @@ */ 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'; @@ -21,25 +16,15 @@ 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, @@ -58,4 +43,5 @@ export const artifacts = { TestExchangeInternals: TestExchangeInternals as ContractArtifact, TestSignatureValidator: TestSignatureValidator as ContractArtifact, TestStaticCallReceiver: TestStaticCallReceiver as ContractArtifact, + ReentrantERC20Token: ReentrantERC20Token as ContractArtifact, }; diff --git a/contracts/exchange/src/wrappers.ts b/contracts/exchange/src/wrappers.ts index 1c1d7fdb44..76928a0abd 100644 --- a/contracts/exchange/src/wrappers.ts +++ b/contracts/exchange/src/wrappers.ts @@ -3,11 +3,6 @@ * 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'; @@ -19,11 +14,9 @@ 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'; diff --git a/contracts/exchange/test/core.ts b/contracts/exchange/test/core.ts index c25f1e5368..7acb4e2aba 100644 --- a/contracts/exchange/test/core.ts +++ b/contracts/exchange/test/core.ts @@ -1,4 +1,5 @@ import { + artifacts as proxyArtifacts, ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, @@ -6,6 +7,7 @@ import { MultiAssetProxyContract, } from '@0x/contracts-asset-proxy'; import { + artifacts as erc20Artifacts, DummyERC20TokenContract, DummyERC20TokenTransferEventArgs, DummyNoReturnERC20TokenContract, @@ -96,7 +98,7 @@ describe('Exchange core', () => { erc20Proxy = await erc20Wrapper.deployProxyAsync(); erc721Proxy = await erc721Wrapper.deployProxyAsync(); multiAssetProxy = await MultiAssetProxyContract.deployFrom0xArtifactAsync( - artifacts.MultiAssetProxy, + proxyArtifacts.MultiAssetProxy, provider, txDefaults, ); @@ -343,7 +345,7 @@ describe('Exchange core', () => { describe('Testing exchange of ERC20 tokens with no return values', () => { before(async () => { noReturnErc20Token = await DummyNoReturnERC20TokenContract.deployFrom0xArtifactAsync( - artifacts.DummyNoReturnERC20Token, + erc20Artifacts.DummyNoReturnERC20Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, diff --git a/contracts/exchange/test/dispatcher.ts b/contracts/exchange/test/dispatcher.ts index 4ffce7aa7c..a257559365 100644 --- a/contracts/exchange/test/dispatcher.ts +++ b/contracts/exchange/test/dispatcher.ts @@ -1,4 +1,10 @@ -import { ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, ERC721Wrapper } from '@0x/contracts-asset-proxy'; +import { + artifacts as proxyArtifacts, + ERC20ProxyContract, + ERC20Wrapper, + ERC721ProxyContract, + ERC721Wrapper, +} from '@0x/contracts-asset-proxy'; import { DummyERC20TokenContract } from '@0x/contracts-erc20'; import { chaiSetup, @@ -125,7 +131,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( - artifacts.ERC20Proxy, + proxyArtifacts.ERC20Proxy, provider, txDefaults, ); diff --git a/contracts/exchange/test/utils/exchange_wrapper.ts b/contracts/exchange/test/utils/exchange_wrapper.ts index 0a0e4c198d..fef8b55db3 100644 --- a/contracts/exchange/test/utils/exchange_wrapper.ts +++ b/contracts/exchange/test/utils/exchange_wrapper.ts @@ -1,3 +1,5 @@ +import { artifacts as erc20Artifacts } from '@0x/contracts-erc20'; +import { artifacts as erc721Artifacts } from '@0x/contracts-erc721'; import { FillResults, formatters, @@ -23,7 +25,7 @@ export class ExchangeWrapper { constructor(exchangeContract: ExchangeContract, provider: Web3ProviderEngine | ZeroExProvider) { this._exchange = exchangeContract; this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts); + this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...erc20Artifacts, ...erc721Artifacts }); } public async fillOrderAsync( signedOrder: SignedOrder, diff --git a/contracts/exchange/test/utils/fill_order_combinatorial_utils.ts b/contracts/exchange/test/utils/fill_order_combinatorial_utils.ts index f104b72134..5554a1beb7 100644 --- a/contracts/exchange/test/utils/fill_order_combinatorial_utils.ts +++ b/contracts/exchange/test/utils/fill_order_combinatorial_utils.ts @@ -1,4 +1,5 @@ import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; +import { artifacts as libsArtifacts, TestLibsContract } from '@0x/contracts-exchange-libs'; import { AllowanceAmountScenario, AssetDataScenario, @@ -33,7 +34,7 @@ import { LogWithDecodedArgs, TxData } from 'ethereum-types'; import * as _ from 'lodash'; import 'make-promises-safe'; -import { artifacts, ExchangeContract, ExchangeFillEventArgs, TestLibsContract } from '../../src'; +import { artifacts, ExchangeContract, ExchangeFillEventArgs } from '../../src'; import { AssetWrapper } from './asset_wrapper'; import { ExchangeWrapper } from './exchange_wrapper'; @@ -130,7 +131,11 @@ export async function fillOrderCombinatorialUtilsFactoryAsync( exchangeContract.address, ); - const testLibsContract = await TestLibsContract.deployFrom0xArtifactAsync(artifacts.TestLibs, provider, txDefaults); + const testLibsContract = await TestLibsContract.deployFrom0xArtifactAsync( + libsArtifacts.TestLibs, + provider, + txDefaults, + ); const fillOrderCombinatorialUtils = new FillOrderCombinatorialUtils( orderFactory, diff --git a/contracts/exchange/tsconfig.json b/contracts/exchange/tsconfig.json index 35ca3d933c..4158ece939 100644 --- a/contracts/exchange/tsconfig.json +++ b/contracts/exchange/tsconfig.json @@ -3,11 +3,6 @@ "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ - "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", @@ -19,11 +14,9 @@ "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", diff --git a/contracts/extensions/compiler.json b/contracts/extensions/compiler.json index e0c5844f60..9e8471e32b 100644 --- a/contracts/extensions/compiler.json +++ b/contracts/extensions/compiler.json @@ -8,12 +8,7 @@ "optimizer": { "enabled": true, "runs": 1000000, - "details": { - "yul": true, - "deduplicate": true, - "cse": true, - "constantOptimizer": true - } + "details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true } }, "outputSelection": { "*": { diff --git a/contracts/extensions/package.json b/contracts/extensions/package.json index c104c84e78..e67c8d95a5 100644 --- a/contracts/extensions/package.json +++ b/contracts/extensions/package.json @@ -33,7 +33,7 @@ "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "./generated-artifacts/@(BalanceThresholdFilter|DummyERC20Token|DummyERC721Token|DutchAuction|ERC20Proxy|ERC721Proxy|Exchange|ExchangeWrapper|OrderMatcher|OrderValidator|WETH9).json", + "abis": "./generated-artifacts/@(BalanceThresholdFilter|DutchAuction|Exchange|ExchangeWrapper|OrderMatcher|OrderValidator|WETH9).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { diff --git a/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts b/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts index b8118df40a..193ee1cfa4 100644 --- a/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts +++ b/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts @@ -1,3 +1,4 @@ +import { artifacts as erc721Artifacts } from '@0x/contracts-erc721'; import { artifacts as exchangeArtifacts } from '@0x/contracts-exchange'; import { LogDecoder, Web3ProviderEngine } from '@0x/contracts-test-utils'; import { DutchAuctionDetails, SignedOrder } from '@0x/types'; @@ -16,7 +17,11 @@ export class DutchAuctionTestWrapper { constructor(contractInstance: DutchAuctionContract, provider: Web3ProviderEngine) { this._dutchAuctionContract = contractInstance; this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...exchangeArtifacts }); + this._logDecoder = new LogDecoder(this._web3Wrapper, { + ...artifacts, + ...exchangeArtifacts, + ...erc721Artifacts, + }); } /** * 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 b424bfa040..47c29f1f37 100644 --- a/contracts/extensions/tsconfig.json +++ b/contracts/extensions/tsconfig.json @@ -4,11 +4,7 @@ "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ "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", diff --git a/contracts/multisig/compiler.json b/contracts/multisig/compiler.json index 40e31005ac..2395d7c8ff 100644 --- a/contracts/multisig/compiler.json +++ b/contracts/multisig/compiler.json @@ -8,12 +8,7 @@ "optimizer": { "enabled": true, "runs": 1000000, - "details": { - "yul": true, - "deduplicate": true, - "cse": true, - "constantOptimizer": true - } + "details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true } }, "outputSelection": { "*": { diff --git a/contracts/multisig/package.json b/contracts/multisig/package.json index f062e60394..7fb45261c4 100644 --- a/contracts/multisig/package.json +++ b/contracts/multisig/package.json @@ -33,7 +33,7 @@ "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "./generated-artifacts/@(AssetProxyOwner|MixinAuthorizable|MultiSigWallet|MultiSigWalletWithTimeLock|TestAssetProxyOwner|TestRejectEther).json", + "abis": "./generated-artifacts/@(AssetProxyOwner|MultiSigWallet|MultiSigWalletWithTimeLock|TestAssetProxyOwner|TestRejectEther).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, "repository": { diff --git a/contracts/multisig/tsconfig.json b/contracts/multisig/tsconfig.json index 094f894139..394575f96f 100644 --- a/contracts/multisig/tsconfig.json +++ b/contracts/multisig/tsconfig.json @@ -4,7 +4,6 @@ "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ "generated-artifacts/AssetProxyOwner.json", - "generated-artifacts/MixinAuthorizable.json", "generated-artifacts/MultiSigWallet.json", "generated-artifacts/MultiSigWalletWithTimeLock.json", "generated-artifacts/TestAssetProxyOwner.json", diff --git a/contracts/utils/compiler.json b/contracts/utils/compiler.json index 3fd9b1253d..e2884880e9 100644 --- a/contracts/utils/compiler.json +++ b/contracts/utils/compiler.json @@ -8,12 +8,7 @@ "optimizer": { "enabled": true, "runs": 1000000, - "details": { - "yul": true, - "deduplicate": true, - "cse": true, - "constantOptimizer": true - } + "details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true } }, "outputSelection": { "*": { diff --git a/packages/ethereum-types/package.json b/packages/ethereum-types/package.json index 7df14fcfae..178eb3cca2 100644 --- a/packages/ethereum-types/package.json +++ b/packages/ethereum-types/package.json @@ -36,7 +36,7 @@ "typescript": "3.0.1" }, "dependencies": { - "@types/node": "10.9.4", + "@types/node": "*", "bignumber.js": "~8.0.2" }, "publishConfig": { diff --git a/packages/sol-tracing-utils/package.json b/packages/sol-tracing-utils/package.json index 9a874a7d05..f1793d6116 100644 --- a/packages/sol-tracing-utils/package.json +++ b/packages/sol-tracing-utils/package.json @@ -61,7 +61,7 @@ "mkdirp": "^0.5.1", "rimraf": "^2.6.2", "semaphore-async-await": "^1.5.1", - "solc": "^0.5.2", + "solc": "^0.5.5", "solidity-parser-antlr": "^0.2.12" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 7a1b7347d9..03bb94c1d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1610,7 +1610,7 @@ version "2.2.48" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.48.tgz#3523b126a0b049482e1c3c11877460f76622ffab" -"@types/node@*", "@types/node@10.9.4", "@types/node@^10.3.2": +"@types/node@*", "@types/node@^10.3.2": version "10.9.4" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.9.4.tgz#0f4cb2dc7c1de6096055357f70179043c33e9897" @@ -15185,19 +15185,6 @@ solc@^0.4.2: semver "^5.3.0" yargs "^4.7.1" -solc@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.5.2.tgz#45d5d11569e41c2b2535f3a50fe0616ca771a347" - dependencies: - command-exists "^1.2.8" - fs-extra "^0.30.0" - keccak "^1.0.2" - memorystream "^0.3.1" - require-from-string "^2.0.0" - semver "^5.5.0" - tmp "0.0.33" - yargs "^11.0.0" - solc@^0.5.5: version "0.5.5" resolved "https://registry.npmjs.org/solc/-/solc-0.5.5.tgz#bdedd988e1a958f48bb8d84df5414f0ae9f62764"