Compare commits
40 Commits
@0x/contra
...
@0x/contra
Author | SHA1 | Date | |
---|---|---|---|
|
cf04062a19 | ||
|
2e922bf7db | ||
|
741a731ecb | ||
|
91bff1976c | ||
|
fad500042a | ||
|
bdb2a01385 | ||
|
f372cd2d13 | ||
|
a435da910f | ||
|
f1d96d9673 | ||
|
45226ee1f6 | ||
|
03b8d29740 | ||
|
80a4af249f | ||
|
900d444946 | ||
|
7ca9393d2d | ||
|
b22d7bb310 | ||
|
c742cdfe5c | ||
|
2d3fe02cd7 | ||
|
7d61cb6bac | ||
|
a804433a7a | ||
|
11082320c2 | ||
|
9f9797b123 | ||
|
05d34616b7 | ||
|
c7f474ada1 | ||
|
c7328a63d0 | ||
|
db818794d5 | ||
|
b4b34e4890 | ||
|
eec016380d | ||
|
dcab272be0 | ||
|
1bff790628 | ||
|
0010ca3e03 | ||
|
9edb5dae88 | ||
|
85b49096dc | ||
|
a7eaa10220 | ||
|
5a46ce55b6 | ||
|
dbebbecab1 | ||
|
c7593e66bf | ||
|
d52dc69279 | ||
|
1c65fa212d | ||
|
be88eb00f8 | ||
|
65c60f5386 |
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "2.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "2.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "2.1.3",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.5 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.4 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.3 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-asset-proxy",
|
||||
"version": "2.1.3",
|
||||
"version": "2.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -49,9 +49,9 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.5",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/contracts-test-utils": "^3.1.7",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -69,11 +69,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-erc1155": "^1.1.4",
|
||||
"@0x/contracts-erc20": "^2.2.3",
|
||||
"@0x/contracts-erc721": "^2.1.4",
|
||||
"@0x/contracts-utils": "^3.1.4",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/contracts-erc1155": "^1.1.6",
|
||||
"@0x/contracts-erc20": "^2.2.5",
|
||||
"@0x/contracts-erc721": "^2.1.6",
|
||||
"@0x/contracts-utils": "^3.1.6",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "2.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "2.0.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "2.0.2",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.4 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.3 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.2 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-coordinator",
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.4",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -49,9 +49,9 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.5",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/contracts-test-utils": "^3.1.7",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -69,12 +69,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-asset-proxy": "^2.1.3",
|
||||
"@0x/contracts-erc20": "^2.2.3",
|
||||
"@0x/contracts-asset-proxy": "^2.1.5",
|
||||
"@0x/contracts-erc20": "^2.2.5",
|
||||
"@0x/contracts-exchange": "1.0.2",
|
||||
"@0x/contracts-exchange-libs": "^2.1.4",
|
||||
"@0x/contracts-utils": "^3.1.4",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/contracts-exchange-libs": "^2.1.6",
|
||||
"@0x/contracts-utils": "^3.1.6",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "1.1.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "1.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.1.4",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.1.6 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.5 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.4 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc1155",
|
||||
"version": "1.1.4",
|
||||
"version": "1.1.6",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -49,8 +49,8 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -68,8 +68,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-test-utils": "^3.1.5",
|
||||
"@0x/contracts-utils": "^3.1.4",
|
||||
"@0x/contracts-test-utils": "^3.1.7",
|
||||
"@0x/contracts-utils": "^3.1.6",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "2.2.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "2.2.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.2.3",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.2.5 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.4 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.3 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc20",
|
||||
"version": "2.2.3",
|
||||
"version": "2.2.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -49,9 +49,9 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.5",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/contracts-test-utils": "^3.1.7",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -69,8 +69,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-exchange-libs": "^2.1.4",
|
||||
"@0x/contracts-utils": "^3.1.4",
|
||||
"@0x/contracts-utils": "^3.1.6",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "2.1.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "2.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.4",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.6 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.5 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.4 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc721",
|
||||
"version": "2.1.4",
|
||||
"version": "2.1.6",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -49,9 +49,9 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.5",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/contracts-test-utils": "^3.1.7",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -69,7 +69,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-utils": "^3.1.4",
|
||||
"@0x/contracts-utils": "^3.1.6",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "3.0.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "3.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "3.0.1",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.3 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.2 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.1 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-forwarder",
|
||||
"version": "3.0.1",
|
||||
"version": "3.0.3",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contract-wrappers": "^9.1.2",
|
||||
"@0x/contract-wrappers": "^9.1.4",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.5",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/contracts-test-utils": "^3.1.7",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -69,13 +69,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-asset-proxy": "^2.1.3",
|
||||
"@0x/contracts-erc20": "^2.2.3",
|
||||
"@0x/contracts-erc721": "^2.1.4",
|
||||
"@0x/contracts-exchange": "^2.1.3",
|
||||
"@0x/contracts-exchange-libs": "^2.1.4",
|
||||
"@0x/contracts-utils": "^3.1.4",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/contracts-asset-proxy": "^2.1.5",
|
||||
"@0x/contracts-erc20": "^2.2.5",
|
||||
"@0x/contracts-erc721": "^2.1.6",
|
||||
"@0x/contracts-exchange": "^2.1.5",
|
||||
"@0x/contracts-exchange-libs": "^2.1.6",
|
||||
"@0x/contracts-utils": "^3.1.6",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.1",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "2.1.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "2.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.4",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.6 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.5 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.4 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -30,6 +30,7 @@
|
||||
"src/LibFillResults.sol",
|
||||
"src/LibMath.sol",
|
||||
"src/LibOrder.sol",
|
||||
"src/LibTransactionDecoder.sol",
|
||||
"test/TestLibs.sol"
|
||||
]
|
||||
}
|
||||
|
191
contracts/exchange-libs/contracts/src/LibTransactionDecoder.sol
Normal file
191
contracts/exchange-libs/contracts/src/LibTransactionDecoder.sol
Normal file
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
|
||||
Copyright 2019 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;
|
||||
pragma experimental "ABIEncoderV2";
|
||||
|
||||
import "@0x/contracts-exchange-libs/contracts/src/LibExchangeSelectors.sol";
|
||||
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
|
||||
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
||||
|
||||
|
||||
contract LibTransactionDecoder is LibExchangeSelectors {
|
||||
using LibBytes for bytes;
|
||||
|
||||
/// @dev Decodes the call data for an Exchange contract method call.
|
||||
/// @param transactionData ABI-encoded calldata for an Exchange
|
||||
/// contract method call.
|
||||
/// @return The name of the function called, and the parameters it was
|
||||
/// given. For single-order fills and cancels, the arrays will have
|
||||
/// just one element.
|
||||
function decodeZeroExTransactionData(bytes memory transactionData)
|
||||
public
|
||||
pure
|
||||
returns(
|
||||
string memory functionName,
|
||||
LibOrder.Order[] memory orders,
|
||||
uint256[] memory takerAssetFillAmounts,
|
||||
bytes[] memory signatures
|
||||
)
|
||||
{
|
||||
bytes4 functionSelector = transactionData.readBytes4(0);
|
||||
|
||||
if (functionSelector == BATCH_CANCEL_ORDERS_SELECTOR) {
|
||||
functionName = "batchCancelOrders";
|
||||
} else if (functionSelector == BATCH_FILL_ORDERS_SELECTOR) {
|
||||
functionName = "batchFillOrders";
|
||||
} else if (functionSelector == BATCH_FILL_ORDERS_NO_THROW_SELECTOR) {
|
||||
functionName = "batchFillOrdersNoThrow";
|
||||
} else if (functionSelector == BATCH_FILL_OR_KILL_ORDERS_SELECTOR) {
|
||||
functionName = "batchFillOrKillOrders";
|
||||
} else if (functionSelector == CANCEL_ORDER_SELECTOR) {
|
||||
functionName = "cancelOrder";
|
||||
} else if (functionSelector == FILL_ORDER_SELECTOR) {
|
||||
functionName = "fillOrder";
|
||||
} else if (functionSelector == FILL_ORDER_NO_THROW_SELECTOR) {
|
||||
functionName = "fillOrderNoThrow";
|
||||
} else if (functionSelector == FILL_OR_KILL_ORDER_SELECTOR) {
|
||||
functionName = "fillOrKillOrder";
|
||||
} else if (functionSelector == MARKET_BUY_ORDERS_SELECTOR) {
|
||||
functionName = "marketBuyOrders";
|
||||
} else if (functionSelector == MARKET_BUY_ORDERS_NO_THROW_SELECTOR) {
|
||||
functionName = "marketBuyOrdersNoThrow";
|
||||
} else if (functionSelector == MARKET_SELL_ORDERS_SELECTOR) {
|
||||
functionName = "marketSellOrders";
|
||||
} else if (functionSelector == MARKET_SELL_ORDERS_NO_THROW_SELECTOR) {
|
||||
functionName = "marketSellOrdersNoThrow";
|
||||
} else if (functionSelector == MATCH_ORDERS_SELECTOR) {
|
||||
functionName = "matchOrders";
|
||||
} else if (
|
||||
functionSelector == CANCEL_ORDERS_UP_TO_SELECTOR ||
|
||||
functionSelector == EXECUTE_TRANSACTION_SELECTOR
|
||||
// TODO: add new noThrow cancel functions when https://github.com/0xProject/ZEIPs/issues/35 is merged.
|
||||
) {
|
||||
revert("UNIMPLEMENTED");
|
||||
} else {
|
||||
revert("UNKNOWN_FUNCTION_SELECTOR");
|
||||
}
|
||||
|
||||
if (functionSelector == BATCH_CANCEL_ORDERS_SELECTOR) {
|
||||
// solhint-disable-next-line indent
|
||||
orders = abi.decode(transactionData.slice(4, transactionData.length), (LibOrder.Order[]));
|
||||
takerAssetFillAmounts = new uint256[](0);
|
||||
signatures = new bytes[](0);
|
||||
} else if (
|
||||
functionSelector == BATCH_FILL_OR_KILL_ORDERS_SELECTOR ||
|
||||
functionSelector == BATCH_FILL_ORDERS_NO_THROW_SELECTOR ||
|
||||
functionSelector == BATCH_FILL_ORDERS_SELECTOR
|
||||
) {
|
||||
(orders, takerAssetFillAmounts, signatures) = _makeReturnValuesForBatchFill(transactionData);
|
||||
} else if (functionSelector == CANCEL_ORDER_SELECTOR) {
|
||||
orders = new LibOrder.Order[](1);
|
||||
orders[0] = abi.decode(transactionData.slice(4, transactionData.length), (LibOrder.Order));
|
||||
takerAssetFillAmounts = new uint256[](0);
|
||||
signatures = new bytes[](0);
|
||||
} else if (
|
||||
functionSelector == FILL_OR_KILL_ORDER_SELECTOR ||
|
||||
functionSelector == FILL_ORDER_SELECTOR ||
|
||||
functionSelector == FILL_ORDER_NO_THROW_SELECTOR
|
||||
) {
|
||||
(orders, takerAssetFillAmounts, signatures) = _makeReturnValuesForSingleOrderFill(transactionData);
|
||||
} else if (
|
||||
functionSelector == MARKET_BUY_ORDERS_SELECTOR ||
|
||||
functionSelector == MARKET_BUY_ORDERS_NO_THROW_SELECTOR ||
|
||||
functionSelector == MARKET_SELL_ORDERS_SELECTOR ||
|
||||
functionSelector == MARKET_SELL_ORDERS_NO_THROW_SELECTOR
|
||||
) {
|
||||
(orders, takerAssetFillAmounts, signatures) = _makeReturnValuesForMarketFill(transactionData);
|
||||
} else if (functionSelector == MATCH_ORDERS_SELECTOR) {
|
||||
(
|
||||
LibOrder.Order memory leftOrder,
|
||||
LibOrder.Order memory rightOrder,
|
||||
bytes memory leftSignature,
|
||||
bytes memory rightSignature
|
||||
) = abi.decode(
|
||||
transactionData.slice(4, transactionData.length),
|
||||
(LibOrder.Order, LibOrder.Order, bytes, bytes)
|
||||
);
|
||||
|
||||
orders = new LibOrder.Order[](2);
|
||||
orders[0] = leftOrder;
|
||||
orders[1] = rightOrder;
|
||||
|
||||
takerAssetFillAmounts = new uint256[](2);
|
||||
takerAssetFillAmounts[0] = leftOrder.takerAssetAmount;
|
||||
takerAssetFillAmounts[1] = rightOrder.takerAssetAmount;
|
||||
|
||||
signatures = new bytes[](2);
|
||||
signatures[0] = leftSignature;
|
||||
signatures[1] = rightSignature;
|
||||
}
|
||||
}
|
||||
|
||||
function _makeReturnValuesForSingleOrderFill(bytes memory transactionData)
|
||||
private
|
||||
pure
|
||||
returns(
|
||||
LibOrder.Order[] memory orders,
|
||||
uint256[] memory takerAssetFillAmounts,
|
||||
bytes[] memory signatures
|
||||
)
|
||||
{
|
||||
orders = new LibOrder.Order[](1);
|
||||
takerAssetFillAmounts = new uint256[](1);
|
||||
signatures = new bytes[](1);
|
||||
// solhint-disable-next-line indent
|
||||
(orders[0], takerAssetFillAmounts[0], signatures[0]) = abi.decode(
|
||||
transactionData.slice(4, transactionData.length),
|
||||
(LibOrder.Order, uint256, bytes)
|
||||
);
|
||||
}
|
||||
|
||||
function _makeReturnValuesForBatchFill(bytes memory transactionData)
|
||||
private
|
||||
pure
|
||||
returns(
|
||||
LibOrder.Order[] memory orders,
|
||||
uint256[] memory takerAssetFillAmounts,
|
||||
bytes[] memory signatures
|
||||
)
|
||||
{
|
||||
// solhint-disable-next-line indent
|
||||
(orders, takerAssetFillAmounts, signatures) = abi.decode(
|
||||
transactionData.slice(4, transactionData.length),
|
||||
// solhint-disable-next-line indent
|
||||
(LibOrder.Order[], uint256[], bytes[])
|
||||
);
|
||||
}
|
||||
|
||||
function _makeReturnValuesForMarketFill(bytes memory transactionData)
|
||||
private
|
||||
pure
|
||||
returns(
|
||||
LibOrder.Order[] memory orders,
|
||||
uint256[] memory takerAssetFillAmounts,
|
||||
bytes[] memory signatures
|
||||
)
|
||||
{
|
||||
takerAssetFillAmounts = new uint256[](1);
|
||||
// solhint-disable-next-line indent
|
||||
(orders, takerAssetFillAmounts[0], signatures) = abi.decode(
|
||||
transactionData.slice(4, transactionData.length),
|
||||
// solhint-disable-next-line indent
|
||||
(LibOrder.Order[], uint256, bytes[])
|
||||
);
|
||||
}
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-libs",
|
||||
"version": "2.1.4",
|
||||
"version": "2.1.6",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -34,7 +34,7 @@
|
||||
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
|
||||
},
|
||||
"config": {
|
||||
"abis": "./generated-artifacts/@(LibAbiEncoder|LibAssetProxyErrors|LibConstants|LibEIP712|LibFillResults|LibMath|LibOrder|TestLibs).json",
|
||||
"abis": "./generated-artifacts/@(LibAbiEncoder|LibAssetProxyErrors|LibConstants|LibEIP712|LibFillResults|LibMath|LibOrder|LibTransactionDecoder|TestLibs).json",
|
||||
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
|
||||
},
|
||||
"repository": {
|
||||
@@ -49,9 +49,9 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.5",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/contracts-test-utils": "^3.1.7",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -69,8 +69,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-utils": "^3.1.4",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/contracts-utils": "^3.1.6",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -12,6 +12,7 @@ import * as LibEIP712 from '../generated-artifacts/LibEIP712.json';
|
||||
import * as LibFillResults from '../generated-artifacts/LibFillResults.json';
|
||||
import * as LibMath from '../generated-artifacts/LibMath.json';
|
||||
import * as LibOrder from '../generated-artifacts/LibOrder.json';
|
||||
import * as LibTransactionDecoder from '../generated-artifacts/LibTransactionDecoder.json';
|
||||
import * as TestLibs from '../generated-artifacts/TestLibs.json';
|
||||
export const artifacts = {
|
||||
LibAbiEncoder: LibAbiEncoder as ContractArtifact,
|
||||
@@ -21,5 +22,6 @@ export const artifacts = {
|
||||
LibFillResults: LibFillResults as ContractArtifact,
|
||||
LibMath: LibMath as ContractArtifact,
|
||||
LibOrder: LibOrder as ContractArtifact,
|
||||
LibTransactionDecoder: LibTransactionDecoder as ContractArtifact,
|
||||
TestLibs: TestLibs as ContractArtifact,
|
||||
};
|
||||
|
@@ -10,4 +10,5 @@ export * from '../generated-wrappers/lib_e_i_p712';
|
||||
export * from '../generated-wrappers/lib_fill_results';
|
||||
export * from '../generated-wrappers/lib_math';
|
||||
export * from '../generated-wrappers/lib_order';
|
||||
export * from '../generated-wrappers/lib_transaction_decoder';
|
||||
export * from '../generated-wrappers/test_libs';
|
||||
|
231
contracts/exchange-libs/test/lib_transaction_decoder.ts
Normal file
231
contracts/exchange-libs/test/lib_transaction_decoder.ts
Normal file
@@ -0,0 +1,231 @@
|
||||
import { chaiSetup, provider, txDefaults, web3Wrapper } from '@0x/contracts-test-utils';
|
||||
import { BlockchainLifecycle } from '@0x/dev-utils';
|
||||
import { Order } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import * as chai from 'chai';
|
||||
|
||||
import { artifacts, LibTransactionDecoderContract } from '../src';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
|
||||
type OrderWithoutExchange = Pick<Order, Exclude<keyof Order, 'exchangeAddress'>>;
|
||||
|
||||
const INPUTS: { order: OrderWithoutExchange; takerAssetFillAmount: BigNumber; signature: string } = {
|
||||
order: {
|
||||
makerAddress: '0xe36ea790bc9d7ab70c55260c66d52b1eca985f84',
|
||||
takerAddress: '0x0000000000000000000000000000000000000000',
|
||||
feeRecipientAddress: '0x78dc5d2d739606d31509c31d654056a45185ecb6',
|
||||
senderAddress: '0x6ecbe1db9ef729cbe972c83fb886247691fb6beb',
|
||||
makerAssetAmount: new BigNumber('100000000000000000000'),
|
||||
takerAssetAmount: new BigNumber('200000000000000000000'),
|
||||
makerFee: new BigNumber('1000000000000000000'),
|
||||
takerFee: new BigNumber('1000000000000000000'),
|
||||
expirationTimeSeconds: new BigNumber('1552396423'),
|
||||
salt: new BigNumber('66097384406870180066678463045003379626790660770396923976862707230261946348951'),
|
||||
makerAssetData: '0xf47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064',
|
||||
takerAssetData: '0xf47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e3',
|
||||
},
|
||||
takerAssetFillAmount: new BigNumber('100000000000000000000'),
|
||||
signature:
|
||||
'0x1ce8e3c600d933423172b5021158a6be2e818613ff8e762d70ef490c752fd98a626a215f09f169668990414de75a53da221c294a3002f796d004827258b641876e03',
|
||||
};
|
||||
|
||||
const ENCODED_INPUTS: { [functionName: string]: string } = {
|
||||
// It would be best to encode inputs as part of the test run, but that's
|
||||
// not really possible in this case, because doing so would introduce a
|
||||
// dependency on @0x/contracts-exchange, but of course that package already
|
||||
// depends on @0x/contracts-exchange-libs (this package), so it would
|
||||
// introduce a circular dependency.
|
||||
//
|
||||
// Values used in this object are declared along with the (commented out)
|
||||
// code that generated them. Running that code depends on the following:
|
||||
//
|
||||
// import { artifacts as exchangeArtifacts, ExchangeContract } from '@0x/contracts-exchange';
|
||||
// import { getContractAddressesForNetworkOrThrow, NetworkId } from '@0x/contract-addresses';
|
||||
// const exchangeContract = new ExchangeContract(
|
||||
// exchangeArtifacts.Exchange.compilerOutput.abi,
|
||||
// getContractAddressesForNetworkOrThrow(NetworkId.Ganache).exchange,
|
||||
// provider,
|
||||
// );
|
||||
//
|
||||
batchCancelOrders:
|
||||
// exchangeContract.batchCancelOrders.getABIEncodedTransactionData([
|
||||
// INPUTS.order,
|
||||
// INPUTS.order,
|
||||
// ]),
|
||||
'0x4ac147820000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000e36ea790bc9d7ab70c55260c66d52b1eca985f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078dc5d2d739606d31509c31d654056a45185ecb60000000000000000000000006ecbe1db9ef729cbe972c83fb886247691fb6beb0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000005c87b0879221cb37dcf690e02b0f9aecf44fcaa5ed9ce99697e86743795fa132596ff597000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e300000000000000000000000000000000000000000000000000000000',
|
||||
batchFillOrders:
|
||||
// exchangeContract.batchFillOrders.getABIEncodedTransactionData(
|
||||
// [INPUTS.order, INPUTS.order],
|
||||
// [INPUTS.takerAssetFillAmount, INPUTS.takerAssetFillAmount],
|
||||
// [INPUTS.signature, INPUTS.signature],
|
||||
// ),
|
||||
'0x297bb70b000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000e36ea790bc9d7ab70c55260c66d52b1eca985f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078dc5d2d739606d31509c31d654056a45185ecb60000000000000000000000006ecbe1db9ef729cbe972c83fb886247691fb6beb0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000005c87b0879221cb37dcf690e02b0f9aecf44fcaa5ed9ce99697e86743795fa132596ff597000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000421ce8e3c600d933423172b5021158a6be2e818613ff8e762d70ef490c752fd98a626a215f09f169668990414de75a53da221c294a3002f796d004827258b641876e03000000000000000000000000000000000000000000000000000000000000',
|
||||
batchFillOrdersNoThrow:
|
||||
// exchangeContract.batchFillOrdersNoThrow.getABIEncodedTransactionData(
|
||||
// [INPUTS.order, INPUTS.order],
|
||||
// [INPUTS.takerAssetFillAmount, INPUTS.takerAssetFillAmount],
|
||||
// [INPUTS.signature, INPUTS.signature],
|
||||
// ),
|
||||
'0x50dde190000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000e36ea790bc9d7ab70c55260c66d52b1eca985f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078dc5d2d739606d31509c31d654056a45185ecb60000000000000000000000006ecbe1db9ef729cbe972c83fb886247691fb6beb0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000005c87b0879221cb37dcf690e02b0f9aecf44fcaa5ed9ce99697e86743795fa132596ff597000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000421ce8e3c600d933423172b5021158a6be2e818613ff8e762d70ef490c752fd98a626a215f09f169668990414de75a53da221c294a3002f796d004827258b641876e03000000000000000000000000000000000000000000000000000000000000',
|
||||
batchFillOrKillOrders:
|
||||
// exchangeContract.batchFillOrKillOrders.getABIEncodedTransactionData(
|
||||
// [INPUTS.order, INPUTS.order],
|
||||
// [INPUTS.takerAssetFillAmount, INPUTS.takerAssetFillAmount],
|
||||
// [INPUTS.signature, INPUTS.signature],
|
||||
// ),
|
||||
'0x4d0ae546000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000e36ea790bc9d7ab70c55260c66d52b1eca985f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078dc5d2d739606d31509c31d654056a45185ecb60000000000000000000000006ecbe1db9ef729cbe972c83fb886247691fb6beb0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000005c87b0879221cb37dcf690e02b0f9aecf44fcaa5ed9ce99697e86743795fa132596ff597000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000421ce8e3c600d933423172b5021158a6be2e818613ff8e762d70ef490c752fd98a626a215f09f169668990414de75a53da221c294a3002f796d004827258b641876e03000000000000000000000000000000000000000000000000000000000000',
|
||||
cancelOrder:
|
||||
// exchangeContract.cancelOrder.getABIEncodedTransactionData(INPUTS.order),
|
||||
'0xd46b02c30000000000000000000000000000000000000000000000000000000000000020000000000000000000000000e36ea790bc9d7ab70c55260c66d52b1eca985f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078dc5d2d739606d31509c31d654056a45185ecb60000000000000000000000006ecbe1db9ef729cbe972c83fb886247691fb6beb0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000005c87b0879221cb37dcf690e02b0f9aecf44fcaa5ed9ce99697e86743795fa132596ff597000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e300000000000000000000000000000000000000000000000000000000',
|
||||
fillOrder:
|
||||
// exchangeContract.fillOrder.getABIEncodedTransactionData(
|
||||
// INPUTS.order,
|
||||
// INPUTS.takerAssetFillAmount,
|
||||
// INPUTS.signature,
|
||||
// ),
|
||||
'0xb4be83d500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000e36ea790bc9d7ab70c55260c66d52b1eca985f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078dc5d2d739606d31509c31d654056a45185ecb60000000000000000000000006ecbe1db9ef729cbe972c83fb886247691fb6beb0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000005c87b0879221cb37dcf690e02b0f9aecf44fcaa5ed9ce99697e86743795fa132596ff597000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000421ce8e3c600d933423172b5021158a6be2e818613ff8e762d70ef490c752fd98a626a215f09f169668990414de75a53da221c294a3002f796d004827258b641876e03000000000000000000000000000000000000000000000000000000000000',
|
||||
fillOrderNoThrow:
|
||||
// exchangeContract.fillOrderNoThrow.getABIEncodedTransactionData(
|
||||
// INPUTS.order,
|
||||
// INPUTS.takerAssetFillAmount,
|
||||
// INPUTS.signature,
|
||||
// ),
|
||||
'0x3e228bae00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000e36ea790bc9d7ab70c55260c66d52b1eca985f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078dc5d2d739606d31509c31d654056a45185ecb60000000000000000000000006ecbe1db9ef729cbe972c83fb886247691fb6beb0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000005c87b0879221cb37dcf690e02b0f9aecf44fcaa5ed9ce99697e86743795fa132596ff597000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000421ce8e3c600d933423172b5021158a6be2e818613ff8e762d70ef490c752fd98a626a215f09f169668990414de75a53da221c294a3002f796d004827258b641876e03000000000000000000000000000000000000000000000000000000000000',
|
||||
fillOrKillOrder:
|
||||
// exchangeContract.fillOrKillOrder.getABIEncodedTransactionData(
|
||||
// INPUTS.order,
|
||||
// INPUTS.takerAssetFillAmount,
|
||||
// INPUTS.signature,
|
||||
// ),
|
||||
'0x64a3bc1500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000e36ea790bc9d7ab70c55260c66d52b1eca985f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078dc5d2d739606d31509c31d654056a45185ecb60000000000000000000000006ecbe1db9ef729cbe972c83fb886247691fb6beb0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000005c87b0879221cb37dcf690e02b0f9aecf44fcaa5ed9ce99697e86743795fa132596ff597000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000421ce8e3c600d933423172b5021158a6be2e818613ff8e762d70ef490c752fd98a626a215f09f169668990414de75a53da221c294a3002f796d004827258b641876e03000000000000000000000000000000000000000000000000000000000000',
|
||||
marketBuyOrders:
|
||||
// exchangeContract.marketBuyOrders.getABIEncodedTransactionData(
|
||||
// [INPUTS.order, INPUTS.order],
|
||||
// INPUTS.takerAssetFillAmount,
|
||||
// [INPUTS.signature, INPUTS.signature],
|
||||
// ),
|
||||
'0xe5fa431b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000e36ea790bc9d7ab70c55260c66d52b1eca985f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078dc5d2d739606d31509c31d654056a45185ecb60000000000000000000000006ecbe1db9ef729cbe972c83fb886247691fb6beb0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000005c87b0879221cb37dcf690e02b0f9aecf44fcaa5ed9ce99697e86743795fa132596ff597000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000421ce8e3c600d933423172b5021158a6be2e818613ff8e762d70ef490c752fd98a626a215f09f169668990414de75a53da221c294a3002f796d004827258b641876e03000000000000000000000000000000000000000000000000000000000000',
|
||||
marketBuyOrdersNoThrow:
|
||||
// exchangeContract.marketBuyOrdersNoThrow.getABIEncodedTransactionData(
|
||||
// [INPUTS.order, INPUTS.order],
|
||||
// INPUTS.takerAssetFillAmount,
|
||||
// [INPUTS.signature, INPUTS.signature],
|
||||
// ),
|
||||
'0xa3e2038000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000e36ea790bc9d7ab70c55260c66d52b1eca985f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078dc5d2d739606d31509c31d654056a45185ecb60000000000000000000000006ecbe1db9ef729cbe972c83fb886247691fb6beb0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000005c87b0879221cb37dcf690e02b0f9aecf44fcaa5ed9ce99697e86743795fa132596ff597000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000421ce8e3c600d933423172b5021158a6be2e818613ff8e762d70ef490c752fd98a626a215f09f169668990414de75a53da221c294a3002f796d004827258b641876e03000000000000000000000000000000000000000000000000000000000000',
|
||||
marketSellOrders:
|
||||
// exchangeContract.marketSellOrders.getABIEncodedTransactionData(
|
||||
// [INPUTS.order, INPUTS.order],
|
||||
// INPUTS.takerAssetFillAmount,
|
||||
// [INPUTS.signature, INPUTS.signature],
|
||||
// ),
|
||||
'0x7e1d980800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000e36ea790bc9d7ab70c55260c66d52b1eca985f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078dc5d2d739606d31509c31d654056a45185ecb60000000000000000000000006ecbe1db9ef729cbe972c83fb886247691fb6beb0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000005c87b0879221cb37dcf690e02b0f9aecf44fcaa5ed9ce99697e86743795fa132596ff597000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000421ce8e3c600d933423172b5021158a6be2e818613ff8e762d70ef490c752fd98a626a215f09f169668990414de75a53da221c294a3002f796d004827258b641876e03000000000000000000000000000000000000000000000000000000000000',
|
||||
marketSellOrdersNoThrow:
|
||||
// exchangeContract.marketSellOrdersNoThrow.getABIEncodedTransactionData(
|
||||
// [INPUTS.order, INPUTS.order],
|
||||
// INPUTS.takerAssetFillAmount,
|
||||
// [INPUTS.signature, INPUTS.signature],
|
||||
// ),
|
||||
'0xdd1c7d1800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000e36ea790bc9d7ab70c55260c66d52b1eca985f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078dc5d2d739606d31509c31d654056a45185ecb60000000000000000000000006ecbe1db9ef729cbe972c83fb886247691fb6beb0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000005c87b0879221cb37dcf690e02b0f9aecf44fcaa5ed9ce99697e86743795fa132596ff597000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000421ce8e3c600d933423172b5021158a6be2e818613ff8e762d70ef490c752fd98a626a215f09f169668990414de75a53da221c294a3002f796d004827258b641876e03000000000000000000000000000000000000000000000000000000000000',
|
||||
matchOrders:
|
||||
// exchangeContract.matchOrders.getABIEncodedTransactionData(
|
||||
// INPUTS.order,
|
||||
// makeComplementaryOrder(INPUTS.order),
|
||||
// INPUTS.signature,
|
||||
// INPUTS.signature,
|
||||
// ),
|
||||
'0x3c28d86100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078dc5d2d739606d31509c31d654056a45185ecb60000000000000000000000006ecbe1db9ef729cbe972c83fb886247691fb6beb00000000000000000000000000000000000000000000000ad78ebc5ac620000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000005c87b0879221cb37dcf690e02b0f9aecf44fcaa5ed9ce99697e86743795fa132596ff597000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000025b8fe1de9daf8ba351890744ff28cf7dfa8f5e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000421ce8e3c600d933423172b5021158a6be2e818613ff8e762d70ef490c752fd98a626a215f09f169668990414de75a53da221c294a3002f796d004827258b641876e03000000000000000000000000000000000000000000000000000000000000',
|
||||
};
|
||||
|
||||
describe('LibTransactionDecoder', () => {
|
||||
let libTxDecoder: LibTransactionDecoderContract;
|
||||
|
||||
before(async () => {
|
||||
await blockchainLifecycle.startAsync();
|
||||
libTxDecoder = await LibTransactionDecoderContract.deployFrom0xArtifactAsync(
|
||||
artifacts.LibTransactionDecoder,
|
||||
provider,
|
||||
txDefaults,
|
||||
);
|
||||
});
|
||||
after(async () => {
|
||||
await blockchainLifecycle.revertAsync();
|
||||
});
|
||||
|
||||
it('should decode an Exchange.batchCancelOrders() transaction', async () => {
|
||||
expect(
|
||||
await libTxDecoder.decodeZeroExTransactionData.callAsync(ENCODED_INPUTS.batchCancelOrders),
|
||||
).to.deep.equal(['batchCancelOrders', [INPUTS.order, INPUTS.order], [], []]);
|
||||
});
|
||||
|
||||
for (const func of ['batchFillOrders', 'batchFillOrdersNoThrow', 'batchFillOrKillOrders']) {
|
||||
it(`should decode an Exchange.${func}() transaction`, async () => {
|
||||
expect(await libTxDecoder.decodeZeroExTransactionData.callAsync(ENCODED_INPUTS[func])).to.deep.equal([
|
||||
func,
|
||||
[INPUTS.order, INPUTS.order],
|
||||
[INPUTS.takerAssetFillAmount, INPUTS.takerAssetFillAmount],
|
||||
[INPUTS.signature, INPUTS.signature],
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
it('should decode an Exchange.cancelOrder() transaction', async () => {
|
||||
expect(await libTxDecoder.decodeZeroExTransactionData.callAsync(ENCODED_INPUTS.cancelOrder)).to.deep.equal([
|
||||
'cancelOrder',
|
||||
[INPUTS.order],
|
||||
[],
|
||||
[],
|
||||
]);
|
||||
});
|
||||
|
||||
for (const func of ['fillOrder', 'fillOrderNoThrow', 'fillOrKillOrder']) {
|
||||
it(`should decode an Exchange.${func}() transaction`, async () => {
|
||||
expect(await libTxDecoder.decodeZeroExTransactionData.callAsync(ENCODED_INPUTS[func])).to.deep.equal([
|
||||
func,
|
||||
[INPUTS.order],
|
||||
[INPUTS.takerAssetFillAmount],
|
||||
[INPUTS.signature],
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
for (const func of ['marketBuyOrders', 'marketBuyOrdersNoThrow', 'marketSellOrders', 'marketSellOrdersNoThrow']) {
|
||||
it(`should decode an Exchange.${func}() transaction`, async () => {
|
||||
expect(await libTxDecoder.decodeZeroExTransactionData.callAsync(ENCODED_INPUTS[func])).to.deep.equal([
|
||||
func,
|
||||
[INPUTS.order, INPUTS.order],
|
||||
[INPUTS.takerAssetFillAmount],
|
||||
[INPUTS.signature, INPUTS.signature],
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
it('should decode an Exchange.matchOrders() transaction', async () => {
|
||||
function makeComplementaryOrder(order: OrderWithoutExchange): OrderWithoutExchange {
|
||||
const complementaryOrder = order;
|
||||
|
||||
complementaryOrder.makerAddress = order.takerAddress;
|
||||
complementaryOrder.takerAddress = order.makerAddress;
|
||||
|
||||
complementaryOrder.makerAssetData = order.takerAssetData;
|
||||
complementaryOrder.takerAssetData = order.makerAssetData;
|
||||
|
||||
complementaryOrder.makerAssetAmount = order.takerAssetAmount;
|
||||
complementaryOrder.takerAssetAmount = order.makerAssetAmount;
|
||||
|
||||
complementaryOrder.makerFee = order.takerFee;
|
||||
complementaryOrder.takerFee = order.makerFee;
|
||||
|
||||
return complementaryOrder;
|
||||
}
|
||||
|
||||
expect(await libTxDecoder.decodeZeroExTransactionData.callAsync(ENCODED_INPUTS.matchOrders)).to.deep.equal([
|
||||
'matchOrders',
|
||||
[INPUTS.order, makeComplementaryOrder(INPUTS.order)],
|
||||
[INPUTS.order.takerAssetAmount, makeComplementaryOrder(INPUTS.order).takerAssetAmount],
|
||||
[INPUTS.signature, INPUTS.signature],
|
||||
]);
|
||||
});
|
||||
});
|
@@ -10,6 +10,7 @@
|
||||
"generated-artifacts/LibFillResults.json",
|
||||
"generated-artifacts/LibMath.json",
|
||||
"generated-artifacts/LibOrder.json",
|
||||
"generated-artifacts/LibTransactionDecoder.json",
|
||||
"generated-artifacts/TestLibs.json"
|
||||
],
|
||||
"exclude": ["./deploy/solc/solc_bin"]
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "2.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "2.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "2.1.3",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.5 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.4 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.3 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange",
|
||||
"version": "2.1.3",
|
||||
"version": "2.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -49,9 +49,9 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.5",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/contracts-test-utils": "^3.1.7",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -69,13 +69,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-asset-proxy": "^2.1.3",
|
||||
"@0x/contracts-erc1155": "^1.1.4",
|
||||
"@0x/contracts-erc20": "^2.2.3",
|
||||
"@0x/contracts-erc721": "^2.1.4",
|
||||
"@0x/contracts-exchange-libs": "^2.1.4",
|
||||
"@0x/contracts-utils": "^3.1.4",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/contracts-asset-proxy": "^2.1.5",
|
||||
"@0x/contracts-erc1155": "^1.1.6",
|
||||
"@0x/contracts-erc20": "^2.2.5",
|
||||
"@0x/contracts-erc721": "^2.1.6",
|
||||
"@0x/contracts-exchange-libs": "^2.1.6",
|
||||
"@0x/contracts-utils": "^3.1.6",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "3.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "3.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "3.1.3",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.5 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.4 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.3 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-extensions",
|
||||
"version": "3.1.3",
|
||||
"version": "3.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -48,11 +48,11 @@
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contract-wrappers": "^9.1.2",
|
||||
"@0x/contract-wrappers": "^9.1.4",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.5",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/contracts-test-utils": "^3.1.7",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -70,13 +70,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-asset-proxy": "^2.1.3",
|
||||
"@0x/contracts-erc20": "^2.2.3",
|
||||
"@0x/contracts-erc721": "^2.1.4",
|
||||
"@0x/contracts-exchange": "^2.1.3",
|
||||
"@0x/contracts-exchange-libs": "^2.1.4",
|
||||
"@0x/contracts-utils": "^3.1.4",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/contracts-asset-proxy": "^2.1.5",
|
||||
"@0x/contracts-erc20": "^2.2.5",
|
||||
"@0x/contracts-erc721": "^2.1.6",
|
||||
"@0x/contracts-exchange": "^2.1.5",
|
||||
"@0x/contracts-exchange-libs": "^2.1.6",
|
||||
"@0x/contracts-utils": "^3.1.6",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "3.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "3.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "3.1.3",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.5 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.4 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.3 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-multisig",
|
||||
"version": "3.1.3",
|
||||
"version": "3.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -49,9 +49,9 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.5",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/contracts-test-utils": "^3.1.7",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -69,8 +69,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-asset-proxy": "^2.1.3",
|
||||
"@0x/contracts-erc20": "^2.2.3",
|
||||
"@0x/contracts-asset-proxy": "^2.1.5",
|
||||
"@0x/contracts-erc20": "^2.2.5",
|
||||
"@0x/contracts-utils": "2.0.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "3.1.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "3.1.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.1.5",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.7 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.6 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.5 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-test-utils",
|
||||
"version": "3.1.5",
|
||||
"version": "3.1.7",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -42,13 +42,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/sol-coverage": "^3.0.4",
|
||||
"@0x/sol-profiler": "^3.1.6",
|
||||
"@0x/sol-trace": "^2.0.12",
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/sol-coverage": "^3.0.5",
|
||||
"@0x/sol-profiler": "^3.1.7",
|
||||
"@0x/sol-trace": "^2.0.13",
|
||||
"@0x/subproviders": "^4.1.0",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "3.1.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "3.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.1.4",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.6 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.5 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.4 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-utils",
|
||||
"version": "3.1.4",
|
||||
"version": "3.1.6",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -49,9 +49,9 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.5",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/contracts-test-utils": "^3.1.7",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
@@ -70,7 +70,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "6.0.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "6.0.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "6.0.8",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v6.0.10 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.0.9 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.0.8 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "0x.js",
|
||||
"version": "6.0.8",
|
||||
"version": "6.0.10",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -45,8 +45,8 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen-wrappers": "^4.3.0",
|
||||
"@0x/contract-addresses": "^2.3.3",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/migrations": "^4.1.4",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/migrations": "^4.1.6",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
@@ -75,10 +75,10 @@
|
||||
"dependencies": {
|
||||
"@0x/assert": "^2.0.10",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contract-wrappers": "^9.1.2",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/order-watcher": "^4.0.9",
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/contract-wrappers": "^9.1.4",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/order-watcher": "^4.0.11",
|
||||
"@0x/subproviders": "^4.1.0",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "6.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "6.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "6.1.3",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v6.1.5 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.1.4 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.1.3 - _May 14, 2019_
|
||||
|
||||
* Convert `metaData.remainingTakerAssetAmount` to BigNumber if present in APIOrder (#1810)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/asset-buyer",
|
||||
"version": "6.1.3",
|
||||
"version": "6.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -38,11 +38,11 @@
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/asset-buyer/README.md",
|
||||
"dependencies": {
|
||||
"@0x/assert": "^2.0.10",
|
||||
"@0x/connect": "^5.0.8",
|
||||
"@0x/contract-wrappers": "^9.1.2",
|
||||
"@0x/connect": "^5.0.10",
|
||||
"@0x/contract-wrappers": "^9.1.4",
|
||||
"@0x/json-schemas": "^3.0.10",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/subproviders": "^4.1.0",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "5.0.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "5.0.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "5.0.8",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v5.0.10 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v5.0.9 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v5.0.8 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/connect",
|
||||
"version": "5.0.8",
|
||||
"version": "5.0.10",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,7 +47,7 @@
|
||||
"dependencies": {
|
||||
"@0x/assert": "^2.0.10",
|
||||
"@0x/json-schemas": "^3.0.10",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,4 +1,27 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "9.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "9.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Fix decoding bug in `DutchAuctionWrapper.decodeDutchAuctionData`",
|
||||
"pr": 1815
|
||||
},
|
||||
{
|
||||
"note": "Fallback to eth_sign if eth_signedTypedData fails",
|
||||
"pr": 1817
|
||||
}
|
||||
],
|
||||
"timestamp": 1557961111
|
||||
},
|
||||
{
|
||||
"version": "9.1.2",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,15 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v9.1.4 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v9.1.3 - _May 15, 2019_
|
||||
|
||||
* Fix decoding bug in `DutchAuctionWrapper.decodeDutchAuctionData` (#1815)
|
||||
* Fallback to eth_sign if eth_signedTypedData fails (#1817)
|
||||
|
||||
## v9.1.2 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-wrappers",
|
||||
"version": "9.1.2",
|
||||
"version": "9.1.4",
|
||||
"description": "Smart TS wrappers for 0x smart contracts",
|
||||
"keywords": [
|
||||
"0xproject",
|
||||
@@ -38,12 +38,12 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/contracts-test-utils": "^3.1.5",
|
||||
"@0x/contracts-test-utils": "^3.1.7",
|
||||
"@0x/coordinator-server": "0.1.1",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/fill-scenarios": "^3.0.8",
|
||||
"@0x/migrations": "^4.1.4",
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/fill-scenarios": "^3.0.10",
|
||||
"@0x/migrations": "^4.1.6",
|
||||
"@0x/subproviders": "^4.1.0",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
@@ -76,7 +76,7 @@
|
||||
"@0x/contract-addresses": "^2.3.3",
|
||||
"@0x/contract-artifacts": "^1.5.1",
|
||||
"@0x/json-schemas": "^3.0.10",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -740,7 +740,7 @@ export class CoordinatorWrapper extends ContractWrapper {
|
||||
data,
|
||||
verifyingContractAddress: this.exchangeAddress,
|
||||
};
|
||||
const signedTransaction = await signatureUtils.ecSignTypedDataTransactionAsync(
|
||||
const signedTransaction = await signatureUtils.ecSignTransactionAsync(
|
||||
this._web3Wrapper.getProvider(),
|
||||
transaction,
|
||||
transaction.signerAddress,
|
||||
|
@@ -71,8 +71,8 @@ export class DutchAuctionWrapper extends ContractWrapper {
|
||||
['uint256', 'uint256'],
|
||||
dutchAuctionDetailsBuffer,
|
||||
);
|
||||
const beginTimeSeconds = new BigNumber(`0x${beginTimeSecondsAsBN.toString()}`);
|
||||
const beginAmount = new BigNumber(`0x${beginAmountAsBN.toString()}`);
|
||||
const beginTimeSeconds = new BigNumber(beginTimeSecondsAsBN.toString());
|
||||
const beginAmount = new BigNumber(beginAmountAsBN.toString());
|
||||
return {
|
||||
assetData,
|
||||
beginTimeSeconds,
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import { expectTransactionFailedAsync, getLatestBlockTimestampAsync } from '@0x/contracts-test-utils';
|
||||
import { BlockchainLifecycle } from '@0x/dev-utils';
|
||||
import { assetDataUtils } from '@0x/order-utils';
|
||||
import { RevertReason, SignedOrder } from '@0x/types';
|
||||
import { ERC20AssetData, RevertReason, SignedOrder } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import * as chai from 'chai';
|
||||
import 'mocha';
|
||||
|
||||
import { ContractWrappers } from '../src';
|
||||
import { ContractWrappers, DutchAuctionWrapper } from '../src';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
import { constants } from './utils/constants';
|
||||
@@ -91,6 +91,21 @@ describe('DutchAuctionWrapper', () => {
|
||||
afterEach(async () => {
|
||||
await blockchainLifecycle.revertAsync();
|
||||
});
|
||||
describe('.decodeDutchAuctionAssetData', () => {
|
||||
it('decodes to the encoded values', async () => {
|
||||
const encodedAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
||||
makerTokenAssetData,
|
||||
auctionBeginTimeSeconds,
|
||||
makerAssetAmount,
|
||||
);
|
||||
const decodedAssetData = DutchAuctionWrapper.decodeDutchAuctionData(encodedAssetData);
|
||||
// tslint:disable-next-line:no-unnecessary-type-assertion
|
||||
const erc20AssetData = decodedAssetData.assetData as ERC20AssetData;
|
||||
expect(erc20AssetData.tokenAddress).to.eq(makerTokenAddress);
|
||||
expect(decodedAssetData.beginAmount).to.be.bignumber.eq(makerAssetAmount);
|
||||
expect(decodedAssetData.beginTimeSeconds).to.be.bignumber.eq(auctionBeginTimeSeconds);
|
||||
});
|
||||
});
|
||||
describe('#matchOrdersAsync', () => {
|
||||
it('should match two orders', async () => {
|
||||
const txHash = await contractWrappers.dutchAuction.matchOrdersAsync(buyOrder, sellOrder, takerAddress);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/dev-tools-pages",
|
||||
"version": "0.0.26",
|
||||
"version": "0.0.27",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -27,7 +27,7 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@0x/react-shared": "^2.0.11",
|
||||
"@0x/react-shared": "^2.0.12",
|
||||
"basscss": "^8.0.3",
|
||||
"bowser": "^1.9.4",
|
||||
"highlight.js": "^9.13.1",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "2.2.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "2.2.2",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.2.3 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.2 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/dev-utils",
|
||||
"version": "2.2.2",
|
||||
"version": "2.2.3",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -42,7 +42,7 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/subproviders": "^4.1.0",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "3.0.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "3.0.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.8",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.10 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.9 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.8 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/fill-scenarios",
|
||||
"version": "3.0.8",
|
||||
"version": "3.0.10",
|
||||
"description": "0x order fill scenario generator",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
@@ -32,7 +32,7 @@
|
||||
"@0x/abi-gen-wrappers": "^4.3.0",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contract-artifacts": "^1.5.1",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/instant",
|
||||
"version": "1.0.22",
|
||||
"version": "1.0.24",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,10 +44,10 @@
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/instant/README.md",
|
||||
"dependencies": {
|
||||
"@0x/assert": "^2.0.10",
|
||||
"@0x/asset-buyer": "^6.1.3",
|
||||
"@0x/asset-buyer": "^6.1.5",
|
||||
"@0x/json-schemas": "^3.0.10",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/subproviders": "^4.1.0",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/metacoin",
|
||||
"version": "0.0.49",
|
||||
"version": "0.0.51",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -34,10 +34,10 @@
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/abi-gen-templates": "^2.1.0",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/sol-coverage": "^3.0.4",
|
||||
"@0x/sol-profiler": "^3.1.6",
|
||||
"@0x/sol-trace": "^2.0.12",
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/sol-coverage": "^3.0.5",
|
||||
"@0x/sol-profiler": "^3.1.7",
|
||||
"@0x/sol-trace": "^2.0.13",
|
||||
"@0x/subproviders": "^4.1.0",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
@@ -51,9 +51,9 @@
|
||||
"run-s": "^0.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/contracts-test-utils": "^3.1.5",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/contracts-test-utils": "^3.1.7",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "4.1.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "4.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.1.4",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.1.6 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.1.5 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.1.4 - _May 14, 2019_
|
||||
|
||||
* Add --pk flag to accept private key when migrating (#1811)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/migrations",
|
||||
"version": "4.1.4",
|
||||
"version": "4.1.6",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -36,7 +36,7 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@types/yargs": "^11.0.0",
|
||||
@@ -54,9 +54,9 @@
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contract-addresses": "^2.3.3",
|
||||
"@0x/contract-artifacts": "^1.5.1",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/subproviders": "^4.1.0",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@0x/monorepo-scripts",
|
||||
"version": "1.0.31",
|
||||
"version": "1.0.32",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
|
@@ -18,7 +18,7 @@ async function prepublishChecksAsync(): Promise<void> {
|
||||
await checkCurrentVersionMatchesLatestPublishedNPMPackageAsync(updatedPublicPackages);
|
||||
await checkChangelogFormatAsync(updatedPublicPackages);
|
||||
await checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicPackages);
|
||||
await checkPublishRequiredSetupAsync();
|
||||
await checkPublishRequiredSetupAsync(updatedPublicPackages);
|
||||
await checkDockerHubSetupAsync();
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ async function checkChangelogFormatAsync(updatedPublicPackages: Package[]): Prom
|
||||
}
|
||||
}
|
||||
|
||||
async function checkPublishRequiredSetupAsync(): Promise<void> {
|
||||
async function checkPublishRequiredSetupAsync(updatedPublicPackages: Package[]): Promise<void> {
|
||||
// check to see if logged into npm before publishing
|
||||
try {
|
||||
// HACK: for some reason on some setups, the `npm whoami` will not recognize a logged-in user
|
||||
@@ -141,6 +141,22 @@ async function checkPublishRequiredSetupAsync(): Promise<void> {
|
||||
throw new Error('You must be logged into npm in the commandline to publish. Run `npm login` and try again.');
|
||||
}
|
||||
|
||||
// check to see that all required write permissions exist
|
||||
utils.log(`Checking that all necessary npm write permissions exist...`);
|
||||
const pkgPermissionsResult = await execAsync(`sudo npm access ls-packages`);
|
||||
const pkgPermissions = JSON.parse(pkgPermissionsResult.stdout);
|
||||
const writePermissions = Object.keys(pkgPermissions).filter(pkgName => {
|
||||
return pkgPermissions[pkgName] === 'read-write';
|
||||
});
|
||||
const unwriteablePkgs = updatedPublicPackages.filter(pkg => !writePermissions.includes(pkg.packageJson.name));
|
||||
if (unwriteablePkgs.length > 0) {
|
||||
utils.log(`Missing write permissions for the following packages:`);
|
||||
unwriteablePkgs.forEach(pkg => {
|
||||
utils.log(pkg.packageJson.name);
|
||||
});
|
||||
throw new Error(`Obtain necessary write permissions to continue.`);
|
||||
}
|
||||
|
||||
// Check to see if Git personal token setup
|
||||
if (constants.githubPersonalAccessToken === undefined) {
|
||||
throw new Error(
|
||||
|
@@ -1,4 +1,23 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "8.1.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "8.1.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add `ecSignTransactionAsync`",
|
||||
"pr": 1817
|
||||
}
|
||||
],
|
||||
"timestamp": 1557961111
|
||||
},
|
||||
{
|
||||
"version": "8.0.2",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v8.1.1 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v8.1.0 - _May 15, 2019_
|
||||
|
||||
* Add `ecSignTransactionAsync` (#1817)
|
||||
|
||||
## v8.0.2 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/order-utils",
|
||||
"version": "8.0.2",
|
||||
"version": "8.1.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -36,7 +36,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/order-utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
|
@@ -20,6 +20,7 @@ import * as _ from 'lodash';
|
||||
import { assert } from './assert';
|
||||
import { eip712Utils } from './eip712_utils';
|
||||
import { orderHashUtils } from './order_hash';
|
||||
import { transactionHashUtils } from './transaction_hash';
|
||||
import { TypedDataError } from './types';
|
||||
import { utils } from './utils';
|
||||
|
||||
@@ -292,6 +293,50 @@ export const signatureUtils = {
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Signs a transaction and returns a SignedZeroExTransaction. First `eth_signTypedData` is requested
|
||||
* then a fallback to `eth_sign` if not available on the supplied provider.
|
||||
* @param supportedProvider Web3 provider to use for all JSON RPC requests
|
||||
* @param transaction The ZeroExTransaction to sign.
|
||||
* @param signerAddress The hex encoded Ethereum address you wish to sign it with. This address
|
||||
* must be available via the supplied Provider.
|
||||
* @return A SignedTransaction containing the order and Elliptic curve signature with Signature Type.
|
||||
*/
|
||||
async ecSignTransactionAsync(
|
||||
supportedProvider: SupportedProvider,
|
||||
transaction: ZeroExTransaction,
|
||||
signerAddress: string,
|
||||
): Promise<SignedZeroExTransaction> {
|
||||
assert.doesConformToSchema('transaction', transaction, schemas.zeroExTransactionSchema, [schemas.hexSchema]);
|
||||
try {
|
||||
const signedTransaction = await signatureUtils.ecSignTypedDataTransactionAsync(
|
||||
supportedProvider,
|
||||
transaction,
|
||||
signerAddress,
|
||||
);
|
||||
return signedTransaction;
|
||||
} catch (err) {
|
||||
// HACK: We are unable to handle specific errors thrown since provider is not an object
|
||||
// under our control. It could be Metamask Web3, Ethers, or any general RPC provider.
|
||||
// We check for a user denying the signature request in a way that supports Metamask and
|
||||
// Coinbase Wallet. Unfortunately for signers with a different error message,
|
||||
// they will receive two signature requests.
|
||||
if (err.message.includes('User denied message signature')) {
|
||||
throw err;
|
||||
}
|
||||
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
|
||||
const signatureHex = await signatureUtils.ecSignHashAsync(
|
||||
supportedProvider,
|
||||
transactionHash,
|
||||
signerAddress,
|
||||
);
|
||||
const signedTransaction = {
|
||||
...transaction,
|
||||
signature: signatureHex,
|
||||
};
|
||||
return signedTransaction;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Signs a ZeroExTransaction using `eth_signTypedData` and returns a SignedZeroExTransaction.
|
||||
* @param supportedProvider Web3 provider to use for all JSON RPC requests
|
||||
@@ -495,3 +540,4 @@ function parseSignatureHexAsRSV(signatureHex: string): ECSignature {
|
||||
};
|
||||
return ecSignature;
|
||||
}
|
||||
// tslint:disable:max-file-line-count
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import { Order, SignatureType } from '@0x/types';
|
||||
import { assert } from '@0x/assert';
|
||||
import { Order, SignatureType, ZeroExTransaction } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import * as chai from 'chai';
|
||||
import { JSONRPCErrorCallback, JSONRPCRequestPayload } from 'ethereum-types';
|
||||
@@ -6,7 +7,7 @@ import * as ethUtil from 'ethereumjs-util';
|
||||
import * as _ from 'lodash';
|
||||
import 'mocha';
|
||||
|
||||
import { generatePseudoRandomSalt, orderHashUtils } from '../src';
|
||||
import { generatePseudoRandomSalt, orderHashUtils, transactionHashUtils } from '../src';
|
||||
import { constants } from '../src/constants';
|
||||
import { signatureUtils } from '../src/signature_utils';
|
||||
|
||||
@@ -20,6 +21,7 @@ describe('Signature utils', () => {
|
||||
let makerAddress: string;
|
||||
const fakeExchangeContractAddress = '0x1dc4c1cefef38a777b15aa20260a54e584b16c48';
|
||||
let order: Order;
|
||||
let transaction: ZeroExTransaction;
|
||||
before(async () => {
|
||||
const availableAddreses = await web3Wrapper.getAvailableAddressesAsync();
|
||||
makerAddress = availableAddreses[0];
|
||||
@@ -38,6 +40,12 @@ describe('Signature utils', () => {
|
||||
takerAssetAmount: new BigNumber(0),
|
||||
expirationTimeSeconds: new BigNumber(0),
|
||||
};
|
||||
transaction = {
|
||||
verifyingContractAddress: fakeExchangeContractAddress,
|
||||
salt: generatePseudoRandomSalt(),
|
||||
signerAddress: makerAddress,
|
||||
data: '0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b0',
|
||||
};
|
||||
});
|
||||
describe('#isValidSignatureAsync', () => {
|
||||
let dataHex = '0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b0';
|
||||
@@ -197,6 +205,55 @@ describe('Signature utils', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('#ecSignTransactionAsync', () => {
|
||||
it('should default to eth_sign if eth_signTypedData is unavailable', async () => {
|
||||
const fakeProvider = {
|
||||
async sendAsync(payload: JSONRPCRequestPayload, callback: JSONRPCErrorCallback): Promise<void> {
|
||||
if (payload.method === 'eth_signTypedData') {
|
||||
callback(new Error('Internal RPC Error'));
|
||||
} else if (payload.method === 'eth_sign') {
|
||||
const [address, message] = payload.params;
|
||||
const signature = await web3Wrapper.signMessageAsync(address, message);
|
||||
callback(null, {
|
||||
id: 42,
|
||||
jsonrpc: '2.0',
|
||||
result: signature,
|
||||
});
|
||||
} else {
|
||||
callback(null, { id: 42, jsonrpc: '2.0', result: [makerAddress] });
|
||||
}
|
||||
},
|
||||
};
|
||||
const signedTransaction = await signatureUtils.ecSignTransactionAsync(
|
||||
fakeProvider,
|
||||
transaction,
|
||||
makerAddress,
|
||||
);
|
||||
assert.isHexString('signedTransaction.signature', signedTransaction.signature);
|
||||
});
|
||||
it('should throw if the user denies the signing request', async () => {
|
||||
const fakeProvider = {
|
||||
async sendAsync(payload: JSONRPCRequestPayload, callback: JSONRPCErrorCallback): Promise<void> {
|
||||
if (payload.method === 'eth_signTypedData') {
|
||||
callback(new Error('User denied message signature'));
|
||||
} else if (payload.method === 'eth_sign') {
|
||||
const [address, message] = payload.params;
|
||||
const signature = await web3Wrapper.signMessageAsync(address, message);
|
||||
callback(null, {
|
||||
id: 42,
|
||||
jsonrpc: '2.0',
|
||||
result: signature,
|
||||
});
|
||||
} else {
|
||||
callback(null, { id: 42, jsonrpc: '2.0', result: [makerAddress] });
|
||||
}
|
||||
},
|
||||
};
|
||||
expect(
|
||||
signatureUtils.ecSignTransactionAsync(fakeProvider, transaction, makerAddress),
|
||||
).to.to.be.rejectedWith('User denied message signature');
|
||||
});
|
||||
});
|
||||
describe('#ecSignHashAsync', () => {
|
||||
before(async () => {
|
||||
const availableAddreses = await web3Wrapper.getAvailableAddressesAsync();
|
||||
@@ -319,6 +376,60 @@ describe('Signature utils', () => {
|
||||
expect(signedOrder.signature).to.equal(expectedSignature);
|
||||
});
|
||||
});
|
||||
describe('#ecSignTypedDataTransactionAsync', () => {
|
||||
it('should result in the same signature as signing the order hash without an ethereum message prefix', async () => {
|
||||
// Note: Since order hash is an EIP712 hash the result of a valid EIP712 signature
|
||||
// of order hash is the same as signing the order without the Ethereum Message prefix.
|
||||
const transactionHashHex = transactionHashUtils.getTransactionHashHex(transaction);
|
||||
const sig = ethUtil.ecsign(
|
||||
ethUtil.toBuffer(transactionHashHex),
|
||||
Buffer.from('F2F48EE19680706196E2E339E5DA3491186E0C4C5030670656B0E0164837257D', 'hex'),
|
||||
);
|
||||
const signatureBuffer = Buffer.concat([
|
||||
ethUtil.toBuffer(sig.v),
|
||||
ethUtil.toBuffer(sig.r),
|
||||
ethUtil.toBuffer(sig.s),
|
||||
ethUtil.toBuffer(SignatureType.EIP712),
|
||||
]);
|
||||
const signatureHex = `0x${signatureBuffer.toString('hex')}`;
|
||||
const signedTransaction = await signatureUtils.ecSignTypedDataTransactionAsync(
|
||||
provider,
|
||||
transaction,
|
||||
makerAddress,
|
||||
);
|
||||
const isValidSignature = await signatureUtils.isValidSignatureAsync(
|
||||
provider,
|
||||
transactionHashHex,
|
||||
signedTransaction.signature,
|
||||
makerAddress,
|
||||
);
|
||||
expect(signatureHex).to.eq(signedTransaction.signature);
|
||||
expect(isValidSignature).to.eq(true);
|
||||
});
|
||||
it('should return the correct Signature for signatureHex concatenated as R + S + V', async () => {
|
||||
const fakeProvider = {
|
||||
async sendAsync(payload: JSONRPCRequestPayload, callback: JSONRPCErrorCallback): Promise<void> {
|
||||
if (payload.method === 'eth_signTypedData') {
|
||||
const [address, typedData] = payload.params;
|
||||
const signature = await web3Wrapper.signTypedDataAsync(address, typedData);
|
||||
callback(null, {
|
||||
id: 42,
|
||||
jsonrpc: '2.0',
|
||||
result: signature,
|
||||
});
|
||||
} else {
|
||||
callback(null, { id: 42, jsonrpc: '2.0', result: [makerAddress] });
|
||||
}
|
||||
},
|
||||
};
|
||||
const signedTransaction = await signatureUtils.ecSignTypedDataTransactionAsync(
|
||||
fakeProvider,
|
||||
transaction,
|
||||
makerAddress,
|
||||
);
|
||||
assert.isHexString('signedTransaction.signature', signedTransaction.signature);
|
||||
});
|
||||
});
|
||||
describe('#convertECSignatureToSignatureHex', () => {
|
||||
const ecSignature: ECSignature = {
|
||||
v: 27,
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "4.0.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "4.0.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.0.9",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.0.11 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.10 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.9 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/order-watcher",
|
||||
"version": "4.0.9",
|
||||
"version": "4.0.11",
|
||||
"description": "An order watcher daemon that watches for order validity",
|
||||
"keywords": [
|
||||
"0x",
|
||||
@@ -39,9 +39,9 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/migrations": "^4.1.4",
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/migrations": "^4.1.6",
|
||||
"@0x/subproviders": "^4.1.0",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/bintrees": "^1.0.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
@@ -69,10 +69,10 @@
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contract-addresses": "^2.3.3",
|
||||
"@0x/contract-artifacts": "^1.5.1",
|
||||
"@0x/contract-wrappers": "^9.1.2",
|
||||
"@0x/fill-scenarios": "^3.0.8",
|
||||
"@0x/contract-wrappers": "^9.1.4",
|
||||
"@0x/fill-scenarios": "^3.0.10",
|
||||
"@0x/json-schemas": "^3.0.10",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/pipeline",
|
||||
"version": "1.0.19",
|
||||
"version": "1.0.21",
|
||||
"private": true,
|
||||
"description": "Data pipeline for offline analysis",
|
||||
"scripts": {
|
||||
@@ -40,13 +40,13 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/connect": "^5.0.8",
|
||||
"@0x/connect": "^5.0.10",
|
||||
"@0x/contract-addresses": "^2.3.3",
|
||||
"@0x/contract-artifacts": "^1.5.1",
|
||||
"@0x/contract-wrappers": "^9.1.2",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/order-utils": "^8.0.2",
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/contract-wrappers": "^9.1.4",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/subproviders": "^4.1.0",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "2.0.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "2.0.11",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.12 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.11 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/react-docs",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.12",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -25,7 +25,7 @@
|
||||
"url": "https://github.com/0xProject/0x-monorepo.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/compare-versions": "^3.0.0",
|
||||
"@types/styled-components": "4.0.0",
|
||||
@@ -35,7 +35,7 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/react-shared": "^2.0.11",
|
||||
"@0x/react-shared": "^2.0.12",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@types/lodash": "4.14.104",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "2.0.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "2.0.11",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.12 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.11 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/react-shared",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.12",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -26,7 +26,7 @@
|
||||
"url": "https://github.com/0xProject/0x-monorepo.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"shx": "^0.2.2",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "3.1.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "3.1.7",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.8 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.7 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/sol-compiler",
|
||||
"version": "3.1.7",
|
||||
"version": "3.1.8",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -43,7 +43,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-compiler/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/dev-utils": "^2.2.3",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/chokidar": "^1.7.5",
|
||||
"@types/mkdirp": "^0.5.2",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "3.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "3.0.4",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.5 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.4 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/sol-coverage",
|
||||
"version": "3.0.4",
|
||||
"version": "3.0.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -30,8 +30,8 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-coverage/README.md",
|
||||
"dependencies": {
|
||||
"@0x/sol-tracing-utils": "^6.0.11",
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/sol-tracing-utils": "^6.0.12",
|
||||
"@0x/subproviders": "^4.1.0",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@types/minimatch": "^3.0.3",
|
||||
"ethereum-types": "^2.1.2",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "2.0.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "2.0.11",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.12 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.11 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/sol-doc",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.12",
|
||||
"description": "Solidity documentation generator",
|
||||
"main": "lib/src/index.js",
|
||||
"types": "lib/src/index.d.js",
|
||||
@@ -26,7 +26,7 @@
|
||||
"author": "F. Eugene Aumson",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/sol-compiler": "^3.1.8",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"ethereum-types": "^2.1.2",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "3.1.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "3.1.6",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.7 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.6 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/sol-profiler",
|
||||
"version": "3.1.6",
|
||||
"version": "3.1.7",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -30,8 +30,8 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-profiler/README.md",
|
||||
"dependencies": {
|
||||
"@0x/sol-tracing-utils": "^6.0.11",
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/sol-tracing-utils": "^6.0.12",
|
||||
"@0x/subproviders": "^4.1.0",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"ethereum-types": "^2.1.2",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1558712885,
|
||||
"version": "2.0.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "2.0.12",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.13 - _May 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.12 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user