Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
abandeali1 committed Mar 8, 2019
1 parent 2f7dd17 commit 4555310
Show file tree
Hide file tree
Showing 35 changed files with 54 additions and 147 deletions.
7 changes: 1 addition & 6 deletions contracts/asset-proxy/compiler.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
"*": {
Expand Down
5 changes: 0 additions & 5 deletions contracts/asset-proxy/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 1 addition & 6 deletions contracts/coordinator/compiler.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
"*": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*/

pragma solidity 0.5.3;
pragma experimental ABIEncoderV2;
pragma solidity 0.5.5;

import "./MixinCoordinatorRegistryCore.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*/

pragma solidity 0.5.3;
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.5;

import "./interfaces/ICoordinatorRegistryCore.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*/

pragma solidity 0.5.3;
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.5;


// solhint-disable no-empty-blocks
Expand Down
7 changes: 1 addition & 6 deletions contracts/erc20/compiler.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
"*": {
Expand Down
2 changes: 1 addition & 1 deletion contracts/erc20/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 0 additions & 1 deletion contracts/erc20/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 1 addition & 6 deletions contracts/erc721/compiler.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
"*": {
Expand Down
7 changes: 1 addition & 6 deletions contracts/exchange-forwarder/compiler.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
"*": {
Expand Down
2 changes: 1 addition & 1 deletion contracts/exchange-forwarder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 1 addition & 3 deletions contracts/exchange-forwarder/src/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
8 changes: 1 addition & 7 deletions contracts/exchange-forwarder/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
7 changes: 1 addition & 6 deletions contracts/exchange-libs/compiler.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
"*": {
Expand Down
11 changes: 3 additions & 8 deletions contracts/exchange/compiler.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
"*": {
Expand Down Expand Up @@ -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"
]
}
2 changes: 1 addition & 1 deletion contracts/exchange/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
16 changes: 1 addition & 15 deletions contracts/exchange/src/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand All @@ -58,4 +43,5 @@ export const artifacts = {
TestExchangeInternals: TestExchangeInternals as ContractArtifact,
TestSignatureValidator: TestSignatureValidator as ContractArtifact,
TestStaticCallReceiver: TestStaticCallReceiver as ContractArtifact,
ReentrantERC20Token: ReentrantERC20Token as ContractArtifact,
};
7 changes: 0 additions & 7 deletions contracts/exchange/src/wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down
6 changes: 4 additions & 2 deletions contracts/exchange/test/core.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import {
artifacts as proxyArtifacts,
ERC20ProxyContract,
ERC20Wrapper,
ERC721ProxyContract,
ERC721Wrapper,
MultiAssetProxyContract,
} from '@0x/contracts-asset-proxy';
import {
artifacts as erc20Artifacts,
DummyERC20TokenContract,
DummyERC20TokenTransferEventArgs,
DummyNoReturnERC20TokenContract,
Expand Down Expand Up @@ -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,
);
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 8 additions & 2 deletions contracts/exchange/test/dispatcher.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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,
);
Expand Down
4 changes: 3 additions & 1 deletion contracts/exchange/test/utils/exchange_wrapper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { artifacts as erc20Artifacts } from '@0x/contracts-erc20';
import { artifacts as erc721Artifacts } from '@0x/contracts-erc721';
import {
FillResults,
formatters,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 0 additions & 7 deletions contracts/exchange/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
Loading

0 comments on commit 4555310

Please sign in to comment.