Compare commits
6 Commits
marcin/foo
...
@0x/contra
Author | SHA1 | Date | |
---|---|---|---|
|
37dc99181e | ||
|
6efb9f532b | ||
|
9b7d88e136 | ||
|
e51e1f1674 | ||
|
036a263267 | ||
|
1fb44a55b4 |
@@ -46,13 +46,29 @@ jobs:
|
||||
- ~/project/packages/protocol-utils/node_modules
|
||||
- ~/.cache/yarn
|
||||
- save_cache:
|
||||
key: lib-{{ .Environment.CIRCLE_SHA1 }}
|
||||
key: lib-{{ .Environment.CIRCLE_BRANCH }}
|
||||
paths:
|
||||
- ~/project/contracts/erc20/generated-artifacts/
|
||||
- ~/project/contracts/erc20/generated-wrappers/
|
||||
- ~/project/contracts/erc20/lib/
|
||||
- ~/project/contracts/erc20/test/generated-artifacts/
|
||||
- ~/project/contracts/erc20/test/generated-wrappers/
|
||||
- ~/project/contracts/test-utils/lib/
|
||||
- ~/project/contracts/treasury/generated-artifacts/
|
||||
- ~/project/contracts/treasury/generated-wrappers/
|
||||
- ~/project/contracts/treasury/lib/
|
||||
- ~/project/contracts/treasury/test/generated-artifacts/
|
||||
- ~/project/contracts/treasury/test/generated-wrappers/
|
||||
- ~/project/contracts/utils/generated-artifacts/
|
||||
- ~/project/contracts/utils/generated-wrappers/
|
||||
- ~/project/contracts/utils/lib/
|
||||
- ~/project/contracts/utils/test/generated-artifacts/
|
||||
- ~/project/contracts/utils/test/generated-wrappers/
|
||||
- ~/project/contracts/zero-ex/generated-artifacts/
|
||||
- ~/project/contracts/zero-ex/generated-wrappers/
|
||||
- ~/project/contracts/zero-ex/lib/
|
||||
- ~/project/contracts/zero-ex/test/generated-artifacts/
|
||||
- ~/project/contracts/zero-ex/test/generated-wrappers/
|
||||
- ~/project/packages/contract-addresses/lib/
|
||||
- ~/project/packages/contract-artifacts/lib/
|
||||
- ~/project/packages/contract-wrappers/lib/
|
||||
@@ -72,7 +88,7 @@ jobs:
|
||||
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
||||
- restore_cache:
|
||||
keys:
|
||||
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- lib-{{ .Environment.CIRCLE_BRANCH }}
|
||||
- run: yarn wsrun -p @0x/contracts-exchange -m --serial -c test:circleci
|
||||
test-integrations-ganache:
|
||||
resource_class: xlarge
|
||||
@@ -85,7 +101,7 @@ jobs:
|
||||
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
||||
- restore_cache:
|
||||
keys:
|
||||
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- lib-{{ .Environment.CIRCLE_BRANCH }}
|
||||
- run: yarn wsrun -p @0x/contracts-integrations -m --serial -c test:circleci
|
||||
test-contracts-staking-ganache:
|
||||
resource_class: xlarge
|
||||
@@ -96,7 +112,7 @@ jobs:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
||||
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- lib-{{ .Environment.CIRCLE_BRANCH }}
|
||||
- run: yarn wsrun -p @0x/contracts-staking -m --serial -c test:circleci
|
||||
test-contracts-extra-ganache:
|
||||
resource_class: xlarge
|
||||
@@ -109,7 +125,7 @@ jobs:
|
||||
- cache-{{ checksum "yarn.lock" }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- lib-{{ .Environment.CIRCLE_BRANCH }}
|
||||
- run: yarn wsrun -p @0x/contracts-exchange-forwarder -p @0x/contracts-coordinator -m --serial -c test:circleci
|
||||
test-contracts-rest-ganache:
|
||||
resource_class: xlarge
|
||||
@@ -127,7 +143,7 @@ jobs:
|
||||
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
||||
- restore_cache:
|
||||
keys:
|
||||
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- lib-{{ .Environment.CIRCLE_BRANCH }}
|
||||
- run: |
|
||||
yarn wsrun \
|
||||
-p @0x/contracts-multisig \
|
||||
@@ -157,7 +173,8 @@ jobs:
|
||||
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
||||
- restore_cache:
|
||||
keys:
|
||||
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- lib-{{ .Environment.CIRCLE_BRANCH }}
|
||||
- run: git submodule update --init --recursive
|
||||
- run:
|
||||
command: forge test
|
||||
working_directory: ~/project/contracts/zero-ex
|
||||
@@ -181,7 +198,7 @@ jobs:
|
||||
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
||||
- restore_cache:
|
||||
keys:
|
||||
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- lib-{{ .Environment.CIRCLE_BRANCH }}
|
||||
- run:
|
||||
command: yarn test:publish:circleci
|
||||
no_output_timeout: 1800
|
||||
@@ -197,7 +214,7 @@ jobs:
|
||||
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
||||
- restore_cache:
|
||||
keys:
|
||||
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- lib-{{ .Environment.CIRCLE_BRANCH }}
|
||||
- run:
|
||||
command: yarn test:generate_docs:circleci
|
||||
no_output_timeout: 1200
|
||||
@@ -213,7 +230,7 @@ jobs:
|
||||
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
||||
- restore_cache:
|
||||
keys:
|
||||
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- lib-{{ .Environment.CIRCLE_BRANCH }}
|
||||
- run: yarn wsrun -p @0x/contracts-test-utils -m --serial -c test:circleci
|
||||
- run: yarn wsrun -p @0x/contract-addresses -m --serial -c test:circleci
|
||||
- run: yarn wsrun -p @0x/contract-artifacts -m --serial -c test:circleci
|
||||
@@ -240,7 +257,7 @@ jobs:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
||||
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- lib-{{ .Environment.CIRCLE_BRANCH }}
|
||||
- run:
|
||||
command: yarn lerna run lint
|
||||
- run:
|
||||
@@ -258,7 +275,7 @@ jobs:
|
||||
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
||||
- restore_cache:
|
||||
keys:
|
||||
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- lib-{{ .Environment.CIRCLE_BRANCH }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-contract-wrappers-test-{{ checksum "yarn.lock" }}
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1662046042,
|
||||
"version": "3.3.40",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1661462289,
|
||||
"version": "3.3.39",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.3.40 - _September 1, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.3.39 - _August 25, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc20",
|
||||
"version": "3.3.39",
|
||||
"version": "3.3.40",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -53,8 +53,8 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.8.1",
|
||||
"@0x/contracts-gen": "^2.0.47",
|
||||
"@0x/contracts-test-utils": "^5.4.30",
|
||||
"@0x/contracts-utils": "^4.8.20",
|
||||
"@0x/contracts-test-utils": "^5.4.31",
|
||||
"@0x/contracts-utils": "^4.8.21",
|
||||
"@0x/dev-utils": "^5.0.0",
|
||||
"@0x/sol-compiler": "^4.8.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1662046042,
|
||||
"version": "5.4.31",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1661462289,
|
||||
"version": "5.4.30",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v5.4.31 - _September 1, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v5.4.30 - _August 25, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-test-utils",
|
||||
"version": "5.4.30",
|
||||
"version": "5.4.31",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,7 +44,7 @@
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.35",
|
||||
"@0x/base-contract": "^7.0.0",
|
||||
"@0x/contract-addresses": "^6.22.0",
|
||||
"@0x/contract-addresses": "^6.23.0",
|
||||
"@0x/dev-utils": "^5.0.0",
|
||||
"@0x/json-schemas": "^6.4.4",
|
||||
"@0x/order-utils": "^10.4.28",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1662046042,
|
||||
"version": "1.4.23",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1661462289,
|
||||
"version": "1.4.22",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.4.23 - _September 1, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.4.22 - _August 25, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-treasury",
|
||||
"version": "1.4.22",
|
||||
"version": "1.4.23",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,12 +47,12 @@
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/treasury",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.8.1",
|
||||
"@0x/contract-addresses": "^6.22.0",
|
||||
"@0x/contract-addresses": "^6.23.0",
|
||||
"@0x/contracts-asset-proxy": "^3.7.19",
|
||||
"@0x/contracts-erc20": "^3.3.39",
|
||||
"@0x/contracts-erc20": "^3.3.40",
|
||||
"@0x/contracts-gen": "^2.0.47",
|
||||
"@0x/contracts-staking": "^2.0.45",
|
||||
"@0x/contracts-test-utils": "^5.4.30",
|
||||
"@0x/contracts-test-utils": "^5.4.31",
|
||||
"@0x/sol-compiler": "^4.8.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
@@ -73,7 +73,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^7.0.0",
|
||||
"@0x/protocol-utils": "^11.16.6",
|
||||
"@0x/protocol-utils": "^11.16.7",
|
||||
"@0x/subproviders": "^7.0.0",
|
||||
"@0x/types": "^3.3.6",
|
||||
"@0x/typescript-typings": "^5.3.1",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1662046042,
|
||||
"version": "4.8.21",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1661462289,
|
||||
"version": "4.8.20",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.8.21 - _September 1, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.8.20 - _August 25, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-utils",
|
||||
"version": "4.8.20",
|
||||
"version": "4.8.21",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,7 +52,7 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.8.1",
|
||||
"@0x/contracts-gen": "^2.0.47",
|
||||
"@0x/contracts-test-utils": "^5.4.30",
|
||||
"@0x/contracts-test-utils": "^5.4.31",
|
||||
"@0x/dev-utils": "^5.0.0",
|
||||
"@0x/order-utils": "^10.4.28",
|
||||
"@0x/sol-compiler": "^4.8.2",
|
||||
|
@@ -1,4 +1,18 @@
|
||||
[
|
||||
{
|
||||
"version": "0.37.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add support for OTC orders in the FillQuoteTransformer",
|
||||
"pr": "565"
|
||||
},
|
||||
{
|
||||
"note": "fix CI",
|
||||
"pr": "569"
|
||||
}
|
||||
],
|
||||
"timestamp": 1662046042
|
||||
},
|
||||
{
|
||||
"timestamp": 1661462289,
|
||||
"version": "0.36.6",
|
||||
|
@@ -5,6 +5,11 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.37.0 - _September 1, 2022_
|
||||
|
||||
* Add support for OTC orders in the FillQuoteTransformer (#565)
|
||||
* fix CI (#569)
|
||||
|
||||
## v0.36.6 - _August 25, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -20,8 +20,6 @@
|
||||
pragma solidity ^0.6.5;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
|
||||
|
||||
import "./features/interfaces/IOwnableFeature.sol";
|
||||
import "./features/interfaces/ISimpleFunctionRegistryFeature.sol";
|
||||
import "./features/interfaces/ITokenSpenderFeature.sol";
|
||||
|
@@ -31,6 +31,7 @@ import "../features/libs/LibNativeOrder.sol";
|
||||
import "./bridges/IBridgeAdapter.sol";
|
||||
import "./Transformer.sol";
|
||||
import "./LibERC20Transformer.sol";
|
||||
import "../IZeroEx.sol";
|
||||
|
||||
/// @dev A transformer that fills an ERC20 market sell/buy quote.
|
||||
/// This transformer shortcuts bridge orders and fills them directly
|
||||
@@ -52,7 +53,8 @@ contract FillQuoteTransformer is
|
||||
enum OrderType {
|
||||
Bridge,
|
||||
Limit,
|
||||
Rfq
|
||||
Rfq,
|
||||
Otc
|
||||
}
|
||||
|
||||
struct LimitOrderInfo {
|
||||
@@ -69,6 +71,13 @@ contract FillQuoteTransformer is
|
||||
uint256 maxTakerTokenFillAmount;
|
||||
}
|
||||
|
||||
struct OtcOrderInfo {
|
||||
LibNativeOrder.OtcOrder order;
|
||||
LibSignature.Signature signature;
|
||||
// Maximum taker token amount of this limit order to fill.
|
||||
uint256 maxTakerTokenFillAmount;
|
||||
}
|
||||
|
||||
/// @dev Transform data to ABI-encode and pass into `transform()`.
|
||||
struct TransformData {
|
||||
// Whether we are performing a market sell or buy.
|
||||
@@ -84,6 +93,8 @@ contract FillQuoteTransformer is
|
||||
IBridgeAdapter.BridgeOrder[] bridgeOrders;
|
||||
// Native limit orders. Sorted by fill sequence.
|
||||
LimitOrderInfo[] limitOrders;
|
||||
// Otc orders. Sorted by fill sequence.
|
||||
OtcOrderInfo[] otcOrders;
|
||||
// Native RFQ orders. Sorted by fill sequence.
|
||||
RfqOrderInfo[] rfqOrders;
|
||||
|
||||
@@ -123,7 +134,7 @@ contract FillQuoteTransformer is
|
||||
uint256 soldAmount;
|
||||
uint256 protocolFee;
|
||||
uint256 takerTokenBalanceRemaining;
|
||||
uint256[3] currentIndices;
|
||||
uint256[4] currentIndices;
|
||||
OrderType currentOrderType;
|
||||
}
|
||||
|
||||
@@ -147,12 +158,12 @@ contract FillQuoteTransformer is
|
||||
IBridgeAdapter public immutable bridgeAdapter;
|
||||
|
||||
/// @dev The exchange proxy contract.
|
||||
INativeOrdersFeature public immutable zeroEx;
|
||||
IZeroEx public immutable zeroEx;
|
||||
|
||||
/// @dev Create this contract.
|
||||
/// @param bridgeAdapter_ The bridge adapter contract.
|
||||
/// @param zeroEx_ The Exchange Proxy contract.
|
||||
constructor(IBridgeAdapter bridgeAdapter_, INativeOrdersFeature zeroEx_)
|
||||
constructor(IBridgeAdapter bridgeAdapter_, IZeroEx zeroEx_)
|
||||
public
|
||||
Transformer()
|
||||
{
|
||||
@@ -183,7 +194,8 @@ contract FillQuoteTransformer is
|
||||
|
||||
if (data.bridgeOrders.length
|
||||
+ data.limitOrders.length
|
||||
+ data.rfqOrders.length != data.fillSequence.length
|
||||
+ data.rfqOrders.length
|
||||
+ data.otcOrders.length != data.fillSequence.length
|
||||
) {
|
||||
LibTransformERC20RichErrors.InvalidTransformDataError(
|
||||
LibTransformERC20RichErrors.InvalidTransformDataErrorCode.INVALID_ARRAY_LENGTH,
|
||||
@@ -198,7 +210,7 @@ contract FillQuoteTransformer is
|
||||
|
||||
// Approve the exchange proxy to spend our sell tokens if native orders
|
||||
// are present.
|
||||
if (data.limitOrders.length + data.rfqOrders.length != 0) {
|
||||
if (data.limitOrders.length + data.rfqOrders.length + data.otcOrders.length != 0) {
|
||||
data.sellToken.approveIfBelow(address(zeroEx), data.fillAmount);
|
||||
// Compute the protocol fee if a limit order is present.
|
||||
if (data.limitOrders.length != 0) {
|
||||
@@ -230,6 +242,8 @@ contract FillQuoteTransformer is
|
||||
results = _fillLimitOrder(data.limitOrders[orderIndex], data, state);
|
||||
} else if (state.currentOrderType == OrderType.Rfq) {
|
||||
results = _fillRfqOrder(data.rfqOrders[orderIndex], data, state);
|
||||
} else if (state.currentOrderType == OrderType.Otc) {
|
||||
results = _fillOtcOrder(data.otcOrders[orderIndex], data, state);
|
||||
} else {
|
||||
revert("INVALID_ORDER_TYPE");
|
||||
}
|
||||
@@ -402,6 +416,42 @@ contract FillQuoteTransformer is
|
||||
} catch {}
|
||||
}
|
||||
|
||||
// Fill a single OTC order.
|
||||
function _fillOtcOrder(
|
||||
OtcOrderInfo memory orderInfo,
|
||||
TransformData memory data,
|
||||
FillState memory state
|
||||
)
|
||||
private
|
||||
returns (FillOrderResults memory results)
|
||||
{
|
||||
|
||||
uint256 takerTokenFillAmount = LibSafeMathV06.min256(
|
||||
_computeTakerTokenFillAmount(
|
||||
data,
|
||||
state,
|
||||
orderInfo.order.takerAmount,
|
||||
orderInfo.order.makerAmount,
|
||||
0
|
||||
),
|
||||
orderInfo.maxTakerTokenFillAmount
|
||||
);
|
||||
try
|
||||
zeroEx.fillOtcOrder
|
||||
(
|
||||
orderInfo.order,
|
||||
orderInfo.signature,
|
||||
takerTokenFillAmount.safeDowncastToUint128()
|
||||
)
|
||||
returns (uint128 takerTokenFilledAmount, uint128 makerTokenFilledAmount)
|
||||
{
|
||||
results.takerTokenSoldAmount = takerTokenFilledAmount;
|
||||
results.makerTokenBoughtAmount = makerTokenFilledAmount;
|
||||
} catch {
|
||||
revert("FillQuoteTransformer/OTC_ORDER_FILL_FAILED");
|
||||
}
|
||||
}
|
||||
|
||||
// Compute the next taker token fill amount of a generic order.
|
||||
function _computeTakerTokenFillAmount(
|
||||
TransformData memory data,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-zero-ex",
|
||||
"version": "0.36.6",
|
||||
"version": "0.37.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -57,10 +57,10 @@
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/zero-ex",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.8.1",
|
||||
"@0x/contract-addresses": "^6.22.0",
|
||||
"@0x/contracts-erc20": "^3.3.39",
|
||||
"@0x/contract-addresses": "^6.23.0",
|
||||
"@0x/contracts-erc20": "^3.3.40",
|
||||
"@0x/contracts-gen": "^2.0.47",
|
||||
"@0x/contracts-test-utils": "^5.4.30",
|
||||
"@0x/contracts-test-utils": "^5.4.31",
|
||||
"@0x/dev-utils": "^5.0.0",
|
||||
"@0x/order-utils": "^10.4.28",
|
||||
"@0x/sol-compiler": "^4.8.2",
|
||||
@@ -86,7 +86,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^7.0.0",
|
||||
"@0x/protocol-utils": "^11.16.6",
|
||||
"@0x/protocol-utils": "^11.16.7",
|
||||
"@0x/subproviders": "^7.0.0",
|
||||
"@0x/types": "^3.3.6",
|
||||
"@0x/typescript-typings": "^5.3.1",
|
||||
|
@@ -393,6 +393,7 @@ blockchainTests.resets('FillQuoteTransformer', env => {
|
||||
buyToken: makerToken.address,
|
||||
bridgeOrders: [],
|
||||
limitOrders: [],
|
||||
otcOrders: [],
|
||||
rfqOrders: [],
|
||||
fillSequence: [],
|
||||
fillAmount: MAX_UINT256,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/asset-swapper",
|
||||
"version": "16.66.6",
|
||||
"version": "16.66.7",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
@@ -62,15 +62,15 @@
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.35",
|
||||
"@0x/base-contract": "^7.0.0",
|
||||
"@0x/contract-addresses": "^6.22.0",
|
||||
"@0x/contract-wrappers": "^13.21.3",
|
||||
"@0x/contracts-erc20": "^3.3.39",
|
||||
"@0x/contracts-zero-ex": "^0.36.6",
|
||||
"@0x/contract-addresses": "^6.23.0",
|
||||
"@0x/contract-wrappers": "^13.22.0",
|
||||
"@0x/contracts-erc20": "^3.3.40",
|
||||
"@0x/contracts-zero-ex": "^0.37.0",
|
||||
"@0x/dev-utils": "^5.0.0",
|
||||
"@0x/fast-abi": "^0.0.5",
|
||||
"@0x/json-schemas": "^6.4.4",
|
||||
"@0x/neon-router": "^0.3.5",
|
||||
"@0x/protocol-utils": "^11.16.6",
|
||||
"@0x/protocol-utils": "^11.16.7",
|
||||
"@0x/quote-server": "^8.0.0",
|
||||
"@0x/types": "^3.3.6",
|
||||
"@0x/utils": "^7.0.0",
|
||||
@@ -95,7 +95,7 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.8.1",
|
||||
"@0x/contracts-gen": "^2.0.47",
|
||||
"@0x/contracts-test-utils": "^5.4.30",
|
||||
"@0x/contracts-test-utils": "^5.4.31",
|
||||
"@0x/sol-compiler": "^4.8.2",
|
||||
"@0x/subproviders": "^7.0.0",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
|
@@ -224,10 +224,7 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.Velodrome,
|
||||
ERC20BridgeSource.Synthetix,
|
||||
]),
|
||||
[ChainId.ArbitrumRinkeby]: new SourceFilters([
|
||||
ERC20BridgeSource.Native,
|
||||
ERC20BridgeSource.UniswapV3,
|
||||
]),
|
||||
[ChainId.ArbitrumRinkeby]: new SourceFilters([ERC20BridgeSource.Native, ERC20BridgeSource.UniswapV3]),
|
||||
},
|
||||
new SourceFilters([]),
|
||||
);
|
||||
@@ -379,10 +376,7 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.Velodrome,
|
||||
ERC20BridgeSource.Synthetix,
|
||||
]),
|
||||
[ChainId.ArbitrumRinkeby]: new SourceFilters([
|
||||
ERC20BridgeSource.Native,
|
||||
ERC20BridgeSource.UniswapV3,
|
||||
]),
|
||||
[ChainId.ArbitrumRinkeby]: new SourceFilters([ERC20BridgeSource.Native, ERC20BridgeSource.UniswapV3]),
|
||||
},
|
||||
new SourceFilters([]),
|
||||
);
|
||||
|
@@ -5,8 +5,13 @@
|
||||
{
|
||||
"note": "Remove contract addresses that are no longer needed",
|
||||
"pr": 564
|
||||
},
|
||||
{
|
||||
"note": "Change WETH address in contract-addresses",
|
||||
"pr": 571
|
||||
}
|
||||
]
|
||||
],
|
||||
"timestamp": 1662046042
|
||||
},
|
||||
{
|
||||
"version": "6.22.0",
|
||||
|
@@ -5,6 +5,11 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v6.23.0 - _September 1, 2022_
|
||||
|
||||
* Remove contract addresses that are no longer needed (#564)
|
||||
* Change WETH address in contract-addresses (#571)
|
||||
|
||||
## v6.22.0 - _August 25, 2022_
|
||||
|
||||
* Arbitrum Rinkeby support (#552)
|
||||
|
@@ -323,7 +323,7 @@
|
||||
},
|
||||
"42161": {
|
||||
"zrxToken": "0x0000000000000000000000000000000000000000",
|
||||
"etherToken": "0x4200000000000000000000000000000000000006",
|
||||
"etherToken": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
|
||||
"zeroExGovernor": "0x0000000000000000000000000000000000000000",
|
||||
"zrxVault": "0x0000000000000000000000000000000000000000",
|
||||
"staking": "0x0000000000000000000000000000000000000000",
|
||||
@@ -344,5 +344,4 @@
|
||||
"positiveSlippageFeeTransformer": "0xd56b9c014b45ed95e2a048a0c28121db30265f13"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-addresses",
|
||||
"version": "6.22.0",
|
||||
"version": "6.23.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
|
@@ -39,7 +39,7 @@ export enum ChainId {
|
||||
Celo = 42220,
|
||||
Optimism = 10,
|
||||
Arbitrum = 42161,
|
||||
ArbitrumRinkeby = 421611
|
||||
ArbitrumRinkeby = 421611,
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -5,7 +5,8 @@
|
||||
{
|
||||
"note": "Remove deprecated contracts"
|
||||
}
|
||||
]
|
||||
],
|
||||
"timestamp": 1662046042
|
||||
},
|
||||
{
|
||||
"timestamp": 1661462289,
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v13.22.0 - _September 1, 2022_
|
||||
|
||||
* Remove deprecated contracts
|
||||
|
||||
## v13.21.3 - _August 25, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-wrappers",
|
||||
"version": "13.21.3",
|
||||
"version": "13.22.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -57,7 +57,7 @@
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.35",
|
||||
"@0x/base-contract": "^7.0.0",
|
||||
"@0x/contract-addresses": "^6.22.0",
|
||||
"@0x/contract-addresses": "^6.23.0",
|
||||
"@0x/json-schemas": "^6.4.4",
|
||||
"@0x/types": "^3.3.6",
|
||||
"@0x/utils": "^7.0.0",
|
||||
|
@@ -1,8 +1,9 @@
|
||||
import { ContractAddresses } from '@0x/contract-addresses';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
|
||||
// not formatted
|
||||
export enum ForwarderError { CompleteFillFailed = 'COMPLETE_FILL_FAILED', }
|
||||
export enum ForwarderError {
|
||||
CompleteFillFailed = 'COMPLETE_FILL_FAILED',
|
||||
}
|
||||
|
||||
export enum ContractError {
|
||||
ContractNotDeployedOnChain = 'CONTRACT_NOT_DEPLOYED_ON_CHAIN',
|
||||
|
@@ -1,4 +1,14 @@
|
||||
[
|
||||
{
|
||||
"version": "11.16.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add otc order info to transformer_utils",
|
||||
"pr": "565"
|
||||
}
|
||||
],
|
||||
"timestamp": 1662046042
|
||||
},
|
||||
{
|
||||
"timestamp": 1661462289,
|
||||
"version": "11.16.6",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v11.16.7 - _September 1, 2022_
|
||||
|
||||
* Add otc order info to transformer_utils (#565)
|
||||
|
||||
## v11.16.6 - _August 25, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/protocol-utils",
|
||||
"version": "11.16.6",
|
||||
"version": "11.16.7",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -63,8 +63,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.35",
|
||||
"@0x/contract-addresses": "^6.22.0",
|
||||
"@0x/contract-wrappers": "^13.21.3",
|
||||
"@0x/contract-addresses": "^6.23.0",
|
||||
"@0x/contract-wrappers": "^13.22.0",
|
||||
"@0x/json-schemas": "^6.4.4",
|
||||
"@0x/subproviders": "^7.0.0",
|
||||
"@0x/utils": "^7.0.0",
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { AbiEncoder, BigNumber, hexUtils, NULL_ADDRESS } from '@0x/utils';
|
||||
import * as ethjs from 'ethereumjs-util';
|
||||
|
||||
import { LimitOrder, LimitOrderFields, RfqOrder, RfqOrderFields } from './orders';
|
||||
import { LimitOrder, LimitOrderFields, OtcOrder, OtcOrderFields, RfqOrder, RfqOrderFields } from './orders';
|
||||
import { Signature, SIGNATURE_ABI } from './signature_utils';
|
||||
|
||||
const BRIDGE_ORDER_ABI_COMPONENTS = [
|
||||
@@ -39,6 +39,20 @@ const RFQ_ORDER_INFO_ABI_COMPONENTS = [
|
||||
{ name: 'maxTakerTokenFillAmount', type: 'uint256' },
|
||||
];
|
||||
|
||||
const OTC_ORDER_INFO_ABI_COMPONENTS = [
|
||||
{
|
||||
name: 'order',
|
||||
type: 'tuple',
|
||||
components: OtcOrder.STRUCT_ABI,
|
||||
},
|
||||
{
|
||||
name: 'signature',
|
||||
type: 'tuple',
|
||||
components: SIGNATURE_ABI,
|
||||
},
|
||||
{ name: 'maxTakerTokenFillAmount', type: 'uint256' },
|
||||
];
|
||||
|
||||
/**
|
||||
* ABI encoder for `FillQuoteTransformer.TransformData`
|
||||
*/
|
||||
@@ -60,6 +74,11 @@ export const fillQuoteTransformerDataEncoder = AbiEncoder.create([
|
||||
type: 'tuple[]',
|
||||
components: LIMIT_ORDER_INFO_ABI_COMPONENTS,
|
||||
},
|
||||
{
|
||||
name: 'otcOrders',
|
||||
type: 'tuple[]',
|
||||
components: OTC_ORDER_INFO_ABI_COMPONENTS,
|
||||
},
|
||||
{
|
||||
name: 'rfqOrders',
|
||||
type: 'tuple[]',
|
||||
@@ -86,6 +105,7 @@ export enum FillQuoteTransformerSide {
|
||||
export enum FillQuoteTransformerOrderType {
|
||||
Bridge,
|
||||
Limit,
|
||||
Otc,
|
||||
Rfq,
|
||||
}
|
||||
|
||||
@@ -99,6 +119,7 @@ export interface FillQuoteTransformerData {
|
||||
bridgeOrders: FillQuoteTransformerBridgeOrder[];
|
||||
limitOrders: FillQuoteTransformerLimitOrderInfo[];
|
||||
rfqOrders: FillQuoteTransformerRfqOrderInfo[];
|
||||
otcOrders: FillQuoteTransformerOtcOrderInfo[];
|
||||
fillSequence: FillQuoteTransformerOrderType[];
|
||||
fillAmount: BigNumber;
|
||||
refundReceiver: string;
|
||||
@@ -178,6 +199,11 @@ export type FillQuoteTransformerLimitOrderInfo = FillQuoteTransformerNativeOrder
|
||||
*/
|
||||
export type FillQuoteTransformerRfqOrderInfo = FillQuoteTransformerNativeOrderInfo<RfqOrderFields>;
|
||||
|
||||
/**
|
||||
* `FillQuoteTransformer.OtcOrderInfo`
|
||||
*/
|
||||
export type FillQuoteTransformerOtcOrderInfo = FillQuoteTransformerNativeOrderInfo<OtcOrderFields>;
|
||||
|
||||
/**
|
||||
* ABI-encode a `FillQuoteTransformer.TransformData` type.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user