aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/0x.js/CHANGELOG.json2
-rw-r--r--packages/abi-gen/CHANGELOG.json10
-rwxr-xr-xpackages/abi-gen/bin/abi-gen.js2
-rw-r--r--packages/abi-gen/package.json4
-rw-r--r--packages/assert/CHANGELOG.json1
-rw-r--r--packages/base-contract/CHANGELOG.json1
-rw-r--r--packages/connect/CHANGELOG.json1
-rw-r--r--packages/contract-wrappers/CHANGELOG.json1
-rw-r--r--packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol186
-rw-r--r--packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol218
-rw-r--r--packages/dev-utils/CHANGELOG.json1
-rw-r--r--packages/ethereum-types/CHANGELOG.json1
-rw-r--r--packages/fill-scenarios/CHANGELOG.json1
-rw-r--r--packages/json-schemas/CHANGELOG.json1
-rw-r--r--packages/migrations/CHANGELOG.json1
-rw-r--r--packages/migrations/package.json1
-rw-r--r--packages/monorepo-scripts/CHANGELOG.json1
-rw-r--r--packages/order-utils/CHANGELOG.json1
-rw-r--r--packages/order-watcher/CHANGELOG.json1
-rw-r--r--packages/react-docs/CHANGELOG.json1
-rw-r--r--packages/react-shared/CHANGELOG.json1
-rw-r--r--packages/sol-compiler/CHANGELOG.json1
-rw-r--r--packages/sol-cov/CHANGELOG.json1
-rw-r--r--packages/sol-resolver/CHANGELOG.json1
-rw-r--r--packages/sra-report/CHANGELOG.json1
-rw-r--r--packages/subproviders/CHANGELOG.json1
-rw-r--r--packages/tslint-config/CHANGELOG.json1
-rw-r--r--packages/types/CHANGELOG.json1
-rw-r--r--packages/typescript-typings/CHANGELOG.json1
-rw-r--r--packages/utils/CHANGELOG.json10
-rw-r--r--packages/utils/package.json1
-rw-r--r--packages/utils/src/fetchAsync.ts3
-rw-r--r--packages/web3-wrapper/CHANGELOG.json1
-rw-r--r--packages/website/package.json10
-rw-r--r--yarn.lock77
35 files changed, 303 insertions, 244 deletions
diff --git a/packages/0x.js/CHANGELOG.json b/packages/0x.js/CHANGELOG.json
index 7d6139658..c3b8728c6 100644
--- a/packages/0x.js/CHANGELOG.json
+++ b/packages/0x.js/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043100,
"version": "1.0.0-rc.2",
"changes": [
{
@@ -8,6 +9,7 @@
]
},
{
+ "timestamp": 1532043000,
"version": "1.0.0-rc.1",
"changes": [
{
diff --git a/packages/abi-gen/CHANGELOG.json b/packages/abi-gen/CHANGELOG.json
index 0207266a2..4162b943f 100644
--- a/packages/abi-gen/CHANGELOG.json
+++ b/packages/abi-gen/CHANGELOG.json
@@ -1,5 +1,15 @@
[
{
+ "version": "1.0.1",
+ "changes": [
+ {
+ "note": "Fix the abi-gen entry point in package.json",
+ "pr": 901
+ }
+ ]
+ },
+ {
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/abi-gen/bin/abi-gen.js b/packages/abi-gen/bin/abi-gen.js
index 8d6bdccf8..73ffe76ed 100755
--- a/packages/abi-gen/bin/abi-gen.js
+++ b/packages/abi-gen/bin/abi-gen.js
@@ -1,2 +1,2 @@
#!/usr/bin/env node
-require('../lib/src/index.js')
+require('../lib/src/index.js');
diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json
index 41561268c..d40db09b9 100644
--- a/packages/abi-gen/package.json
+++ b/packages/abi-gen/package.json
@@ -5,8 +5,8 @@
"node": ">=6.12"
},
"description": "Generate contract wrappers from ABI and handlebars templates",
- "main": "lib/index.js",
- "types": "lib/index.d.ts",
+ "main": "lib/src/index.js",
+ "types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"lint": "tslint --project .",
diff --git a/packages/assert/CHANGELOG.json b/packages/assert/CHANGELOG.json
index dd699fc6b..f06901a44 100644
--- a/packages/assert/CHANGELOG.json
+++ b/packages/assert/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/base-contract/CHANGELOG.json b/packages/base-contract/CHANGELOG.json
index 6f88328bb..f427f0fe5 100644
--- a/packages/base-contract/CHANGELOG.json
+++ b/packages/base-contract/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json
index bb93826f1..8ed147e76 100644
--- a/packages/connect/CHANGELOG.json
+++ b/packages/connect/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json
index 1aa4d0b64..1e82522df 100644
--- a/packages/contract-wrappers/CHANGELOG.json
+++ b/packages/contract-wrappers/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0-rc.1",
"changes": [
{
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol b/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol
index d420f7e85..567f26c52 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol
+++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol
@@ -22,12 +22,14 @@ pragma experimental ABIEncoderV2;
import "./libs/LibMath.sol";
import "./libs/LibOrder.sol";
import "./libs/LibFillResults.sol";
+import "./libs/LibAbiEncoder.sol";
import "./mixins/MExchangeCore.sol";
contract MixinWrapperFunctions is
LibMath,
LibFillResults,
+ LibAbiEncoder,
MExchangeCore
{
/// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.
@@ -68,177 +70,21 @@ contract MixinWrapperFunctions is
public
returns (FillResults memory fillResults)
{
- // We need to call MExchangeCore.fillOrder using a delegatecall in
- // assembly so that we can intercept a call that throws. For this, we
- // need the input encoded in memory in the Ethereum ABIv2 format [1].
-
- // | Area | Offset | Length | Contents |
- // | -------- |--------|---------|-------------------------------------------- |
- // | Header | 0x00 | 4 | function selector |
- // | Params | | 3 * 32 | function parameters: |
- // | | 0x00 | | 1. offset to order (*) |
- // | | 0x20 | | 2. takerAssetFillAmount |
- // | | 0x40 | | 3. offset to signature (*) |
- // | Data | | 12 * 32 | order: |
- // | | 0x000 | | 1. senderAddress |
- // | | 0x020 | | 2. makerAddress |
- // | | 0x040 | | 3. takerAddress |
- // | | 0x060 | | 4. feeRecipientAddress |
- // | | 0x080 | | 5. makerAssetAmount |
- // | | 0x0A0 | | 6. takerAssetAmount |
- // | | 0x0C0 | | 7. makerFeeAmount |
- // | | 0x0E0 | | 8. takerFeeAmount |
- // | | 0x100 | | 9. expirationTimeSeconds |
- // | | 0x120 | | 10. salt |
- // | | 0x140 | | 11. Offset to makerAssetData (*) |
- // | | 0x160 | | 12. Offset to takerAssetData (*) |
- // | | 0x180 | 32 | makerAssetData Length |
- // | | 0x1A0 | ** | makerAssetData Contents |
- // | | 0x1C0 | 32 | takerAssetData Length |
- // | | 0x1E0 | ** | takerAssetData Contents |
- // | | 0x200 | 32 | signature Length |
- // | | 0x220 | ** | signature Contents |
-
- // * Offsets are calculated from the beginning of the current area: Header, Params, Data:
- // An offset stored in the Params area is calculated from the beginning of the Params section.
- // An offset stored in the Data area is calculated from the beginning of the Data section.
-
- // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.
-
- // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html
-
- bytes4 fillOrderSelector = this.fillOrder.selector;
+ // ABI encode calldata for `fillOrder`
+ bytes memory fillOrderCalldata = abiEncodeFillOrder(
+ order,
+ takerAssetFillAmount,
+ signature
+ );
+ // Delegate to `fillOrder` and handle any exceptions gracefully
assembly {
-
- // Areas below may use the following variables:
- // 1. <area>Start -- Start of this area in memory
- // 2. <area>End -- End of this area in memory. This value may
- // be precomputed (before writing contents),
- // or it may be computed as contents are written.
- // 3. <area>Offset -- Current offset into area. If an area's End
- // is precomputed, this variable tracks the
- // offsets of contents as they are written.
-
- /////// Setup Header Area ///////
- // Load free memory pointer
- let headerAreaStart := mload(0x40)
- mstore(headerAreaStart, fillOrderSelector)
- let headerAreaEnd := add(headerAreaStart, 0x4)
-
- /////// Setup Params Area ///////
- // This area is preallocated and written to later.
- // This is because we need to fill in offsets that have not yet been calculated.
- let paramsAreaStart := headerAreaEnd
- let paramsAreaEnd := add(paramsAreaStart, 0x60)
- let paramsAreaOffset := paramsAreaStart
-
- /////// Setup Data Area ///////
- let dataAreaStart := paramsAreaEnd
- let dataAreaEnd := dataAreaStart
-
- // Offset from the source data we're reading from
- let sourceOffset := order
- // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.
- let arrayLenBytes := 0
- let arrayLenWords := 0
-
- /////// Write order Struct ///////
- // Write memory location of Order, relative to the start of the
- // parameter list, then increment the paramsAreaOffset respectively.
- mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))
- paramsAreaOffset := add(paramsAreaOffset, 0x20)
-
- // Write values for each field in the order
- // It would be nice to use a loop, but we save on gas by writing
- // the stores sequentially.
- mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress
- mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress
- mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress
- mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress
- mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount
- mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount
- mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount
- mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount
- mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds
- mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt
- mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData
- mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData
- dataAreaEnd := add(dataAreaEnd, 0x180)
- sourceOffset := add(sourceOffset, 0x180)
-
- // Write offset to <order.makerAssetData>
- mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))
-
- // Calculate length of <order.makerAssetData>
- sourceOffset := mload(add(order, 0x140)) // makerAssetData
- arrayLenBytes := mload(sourceOffset)
- sourceOffset := add(sourceOffset, 0x20)
- arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)
-
- // Write length of <order.makerAssetData>
- mstore(dataAreaEnd, arrayLenBytes)
- dataAreaEnd := add(dataAreaEnd, 0x20)
-
- // Write contents of <order.makerAssetData>
- for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {
- mstore(dataAreaEnd, mload(sourceOffset))
- dataAreaEnd := add(dataAreaEnd, 0x20)
- sourceOffset := add(sourceOffset, 0x20)
- }
-
- // Write offset to <order.takerAssetData>
- mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))
-
- // Calculate length of <order.takerAssetData>
- sourceOffset := mload(add(order, 0x160)) // takerAssetData
- arrayLenBytes := mload(sourceOffset)
- sourceOffset := add(sourceOffset, 0x20)
- arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)
-
- // Write length of <order.takerAssetData>
- mstore(dataAreaEnd, arrayLenBytes)
- dataAreaEnd := add(dataAreaEnd, 0x20)
-
- // Write contents of <order.takerAssetData>
- for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {
- mstore(dataAreaEnd, mload(sourceOffset))
- dataAreaEnd := add(dataAreaEnd, 0x20)
- sourceOffset := add(sourceOffset, 0x20)
- }
-
- /////// Write takerAssetFillAmount ///////
- mstore(paramsAreaOffset, takerAssetFillAmount)
- paramsAreaOffset := add(paramsAreaOffset, 0x20)
-
- /////// Write signature ///////
- // Write offset to paramsArea
- mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))
-
- // Calculate length of signature
- sourceOffset := signature
- arrayLenBytes := mload(sourceOffset)
- sourceOffset := add(sourceOffset, 0x20)
- arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)
-
- // Write length of signature
- mstore(dataAreaEnd, arrayLenBytes)
- dataAreaEnd := add(dataAreaEnd, 0x20)
-
- // Write contents of signature
- for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {
- mstore(dataAreaEnd, mload(sourceOffset))
- dataAreaEnd := add(dataAreaEnd, 0x20)
- sourceOffset := add(sourceOffset, 0x20)
- }
-
- // Execute delegatecall
let success := delegatecall(
gas, // forward all gas, TODO: look into gas consumption of assert/throw
address, // call address of this contract
- headerAreaStart, // pointer to start of input
- sub(dataAreaEnd, headerAreaStart), // length of input
- headerAreaStart, // write output over input
+ add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)
+ mload(fillOrderCalldata), // length of input
+ fillOrderCalldata, // write output over input
128 // output size is 128 bytes
)
switch success
@@ -249,10 +95,10 @@ contract MixinWrapperFunctions is
mstore(add(fillResults, 96), 0)
}
case 1 {
- mstore(fillResults, mload(headerAreaStart))
- mstore(add(fillResults, 32), mload(add(headerAreaStart, 32)))
- mstore(add(fillResults, 64), mload(add(headerAreaStart, 64)))
- mstore(add(fillResults, 96), mload(add(headerAreaStart, 96)))
+ mstore(fillResults, mload(fillOrderCalldata))
+ mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))
+ mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))
+ mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))
}
}
return fillResults;
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol b/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol
new file mode 100644
index 000000000..704c7061c
--- /dev/null
+++ b/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol
@@ -0,0 +1,218 @@
+/*
+
+ Copyright 2018 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.4.24;
+pragma experimental ABIEncoderV2;
+
+import "./LibOrder.sol";
+
+
+contract LibAbiEncoder {
+
+ /// @dev ABI encodes calldata for `fillOrder` in memory and returns the address range.
+ /// This range can be passed into `call` or `delegatecall` to invoke an external
+ /// call to `fillOrder`.
+ /// @param order Order struct containing order specifications.
+ /// @param takerAssetFillAmount Desired amount of takerAsset to sell.
+ /// @param signature Proof that order has been created by maker.
+ /// @return calldataBegin Memory address of ABI encoded calldata.
+ /// @return calldataLength Lenfgth of ABI encoded calldata.
+ function abiEncodeFillOrder(
+ LibOrder.Order memory order,
+ uint256 takerAssetFillAmount,
+ bytes memory signature
+ )
+ public
+ pure
+ returns (bytes memory fillOrderCalldata)
+ {
+ // We need to call MExchangeCore.fillOrder using a delegatecall in
+ // assembly so that we can intercept a call that throws. For this, we
+ // need the input encoded in memory in the Ethereum ABIv2 format [1].
+
+ // | Area | Offset | Length | Contents |
+ // | -------- |--------|---------|-------------------------------------------- |
+ // | Header | 0x00 | 4 | function selector |
+ // | Params | | 3 * 32 | function parameters: |
+ // | | 0x00 | | 1. offset to order (*) |
+ // | | 0x20 | | 2. takerAssetFillAmount |
+ // | | 0x40 | | 3. offset to signature (*) |
+ // | Data | | 12 * 32 | order: |
+ // | | 0x000 | | 1. senderAddress |
+ // | | 0x020 | | 2. makerAddress |
+ // | | 0x040 | | 3. takerAddress |
+ // | | 0x060 | | 4. feeRecipientAddress |
+ // | | 0x080 | | 5. makerAssetAmount |
+ // | | 0x0A0 | | 6. takerAssetAmount |
+ // | | 0x0C0 | | 7. makerFeeAmount |
+ // | | 0x0E0 | | 8. takerFeeAmount |
+ // | | 0x100 | | 9. expirationTimeSeconds |
+ // | | 0x120 | | 10. salt |
+ // | | 0x140 | | 11. Offset to makerAssetData (*) |
+ // | | 0x160 | | 12. Offset to takerAssetData (*) |
+ // | | 0x180 | 32 | makerAssetData Length |
+ // | | 0x1A0 | ** | makerAssetData Contents |
+ // | | 0x1C0 | 32 | takerAssetData Length |
+ // | | 0x1E0 | ** | takerAssetData Contents |
+ // | | 0x200 | 32 | signature Length |
+ // | | 0x220 | ** | signature Contents |
+
+ // * Offsets are calculated from the beginning of the current area: Header, Params, Data:
+ // An offset stored in the Params area is calculated from the beginning of the Params section.
+ // An offset stored in the Data area is calculated from the beginning of the Data section.
+
+ // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.
+
+ // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html
+
+ assembly {
+
+ // Areas below may use the following variables:
+ // 1. <area>Start -- Start of this area in memory
+ // 2. <area>End -- End of this area in memory. This value may
+ // be precomputed (before writing contents),
+ // or it may be computed as contents are written.
+ // 3. <area>Offset -- Current offset into area. If an area's End
+ // is precomputed, this variable tracks the
+ // offsets of contents as they are written.
+
+ /////// Setup Header Area ///////
+ // Load free memory pointer
+ fillOrderCalldata := mload(0x40)
+ // bytes4(keccak256("fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)"))
+ // = 0xb4be83d5
+ // Leave 0x20 bytes to store the length
+ mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)
+ let headerAreaEnd := add(fillOrderCalldata, 0x24)
+
+ /////// Setup Params Area ///////
+ // This area is preallocated and written to later.
+ // This is because we need to fill in offsets that have not yet been calculated.
+ let paramsAreaStart := headerAreaEnd
+ let paramsAreaEnd := add(paramsAreaStart, 0x60)
+ let paramsAreaOffset := paramsAreaStart
+
+ /////// Setup Data Area ///////
+ let dataAreaStart := paramsAreaEnd
+ let dataAreaEnd := dataAreaStart
+
+ // Offset from the source data we're reading from
+ let sourceOffset := order
+ // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.
+ let arrayLenBytes := 0
+ let arrayLenWords := 0
+
+ /////// Write order Struct ///////
+ // Write memory location of Order, relative to the start of the
+ // parameter list, then increment the paramsAreaOffset respectively.
+ mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))
+ paramsAreaOffset := add(paramsAreaOffset, 0x20)
+
+ // Write values for each field in the order
+ // It would be nice to use a loop, but we save on gas by writing
+ // the stores sequentially.
+ mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress
+ mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress
+ mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress
+ mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress
+ mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount
+ mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount
+ mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount
+ mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount
+ mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds
+ mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt
+ mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData
+ mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData
+ dataAreaEnd := add(dataAreaEnd, 0x180)
+ sourceOffset := add(sourceOffset, 0x180)
+
+ // Write offset to <order.makerAssetData>
+ mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))
+
+ // Calculate length of <order.makerAssetData>
+ sourceOffset := mload(add(order, 0x140)) // makerAssetData
+ arrayLenBytes := mload(sourceOffset)
+ sourceOffset := add(sourceOffset, 0x20)
+ arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)
+
+ // Write length of <order.makerAssetData>
+ mstore(dataAreaEnd, arrayLenBytes)
+ dataAreaEnd := add(dataAreaEnd, 0x20)
+
+ // Write contents of <order.makerAssetData>
+ for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {
+ mstore(dataAreaEnd, mload(sourceOffset))
+ dataAreaEnd := add(dataAreaEnd, 0x20)
+ sourceOffset := add(sourceOffset, 0x20)
+ }
+
+ // Write offset to <order.takerAssetData>
+ mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))
+
+ // Calculate length of <order.takerAssetData>
+ sourceOffset := mload(add(order, 0x160)) // takerAssetData
+ arrayLenBytes := mload(sourceOffset)
+ sourceOffset := add(sourceOffset, 0x20)
+ arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)
+
+ // Write length of <order.takerAssetData>
+ mstore(dataAreaEnd, arrayLenBytes)
+ dataAreaEnd := add(dataAreaEnd, 0x20)
+
+ // Write contents of <order.takerAssetData>
+ for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {
+ mstore(dataAreaEnd, mload(sourceOffset))
+ dataAreaEnd := add(dataAreaEnd, 0x20)
+ sourceOffset := add(sourceOffset, 0x20)
+ }
+
+ /////// Write takerAssetFillAmount ///////
+ mstore(paramsAreaOffset, takerAssetFillAmount)
+ paramsAreaOffset := add(paramsAreaOffset, 0x20)
+
+ /////// Write signature ///////
+ // Write offset to paramsArea
+ mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))
+
+ // Calculate length of signature
+ sourceOffset := signature
+ arrayLenBytes := mload(sourceOffset)
+ sourceOffset := add(sourceOffset, 0x20)
+ arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)
+
+ // Write length of signature
+ mstore(dataAreaEnd, arrayLenBytes)
+ dataAreaEnd := add(dataAreaEnd, 0x20)
+
+ // Write contents of signature
+ for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {
+ mstore(dataAreaEnd, mload(sourceOffset))
+ dataAreaEnd := add(dataAreaEnd, 0x20)
+ sourceOffset := add(sourceOffset, 0x20)
+ }
+
+ // Set length of calldata
+ mstore(
+ fillOrderCalldata,
+ sub(dataAreaEnd, add(fillOrderCalldata, 0x20))
+ )
+ }
+
+ return fillOrderCalldata;
+ }
+}
diff --git a/packages/dev-utils/CHANGELOG.json b/packages/dev-utils/CHANGELOG.json
index 4093d352e..f94fd5f30 100644
--- a/packages/dev-utils/CHANGELOG.json
+++ b/packages/dev-utils/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/ethereum-types/CHANGELOG.json b/packages/ethereum-types/CHANGELOG.json
index d851e6ef2..70a2ffcb0 100644
--- a/packages/ethereum-types/CHANGELOG.json
+++ b/packages/ethereum-types/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/fill-scenarios/CHANGELOG.json b/packages/fill-scenarios/CHANGELOG.json
index 0819d446c..e1e8a9d6d 100644
--- a/packages/fill-scenarios/CHANGELOG.json
+++ b/packages/fill-scenarios/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0-rc.1",
"changes": [
{
diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json
index 0729c75e5..8bffe6955 100644
--- a/packages/json-schemas/CHANGELOG.json
+++ b/packages/json-schemas/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0-rc.1",
"changes": [
{
diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json
index f57b10f2a..e0a5c8a52 100644
--- a/packages/migrations/CHANGELOG.json
+++ b/packages/migrations/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/migrations/package.json b/packages/migrations/package.json
index 2356dc1e4..ac4d7e965 100644
--- a/packages/migrations/package.json
+++ b/packages/migrations/package.json
@@ -44,6 +44,7 @@
"@0xproject/tslint-config": "^1.0.0",
"@0xproject/types": "^1.0.0-rc.1",
"@types/yargs": "^10.0.0",
+ "copyfiles": "^1.2.0",
"yargs": "^10.0.3",
"make-promises-safe": "^1.1.0",
"npm-run-all": "^4.1.2",
diff --git a/packages/monorepo-scripts/CHANGELOG.json b/packages/monorepo-scripts/CHANGELOG.json
index 51d060e27..cdac2d278 100644
--- a/packages/monorepo-scripts/CHANGELOG.json
+++ b/packages/monorepo-scripts/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/order-utils/CHANGELOG.json b/packages/order-utils/CHANGELOG.json
index 5d92cb318..d74ba90ea 100644
--- a/packages/order-utils/CHANGELOG.json
+++ b/packages/order-utils/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0-rc.1",
"changes": [
{
diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json
index 5d9d5705b..03b6f0da6 100644
--- a/packages/order-watcher/CHANGELOG.json
+++ b/packages/order-watcher/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0-rc.1",
"changes": [
{
diff --git a/packages/react-docs/CHANGELOG.json b/packages/react-docs/CHANGELOG.json
index 61ccf1dea..1bb2da328 100644
--- a/packages/react-docs/CHANGELOG.json
+++ b/packages/react-docs/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/react-shared/CHANGELOG.json b/packages/react-shared/CHANGELOG.json
index 5e0e40a70..a1fc76193 100644
--- a/packages/react-shared/CHANGELOG.json
+++ b/packages/react-shared/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json
index ff5dac15e..762a26a90 100644
--- a/packages/sol-compiler/CHANGELOG.json
+++ b/packages/sol-compiler/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/sol-cov/CHANGELOG.json b/packages/sol-cov/CHANGELOG.json
index 7308bffb6..6b7cdf6e9 100644
--- a/packages/sol-cov/CHANGELOG.json
+++ b/packages/sol-cov/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/sol-resolver/CHANGELOG.json b/packages/sol-resolver/CHANGELOG.json
index 9ebbe1adb..0be30856e 100644
--- a/packages/sol-resolver/CHANGELOG.json
+++ b/packages/sol-resolver/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/sra-report/CHANGELOG.json b/packages/sra-report/CHANGELOG.json
index c5220c493..0867f0723 100644
--- a/packages/sra-report/CHANGELOG.json
+++ b/packages/sra-report/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/subproviders/CHANGELOG.json b/packages/subproviders/CHANGELOG.json
index bc427db09..c91358aad 100644
--- a/packages/subproviders/CHANGELOG.json
+++ b/packages/subproviders/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/tslint-config/CHANGELOG.json b/packages/tslint-config/CHANGELOG.json
index 462a01dcc..fb879f169 100644
--- a/packages/tslint-config/CHANGELOG.json
+++ b/packages/tslint-config/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/types/CHANGELOG.json b/packages/types/CHANGELOG.json
index 35090ff2c..6189acbbc 100644
--- a/packages/types/CHANGELOG.json
+++ b/packages/types/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0-rc.1",
"changes": [
{
diff --git a/packages/typescript-typings/CHANGELOG.json b/packages/typescript-typings/CHANGELOG.json
index a08ded02d..5a64d0490 100644
--- a/packages/typescript-typings/CHANGELOG.json
+++ b/packages/typescript-typings/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json
index 4bd82d476..92149a7d4 100644
--- a/packages/utils/CHANGELOG.json
+++ b/packages/utils/CHANGELOG.json
@@ -1,5 +1,15 @@
[
{
+ "version": "1.0.1",
+ "changes": [
+ {
+ "note": "Add `AbortController` polyfill to `fetchAsync`",
+ "pr": 903
+ }
+ ]
+ },
+ {
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/utils/package.json b/packages/utils/package.json
index 7e3d46ce7..382604fdd 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -38,6 +38,7 @@
"@0xproject/types": "^1.0.0-rc.1",
"@0xproject/typescript-typings": "^1.0.0",
"@types/node": "^8.0.53",
+ "abortcontroller-polyfill": "^1.1.9",
"bignumber.js": "~4.1.0",
"detect-node": "2.0.3",
"ethereum-types": "^1.0.0",
diff --git a/packages/utils/src/fetchAsync.ts b/packages/utils/src/fetchAsync.ts
index c02e5baba..b4c85718d 100644
--- a/packages/utils/src/fetchAsync.ts
+++ b/packages/utils/src/fetchAsync.ts
@@ -1,5 +1,8 @@
import isNode = require('detect-node');
import 'isomorphic-fetch';
+// WARNING: This needs to be imported after isomorphic-fetch: https://github.com/mo/abortcontroller-polyfill#using-it-on-browsers-without-fetch
+// tslint:disable-next-line:ordered-imports
+import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only';
export const fetchAsync = async (
endpoint: string,
diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json
index e8f3b5f43..200836a82 100644
--- a/packages/web3-wrapper/CHANGELOG.json
+++ b/packages/web3-wrapper/CHANGELOG.json
@@ -1,5 +1,6 @@
[
{
+ "timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
diff --git a/packages/website/package.json b/packages/website/package.json
index 4cefa19a9..99fd7cff3 100644
--- a/packages/website/package.json
+++ b/packages/website/package.json
@@ -7,7 +7,7 @@
"private": true,
"description": "Website and 0x portal dapp",
"scripts": {
- "build": "NODE_ENV=production webpack; exit 0;",
+ "build": "NODE_ENV=production node --max_old_space_size=8192 ../../node_modules/.bin/webpack; exit 0;",
"clean": "shx rm -f public/bundle*",
"lint": "tslint --project . 'ts/**/*.ts' 'ts/**/*.tsx'",
"watch_without_deps": "webpack-dev-server --content-base public --https",
@@ -23,13 +23,13 @@
"dependencies": {
"@0xproject/contract-wrappers": "^0.0.5",
"@0xproject/order-utils": "^0.0.9",
- "@0xproject/react-docs": "^0.0.16",
+ "@0xproject/react-docs": "^1.0.0",
"@0xproject/react-shared": "^0.2.3",
- "@0xproject/subproviders": "^0.10.6",
+ "@0xproject/subproviders": "^1.0.0",
"@0xproject/types": "^0.8.1",
"@0xproject/typescript-typings": "^0.4.3",
- "@0xproject/utils": "^0.7.3",
- "@0xproject/web3-wrapper": "^0.7.3",
+ "@0xproject/utils": "^1.0.0",
+ "@0xproject/web3-wrapper": "^1.0.0",
"accounting": "^0.4.1",
"basscss": "^8.0.3",
"blockies": "^0.0.2",
diff --git a/yarn.lock b/yarn.lock
index 8c6dda8a6..62b5750b0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -220,28 +220,6 @@
ethers "3.0.22"
lodash "4.17.10"
-"@0xproject/react-docs@^0.0.16":
- version "0.0.16"
- resolved "https://registry.yarnpkg.com/@0xproject/react-docs/-/react-docs-0.0.16.tgz#67670f0f77e34aca0647fb4a56bbe9102c0c6e3a"
- dependencies:
- "@0xproject/react-shared" "^0.2.3"
- "@0xproject/utils" "^0.7.3"
- "@types/lodash" "4.14.104"
- "@types/material-ui" "0.18.0"
- "@types/node" "9.6.0"
- "@types/react" "16.3.13"
- "@types/react-dom" "16.0.4"
- "@types/react-scroll" "0.0.31"
- basscss "8.0.4"
- compare-versions "3.1.0"
- lodash "4.17.10"
- material-ui "0.17.4"
- react "15.6.1"
- react-dom "15.6.1"
- react-markdown "3.2.2"
- react-scroll "1.7.7"
- react-tooltip "3.4.0"
-
"@0xproject/react-shared@^0.2.3":
version "0.2.3"
resolved "https://registry.yarnpkg.com/@0xproject/react-shared/-/react-shared-0.2.3.tgz#f0403b9b7f1cfbe2853b53cc983ebb13ee8753a5"
@@ -294,29 +272,6 @@
"@0xproject/typescript-typings" "^0.0.3"
lodash "4.17.10"
-"@0xproject/subproviders@^0.10.6":
- version "0.10.6"
- resolved "https://registry.yarnpkg.com/@0xproject/subproviders/-/subproviders-0.10.6.tgz#383a9bb96c661148b6f4541fb553c79c787983e1"
- dependencies:
- "@0xproject/assert" "^0.2.14"
- "@0xproject/types" "^0.8.2"
- "@0xproject/typescript-typings" "^0.4.3"
- "@0xproject/utils" "^0.7.3"
- "@ledgerhq/hw-app-eth" "4.7.3"
- "@ledgerhq/hw-transport-u2f" "4.7.3"
- bip39 "2.5.0"
- bn.js "4.11.7"
- ethereumjs-tx "1.3.4"
- ethereumjs-util "5.1.5"
- ganache-core "0xProject/ganache-core"
- hdkey "0.7.1"
- lodash "4.17.10"
- semaphore-async-await "1.5.1"
- web3 "0.20.6"
- web3-provider-engine "14.0.6"
- optionalDependencies:
- "@ledgerhq/hw-transport-node-hid" "4.7.3"
-
"@0xproject/types@^0.5.0":
version "0.5.0"
resolved "https://registry.yarnpkg.com/@0xproject/types/-/types-0.5.0.tgz#ba3cfbc11a8c6344b57c9680aa7df2ea84b9bf05"
@@ -370,19 +325,12 @@
lodash "4.17.10"
web3 "0.20.6"
-"@ledgerhq/hw-app-eth@4.7.3", "@ledgerhq/hw-app-eth@^4.3.0":
+"@ledgerhq/hw-app-eth@^4.3.0":
version "4.7.3"
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-4.7.3.tgz#d352e19658ae296532e522c53c8ec2a1a77b64e5"
dependencies:
"@ledgerhq/hw-transport" "^4.7.3"
-"@ledgerhq/hw-transport-node-hid@4.7.3":
- version "4.7.3"
- resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-4.7.3.tgz#e7634d53161cdffed4f602cddca6a7bc34e7b79b"
- dependencies:
- "@ledgerhq/hw-transport" "^4.7.3"
- node-hid "^0.7.2"
-
"@ledgerhq/hw-transport-node-hid@^4.3.0":
version "4.7.6"
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-4.7.6.tgz#f2bd7c714e359af84377d07dd6431f2aa582e71e"
@@ -390,7 +338,7 @@
"@ledgerhq/hw-transport" "^4.7.3"
node-hid "^0.7.2"
-"@ledgerhq/hw-transport-u2f@4.7.3", "@ledgerhq/hw-transport-u2f@^4.3.0":
+"@ledgerhq/hw-transport-u2f@^4.3.0":
version "4.7.3"
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-u2f/-/hw-transport-u2f-4.7.3.tgz#32be84bd2829f0ad0745604355f73a169dceb5e5"
dependencies:
@@ -1283,6 +1231,10 @@ abbrev@1.0.x:
version "1.0.9"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135"
+abortcontroller-polyfill@^1.1.9:
+ version "1.1.9"
+ resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.1.9.tgz#9fefe359fda2e9e0932dc85e6106453ac393b2da"
+
abstract-leveldown@0.12.3:
version "0.12.3"
resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-0.12.3.tgz#116b1ec5c7710ef7a2d5706768bbdb4440be1070"
@@ -2531,7 +2483,7 @@ bintrees@1.0.2, bintrees@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/bintrees/-/bintrees-1.0.2.tgz#49f896d6e858a4a499df85c38fb399b9aff840f8"
-bip39@2.5.0, bip39@^2.5.0:
+bip39@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/bip39/-/bip39-2.5.0.tgz#51cbd5179460504a63ea3c000db3f787ca051235"
dependencies:
@@ -3465,7 +3417,7 @@ compare-func@^1.3.1:
array-ify "^1.0.0"
dot-prop "^3.0.0"
-compare-versions@3.1.0, compare-versions@^3.0.1:
+compare-versions@^3.0.1:
version "3.1.0"
resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.1.0.tgz#43310256a5c555aaed4193c04d8f154cf9c6efd5"
@@ -5049,7 +5001,7 @@ ethereumjs-blockstream@5.0.0:
source-map-support "0.5.6"
uuid "3.2.1"
-ethereumjs-tx@0xProject/ethereumjs-tx#fake-tx-include-signature-by-default, ethereumjs-tx@1.3.4:
+ethereumjs-tx@0xProject/ethereumjs-tx#fake-tx-include-signature-by-default:
version "1.3.4"
resolved "https://codeload.github.com/0xProject/ethereumjs-tx/tar.gz/29d1153889c389591f74b2401da8a0c6ad40f9a7"
dependencies:
@@ -6514,7 +6466,7 @@ hawk@~6.0.2:
hoek "4.x.x"
sntp "2.x.x"
-hdkey@0.7.1, hdkey@^0.7.0, hdkey@^0.7.1:
+hdkey@^0.7.0, hdkey@^0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/hdkey/-/hdkey-0.7.1.tgz#caee4be81aa77921e909b8d228dd0f29acaee632"
dependencies:
@@ -10709,13 +10661,6 @@ react-tap-event-plugin@2.0.1, react-tap-event-plugin@^2.0.1:
dependencies:
fbjs "^0.8.6"
-react-tooltip@3.4.0:
- version "3.4.0"
- resolved "https://registry.yarnpkg.com/react-tooltip/-/react-tooltip-3.4.0.tgz#037f38f797c3e6b1b58d2534ccc8c2c76af4f52d"
- dependencies:
- classnames "^2.2.5"
- prop-types "^15.6.0"
-
react-tooltip@^3.2.7:
version "3.5.0"
resolved "https://registry.yarnpkg.com/react-tooltip/-/react-tooltip-3.5.0.tgz#f4bff54b3c70415b6bd25b8bcf7801c230d1b517"
@@ -11533,7 +11478,7 @@ selfsigned@^1.9.1:
dependencies:
node-forge "0.7.1"
-semaphore-async-await@1.5.1, semaphore-async-await@^1.5.1:
+semaphore-async-await@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz#857bef5e3644601ca4b9570b87e9df5ca12974fa"