Merge pull request #1682 from 0xProject/feat/contracts/solidity0.5.5

Upgrade contracts to Solidity 0.5.5
This commit is contained in:
Amir Bandeali 2019-03-11 17:06:28 -07:00 committed by GitHub
commit 2822e77716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
171 changed files with 527 additions and 417 deletions

View File

@ -1,10 +1,14 @@
[ [
{ {
"version": "1.0.10", "version": "2.0.0",
"changes": [ "changes": [
{ {
"note": "Set evmVersion to byzantium", "note": "Set evmVersion to byzantium",
"pr": 1678 "pr": 1678
},
{
"note": "Do not reexport external dependencies",
"pr": 1682
} }
] ]
}, },

View File

@ -5,7 +5,11 @@
"isOfflineMode": false, "isOfflineMode": false,
"compilerSettings": { "compilerSettings": {
"evmVersion": "byzantium", "evmVersion": "byzantium",
"optimizer": { "enabled": true, "runs": 1000000 }, "optimizer": {
"enabled": true,
"runs": 1000000,
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": { "outputSelection": {
"*": { "*": {
"*": [ "*": [
@ -19,11 +23,6 @@
} }
}, },
"contracts": [ "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/ERC20Proxy.sol",
"src/ERC721Proxy.sol", "src/ERC721Proxy.sol",
"src/MixinAuthorizable.sol", "src/MixinAuthorizable.sol",

View File

@ -33,7 +33,7 @@
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
}, },
"config": { "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." "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
}, },
"repository": { "repository": {

View File

@ -5,11 +5,6 @@
*/ */
import { ContractArtifact } from 'ethereum-types'; 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 ERC20Proxy from '../generated-artifacts/ERC20Proxy.json';
import * as ERC721Proxy from '../generated-artifacts/ERC721Proxy.json'; import * as ERC721Proxy from '../generated-artifacts/ERC721Proxy.json';
import * as IAssetData from '../generated-artifacts/IAssetData.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 MixinAuthorizable from '../generated-artifacts/MixinAuthorizable.json';
import * as MultiAssetProxy from '../generated-artifacts/MultiAssetProxy.json'; import * as MultiAssetProxy from '../generated-artifacts/MultiAssetProxy.json';
export const artifacts = { 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, ERC20Proxy: ERC20Proxy as ContractArtifact,
ERC721Proxy: ERC721Proxy as ContractArtifact, ERC721Proxy: ERC721Proxy as ContractArtifact,
MixinAuthorizable: MixinAuthorizable as ContractArtifact, MixinAuthorizable: MixinAuthorizable as ContractArtifact,

View File

@ -3,11 +3,6 @@
* Warning: This file is auto-generated by contracts-gen. Don't edit manually. * 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/erc20_proxy';
export * from '../generated-wrappers/erc721_proxy'; export * from '../generated-wrappers/erc721_proxy';
export * from '../generated-wrappers/i_asset_data'; export * from '../generated-wrappers/i_asset_data';

View File

@ -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 { import {
chaiSetup, chaiSetup,
constants, constants,
@ -18,12 +30,6 @@ import * as _ from 'lodash';
import { import {
artifacts, artifacts,
DummyERC20TokenContract,
DummyERC20TokenTransferEventArgs,
DummyERC721ReceiverContract,
DummyERC721TokenContract,
DummyMultipleReturnERC20TokenContract,
DummyNoReturnERC20TokenContract,
ERC20ProxyContract, ERC20ProxyContract,
ERC20Wrapper, ERC20Wrapper,
ERC721ProxyContract, ERC721ProxyContract,
@ -148,7 +154,7 @@ describe('Asset Transfer Proxies', () => {
constants.DUMMY_TOKEN_DECIMALS, constants.DUMMY_TOKEN_DECIMALS,
); );
noReturnErc20Token = await DummyNoReturnERC20TokenContract.deployFrom0xArtifactAsync( noReturnErc20Token = await DummyNoReturnERC20TokenContract.deployFrom0xArtifactAsync(
artifacts.DummyNoReturnERC20Token, erc20Artifacts.DummyNoReturnERC20Token,
provider, provider,
txDefaults, txDefaults,
constants.DUMMY_TOKEN_NAME, constants.DUMMY_TOKEN_NAME,
@ -157,7 +163,7 @@ describe('Asset Transfer Proxies', () => {
constants.DUMMY_TOKEN_TOTAL_SUPPLY, constants.DUMMY_TOKEN_TOTAL_SUPPLY,
); );
multipleReturnErc20Token = await DummyMultipleReturnERC20TokenContract.deployFrom0xArtifactAsync( multipleReturnErc20Token = await DummyMultipleReturnERC20TokenContract.deployFrom0xArtifactAsync(
artifacts.DummyMultipleReturnERC20Token, erc20Artifacts.DummyMultipleReturnERC20Token,
provider, provider,
txDefaults, txDefaults,
constants.DUMMY_TOKEN_NAME, constants.DUMMY_TOKEN_NAME,
@ -198,7 +204,7 @@ describe('Asset Transfer Proxies', () => {
// Deploy and configure ERC721 tokens and receiver // Deploy and configure ERC721 tokens and receiver
[erc721TokenA, erc721TokenB] = await erc721Wrapper.deployDummyTokensAsync(); [erc721TokenA, erc721TokenB] = await erc721Wrapper.deployDummyTokensAsync();
erc721Receiver = await DummyERC721ReceiverContract.deployFrom0xArtifactAsync( erc721Receiver = await DummyERC721ReceiverContract.deployFrom0xArtifactAsync(
artifacts.DummyERC721Receiver, erc721Artifacts.DummyERC721Receiver,
provider, provider,
txDefaults, txDefaults,
); );
@ -562,7 +568,7 @@ describe('Asset Transfer Proxies', () => {
erc721Receiver.address, erc721Receiver.address,
amount, amount,
); );
const logDecoder = new LogDecoder(web3Wrapper, artifacts); const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc721Artifacts });
const tx = await logDecoder.getTxWithDecodedLogsAsync( const tx = await logDecoder.getTxWithDecodedLogsAsync(
await web3Wrapper.sendTransactionAsync({ await web3Wrapper.sendTransactionAsync({
to: erc721Proxy.address, to: erc721Proxy.address,
@ -754,7 +760,7 @@ describe('Asset Transfer Proxies', () => {
inputAmount, inputAmount,
); );
const erc20Balances = await erc20Wrapper.getBalancesAsync(); const erc20Balances = await erc20Wrapper.getBalancesAsync();
const logDecoder = new LogDecoder(web3Wrapper, artifacts); const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc20Artifacts });
const tx = await logDecoder.getTxWithDecodedLogsAsync( const tx = await logDecoder.getTxWithDecodedLogsAsync(
await web3Wrapper.sendTransactionAsync({ await web3Wrapper.sendTransactionAsync({
to: multiAssetProxy.address, to: multiAssetProxy.address,

View File

@ -1,3 +1,4 @@
import { artifacts as erc20Artifacts, DummyERC20TokenContract } from '@0x/contracts-erc20';
import { constants, ERC20BalancesByOwner, txDefaults } from '@0x/contracts-test-utils'; import { constants, ERC20BalancesByOwner, txDefaults } from '@0x/contracts-test-utils';
import { assetDataUtils } from '@0x/order-utils'; import { assetDataUtils } from '@0x/order-utils';
import { BigNumber } from '@0x/utils'; import { BigNumber } from '@0x/utils';
@ -5,7 +6,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper';
import { ZeroExProvider } from 'ethereum-types'; import { ZeroExProvider } from 'ethereum-types';
import * as _ from 'lodash'; import * as _ from 'lodash';
import { artifacts, DummyERC20TokenContract, ERC20ProxyContract } from '../../src'; import { artifacts, ERC20ProxyContract } from '../../src';
export class ERC20Wrapper { export class ERC20Wrapper {
private readonly _tokenOwnerAddresses: string[]; private readonly _tokenOwnerAddresses: string[];
@ -36,7 +37,7 @@ export class ERC20Wrapper {
for (let i = 0; i < numberToDeploy; i++) { for (let i = 0; i < numberToDeploy; i++) {
this._dummyTokenContracts.push( this._dummyTokenContracts.push(
await DummyERC20TokenContract.deployFrom0xArtifactAsync( await DummyERC20TokenContract.deployFrom0xArtifactAsync(
artifacts.DummyERC20Token, erc20Artifacts.DummyERC20Token,
this._provider, this._provider,
txDefaults, txDefaults,
constants.DUMMY_TOKEN_NAME, constants.DUMMY_TOKEN_NAME,

View File

@ -1,3 +1,4 @@
import { artifacts as erc721Artifacts, DummyERC721TokenContract } from '@0x/contracts-erc721';
import { constants, ERC721TokenIdsByOwner, txDefaults } from '@0x/contracts-test-utils'; import { constants, ERC721TokenIdsByOwner, txDefaults } from '@0x/contracts-test-utils';
import { generatePseudoRandomSalt } from '@0x/order-utils'; import { generatePseudoRandomSalt } from '@0x/order-utils';
import { BigNumber } from '@0x/utils'; import { BigNumber } from '@0x/utils';
@ -5,7 +6,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper';
import { ZeroExProvider } from 'ethereum-types'; import { ZeroExProvider } from 'ethereum-types';
import * as _ from 'lodash'; import * as _ from 'lodash';
import { artifacts, DummyERC721TokenContract, ERC721ProxyContract } from '../../src'; import { artifacts, ERC721ProxyContract } from '../../src';
export class ERC721Wrapper { export class ERC721Wrapper {
private readonly _tokenOwnerAddresses: string[]; private readonly _tokenOwnerAddresses: string[];
@ -28,7 +29,7 @@ export class ERC721Wrapper {
for (const i of _.times(constants.NUM_DUMMY_ERC721_TO_DEPLOY)) { for (const i of _.times(constants.NUM_DUMMY_ERC721_TO_DEPLOY)) {
this._dummyTokenContracts.push( this._dummyTokenContracts.push(
await DummyERC721TokenContract.deployFrom0xArtifactAsync( await DummyERC721TokenContract.deployFrom0xArtifactAsync(
artifacts.DummyERC721Token, erc721Artifacts.DummyERC721Token,
this._provider, this._provider,
txDefaults, txDefaults,
constants.DUMMY_TOKEN_NAME, constants.DUMMY_TOKEN_NAME,

View File

@ -3,11 +3,6 @@
"compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true },
"include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"],
"files": [ "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/ERC20Proxy.json",
"generated-artifacts/ERC721Proxy.json", "generated-artifacts/ERC721Proxy.json",
"generated-artifacts/IAssetData.json", "generated-artifacts/IAssetData.json",

View File

@ -4,7 +4,11 @@
"useDockerisedSolc": true, "useDockerisedSolc": true,
"compilerSettings": { "compilerSettings": {
"evmVersion": "byzantium", "evmVersion": "byzantium",
"optimizer": { "enabled": true, "runs": 1000000 }, "optimizer": {
"enabled": true,
"runs": 1000000,
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": { "outputSelection": {
"*": { "*": {
"*": [ "*": [

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.5.3; pragma solidity 0.5.5;
pragma experimental "ABIEncoderV2"; pragma experimental "ABIEncoderV2";
import "./libs/LibConstants.sol"; import "./libs/LibConstants.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
pragma experimental "ABIEncoderV2"; pragma experimental "ABIEncoderV2";
import "@0x/contracts-exchange-libs/contracts/src/LibExchangeSelectors.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibExchangeSelectors.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
pragma experimental "ABIEncoderV2"; pragma experimental "ABIEncoderV2";
import "./libs/LibZeroExTransaction.sol"; import "./libs/LibZeroExTransaction.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/LibBytes.sol"; import "@0x/contracts-utils/contracts/src/LibBytes.sol";
import "./mixins/MSignatureValidator.sol"; import "./mixins/MSignatureValidator.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
pragma experimental "ABIEncoderV2"; pragma experimental "ABIEncoderV2";
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
pragma experimental "ABIEncoderV2"; pragma experimental "ABIEncoderV2";
import "../libs/LibZeroExTransaction.sol"; import "../libs/LibZeroExTransaction.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
contract ISignatureValidator { contract ISignatureValidator {

View File

@ -15,7 +15,7 @@
limitations under the License. limitations under the License.
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
contract ITransactions { contract ITransactions {

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
import "../interfaces/ITransactions.sol"; import "../interfaces/ITransactions.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
import "./LibEIP712Domain.sol"; import "./LibEIP712Domain.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
contract LibEIP712Domain { contract LibEIP712Domain {

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
import "./LibEIP712Domain.sol"; import "./LibEIP712Domain.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
pragma experimental "ABIEncoderV2"; pragma experimental "ABIEncoderV2";
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
import "../interfaces/ISignatureValidator.sol"; import "../interfaces/ISignatureValidator.sol";

View File

@ -16,8 +16,7 @@
*/ */
pragma solidity 0.5.3; pragma solidity 0.5.5;
pragma experimental ABIEncoderV2;
import "./MixinCoordinatorRegistryCore.sol"; import "./MixinCoordinatorRegistryCore.sol";

View File

@ -16,8 +16,7 @@
*/ */
pragma solidity 0.5.3; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "./interfaces/ICoordinatorRegistryCore.sol"; import "./interfaces/ICoordinatorRegistryCore.sol";

View File

@ -16,8 +16,7 @@
*/ */
pragma solidity 0.5.3; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
// solhint-disable no-empty-blocks // solhint-disable no-empty-blocks

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity 0.5.5;
pragma experimental "ABIEncoderV2"; pragma experimental "ABIEncoderV2";
import "../src/libs/LibCoordinatorApproval.sol"; import "../src/libs/LibCoordinatorApproval.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.5.3; pragma solidity 0.5.5;
pragma experimental "ABIEncoderV2"; pragma experimental "ABIEncoderV2";
import "../src/MixinSignatureValidator.sol"; import "../src/MixinSignatureValidator.sol";

View File

@ -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 { import {
artifacts as exchangeArtifacts, artifacts as exchangeArtifacts,
ExchangeCancelEventArgs, ExchangeCancelEventArgs,

View File

@ -1,10 +1,14 @@
[ [
{ {
"version": "1.0.10", "version": "2.0.0",
"changes": [ "changes": [
{ {
"note": "Set evmVersion to byzantium", "note": "Set evmVersion to byzantium",
"pr": 1678 "pr": 1678
},
{
"note": "Upgrade contracts to Solidity 0.5.5",
"pr": 1682
} }
] ]
}, },

View File

@ -5,7 +5,11 @@
"isOfflineMode": false, "isOfflineMode": false,
"compilerSettings": { "compilerSettings": {
"evmVersion": "byzantium", "evmVersion": "byzantium",
"optimizer": { "enabled": true, "runs": 1000000 }, "optimizer": {
"enabled": true,
"runs": 1000000,
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": { "outputSelection": {
"*": { "*": {
"*": [ "*": [
@ -28,7 +32,6 @@
"src/interfaces/IEtherToken.sol", "src/interfaces/IEtherToken.sol",
"test/DummyERC20Token.sol", "test/DummyERC20Token.sol",
"test/DummyMultipleReturnERC20Token.sol", "test/DummyMultipleReturnERC20Token.sol",
"test/DummyNoReturnERC20Token.sol", "test/DummyNoReturnERC20Token.sol"
"test/ReentrantERC20Token.sol"
] ]
} }

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
import "./interfaces/IERC20Token.sol"; import "./interfaces/IERC20Token.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/SafeMath.sol"; import "@0x/contracts-utils/contracts/src/SafeMath.sol";
import "./UnlimitedAllowanceERC20Token.sol"; import "./UnlimitedAllowanceERC20Token.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
import "./ERC20Token.sol"; import "./ERC20Token.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
contract IERC20Token { contract IERC20Token {

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
import "./IERC20Token.sol"; import "./IERC20Token.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.4.24; pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/Ownable.sol"; import "@0x/contracts-utils/contracts/src/Ownable.sol";
import "../src/MintableERC20Token.sol"; import "../src/MintableERC20Token.sol";
@ -32,8 +32,8 @@ contract DummyERC20Token is
uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000; uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;
constructor ( constructor (
string _name, string memory _name,
string _symbol, string memory _symbol,
uint256 _decimals, uint256 _decimals,
uint256 _totalSupply uint256 _totalSupply
) )

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.4.24; pragma solidity ^0.5.5;
import "./DummyERC20Token.sol"; import "./DummyERC20Token.sol";
@ -26,8 +26,8 @@ contract DummyMultipleReturnERC20Token is
DummyERC20Token DummyERC20Token
{ {
constructor ( constructor (
string _name, string memory _name,
string _symbol, string memory _symbol,
uint256 _decimals, uint256 _decimals,
uint256 _totalSupply uint256 _totalSupply
) )

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.4.24; pragma solidity ^0.5.5;
import "./DummyERC20Token.sol"; import "./DummyERC20Token.sol";
@ -26,8 +26,8 @@ contract DummyNoReturnERC20Token is
DummyERC20Token DummyERC20Token
{ {
constructor ( constructor (
string _name, string memory _name,
string _symbol, string memory _symbol,
uint256 _decimals, uint256 _decimals,
uint256 _totalSupply uint256 _totalSupply
) )

View File

@ -33,7 +33,7 @@
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
}, },
"config": { "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." "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
}, },
"repository": { "repository": {
@ -68,8 +68,8 @@
}, },
"dependencies": { "dependencies": {
"@0x/base-contract": "^5.0.2", "@0x/base-contract": "^5.0.2",
"@0x/contracts-exchange-libs": "1.0.2", "@0x/contracts-exchange-libs": "^1.1.3",
"@0x/contracts-utils": "2.0.1", "@0x/contracts-utils": "^2.0.8",
"@0x/types": "^2.1.1", "@0x/types": "^2.1.1",
"@0x/typescript-typings": "^4.1.0", "@0x/typescript-typings": "^4.1.0",
"@0x/utils": "^4.2.2", "@0x/utils": "^4.2.2",

View File

@ -12,7 +12,6 @@ import * as ERC20Token from '../generated-artifacts/ERC20Token.json';
import * as IERC20Token from '../generated-artifacts/IERC20Token.json'; import * as IERC20Token from '../generated-artifacts/IERC20Token.json';
import * as IEtherToken from '../generated-artifacts/IEtherToken.json'; import * as IEtherToken from '../generated-artifacts/IEtherToken.json';
import * as MintableERC20Token from '../generated-artifacts/MintableERC20Token.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 UnlimitedAllowanceERC20Token from '../generated-artifacts/UnlimitedAllowanceERC20Token.json';
import * as WETH9 from '../generated-artifacts/WETH9.json'; import * as WETH9 from '../generated-artifacts/WETH9.json';
import * as ZRXToken from '../generated-artifacts/ZRXToken.json'; import * as ZRXToken from '../generated-artifacts/ZRXToken.json';
@ -27,5 +26,4 @@ export const artifacts = {
DummyERC20Token: DummyERC20Token as ContractArtifact, DummyERC20Token: DummyERC20Token as ContractArtifact,
DummyMultipleReturnERC20Token: DummyMultipleReturnERC20Token as ContractArtifact, DummyMultipleReturnERC20Token: DummyMultipleReturnERC20Token as ContractArtifact,
DummyNoReturnERC20Token: DummyNoReturnERC20Token as ContractArtifact, DummyNoReturnERC20Token: DummyNoReturnERC20Token as ContractArtifact,
ReentrantERC20Token: ReentrantERC20Token as ContractArtifact,
}; };

View File

@ -10,7 +10,6 @@ export * from '../generated-wrappers/erc20_token';
export * from '../generated-wrappers/i_erc20_token'; export * from '../generated-wrappers/i_erc20_token';
export * from '../generated-wrappers/i_ether_token'; export * from '../generated-wrappers/i_ether_token';
export * from '../generated-wrappers/mintable_erc20_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/unlimited_allowance_erc20_token';
export * from '../generated-wrappers/weth9'; export * from '../generated-wrappers/weth9';
export * from '../generated-wrappers/zrx_token'; export * from '../generated-wrappers/zrx_token';

View File

@ -10,7 +10,6 @@
"generated-artifacts/IERC20Token.json", "generated-artifacts/IERC20Token.json",
"generated-artifacts/IEtherToken.json", "generated-artifacts/IEtherToken.json",
"generated-artifacts/MintableERC20Token.json", "generated-artifacts/MintableERC20Token.json",
"generated-artifacts/ReentrantERC20Token.json",
"generated-artifacts/UnlimitedAllowanceERC20Token.json", "generated-artifacts/UnlimitedAllowanceERC20Token.json",
"generated-artifacts/WETH9.json", "generated-artifacts/WETH9.json",
"generated-artifacts/ZRXToken.json" "generated-artifacts/ZRXToken.json"

View File

@ -1,10 +1,14 @@
[ [
{ {
"version": "1.0.10", "version": "2.0.0",
"changes": [ "changes": [
{ {
"note": "Set evmVersion to byzantium", "note": "Set evmVersion to byzantium",
"pr": 1678 "pr": 1678
},
{
"note": "Upgrade contracts to Solidity 0.5.5",
"pr": 1682
} }
] ]
}, },

View File

@ -5,7 +5,11 @@
"isOfflineMode": false, "isOfflineMode": false,
"compilerSettings": { "compilerSettings": {
"evmVersion": "byzantium", "evmVersion": "byzantium",
"optimizer": { "enabled": true, "runs": 1000000 }, "optimizer": {
"enabled": true,
"runs": 1000000,
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": { "outputSelection": {
"*": { "*": {
"*": [ "*": [

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
import "./interfaces/IERC721Token.sol"; import "./interfaces/IERC721Token.sol";
import "./interfaces/IERC721Receiver.sol"; import "./interfaces/IERC721Receiver.sol";
@ -59,7 +59,7 @@ contract ERC721Token is
address _from, address _from,
address _to, address _to,
uint256 _tokenId, uint256 _tokenId,
bytes _data bytes calldata _data
) )
external external
{ {

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
import "./ERC721Token.sol"; import "./ERC721Token.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
contract IERC721Receiver { contract IERC721Receiver {
@ -37,7 +37,7 @@ contract IERC721Receiver {
address _operator, address _operator,
address _from, address _from,
uint256 _tokenId, uint256 _tokenId,
bytes _data bytes calldata _data
) )
external external
returns (bytes4); returns (bytes4);

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
contract IERC721Token { contract IERC721Token {
@ -66,7 +66,7 @@ contract IERC721Token {
address _from, address _from,
address _to, address _to,
uint256 _tokenId, uint256 _tokenId,
bytes _data bytes calldata _data
) )
external; external;

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.4.24; pragma solidity ^0.5.5;
import "../src/interfaces/IERC721Receiver.sol"; import "../src/interfaces/IERC721Receiver.sol";
@ -51,7 +51,7 @@ contract DummyERC721Receiver is
address _operator, address _operator,
address _from, address _from,
uint256 _tokenId, uint256 _tokenId,
bytes _data bytes calldata _data
) )
external external
returns (bytes4) returns (bytes4)

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.4.24; pragma solidity ^0.5.5;
import "../src/MintableERC721Token.sol"; import "../src/MintableERC721Token.sol";
import "@0x/contracts-utils/contracts/src/Ownable.sol"; import "@0x/contracts-utils/contracts/src/Ownable.sol";
@ -31,8 +31,8 @@ contract DummyERC721Token is
string public symbol; string public symbol;
constructor ( constructor (
string _name, string memory _name,
string _symbol string memory _symbol
) )
public public
{ {

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.4.24; pragma solidity ^0.5.5;
import "../src/interfaces/IERC721Receiver.sol"; import "../src/interfaces/IERC721Receiver.sol";
@ -50,7 +50,7 @@ contract InvalidERC721Receiver is
address _operator, address _operator,
address _from, address _from,
uint256 _tokenId, uint256 _tokenId,
bytes _data bytes calldata _data
) )
external external
returns (bytes4) returns (bytes4)

View File

@ -68,7 +68,7 @@
}, },
"dependencies": { "dependencies": {
"@0x/base-contract": "^5.0.2", "@0x/base-contract": "^5.0.2",
"@0x/contracts-utils": "2.0.1", "@0x/contracts-utils": "^2.0.8",
"@0x/types": "^2.1.1", "@0x/types": "^2.1.1",
"@0x/typescript-typings": "^4.1.0", "@0x/typescript-typings": "^4.1.0",
"@0x/utils": "^4.2.2", "@0x/utils": "^4.2.2",

View File

@ -1,10 +1,14 @@
[ [
{ {
"version": "1.0.10", "version": "2.0.0",
"changes": [ "changes": [
{ {
"note": "Set evmVersion to byzantium", "note": "Set evmVersion to byzantium",
"pr": 1678 "pr": 1678
},
{
"note": "Do not reexport external dependencies",
"pr": 1682
} }
] ]
}, },

View File

@ -5,7 +5,11 @@
"isOfflineMode": false, "isOfflineMode": false,
"compilerSettings": { "compilerSettings": {
"evmVersion": "byzantium", "evmVersion": "byzantium",
"optimizer": { "enabled": true, "runs": 1000000 }, "optimizer": {
"enabled": true,
"runs": 1000000,
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": { "outputSelection": {
"*": { "*": {
"*": [ "*": [
@ -18,11 +22,5 @@
} }
} }
}, },
"contracts": [ "contracts": ["src/Forwarder.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/src/Exchange.sol",
"src/Forwarder.sol"
]
} }

View File

@ -33,7 +33,7 @@
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
}, },
"config": { "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." "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
}, },
"repository": { "repository": {
@ -70,8 +70,8 @@
"dependencies": { "dependencies": {
"@0x/base-contract": "^5.0.2", "@0x/base-contract": "^5.0.2",
"@0x/contracts-asset-proxy": "^1.0.9", "@0x/contracts-asset-proxy": "^1.0.9",
"@0x/contracts-erc20": "^1.0.9", "@0x/contracts-erc20": "1.0.8",
"@0x/contracts-erc721": "^1.0.9", "@0x/contracts-erc721": "1.0.8",
"@0x/contracts-exchange": "1.0.2", "@0x/contracts-exchange": "1.0.2",
"@0x/contracts-exchange-libs": "1.0.2", "@0x/contracts-exchange-libs": "1.0.2",
"@0x/contracts-utils": "2.0.1", "@0x/contracts-utils": "2.0.1",

View File

@ -5,15 +5,5 @@
*/ */
import { ContractArtifact } from 'ethereum-types'; 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 Forwarder from '../generated-artifacts/Forwarder.json';
import * as WETH9 from '../generated-artifacts/WETH9.json'; export const artifacts = { Forwarder: Forwarder as ContractArtifact };
export const artifacts = {
WETH9: WETH9 as ContractArtifact,
DummyERC20Token: DummyERC20Token as ContractArtifact,
DummyERC721Token: DummyERC721Token as ContractArtifact,
Exchange: Exchange as ContractArtifact,
Forwarder: Forwarder as ContractArtifact,
};

View File

@ -3,8 +3,4 @@
* Warning: This file is auto-generated by contracts-gen. Don't edit manually. * 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/forwarder';
export * from '../generated-wrappers/weth9';

View File

@ -1,10 +1,7 @@
import { import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy';
DummyERC20TokenContract, import { artifacts as erc20Artifacts, DummyERC20TokenContract, WETH9Contract } from '@0x/contracts-erc20';
DummyERC721TokenContract, import { DummyERC721TokenContract } from '@0x/contracts-erc721';
ERC20Wrapper, import { artifacts as exchangeArtifacts, ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange';
ERC721Wrapper,
} from '@0x/contracts-asset-proxy';
import { ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange';
import { import {
chaiSetup, chaiSetup,
constants, constants,
@ -26,7 +23,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai'; import * as chai from 'chai';
import { TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import { TransactionReceiptWithDecodedLogs } from 'ethereum-types';
import { artifacts, ForwarderContract, ForwarderWrapper, WETH9Contract } from '../src'; import { artifacts, ForwarderContract, ForwarderWrapper } from '../src';
chaiSetup.configure(); chaiSetup.configure();
const expect = chai.expect; const expect = chai.expect;
@ -91,14 +88,14 @@ describe(ContractName.Forwarder, () => {
const erc721Balances = await erc721Wrapper.getBalancesAsync(); const erc721Balances = await erc721Wrapper.getBalancesAsync();
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address]; 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); weth = new DummyERC20TokenContract(wethContract.abi, wethContract.address, provider);
erc20Wrapper.addDummyTokenContract(weth); erc20Wrapper.addDummyTokenContract(weth);
wethAssetData = assetDataUtils.encodeERC20AssetData(wethContract.address); wethAssetData = assetDataUtils.encodeERC20AssetData(wethContract.address);
zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address); zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address);
const exchangeInstance = await ExchangeContract.deployFrom0xArtifactAsync( const exchangeInstance = await ExchangeContract.deployFrom0xArtifactAsync(
artifacts.Exchange, exchangeArtifacts.Exchange,
provider, provider,
txDefaults, txDefaults,
zrxAssetData, zrxAssetData,
@ -169,7 +166,7 @@ describe(ContractName.Forwarder, () => {
describe('constructor', () => { describe('constructor', () => {
it('should revert if assetProxy is unregistered', async () => { it('should revert if assetProxy is unregistered', async () => {
const exchangeInstance = await ExchangeContract.deployFrom0xArtifactAsync( const exchangeInstance = await ExchangeContract.deployFrom0xArtifactAsync(
artifacts.Exchange, exchangeArtifacts.Exchange,
provider, provider,
txDefaults, txDefaults,
zrxAssetData, zrxAssetData,

View File

@ -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 { constants, formatters, LogDecoder, MarketSellOrders, Web3ProviderEngine } from '@0x/contracts-test-utils';
import { SignedOrder } from '@0x/types'; import { SignedOrder } from '@0x/types';
import { BigNumber } from '@0x/utils'; import { BigNumber } from '@0x/utils';
@ -58,7 +61,12 @@ export class ForwarderWrapper {
constructor(contractInstance: ForwarderContract, provider: Web3ProviderEngine) { constructor(contractInstance: ForwarderContract, provider: Web3ProviderEngine) {
this._forwarderContract = contractInstance; this._forwarderContract = contractInstance;
this._web3Wrapper = new Web3Wrapper(provider); 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( public async marketSellOrdersWithEthAsync(
orders: SignedOrder[], orders: SignedOrder[],

View File

@ -2,12 +2,6 @@
"extends": "../../tsconfig", "extends": "../../tsconfig",
"compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true },
"include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"],
"files": [ "files": ["generated-artifacts/Forwarder.json"],
"generated-artifacts/DummyERC20Token.json",
"generated-artifacts/DummyERC721Token.json",
"generated-artifacts/Exchange.json",
"generated-artifacts/Forwarder.json",
"generated-artifacts/WETH9.json"
],
"exclude": ["./deploy/solc/solc_bin"] "exclude": ["./deploy/solc/solc_bin"]
} }

View File

@ -1,10 +1,14 @@
[ [
{ {
"version": "1.1.4", "version": "2.0.0",
"changes": [ "changes": [
{ {
"note": "Set evmVersion to byzantium", "note": "Set evmVersion to byzantium",
"pr": 1678 "pr": 1678
},
{
"note": "Upgrade contracts to Solidity 0.5.5",
"pr": 1682
} }
] ]
}, },

View File

@ -5,7 +5,11 @@
"isOfflineMode": false, "isOfflineMode": false,
"compilerSettings": { "compilerSettings": {
"evmVersion": "byzantium", "evmVersion": "byzantium",
"optimizer": { "enabled": true, "runs": 1000000 }, "optimizer": {
"enabled": true,
"runs": 1000000,
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": { "outputSelection": {
"*": { "*": {
"*": [ "*": [

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "./LibOrder.sol"; import "./LibOrder.sol";

View File

@ -17,7 +17,7 @@
*/ */
// solhint-disable // solhint-disable
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
/// @dev This contract documents the revert reasons used in the AssetProxy contracts. /// @dev This contract documents the revert reasons used in the AssetProxy contracts.

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
// solhint-disable max-line-length // solhint-disable max-line-length

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
contract LibEIP712 { contract LibEIP712 {

View File

@ -17,7 +17,7 @@
*/ */
// solhint-disable // solhint-disable
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
/// @dev This contract documents the revert reasons used in the Exchange contract. /// @dev This contract documents the revert reasons used in the Exchange contract.

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
contract LibExchangeSelectors { contract LibExchangeSelectors {

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/SafeMath.sol"; import "@0x/contracts-utils/contracts/src/SafeMath.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/SafeMath.sol"; import "@0x/contracts-utils/contracts/src/SafeMath.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.5.3; pragma solidity ^0.5.5;
import "./LibEIP712.sol"; import "./LibEIP712.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.5.3; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "../src/LibMath.sol"; import "../src/LibMath.sol";

View File

@ -1,10 +1,18 @@
[ [
{ {
"version": "1.0.10", "version": "2.0.0",
"changes": [ "changes": [
{ {
"note": "Set evmVersion to byzantium", "note": "Set evmVersion to byzantium",
"pr": 1678 "pr": 1678
},
{
"note": "Do not reexport external dependencies",
"pr": 1682
},
{
"note": "Upgrade contracts to Solidity 0.5.5",
"pr": 1682
} }
] ]
}, },

View File

@ -5,7 +5,11 @@
"isOfflineMode": false, "isOfflineMode": false,
"compilerSettings": { "compilerSettings": {
"evmVersion": "byzantium", "evmVersion": "byzantium",
"optimizer": { "enabled": true, "runs": 1000000 }, "optimizer": {
"enabled": true,
"runs": 1000000,
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": { "outputSelection": {
"*": { "*": {
"*": [ "*": [
@ -19,14 +23,6 @@
} }
}, },
"contracts": [ "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/ExchangeWrapper.sol",
"examples/Validator.sol", "examples/Validator.sol",
"examples/Wallet.sol", "examples/Wallet.sol",
@ -41,6 +37,7 @@
"src/interfaces/IValidator.sol", "src/interfaces/IValidator.sol",
"src/interfaces/IWallet.sol", "src/interfaces/IWallet.sol",
"src/interfaces/IWrapperFunctions.sol", "src/interfaces/IWrapperFunctions.sol",
"test/ReentrantERC20Token.sol",
"test/TestAssetProxyDispatcher.sol", "test/TestAssetProxyDispatcher.sol",
"test/TestExchangeInternals.sol", "test/TestExchangeInternals.sol",
"test/TestSignatureValidator.sol", "test/TestSignatureValidator.sol",

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "../src/interfaces/IExchange.sol"; import "../src/interfaces/IExchange.sol";
@ -43,7 +43,7 @@ contract ExchangeWrapper {
function cancelOrdersUpTo( function cancelOrdersUpTo(
uint256 targetOrderEpoch, uint256 targetOrderEpoch,
uint256 salt, uint256 salt,
bytes makerSignature bytes calldata makerSignature
) )
external external
{ {

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.4.24; pragma solidity ^0.5.5;
import "../src/interfaces/IValidator.sol"; import "../src/interfaces/IValidator.sol";
@ -44,7 +44,7 @@ contract Validator is
function isValidSignature( function isValidSignature(
bytes32 hash, bytes32 hash,
address signerAddress, address signerAddress,
bytes signature bytes calldata signature
) )
external external
view view

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.4.24; pragma solidity ^0.5.5;
import "../src/interfaces/IWallet.sol"; import "../src/interfaces/IWallet.sol";
import "@0x/contracts-utils/contracts/src/LibBytes.sol"; import "@0x/contracts-utils/contracts/src/LibBytes.sol";
@ -44,7 +44,7 @@ contract Wallet is
/// @return Validity of signature. /// @return Validity of signature.
function isValidSignature( function isValidSignature(
bytes32 hash, bytes32 hash,
bytes eip712Signature bytes calldata eip712Signature
) )
external external
view view

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "../src/interfaces/IExchange.sol"; import "../src/interfaces/IExchange.sol";
@ -69,7 +69,7 @@ contract Whitelist is
function isValidSignature( function isValidSignature(
bytes32 hash, bytes32 hash,
address signerAddress, address signerAddress,
bytes signature bytes calldata signature
) )
external external
view view

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.4.24; pragma solidity 0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibConstants.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibConstants.sol";
@ -37,7 +37,7 @@ contract Exchange is
MixinAssetProxyDispatcher, MixinAssetProxyDispatcher,
MixinWrapperFunctions 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 // Mixins are instantiated in the order they are inherited
constructor (bytes memory _zrxAssetData) constructor (bytes memory _zrxAssetData)

View File

@ -16,11 +16,11 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/Ownable.sol"; import "@0x/contracts-utils/contracts/src/Ownable.sol";
import "./mixins/MAssetProxyDispatcher.sol"; import "./mixins/MAssetProxyDispatcher.sol";
import "@0x/contracts-asset-proxy/contracts/src/interfaces/IAssetProxy.sol"; import "./interfaces/IAssetProxy.sol";
contract MixinAssetProxyDispatcher is contract MixinAssetProxyDispatcher is
@ -28,7 +28,7 @@ contract MixinAssetProxyDispatcher is
MAssetProxyDispatcher MAssetProxyDispatcher
{ {
// Mapping from Asset Proxy Id's to their respective Asset Proxy // 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. /// @dev Registers an asset proxy to its asset proxy id.
/// Once an asset proxy is registered, it cannot be unregistered. /// Once an asset proxy is registered, it cannot be unregistered.
@ -37,10 +37,8 @@ contract MixinAssetProxyDispatcher is
external external
onlyOwner onlyOwner
{ {
IAssetProxy assetProxyContract = IAssetProxy(assetProxy);
// Ensure that no asset proxy exists with current id. // Ensure that no asset proxy exists with current id.
bytes4 assetProxyId = assetProxyContract.getProxyId(); bytes4 assetProxyId = IAssetProxy(assetProxy).getProxyId();
address currentAssetProxy = assetProxies[assetProxyId]; address currentAssetProxy = assetProxies[assetProxyId];
require( require(
currentAssetProxy == address(0), currentAssetProxy == address(0),
@ -48,7 +46,7 @@ contract MixinAssetProxyDispatcher is
); );
// Add asset proxy and log registration. // Add asset proxy and log registration.
assetProxies[assetProxyId] = assetProxyContract; assetProxies[assetProxyId] = assetProxy;
emit AssetProxyRegistered( emit AssetProxyRegistered(
assetProxyId, assetProxyId,
assetProxy assetProxy

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol"; import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol";

View File

@ -11,7 +11,7 @@
limitations under the License. limitations under the License.
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol"; import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol";

View File

@ -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/LibBytes.sol";
import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol"; import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol";
@ -46,7 +46,7 @@ contract MixinSignatureValidator is
function preSign( function preSign(
bytes32 hash, bytes32 hash,
address signerAddress, address signerAddress,
bytes signature bytes calldata signature
) )
external external
{ {
@ -233,7 +233,7 @@ contract MixinSignatureValidator is
function isValidWalletSignature( function isValidWalletSignature(
bytes32 hash, bytes32 hash,
address walletAddress, address walletAddress,
bytes signature bytes memory signature
) )
internal internal
view view
@ -282,7 +282,7 @@ contract MixinSignatureValidator is
address validatorAddress, address validatorAddress,
bytes32 hash, bytes32 hash,
address signerAddress, address signerAddress,
bytes signature bytes memory signature
) )
internal internal
view view

View File

@ -15,7 +15,8 @@
limitations under the License. limitations under the License.
*/ */
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "@0x/contracts-exchange-libs/contracts/src/LibExchangeErrors.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibExchangeErrors.sol";
import "./mixins/MSignatureValidator.sol"; import "./mixins/MSignatureValidator.sol";
@ -43,8 +44,8 @@ contract MixinTransactions is
function executeTransaction( function executeTransaction(
uint256 salt, uint256 salt,
address signerAddress, address signerAddress,
bytes data, bytes calldata data,
bytes signature bytes calldata signature
) )
external external
{ {
@ -84,8 +85,9 @@ contract MixinTransactions is
// Execute transaction // Execute transaction
transactions[transactionHash] = true; transactions[transactionHash] = true;
(bool success,) = address(this).delegatecall(data);
require( require(
address(this).delegatecall(data), success,
"FAILED_EXECUTION" "FAILED_EXECUTION"
); );

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol"; import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol";

View File

@ -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);
}

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
contract IAssetProxyDispatcher { contract IAssetProxyDispatcher {

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "./IExchangeCore.sol"; import "./IExchangeCore.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";

View File

@ -15,7 +15,8 @@
limitations under the License. limitations under the License.
*/ */
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
contract ISignatureValidator { contract ISignatureValidator {
@ -28,7 +28,7 @@ contract ISignatureValidator {
function preSign( function preSign(
bytes32 hash, bytes32 hash,
address signerAddress, address signerAddress,
bytes signature bytes calldata signature
) )
external; external;

View File

@ -15,7 +15,8 @@
limitations under the License. limitations under the License.
*/ */
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
contract ITransactions { contract ITransactions {
@ -28,8 +29,8 @@ contract ITransactions {
function executeTransaction( function executeTransaction(
uint256 salt, uint256 salt,
address signerAddress, address signerAddress,
bytes data, bytes calldata data,
bytes signature bytes calldata signature
) )
external; external;
} }

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
contract IValidator { contract IValidator {
@ -29,7 +29,7 @@ contract IValidator {
function isValidSignature( function isValidSignature(
bytes32 hash, bytes32 hash,
address signerAddress, address signerAddress,
bytes signature bytes calldata signature
) )
external external
view view

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
contract IWallet { contract IWallet {
@ -27,7 +27,7 @@ contract IWallet {
/// @return Validity of order signature. /// @return Validity of order signature.
function isValidSignature( function isValidSignature(
bytes32 hash, bytes32 hash,
bytes signature bytes calldata signature
) )
external external
view view

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
import "../interfaces/IAssetProxyDispatcher.sol"; import "../interfaces/IAssetProxyDispatcher.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";

View File

@ -15,7 +15,8 @@
limitations under the License. limitations under the License.
*/ */
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";

Some files were not shown because too many files have changed in this diff Show More