diff options
Diffstat (limited to 'contracts/protocol')
-rw-r--r-- | contracts/protocol/CHANGELOG.json | 9 | ||||
-rw-r--r-- | contracts/protocol/CHANGELOG.md | 4 | ||||
-rw-r--r-- | contracts/protocol/README.md | 8 | ||||
-rw-r--r-- | contracts/protocol/package.json | 40 | ||||
-rw-r--r-- | contracts/protocol/test/exchange/core.ts | 20 | ||||
-rw-r--r-- | contracts/protocol/test/exchange/wrapper.ts | 24 | ||||
-rw-r--r-- | contracts/protocol/test/utils/match_order_tester.ts | 8 |
7 files changed, 63 insertions, 50 deletions
diff --git a/contracts/protocol/CHANGELOG.json b/contracts/protocol/CHANGELOG.json index 6672ce9c3..039f0f94a 100644 --- a/contracts/protocol/CHANGELOG.json +++ b/contracts/protocol/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "timestamp": 1547225310, + "version": "2.2.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "version": "2.2.0", "changes": [ { diff --git a/contracts/protocol/CHANGELOG.md b/contracts/protocol/CHANGELOG.md index a8ad921a2..75d4b9a5e 100644 --- a/contracts/protocol/CHANGELOG.md +++ b/contracts/protocol/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.2.1 - _January 11, 2019_ + + * Dependencies updated + ## v2.2.0 - _January 9, 2019_ * Added LibAddressArray (#1383) diff --git a/contracts/protocol/README.md b/contracts/protocol/README.md index 5fc9c0a89..dc1f32c98 100644 --- a/contracts/protocol/README.md +++ b/contracts/protocol/README.md @@ -6,10 +6,10 @@ Smart contracts that implement the 0x protocol. Addresses of the deployed contra Contracts that make up and interact with version 2.0.0 of the protocol can be found in the [contracts](./contracts) directory. The contents of this directory are broken down into the following subdirectories: -* [protocol](./contracts/protocol) - * This directory contains the contracts that make up version 2.0.0. A full specification can be found [here](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md). -* [test](./contracts/test) - * This directory contains mocks and other contracts that are used solely for testing contracts within the other directories. +- [protocol](./contracts/protocol) + - This directory contains the contracts that make up version 2.0.0. A full specification can be found [here](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md). +- [test](./contracts/test) + - This directory contains mocks and other contracts that are used solely for testing contracts within the other directories. ## Bug bounty diff --git a/contracts/protocol/package.json b/contracts/protocol/package.json index 7d49dfbe8..daece8876 100644 --- a/contracts/protocol/package.json +++ b/contracts/protocol/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-protocol", - "version": "2.2.0", + "version": "2.2.1", "engines": { "node": ">=6.12" }, @@ -44,11 +44,11 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.20", - "@0x/dev-utils": "^1.0.22", - "@0x/sol-compiler": "^2.0.0", - "@0x/subproviders": "^2.1.9", - "@0x/tslint-config": "^2.0.0", + "@0x/abi-gen": "^1.0.21", + "@0x/dev-utils": "^1.0.23", + "@0x/sol-compiler": "^2.0.1", + "@0x/subproviders": "^2.1.10", + "@0x/tslint-config": "^2.0.1", "@types/bn.js": "^4.11.0", "@types/lodash": "4.14.104", "@types/node": "*", @@ -68,22 +68,22 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/base-contract": "^3.0.11", - "@0x/contracts-examples": "^1.0.3", - "@0x/contracts-interfaces": "^1.0.3", - "@0x/contracts-libs": "^1.0.3", - "@0x/contracts-multisig": "^1.0.3", - "@0x/contracts-test-utils": "^1.0.3", - "@0x/contracts-tokens": "^1.0.3", - "@0x/contracts-utils": "^1.0.3", - "@0x/order-utils": "^3.1.0", - "@0x/types": "^1.5.0", - "@0x/typescript-typings": "^3.0.6", - "@0x/utils": "^2.1.1", - "@0x/web3-wrapper": "^3.2.2", + "@0x/base-contract": "^3.0.12", + "@0x/contracts-examples": "^1.0.4", + "@0x/contracts-interfaces": "^1.0.4", + "@0x/contracts-libs": "^1.0.4", + "@0x/contracts-multisig": "^1.0.4", + "@0x/contracts-test-utils": "^1.0.4", + "@0x/contracts-tokens": "^1.0.4", + "@0x/contracts-utils": "^1.0.4", + "@0x/order-utils": "^3.1.1", + "@0x/types": "^1.5.1", + "@0x/typescript-typings": "^3.0.7", + "@0x/utils": "^3.0.0", + "@0x/web3-wrapper": "^3.2.3", "@types/js-combinatorics": "^0.5.29", "bn.js": "^4.11.8", - "ethereum-types": "^1.1.4", + "ethereum-types": "^1.1.5", "ethereumjs-util": "^5.1.1", "lodash": "^4.17.5" }, diff --git a/contracts/protocol/test/exchange/core.ts b/contracts/protocol/test/exchange/core.ts index 42db8623d..700643b79 100644 --- a/contracts/protocol/test/exchange/core.ts +++ b/contracts/protocol/test/exchange/core.ts @@ -1043,7 +1043,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.FILLABLE; + const expectedOrderStatus = OrderStatus.Fillable; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1053,7 +1053,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount; - const expectedOrderStatus = OrderStatus.FULLY_FILLED; + const expectedOrderStatus = OrderStatus.FullyFilled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1064,7 +1064,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = takerAssetFillAmount; - const expectedOrderStatus = OrderStatus.FILLABLE; + const expectedOrderStatus = OrderStatus.Fillable; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1074,7 +1074,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.CANCELLED; + const expectedOrderStatus = OrderStatus.Cancelled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1086,7 +1086,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = takerAssetFillAmount; - const expectedOrderStatus = OrderStatus.CANCELLED; + const expectedOrderStatus = OrderStatus.Cancelled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1098,7 +1098,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.EXPIRED; + const expectedOrderStatus = OrderStatus.Expired; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1112,7 +1112,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = takerAssetFillAmount; - const expectedOrderStatus = OrderStatus.EXPIRED; + const expectedOrderStatus = OrderStatus.Expired; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1126,7 +1126,7 @@ describe('Exchange core', () => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount; // FULLY_FILLED takes precedence over EXPIRED - const expectedOrderStatus = OrderStatus.FULLY_FILLED; + const expectedOrderStatus = OrderStatus.FullyFilled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1136,7 +1136,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.INVALID_MAKER_ASSET_AMOUNT; + const expectedOrderStatus = OrderStatus.InvalidMakerAssetAmount; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1146,7 +1146,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.INVALID_TAKER_ASSET_AMOUNT; + const expectedOrderStatus = OrderStatus.InvalidTakerAssetAmount; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); diff --git a/contracts/protocol/test/exchange/wrapper.ts b/contracts/protocol/test/exchange/wrapper.ts index c9efb0c9d..4c4506945 100644 --- a/contracts/protocol/test/exchange/wrapper.ts +++ b/contracts/protocol/test/exchange/wrapper.ts @@ -1288,7 +1288,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.FILLABLE; + const expectedOrderStatus = OrderStatus.Fillable; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1303,7 +1303,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount.div(2); - const expectedOrderStatus = OrderStatus.FILLABLE; + const expectedOrderStatus = OrderStatus.Fillable; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1317,7 +1317,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount; - const expectedOrderStatus = OrderStatus.FULLY_FILLED; + const expectedOrderStatus = OrderStatus.FullyFilled; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1331,7 +1331,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.CANCELLED; + const expectedOrderStatus = OrderStatus.Cancelled; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1347,7 +1347,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount.div(2); - const expectedOrderStatus = OrderStatus.CANCELLED; + const expectedOrderStatus = OrderStatus.Cancelled; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1363,7 +1363,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.EXPIRED; + const expectedOrderStatus = OrderStatus.Expired; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1381,7 +1381,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount.div(2); - const expectedOrderStatus = OrderStatus.EXPIRED; + const expectedOrderStatus = OrderStatus.Expired; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1408,7 +1408,7 @@ describe('Exchange wrappers', () => { const expectedUnfilledOrderHash = orderHashUtils.getOrderHashHex(unfilledOrder); const expectedUnfilledTakerAssetFilledAmount = new BigNumber(0); - const expectedUnfilledOrderStatus = OrderStatus.FILLABLE; + const expectedUnfilledOrderStatus = OrderStatus.Fillable; const unfilledOrderInfo = ordersInfo[0]; expect(unfilledOrderInfo.orderHash).to.be.equal(expectedUnfilledOrderHash); expect(unfilledOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal( @@ -1418,7 +1418,7 @@ describe('Exchange wrappers', () => { const expectedPartialOrderHash = orderHashUtils.getOrderHashHex(partiallyFilledOrder); const expectedPartialTakerAssetFilledAmount = partiallyFilledOrder.takerAssetAmount.div(2); - const expectedPartialOrderStatus = OrderStatus.FILLABLE; + const expectedPartialOrderStatus = OrderStatus.Fillable; const partialOrderInfo = ordersInfo[1]; expect(partialOrderInfo.orderHash).to.be.equal(expectedPartialOrderHash); expect(partialOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal( @@ -1428,7 +1428,7 @@ describe('Exchange wrappers', () => { const expectedFilledOrderHash = orderHashUtils.getOrderHashHex(fullyFilledOrder); const expectedFilledTakerAssetFilledAmount = fullyFilledOrder.takerAssetAmount; - const expectedFilledOrderStatus = OrderStatus.FULLY_FILLED; + const expectedFilledOrderStatus = OrderStatus.FullyFilled; const filledOrderInfo = ordersInfo[2]; expect(filledOrderInfo.orderHash).to.be.equal(expectedFilledOrderHash); expect(filledOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal( @@ -1438,7 +1438,7 @@ describe('Exchange wrappers', () => { const expectedCancelledOrderHash = orderHashUtils.getOrderHashHex(cancelledOrder); const expectedCancelledTakerAssetFilledAmount = new BigNumber(0); - const expectedCancelledOrderStatus = OrderStatus.CANCELLED; + const expectedCancelledOrderStatus = OrderStatus.Cancelled; const cancelledOrderInfo = ordersInfo[3]; expect(cancelledOrderInfo.orderHash).to.be.equal(expectedCancelledOrderHash); expect(cancelledOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal( @@ -1448,7 +1448,7 @@ describe('Exchange wrappers', () => { const expectedExpiredOrderHash = orderHashUtils.getOrderHashHex(expiredOrder); const expectedExpiredTakerAssetFilledAmount = new BigNumber(0); - const expectedExpiredOrderStatus = OrderStatus.EXPIRED; + const expectedExpiredOrderStatus = OrderStatus.Expired; const expiredOrderInfo = ordersInfo[4]; expect(expiredOrderInfo.orderHash).to.be.equal(expectedExpiredOrderHash); expect(expiredOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal( diff --git a/contracts/protocol/test/utils/match_order_tester.ts b/contracts/protocol/test/utils/match_order_tester.ts index 8f574704e..31864820f 100644 --- a/contracts/protocol/test/utils/match_order_tester.ts +++ b/contracts/protocol/test/utils/match_order_tester.ts @@ -268,15 +268,15 @@ export class MatchOrderTester { const maxAmountBoughtByLeftMaker = signedOrderLeft.takerAssetAmount.minus(initialLeftOrderFilledAmount); const leftOrderInfo: OrderInfo = await this._exchangeWrapper.getOrderInfoAsync(signedOrderLeft); const leftExpectedStatus = expectedTransferAmounts.amountBoughtByLeftMaker.equals(maxAmountBoughtByLeftMaker) - ? OrderStatus.FULLY_FILLED - : OrderStatus.FILLABLE; + ? OrderStatus.FullyFilled + : OrderStatus.Fillable; expect(leftOrderInfo.orderStatus, 'Checking exchange status for left order').to.be.equal(leftExpectedStatus); // Assert right order status const maxAmountBoughtByRightMaker = signedOrderRight.takerAssetAmount.minus(initialRightOrderFilledAmount); const rightOrderInfo: OrderInfo = await this._exchangeWrapper.getOrderInfoAsync(signedOrderRight); const rightExpectedStatus = expectedTransferAmounts.amountBoughtByRightMaker.equals(maxAmountBoughtByRightMaker) - ? OrderStatus.FULLY_FILLED - : OrderStatus.FILLABLE; + ? OrderStatus.FullyFilled + : OrderStatus.Fillable; expect(rightOrderInfo.orderStatus, 'Checking exchange status for right order').to.be.equal(rightExpectedStatus); } /// @dev Asserts account balances after matching orders. |