aboutsummaryrefslogtreecommitdiffstats
path: root/contracts/asset-proxy
diff options
context:
space:
mode:
Diffstat (limited to 'contracts/asset-proxy')
-rw-r--r--contracts/asset-proxy/compiler.json24
-rw-r--r--contracts/asset-proxy/package.json5
-rw-r--r--contracts/asset-proxy/src/artifacts.ts29
-rw-r--r--contracts/asset-proxy/src/artifacts/index.ts19
-rw-r--r--contracts/asset-proxy/src/wrappers.ts13
-rw-r--r--contracts/asset-proxy/src/wrappers/index.ts7
-rw-r--r--contracts/asset-proxy/test/proxies.ts28
-rw-r--r--contracts/asset-proxy/test/utils/erc20_wrapper.ts6
-rw-r--r--contracts/asset-proxy/test/utils/erc721_wrapper.ts6
-rw-r--r--contracts/asset-proxy/tsconfig.json25
10 files changed, 87 insertions, 75 deletions
diff --git a/contracts/asset-proxy/compiler.json b/contracts/asset-proxy/compiler.json
index 70d4c6b20..aab143bad 100644
--- a/contracts/asset-proxy/compiler.json
+++ b/contracts/asset-proxy/compiler.json
@@ -3,10 +3,7 @@
"contractsDir": "./contracts",
"useDockerisedSolc": true,
"compilerSettings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
+ "optimizer": { "enabled": true, "runs": 1000000 },
"outputSelection": {
"*": {
"*": [
@@ -20,12 +17,17 @@
}
},
"contracts": [
- "IAssetData",
- "IAssetProxy",
- "IAuthorizable",
- "ERC20Proxy",
- "ERC721Proxy",
- "MixinAuthorizable",
- "MultiAssetProxy"
+ "@0x/contracts-erc20/contracts/test/DummyERC20Token.sol",
+ "@0x/contracts-erc20/contracts/test/DummyMultipleReturnERC20Token.sol",
+ "@0x/contracts-erc20/contracts/test/DummyNoReturnERC20Token.sol",
+ "@0x/contracts-erc721/contracts/test/DummyERC721Receiver.sol",
+ "@0x/contracts-erc721/contracts/test/DummyERC721Token.sol",
+ "src/ERC20Proxy.sol",
+ "src/ERC721Proxy.sol",
+ "src/MixinAuthorizable.sol",
+ "src/MultiAssetProxy.sol",
+ "src/interfaces/IAssetData.sol",
+ "src/interfaces/IAssetProxy.sol",
+ "src/interfaces/IAuthorizable.sol"
]
}
diff --git a/contracts/asset-proxy/package.json b/contracts/asset-proxy/package.json
index 360fdab75..ce686b7ef 100644
--- a/contracts/asset-proxy/package.json
+++ b/contracts/asset-proxy/package.json
@@ -29,10 +29,12 @@
"profiler:report:html": "istanbul report html && open coverage/index.html",
"coverage:report:lcov": "istanbul report lcov",
"test:circleci": "yarn test",
+ "contracts:gen": "contracts-gen",
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
},
"config": {
- "abis": "generated-artifacts/@(ERC20Proxy|ERC721Proxy|IAssetData|IAssetProxy|IAuthorizable|MixinAuthorizable|MultiAssetProxy).json"
+ "abis": "./generated-artifacts/@(DummyERC20Token|DummyERC721Receiver|DummyERC721Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|ERC20Proxy|ERC721Proxy|IAssetData|IAssetProxy|IAuthorizable|MixinAuthorizable|MultiAssetProxy).json",
+ "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
},
"repository": {
"type": "git",
@@ -48,6 +50,7 @@
"@0x/dev-utils": "^1.0.24",
"@0x/sol-compiler": "^2.0.2",
"@0x/tslint-config": "^2.0.2",
+ "@0x/contracts-gen": "^1.0.0",
"@types/lodash": "4.14.104",
"@types/node": "*",
"chai": "^4.0.1",
diff --git a/contracts/asset-proxy/src/artifacts.ts b/contracts/asset-proxy/src/artifacts.ts
new file mode 100644
index 000000000..87b80d075
--- /dev/null
+++ b/contracts/asset-proxy/src/artifacts.ts
@@ -0,0 +1,29 @@
+// This file is auto-generated by contracts-gen. Don't edit manually.
+import { ContractArtifact } from 'ethereum-types';
+
+import * as DummyERC20Token from '../generated-artifacts/DummyERC20Token.json';
+import * as DummyERC721Receiver from '../generated-artifacts/DummyERC721Receiver.json';
+import * as DummyERC721Token from '../generated-artifacts/DummyERC721Token.json';
+import * as DummyMultipleReturnERC20Token from '../generated-artifacts/DummyMultipleReturnERC20Token.json';
+import * as DummyNoReturnERC20Token from '../generated-artifacts/DummyNoReturnERC20Token.json';
+import * as ERC20Proxy from '../generated-artifacts/ERC20Proxy.json';
+import * as ERC721Proxy from '../generated-artifacts/ERC721Proxy.json';
+import * as IAssetData from '../generated-artifacts/IAssetData.json';
+import * as IAssetProxy from '../generated-artifacts/IAssetProxy.json';
+import * as IAuthorizable from '../generated-artifacts/IAuthorizable.json';
+import * as MixinAuthorizable from '../generated-artifacts/MixinAuthorizable.json';
+import * as MultiAssetProxy from '../generated-artifacts/MultiAssetProxy.json';
+export const artifacts = {
+ DummyERC20Token: DummyERC20Token as ContractArtifact,
+ DummyMultipleReturnERC20Token: DummyMultipleReturnERC20Token as ContractArtifact,
+ DummyNoReturnERC20Token: DummyNoReturnERC20Token as ContractArtifact,
+ DummyERC721Receiver: DummyERC721Receiver as ContractArtifact,
+ DummyERC721Token: DummyERC721Token as ContractArtifact,
+ ERC20Proxy: ERC20Proxy as ContractArtifact,
+ ERC721Proxy: ERC721Proxy as ContractArtifact,
+ MixinAuthorizable: MixinAuthorizable as ContractArtifact,
+ MultiAssetProxy: MultiAssetProxy as ContractArtifact,
+ IAssetData: IAssetData as ContractArtifact,
+ IAssetProxy: IAssetProxy as ContractArtifact,
+ IAuthorizable: IAuthorizable as ContractArtifact,
+};
diff --git a/contracts/asset-proxy/src/artifacts/index.ts b/contracts/asset-proxy/src/artifacts/index.ts
deleted file mode 100644
index 7f3060815..000000000
--- a/contracts/asset-proxy/src/artifacts/index.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { ContractArtifact } from 'ethereum-types';
-
-import * as ERC20Proxy from '../../generated-artifacts/ERC20Proxy.json';
-import * as ERC721Proxy from '../../generated-artifacts/ERC721Proxy.json';
-import * as IAssetData from '../../generated-artifacts/IAssetData.json';
-import * as IAssetProxy from '../../generated-artifacts/IAssetProxy.json';
-import * as IAuthorizable from '../../generated-artifacts/IAuthorizable.json';
-import * as MixinAuthorizable from '../../generated-artifacts/MixinAuthorizable.json';
-import * as MultiAssetProxy from '../../generated-artifacts/MultiAssetProxy.json';
-
-export const artifacts = {
- IAuthorizable: IAuthorizable as ContractArtifact,
- IAssetData: IAssetData as ContractArtifact,
- IAssetProxy: IAssetProxy as ContractArtifact,
- ERC20Proxy: ERC20Proxy as ContractArtifact,
- ERC721Proxy: ERC721Proxy as ContractArtifact,
- MixinAuthorizable: MixinAuthorizable as ContractArtifact,
- MultiAssetProxy: MultiAssetProxy as ContractArtifact,
-};
diff --git a/contracts/asset-proxy/src/wrappers.ts b/contracts/asset-proxy/src/wrappers.ts
new file mode 100644
index 000000000..4bff2f423
--- /dev/null
+++ b/contracts/asset-proxy/src/wrappers.ts
@@ -0,0 +1,13 @@
+// This file is auto-generated by contracts-gen. Don't edit manually.
+export * from '../generated-wrappers/dummy_erc20_token';
+export * from '../generated-wrappers/dummy_erc721_receiver';
+export * from '../generated-wrappers/dummy_erc721_token';
+export * from '../generated-wrappers/dummy_multiple_return_erc20_token';
+export * from '../generated-wrappers/dummy_no_return_erc20_token';
+export * from '../generated-wrappers/erc20_proxy';
+export * from '../generated-wrappers/erc721_proxy';
+export * from '../generated-wrappers/i_asset_data';
+export * from '../generated-wrappers/i_asset_proxy';
+export * from '../generated-wrappers/i_authorizable';
+export * from '../generated-wrappers/mixin_authorizable';
+export * from '../generated-wrappers/multi_asset_proxy';
diff --git a/contracts/asset-proxy/src/wrappers/index.ts b/contracts/asset-proxy/src/wrappers/index.ts
deleted file mode 100644
index 6aecbc086..000000000
--- a/contracts/asset-proxy/src/wrappers/index.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export * from '../../generated-wrappers/i_asset_data';
-export * from '../../generated-wrappers/i_asset_proxy';
-export * from '../../generated-wrappers/erc20_proxy';
-export * from '../../generated-wrappers/erc721_proxy';
-export * from '../../generated-wrappers/mixin_authorizable';
-export * from '../../generated-wrappers/multi_asset_proxy';
-export * from '../../generated-wrappers/i_authorizable';
diff --git a/contracts/asset-proxy/test/proxies.ts b/contracts/asset-proxy/test/proxies.ts
index 797787135..c2f9653aa 100644
--- a/contracts/asset-proxy/test/proxies.ts
+++ b/contracts/asset-proxy/test/proxies.ts
@@ -1,16 +1,4 @@
import {
- artifacts as erc20Artifacts,
- DummyERC20TokenContract,
- DummyERC20TokenTransferEventArgs,
- DummyMultipleReturnERC20TokenContract,
- DummyNoReturnERC20TokenContract,
-} from '@0x/contracts-erc20';
-import {
- artifacts as erc721Artifacts,
- DummyERC721ReceiverContract,
- DummyERC721TokenContract,
-} from '@0x/contracts-erc721';
-import {
chaiSetup,
constants,
expectTransactionFailedAsync,
@@ -30,6 +18,12 @@ import * as _ from 'lodash';
import {
artifacts,
+ DummyERC20TokenContract,
+ DummyERC20TokenTransferEventArgs,
+ DummyERC721ReceiverContract,
+ DummyERC721TokenContract,
+ DummyMultipleReturnERC20TokenContract,
+ DummyNoReturnERC20TokenContract,
ERC20ProxyContract,
ERC20Wrapper,
ERC721ProxyContract,
@@ -154,7 +148,7 @@ describe('Asset Transfer Proxies', () => {
constants.DUMMY_TOKEN_DECIMALS,
);
noReturnErc20Token = await DummyNoReturnERC20TokenContract.deployFrom0xArtifactAsync(
- erc20Artifacts.DummyNoReturnERC20Token,
+ artifacts.DummyNoReturnERC20Token,
provider,
txDefaults,
constants.DUMMY_TOKEN_NAME,
@@ -163,7 +157,7 @@ describe('Asset Transfer Proxies', () => {
constants.DUMMY_TOKEN_TOTAL_SUPPLY,
);
multipleReturnErc20Token = await DummyMultipleReturnERC20TokenContract.deployFrom0xArtifactAsync(
- erc20Artifacts.DummyMultipleReturnERC20Token,
+ artifacts.DummyMultipleReturnERC20Token,
provider,
txDefaults,
constants.DUMMY_TOKEN_NAME,
@@ -204,7 +198,7 @@ describe('Asset Transfer Proxies', () => {
// Deploy and configure ERC721 tokens and receiver
[erc721TokenA, erc721TokenB] = await erc721Wrapper.deployDummyTokensAsync();
erc721Receiver = await DummyERC721ReceiverContract.deployFrom0xArtifactAsync(
- erc721Artifacts.DummyERC721Receiver,
+ artifacts.DummyERC721Receiver,
provider,
txDefaults,
);
@@ -568,7 +562,7 @@ describe('Asset Transfer Proxies', () => {
erc721Receiver.address,
amount,
);
- const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc721Artifacts });
+ const logDecoder = new LogDecoder(web3Wrapper, artifacts);
const tx = await logDecoder.getTxWithDecodedLogsAsync(
await web3Wrapper.sendTransactionAsync({
to: erc721Proxy.address,
@@ -760,7 +754,7 @@ describe('Asset Transfer Proxies', () => {
inputAmount,
);
const erc20Balances = await erc20Wrapper.getBalancesAsync();
- const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc20Artifacts });
+ const logDecoder = new LogDecoder(web3Wrapper, artifacts);
const tx = await logDecoder.getTxWithDecodedLogsAsync(
await web3Wrapper.sendTransactionAsync({
to: multiAssetProxy.address,
diff --git a/contracts/asset-proxy/test/utils/erc20_wrapper.ts b/contracts/asset-proxy/test/utils/erc20_wrapper.ts
index 12cd06ece..09607e776 100644
--- a/contracts/asset-proxy/test/utils/erc20_wrapper.ts
+++ b/contracts/asset-proxy/test/utils/erc20_wrapper.ts
@@ -1,4 +1,3 @@
-import { artifacts as tokensArtifacts, DummyERC20TokenContract } from '@0x/contracts-erc20';
import { constants, ERC20BalancesByOwner, txDefaults } from '@0x/contracts-test-utils';
import { assetDataUtils } from '@0x/order-utils';
import { BigNumber } from '@0x/utils';
@@ -6,8 +5,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
import * as _ from 'lodash';
-import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy';
-import { artifacts } from '../../src/artifacts';
+import { artifacts, DummyERC20TokenContract, ERC20ProxyContract } from '../../src';
export class ERC20Wrapper {
private readonly _tokenOwnerAddresses: string[];
@@ -38,7 +36,7 @@ export class ERC20Wrapper {
for (let i = 0; i < numberToDeploy; i++) {
this._dummyTokenContracts.push(
await DummyERC20TokenContract.deployFrom0xArtifactAsync(
- tokensArtifacts.DummyERC20Token,
+ artifacts.DummyERC20Token,
this._provider,
txDefaults,
constants.DUMMY_TOKEN_NAME,
diff --git a/contracts/asset-proxy/test/utils/erc721_wrapper.ts b/contracts/asset-proxy/test/utils/erc721_wrapper.ts
index fc43d8c52..92d1398a7 100644
--- a/contracts/asset-proxy/test/utils/erc721_wrapper.ts
+++ b/contracts/asset-proxy/test/utils/erc721_wrapper.ts
@@ -1,4 +1,3 @@
-import { artifacts as tokensArtifacts, DummyERC721TokenContract } from '@0x/contracts-erc721';
import { constants, ERC721TokenIdsByOwner, txDefaults } from '@0x/contracts-test-utils';
import { generatePseudoRandomSalt } from '@0x/order-utils';
import { BigNumber } from '@0x/utils';
@@ -6,8 +5,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
import * as _ from 'lodash';
-import { ERC721ProxyContract } from '../../generated-wrappers/erc721_proxy';
-import { artifacts } from '../../src/artifacts';
+import { artifacts, DummyERC721TokenContract, ERC721ProxyContract } from '../../src';
export class ERC721Wrapper {
private readonly _tokenOwnerAddresses: string[];
@@ -30,7 +28,7 @@ export class ERC721Wrapper {
for (const i of _.times(constants.NUM_DUMMY_ERC721_TO_DEPLOY)) {
this._dummyTokenContracts.push(
await DummyERC721TokenContract.deployFrom0xArtifactAsync(
- tokensArtifacts.DummyERC721Token,
+ artifacts.DummyERC721Token,
this._provider,
txDefaults,
constants.DUMMY_TOKEN_NAME,
diff --git a/contracts/asset-proxy/tsconfig.json b/contracts/asset-proxy/tsconfig.json
index 7baa48cbe..526be2c64 100644
--- a/contracts/asset-proxy/tsconfig.json
+++ b/contracts/asset-proxy/tsconfig.json
@@ -1,19 +1,20 @@
{
"extends": "../../tsconfig",
- "compilerOptions": {
- "outDir": "lib",
- "rootDir": ".",
- "resolveJsonModule": true
- },
+ "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true },
"include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"],
"files": [
- "./generated-artifacts/IAssetData.json",
- "./generated-artifacts/IAssetProxy.json",
- "./generated-artifacts/IAuthorizable.json",
- "./generated-artifacts/ERC20Proxy.json",
- "./generated-artifacts/ERC721Proxy.json",
- "./generated-artifacts/MixinAuthorizable.json",
- "./generated-artifacts/MultiAssetProxy.json"
+ "generated-artifacts/DummyERC20Token.json",
+ "generated-artifacts/DummyERC721Receiver.json",
+ "generated-artifacts/DummyERC721Token.json",
+ "generated-artifacts/DummyMultipleReturnERC20Token.json",
+ "generated-artifacts/DummyNoReturnERC20Token.json",
+ "generated-artifacts/ERC20Proxy.json",
+ "generated-artifacts/ERC721Proxy.json",
+ "generated-artifacts/IAssetData.json",
+ "generated-artifacts/IAssetProxy.json",
+ "generated-artifacts/IAuthorizable.json",
+ "generated-artifacts/MixinAuthorizable.json",
+ "generated-artifacts/MultiAssetProxy.json"
],
"exclude": ["./deploy/solc/solc_bin"]
}