diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-12-21 01:08:38 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-12-21 02:27:39 +0800 |
commit | f7fd9789bac823fe4b7bb3df8b2d1f849f1a3212 (patch) | |
tree | e79268206bfdd0a16510b14d7f0f76e8f5afa817 | |
parent | bc3093e635e7753e897c9d7aa0f9d8dde49d752a (diff) | |
download | dexon-sol-tools-f7fd9789bac823fe4b7bb3df8b2d1f849f1a3212.tar.gz dexon-sol-tools-f7fd9789bac823fe4b7bb3df8b2d1f849f1a3212.tar.zst dexon-sol-tools-f7fd9789bac823fe4b7bb3df8b2d1f849f1a3212.zip |
Move OrderValidator to extensions
-rw-r--r-- | contracts/extensions/CHANGELOG.json | 4 | ||||
-rw-r--r-- | contracts/extensions/compiler.json | 2 | ||||
-rw-r--r-- | contracts/extensions/contracts/OrderValidator/OrderValidator.sol (renamed from contracts/protocol/contracts/protocol/OrderValidator/OrderValidator.sol) | 0 | ||||
-rw-r--r-- | contracts/extensions/package.json | 2 | ||||
-rw-r--r-- | contracts/extensions/src/artifacts/index.ts | 2 | ||||
-rw-r--r-- | contracts/extensions/src/wrappers/index.ts | 1 | ||||
-rw-r--r-- | contracts/extensions/test/extensions/order_validator.ts (renamed from contracts/protocol/test/exchange/order_validator.ts) | 23 | ||||
-rw-r--r-- | contracts/extensions/tsconfig.json | 3 | ||||
-rw-r--r-- | contracts/protocol/CHANGELOG.json | 4 | ||||
-rw-r--r-- | contracts/protocol/compiler.json | 1 | ||||
-rw-r--r-- | contracts/protocol/contracts/protocol/AssetProxy/MultiAssetProxy.sol | 4 | ||||
-rw-r--r-- | contracts/protocol/package.json | 2 | ||||
-rw-r--r-- | contracts/protocol/src/artifacts/index.ts | 2 | ||||
-rw-r--r-- | contracts/protocol/src/wrappers/index.ts | 1 | ||||
-rw-r--r-- | contracts/protocol/tsconfig.json | 1 |
15 files changed, 30 insertions, 22 deletions
diff --git a/contracts/extensions/CHANGELOG.json b/contracts/extensions/CHANGELOG.json index 4f2b54988..083ad33fb 100644 --- a/contracts/extensions/CHANGELOG.json +++ b/contracts/extensions/CHANGELOG.json @@ -9,6 +9,10 @@ { "note": "Add OrderMatcher", "pr": 1117 + }, + { + "note": "Add OrderValidator", + "pr": 1464 } ] }, diff --git a/contracts/extensions/compiler.json b/contracts/extensions/compiler.json index 1e21e6e6a..2bb468724 100644 --- a/contracts/extensions/compiler.json +++ b/contracts/extensions/compiler.json @@ -18,5 +18,5 @@ } } }, - "contracts": ["BalanceThresholdFilter", "DutchAuction", "Forwarder", "OrderMatcher"] + "contracts": ["BalanceThresholdFilter", "DutchAuction", "Forwarder", "OrderMatcher", "OrderValidator"] } diff --git a/contracts/protocol/contracts/protocol/OrderValidator/OrderValidator.sol b/contracts/extensions/contracts/OrderValidator/OrderValidator.sol index 33dd1326c..33dd1326c 100644 --- a/contracts/protocol/contracts/protocol/OrderValidator/OrderValidator.sol +++ b/contracts/extensions/contracts/OrderValidator/OrderValidator.sol diff --git a/contracts/extensions/package.json b/contracts/extensions/package.json index d0caa030e..069b5d2d5 100644 --- a/contracts/extensions/package.json +++ b/contracts/extensions/package.json @@ -32,7 +32,7 @@ "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "generated-artifacts/@(BalanceThresholdFilter|DutchAuction|Forwarder|OrderMatcher).json" + "abis": "generated-artifacts/@(BalanceThresholdFilter|DutchAuction|Forwarder|OrderMatcher|OrderValidator).json" }, "repository": { "type": "git", diff --git a/contracts/extensions/src/artifacts/index.ts b/contracts/extensions/src/artifacts/index.ts index a8bd34b4e..329d0f3f3 100644 --- a/contracts/extensions/src/artifacts/index.ts +++ b/contracts/extensions/src/artifacts/index.ts @@ -4,10 +4,12 @@ import * as BalanceThresholdFilter from '../../generated-artifacts/BalanceThresh import * as DutchAuction from '../../generated-artifacts/DutchAuction.json'; import * as Forwarder from '../../generated-artifacts/Forwarder.json'; import * as OrderMatcher from '../../generated-artifacts/OrderMatcher.json'; +import * as OrderValidator from '../../generated-artifacts/OrderValidator.json'; export const artifacts = { BalanceThresholdFilter: BalanceThresholdFilter as ContractArtifact, DutchAuction: DutchAuction as ContractArtifact, Forwarder: Forwarder as ContractArtifact, OrderMatcher: OrderMatcher as ContractArtifact, + OrderValidator: OrderValidator as ContractArtifact, }; diff --git a/contracts/extensions/src/wrappers/index.ts b/contracts/extensions/src/wrappers/index.ts index 4d075ee13..65aec3ccd 100644 --- a/contracts/extensions/src/wrappers/index.ts +++ b/contracts/extensions/src/wrappers/index.ts @@ -2,3 +2,4 @@ export * from '../../generated-wrappers/balance_threshold_filter'; export * from '../../generated-wrappers/dutch_auction'; export * from '../../generated-wrappers/forwarder'; export * from '../../generated-wrappers/order_matcher'; +export * from '../../generated-wrappers/order_validator'; diff --git a/contracts/protocol/test/exchange/order_validator.ts b/contracts/extensions/test/extensions/order_validator.ts index 8f53426db..82a6b937f 100644 --- a/contracts/protocol/test/exchange/order_validator.ts +++ b/contracts/extensions/test/extensions/order_validator.ts @@ -1,4 +1,13 @@ import { + artifacts as protocolArtifacts, + ERC20ProxyContract, + ERC20Wrapper, + ERC721ProxyContract, + ERC721Wrapper, + ExchangeContract, + ExchangeWrapper, +} from '@0x/contracts-protocol'; +import { chaiSetup, constants, OrderFactory, @@ -15,16 +24,8 @@ import { BigNumber } from '@0x/utils'; import * as chai from 'chai'; import * as _ from 'lodash'; -import { - artifacts, - ERC20ProxyContract, - ERC20Wrapper, - ERC721ProxyContract, - ERC721Wrapper, - ExchangeContract, - ExchangeWrapper, - OrderValidatorContract, -} from '../../src'; +import { OrderValidatorContract } from '../../generated-wrappers/order_validator'; +import { artifacts } from '../../src/artifacts/index'; chaiSetup.configure(); const expect = chai.expect; @@ -80,7 +81,7 @@ describe('OrderValidator', () => { const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address); exchange = await ExchangeContract.deployFrom0xArtifactAsync( - artifacts.Exchange, + protocolArtifacts.Exchange, provider, txDefaults, zrxAssetData, diff --git a/contracts/extensions/tsconfig.json b/contracts/extensions/tsconfig.json index 506c283aa..ed9b4fbe1 100644 --- a/contracts/extensions/tsconfig.json +++ b/contracts/extensions/tsconfig.json @@ -10,7 +10,8 @@ "./generated-artifacts/BalanceThresholdFilter.json", "./generated-artifacts/DutchAuction.json", "./generated-artifacts/Forwarder.json", - "./generated-artifacts/OrderMatcher.json" + "./generated-artifacts/OrderMatcher.json", + "./generated-artifacts/OrderValidator.json" ], "exclude": ["./deploy/solc/solc_bin"] } diff --git a/contracts/protocol/CHANGELOG.json b/contracts/protocol/CHANGELOG.json index be374d892..e283d7917 100644 --- a/contracts/protocol/CHANGELOG.json +++ b/contracts/protocol/CHANGELOG.json @@ -9,6 +9,10 @@ { "note": "Add validation and comments to MultiAssetProxy", "pr": 1455 + }, + { + "note": "Move OrderValidator to extensions", + "pr": 1464 } ] }, diff --git a/contracts/protocol/compiler.json b/contracts/protocol/compiler.json index c05d62aba..10e5bb0a1 100644 --- a/contracts/protocol/compiler.json +++ b/contracts/protocol/compiler.json @@ -25,7 +25,6 @@ "Exchange", "MixinAuthorizable", "MultiAssetProxy", - "OrderValidator", "TestAssetProxyOwner", "TestAssetProxyDispatcher", "TestExchangeInternals", diff --git a/contracts/protocol/contracts/protocol/AssetProxy/MultiAssetProxy.sol b/contracts/protocol/contracts/protocol/AssetProxy/MultiAssetProxy.sol index 377325384..5f559163c 100644 --- a/contracts/protocol/contracts/protocol/AssetProxy/MultiAssetProxy.sol +++ b/contracts/protocol/contracts/protocol/AssetProxy/MultiAssetProxy.sol @@ -34,8 +34,8 @@ contract MultiAssetProxy is external { // NOTE: The below assembly assumes that clients do some input validation and that the input is properly encoded according to the AbiV2 specification. - // It is technically possible for inputs with very large lengths and offsets to cause overflows. However, this would make the calldata prohibitively expensive - // and we therefore do not check for overflows in these scenarios. + // It is technically possible for inputs with very large lengths and offsets to cause overflows. However, this would make the calldata prohibitively + // expensive and we therefore do not check for overflows in these scenarios. assembly { // The first 4 bytes of calldata holds the function selector let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000) diff --git a/contracts/protocol/package.json b/contracts/protocol/package.json index d37a0302a..891838e54 100644 --- a/contracts/protocol/package.json +++ b/contracts/protocol/package.json @@ -32,7 +32,7 @@ "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { - "abis": "generated-artifacts/@(AssetProxyOwner|ERC20Proxy|ERC721Proxy|Exchange|MixinAuthorizable|MultiAssetProxy|OrderValidator|TestSignatureValidator|TestAssetProxyOwner|TestAssetProxyDispatcher|TestExchangeInternals|TestStaticCallReceiver).json" + "abis": "generated-artifacts/@(AssetProxyOwner|ERC20Proxy|ERC721Proxy|Exchange|MixinAuthorizable|MultiAssetProxy|TestSignatureValidator|TestAssetProxyOwner|TestAssetProxyDispatcher|TestExchangeInternals|TestStaticCallReceiver).json" }, "repository": { "type": "git", diff --git a/contracts/protocol/src/artifacts/index.ts b/contracts/protocol/src/artifacts/index.ts index 1d53ceb04..c5d12f10b 100644 --- a/contracts/protocol/src/artifacts/index.ts +++ b/contracts/protocol/src/artifacts/index.ts @@ -6,7 +6,6 @@ import * as ERC721Proxy from '../../generated-artifacts/ERC721Proxy.json'; import * as Exchange from '../../generated-artifacts/Exchange.json'; import * as MixinAuthorizable from '../../generated-artifacts/MixinAuthorizable.json'; import * as MultiAssetProxy from '../../generated-artifacts/MultiAssetProxy.json'; -import * as OrderValidator from '../../generated-artifacts/OrderValidator.json'; import * as TestAssetProxyDispatcher from '../../generated-artifacts/TestAssetProxyDispatcher.json'; import * as TestAssetProxyOwner from '../../generated-artifacts/TestAssetProxyOwner.json'; import * as TestExchangeInternals from '../../generated-artifacts/TestExchangeInternals.json'; @@ -20,7 +19,6 @@ export const artifacts = { Exchange: Exchange as ContractArtifact, MixinAuthorizable: MixinAuthorizable as ContractArtifact, MultiAssetProxy: MultiAssetProxy as ContractArtifact, - OrderValidator: OrderValidator as ContractArtifact, TestAssetProxyDispatcher: TestAssetProxyDispatcher as ContractArtifact, TestAssetProxyOwner: TestAssetProxyOwner as ContractArtifact, TestExchangeInternals: TestExchangeInternals as ContractArtifact, diff --git a/contracts/protocol/src/wrappers/index.ts b/contracts/protocol/src/wrappers/index.ts index ac951d269..01b121054 100644 --- a/contracts/protocol/src/wrappers/index.ts +++ b/contracts/protocol/src/wrappers/index.ts @@ -3,7 +3,6 @@ export * from '../../generated-wrappers/erc20_proxy'; export * from '../../generated-wrappers/erc721_proxy'; export * from '../../generated-wrappers/exchange'; export * from '../../generated-wrappers/mixin_authorizable'; -export * from '../../generated-wrappers/order_validator'; export * from '../../generated-wrappers/test_asset_proxy_dispatcher'; export * from '../../generated-wrappers/test_asset_proxy_owner'; export * from '../../generated-wrappers/test_exchange_internals'; diff --git a/contracts/protocol/tsconfig.json b/contracts/protocol/tsconfig.json index 989d3ef2b..db872fc32 100644 --- a/contracts/protocol/tsconfig.json +++ b/contracts/protocol/tsconfig.json @@ -13,7 +13,6 @@ "./generated-artifacts/Exchange.json", "./generated-artifacts/MixinAuthorizable.json", "./generated-artifacts/MultiAssetProxy.json", - "./generated-artifacts/OrderValidator.json", "./generated-artifacts/TestAssetProxyDispatcher.json", "./generated-artifacts/TestAssetProxyOwner.json", "./generated-artifacts/TestExchangeInternals.json", |