Compare commits
9 Commits
@0x/contra
...
ewong_prot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e0a36477d | ||
|
|
fd68edb239 | ||
|
|
e5e1393f0e | ||
|
|
20961ef42e | ||
|
|
34febd728a | ||
|
|
c2aed76f2f | ||
|
|
198d986fdc | ||
|
|
e2e1d1074c | ||
|
|
6a15dc3f13 |
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1683749017,
|
||||
"version": "4.0.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1682976338,
|
||||
"version": "4.0.7",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.0.8 - _May 10, 2023_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.7 - _May 1, 2023_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc20",
|
||||
"version": "4.0.7",
|
||||
"version": "4.0.8",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol",
|
||||
"devDependencies": {
|
||||
"@0x/contracts-utils": "^4.8.45",
|
||||
"@0x/contracts-utils": "^4.8.46",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"typedoc": "~0.16.11"
|
||||
},
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1683749017,
|
||||
"version": "5.4.54",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1682976338,
|
||||
"version": "5.4.53",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v5.4.54 - _May 10, 2023_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v5.4.53 - _May 1, 2023_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-test-utils",
|
||||
"version": "5.4.53",
|
||||
"version": "5.4.54",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -41,7 +41,7 @@
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.36",
|
||||
"@0x/base-contract": "^7.0.0",
|
||||
"@0x/contract-addresses": "^8.6.0",
|
||||
"@0x/contract-addresses": "^8.7.0",
|
||||
"@0x/dev-utils": "^5.0.2",
|
||||
"@0x/json-schemas": "^6.4.4",
|
||||
"@0x/order-utils": "^10.4.28",
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1683749017,
|
||||
"version": "1.4.48",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1682976338,
|
||||
"version": "1.4.47",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.4.48 - _May 10, 2023_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.4.47 - _May 1, 2023_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-treasury",
|
||||
"version": "1.4.47",
|
||||
"version": "1.4.48",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -46,12 +46,12 @@
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/treasury",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.8.5",
|
||||
"@0x/contract-addresses": "^8.6.0",
|
||||
"@0x/contract-addresses": "^8.7.0",
|
||||
"@0x/contracts-asset-proxy": "^3.7.19",
|
||||
"@0x/contracts-erc20": "3.3.57",
|
||||
"@0x/contracts-gen": "^2.0.50",
|
||||
"@0x/contracts-staking": "^2.0.45",
|
||||
"@0x/contracts-test-utils": "^5.4.53",
|
||||
"@0x/contracts-test-utils": "^5.4.54",
|
||||
"@0x/sol-compiler": "^4.8.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@types/isomorphic-fetch": "^0.0.35",
|
||||
@@ -73,7 +73,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^7.0.0",
|
||||
"@0x/protocol-utils": "^11.22.1",
|
||||
"@0x/protocol-utils": "^11.22.2",
|
||||
"@0x/subproviders": "^8.0.1",
|
||||
"@0x/types": "^3.3.7",
|
||||
"@0x/typescript-typings": "^5.3.1",
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1683749017,
|
||||
"version": "4.8.46",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1682976338,
|
||||
"version": "4.8.45",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.8.46 - _May 10, 2023_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.8.45 - _May 1, 2023_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-utils",
|
||||
"version": "4.8.45",
|
||||
"version": "4.8.46",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -45,7 +45,7 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.8.5",
|
||||
"@0x/contracts-gen": "^2.0.50",
|
||||
"@0x/contracts-test-utils": "^5.4.53",
|
||||
"@0x/contracts-test-utils": "^5.4.54",
|
||||
"@0x/dev-utils": "^5.0.2",
|
||||
"@0x/order-utils": "^10.4.28",
|
||||
"@0x/sol-compiler": "^4.8.2",
|
||||
|
||||
@@ -1,4 +1,24 @@
|
||||
[
|
||||
{
|
||||
"version": "0.45.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Remove Bancor V1 support"
|
||||
},
|
||||
{
|
||||
"note": "Remove Shell and MStable support"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.44.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add Trader Joe V2 MixIn to Arbitrum"
|
||||
}
|
||||
],
|
||||
"timestamp": 1683749017
|
||||
},
|
||||
{
|
||||
"version": "0.43.0",
|
||||
"changes": [
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.44.0 - _May 10, 2023_
|
||||
|
||||
* Add Trader Joe V2 MixIn to Arbitrum
|
||||
|
||||
## v0.43.0 - _May 1, 2023_
|
||||
|
||||
* Add Trader Joe V2.1 Router Support for MixIn
|
||||
|
||||
@@ -125,7 +125,6 @@
|
||||
"./contracts/src/transformers/bridges/mixins/MixinAaveV2.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinBalancer.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinBalancerV2Batch.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinBancor.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinBancorV3.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinCompound.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinCryptoCom.sol",
|
||||
@@ -136,12 +135,10 @@
|
||||
"./contracts/src/transformers/bridges/mixins/MixinGMX.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinKyberDmm.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinLido.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinMStable.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinMakerPSM.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinMooniswap.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinNerve.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinPlatypus.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinShell.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinSolidly.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinSynthetix.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinUniswap.sol",
|
||||
|
||||
@@ -26,6 +26,7 @@ import "./mixins/MixinKyberDmm.sol";
|
||||
import "./mixins/MixinKyberElastic.sol";
|
||||
import "./mixins/MixinGMX.sol";
|
||||
import "./mixins/MixinNerve.sol";
|
||||
import "./mixins/MixinTraderJoeV2.sol";
|
||||
import "./mixins/MixinUniswapV3.sol";
|
||||
import "./mixins/MixinUniswapV2.sol";
|
||||
import "./mixins/MixinWOOFi.sol";
|
||||
@@ -42,6 +43,7 @@ contract ArbitrumBridgeAdapter is
|
||||
MixinKyberElastic,
|
||||
MixinGMX,
|
||||
MixinNerve,
|
||||
MixinTraderJoeV2,
|
||||
MixinUniswapV3,
|
||||
MixinUniswapV2,
|
||||
MixinWOOFi,
|
||||
@@ -97,6 +99,11 @@ contract ArbitrumBridgeAdapter is
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV2(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.TRADERJOEV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeTraderJoeV2(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.GMX) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
|
||||
@@ -20,7 +20,6 @@ import "./BridgeProtocols.sol";
|
||||
import "./mixins/MixinAaveV2.sol";
|
||||
import "./mixins/MixinBalancer.sol";
|
||||
import "./mixins/MixinBalancerV2Batch.sol";
|
||||
import "./mixins/MixinBancor.sol";
|
||||
import "./mixins/MixinBancorV3.sol";
|
||||
import "./mixins/MixinBarter.sol";
|
||||
import "./mixins/MixinCompound.sol";
|
||||
@@ -33,9 +32,7 @@ import "./mixins/MixinKyberDmm.sol";
|
||||
import "./mixins/MixinKyberElastic.sol";
|
||||
import "./mixins/MixinLido.sol";
|
||||
import "./mixins/MixinMakerPSM.sol";
|
||||
import "./mixins/MixinMStable.sol";
|
||||
import "./mixins/MixinNerve.sol";
|
||||
import "./mixins/MixinShell.sol";
|
||||
import "./mixins/MixinSynthetix.sol";
|
||||
import "./mixins/MixinUniswap.sol";
|
||||
import "./mixins/MixinUniswapV2.sol";
|
||||
@@ -47,7 +44,6 @@ contract EthereumBridgeAdapter is
|
||||
MixinAaveV2,
|
||||
MixinBalancer,
|
||||
MixinBalancerV2Batch,
|
||||
MixinBancor,
|
||||
MixinBancorV3,
|
||||
MixinBarter,
|
||||
MixinCompound,
|
||||
@@ -60,9 +56,7 @@ contract EthereumBridgeAdapter is
|
||||
MixinKyberElastic,
|
||||
MixinLido,
|
||||
MixinMakerPSM,
|
||||
MixinMStable,
|
||||
MixinNerve,
|
||||
MixinShell,
|
||||
MixinSynthetix,
|
||||
MixinUniswap,
|
||||
MixinUniswapV2,
|
||||
@@ -71,15 +65,7 @@ contract EthereumBridgeAdapter is
|
||||
{
|
||||
constructor(
|
||||
IEtherToken weth
|
||||
)
|
||||
public
|
||||
MixinBancor(weth)
|
||||
MixinBancorV3(weth)
|
||||
MixinCompound(weth)
|
||||
MixinCurve(weth)
|
||||
MixinLido(weth)
|
||||
MixinUniswap(weth)
|
||||
{}
|
||||
) public MixinBancorV3(weth) MixinCompound(weth) MixinCurve(weth) MixinLido(weth) MixinUniswap(weth) {}
|
||||
|
||||
function _trade(
|
||||
BridgeOrder memory order,
|
||||
@@ -129,16 +115,6 @@ contract EthereumBridgeAdapter is
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeMakerPsm(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.MSTABLE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeMStable(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.SHELL) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeShell(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.DODO) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
@@ -154,11 +130,6 @@ contract EthereumBridgeAdapter is
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCryptoCom(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.BANCOR) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeBancor(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.NERVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
|
||||
@@ -26,7 +26,6 @@ import "./mixins/MixinDodo.sol";
|
||||
import "./mixins/MixinDodoV2.sol";
|
||||
import "./mixins/MixinKyberDmm.sol";
|
||||
import "./mixins/MixinKyberElastic.sol";
|
||||
import "./mixins/MixinMStable.sol";
|
||||
import "./mixins/MixinNerve.sol";
|
||||
import "./mixins/MixinSolidly.sol";
|
||||
import "./mixins/MixinUniswapV2.sol";
|
||||
@@ -45,7 +44,6 @@ contract PolygonBridgeAdapter is
|
||||
MixinDodoV2,
|
||||
MixinKyberDmm,
|
||||
MixinKyberElastic,
|
||||
MixinMStable,
|
||||
MixinNerve,
|
||||
MixinUniswapV2,
|
||||
MixinUniswapV3,
|
||||
@@ -88,11 +86,6 @@ contract PolygonBridgeAdapter is
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeBalancerV2Batch(sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.MSTABLE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeMStable(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.DODO) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
/*
|
||||
Copyright 2023 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.6.5;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "@0x/contracts-erc20/src/v06/LibERC20TokenV06.sol";
|
||||
import "@0x/contracts-erc20/src/IERC20Token.sol";
|
||||
import "@0x/contracts-erc20/src/IEtherToken.sol";
|
||||
import "../IBridgeAdapter.sol";
|
||||
|
||||
interface IBancorNetwork {
|
||||
function convertByPath(
|
||||
IERC20Token[] calldata _path,
|
||||
uint256 _amount,
|
||||
uint256 _minReturn,
|
||||
address _beneficiary,
|
||||
address _affiliateAccount,
|
||||
uint256 _affiliateFee
|
||||
) external payable returns (uint256);
|
||||
}
|
||||
|
||||
contract MixinBancor {
|
||||
/// @dev Bancor ETH pseudo-address.
|
||||
IERC20Token public constant BANCOR_ETH_ADDRESS = IERC20Token(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);
|
||||
IEtherToken private immutable WETH;
|
||||
|
||||
constructor(IEtherToken weth) public {
|
||||
WETH = weth;
|
||||
}
|
||||
|
||||
function _tradeBancor(
|
||||
IERC20Token buyToken,
|
||||
uint256 sellAmount,
|
||||
bytes memory bridgeData
|
||||
) internal returns (uint256 boughtAmount) {
|
||||
// Decode the bridge data.
|
||||
IBancorNetwork bancorNetworkAddress;
|
||||
IERC20Token[] memory path;
|
||||
{
|
||||
address[] memory _path;
|
||||
(bancorNetworkAddress, _path) = abi.decode(bridgeData, (IBancorNetwork, address[]));
|
||||
// To get around `abi.decode()` not supporting interface array types.
|
||||
assembly {
|
||||
path := _path
|
||||
}
|
||||
}
|
||||
|
||||
require(path.length >= 2, "MixinBancor/PATH_LENGTH_MUST_BE_AT_LEAST_TWO");
|
||||
require(
|
||||
path[path.length - 1] == buyToken || (path[path.length - 1] == BANCOR_ETH_ADDRESS && buyToken == WETH),
|
||||
"MixinBancor/LAST_ELEMENT_OF_PATH_MUST_MATCH_OUTPUT_TOKEN"
|
||||
);
|
||||
|
||||
uint256 payableAmount = 0;
|
||||
// If it's ETH in the path then withdraw from WETH
|
||||
// The Bancor path will have ETH as the 0xeee address
|
||||
// Bancor expects to be paid in ETH not WETH
|
||||
if (path[0] == BANCOR_ETH_ADDRESS) {
|
||||
WETH.withdraw(sellAmount);
|
||||
payableAmount = sellAmount;
|
||||
} else {
|
||||
// Grant an allowance to the Bancor Network.
|
||||
LibERC20TokenV06.approveIfBelow(path[0], address(bancorNetworkAddress), sellAmount);
|
||||
}
|
||||
|
||||
// Convert the tokens
|
||||
boughtAmount = bancorNetworkAddress.convertByPath{value: payableAmount}(
|
||||
path, // path originating with source token and terminating in destination token
|
||||
sellAmount, // amount of source token to trade
|
||||
1, // minimum amount of destination token expected to receive
|
||||
address(this), // beneficiary
|
||||
address(0), // affiliateAccount; no fee paid
|
||||
0 // affiliateFee; no fee paid
|
||||
);
|
||||
if (path[path.length - 1] == BANCOR_ETH_ADDRESS) {
|
||||
WETH.deposit{value: boughtAmount}();
|
||||
}
|
||||
|
||||
return boughtAmount;
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
/*
|
||||
Copyright 2023 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.6.5;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "@0x/contracts-erc20/src/v06/LibERC20TokenV06.sol";
|
||||
import "@0x/contracts-erc20/src/IERC20Token.sol";
|
||||
|
||||
interface IShell {
|
||||
function originSwap(
|
||||
IERC20Token from,
|
||||
IERC20Token to,
|
||||
uint256 fromAmount,
|
||||
uint256 minTargetAmount,
|
||||
uint256 deadline
|
||||
) external returns (uint256 toAmount);
|
||||
}
|
||||
|
||||
contract MixinShell {
|
||||
using LibERC20TokenV06 for IERC20Token;
|
||||
|
||||
function _tradeShell(
|
||||
IERC20Token sellToken,
|
||||
IERC20Token buyToken,
|
||||
uint256 sellAmount,
|
||||
bytes memory bridgeData
|
||||
) internal returns (uint256 boughtAmount) {
|
||||
IShell pool = abi.decode(bridgeData, (IShell));
|
||||
|
||||
// Grant the Shell contract an allowance to sell the first token.
|
||||
IERC20Token(sellToken).approveIfBelow(address(pool), sellAmount);
|
||||
|
||||
boughtAmount = pool.originSwap(
|
||||
sellToken,
|
||||
buyToken,
|
||||
// Sell all tokens we hold.
|
||||
sellAmount,
|
||||
// Minimum buy amount.
|
||||
1,
|
||||
// deadline
|
||||
block.timestamp + 1
|
||||
);
|
||||
return boughtAmount;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-zero-ex",
|
||||
"version": "0.43.0",
|
||||
"version": "0.44.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -38,7 +38,7 @@
|
||||
"config": {
|
||||
"publicInterfaceContracts": "IZeroEx,ZeroEx,FullMigration,InitialMigration,IFlashWallet,IERC20Transformer,IOwnableFeature,ISimpleFunctionRegistryFeature,ITransformERC20Feature,FillQuoteTransformer,PayTakerTransformer,PositiveSlippageFeeTransformer,WethTransformer,OwnableFeature,SimpleFunctionRegistryFeature,TransformERC20Feature,AffiliateFeeTransformer,MetaTransactionsFeature,LogMetadataTransformer,LiquidityProviderFeature,ILiquidityProviderFeature,NativeOrdersFeature,INativeOrdersFeature,FeeCollectorController,FeeCollector,CurveLiquidityProvider,BatchFillNativeOrdersFeature,IBatchFillNativeOrdersFeature,MultiplexFeature,IMultiplexFeature,OtcOrdersFeature,IOtcOrdersFeature,AvalancheBridgeAdapter,BSCBridgeAdapter,CeloBridgeAdapter,EthereumBridgeAdapter,FantomBridgeAdapter,OptimismBridgeAdapter,PolygonBridgeAdapter,MetaTransactionsFeatureV2",
|
||||
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.",
|
||||
"abis": "./test/generated-artifacts/@(AbstractBridgeAdapter|AffiliateFeeTransformer|ArbitrumBridgeAdapter|AvalancheBridgeAdapter|BSCBridgeAdapter|BatchFillNativeOrdersFeature|BootstrapFeature|BridgeProtocols|CeloBridgeAdapter|CurveLiquidityProvider|ERC1155OrdersFeature|ERC165Feature|ERC721OrdersFeature|EthereumBridgeAdapter|FantomBridgeAdapter|FeeCollector|FeeCollectorController|FillQuoteTransformer|FixinCommon|FixinEIP712|FixinERC1155Spender|FixinERC721Spender|FixinProtocolFees|FixinReentrancyGuard|FixinTokenSpender|FlashWallet|FullMigration|FundRecoveryFeature|IBatchFillNativeOrdersFeature|IBootstrapFeature|IBridgeAdapter|IERC1155OrdersFeature|IERC1155Token|IERC165Feature|IERC20Bridge|IERC20Transformer|IERC721OrdersFeature|IERC721Token|IFeature|IFeeRecipient|IFlashWallet|IFundRecoveryFeature|ILiquidityProvider|ILiquidityProviderFeature|ILiquidityProviderSandbox|IMetaTransactionsFeature|IMetaTransactionsFeatureV2|IMooniswapPool|IMultiplexFeature|INativeOrdersEvents|INativeOrdersFeature|IOtcOrdersFeature|IOwnableFeature|IPancakeSwapFeature|IPropertyValidator|ISimpleFunctionRegistryFeature|IStaking|ITakerCallback|ITestSimpleFunctionRegistryFeature|ITokenSpenderFeature|ITransformERC20Feature|IUniswapFeature|IUniswapV2Pair|IUniswapV3Feature|IUniswapV3Pool|IZeroEx|InitialMigration|LibBootstrap|LibCommonRichErrors|LibERC1155OrdersStorage|LibERC20Transformer|LibERC721OrdersStorage|LibFeeCollector|LibLiquidityProviderRichErrors|LibMetaTransactionsRichErrors|LibMetaTransactionsStorage|LibMigrate|LibNFTOrder|LibNFTOrdersRichErrors|LibNativeOrder|LibNativeOrdersRichErrors|LibNativeOrdersStorage|LibOtcOrdersStorage|LibOwnableRichErrors|LibOwnableStorage|LibProxyRichErrors|LibProxyStorage|LibReentrancyGuardStorage|LibSignature|LibSignatureRichErrors|LibSimpleFunctionRegistryRichErrors|LibSimpleFunctionRegistryStorage|LibStorage|LibTransformERC20RichErrors|LibTransformERC20Storage|LibWalletRichErrors|LiquidityProviderFeature|LiquidityProviderSandbox|LogMetadataTransformer|MetaTransactionsFeature|MetaTransactionsFeatureV2|MixinAaveV2|MixinBalancer|MixinBalancerV2Batch|MixinBancor|MixinBancorV3|MixinCompound|MixinCryptoCom|MixinCurve|MixinCurveV2|MixinDodo|MixinDodoV2|MixinGMX|MixinKyberDmm|MixinLido|MixinMStable|MixinMakerPSM|MixinMooniswap|MixinNerve|MixinPlatypus|MixinShell|MixinSolidly|MixinSynthetix|MixinUniswap|MixinUniswapV2|MixinUniswapV3|MixinZeroExBridge|MooniswapLiquidityProvider|MultiplexFeature|MultiplexLiquidityProvider|MultiplexOtc|MultiplexRfq|MultiplexTransformERC20|MultiplexUniswapV2|MultiplexUniswapV3|NFTOrders|NativeOrdersCancellation|NativeOrdersFeature|NativeOrdersInfo|NativeOrdersProtocolFees|NativeOrdersSettlement|OptimismBridgeAdapter|OtcOrdersFeature|OwnableFeature|PancakeSwapFeature|PayTakerTransformer|PermissionlessTransformerDeployer|PolygonBridgeAdapter|PositiveSlippageFeeTransformer|SimpleFunctionRegistryFeature|TestCurve|TestDelegateCaller|TestFeeCollectorController|TestFeeRecipient|TestFillQuoteTransformerBridge|TestFillQuoteTransformerExchange|TestFillQuoteTransformerHost|TestFixinProtocolFees|TestFixinTokenSpender|TestFullMigration|TestInitialMigration|TestLibNativeOrder|TestLibSignature|TestLiquidityProvider|TestMetaTransactionsNativeOrdersFeature|TestMetaTransactionsTransformERC20Feature|TestMigrator|TestMintTokenERC20Transformer|TestMintableERC1155Token|TestMintableERC20Token|TestMintableERC721Token|TestMooniswap|TestNFTOrderPresigner|TestNativeOrdersFeature|TestNoEthRecipient|TestOrderSignerRegistryWithContractWallet|TestPermissionlessTransformerDeployerSuicidal|TestPermissionlessTransformerDeployerTransformer|TestPropertyValidator|TestRfqOriginRegistration|TestSimpleFunctionRegistryFeatureImpl1|TestSimpleFunctionRegistryFeatureImpl2|TestStaking|TestTokenSpenderERC20Token|TestTransformERC20|TestTransformerBase|TestTransformerDeployerTransformer|TestTransformerHost|TestUniswapV2Factory|TestUniswapV2Pool|TestUniswapV3Factory|TestUniswapV3Feature|TestUniswapV3Pool|TestWeth|TestWethTransformerHost|TransformERC20Feature|Transformer|TransformerDeployer|UniswapFeature|UniswapV3Feature|WethTransformer|ZeroEx|ZeroExOptimized).json"
|
||||
"abis": "./test/generated-artifacts/@(AbstractBridgeAdapter|AffiliateFeeTransformer|ArbitrumBridgeAdapter|AvalancheBridgeAdapter|BSCBridgeAdapter|BatchFillNativeOrdersFeature|BootstrapFeature|BridgeProtocols|CeloBridgeAdapter|CurveLiquidityProvider|ERC1155OrdersFeature|ERC165Feature|ERC721OrdersFeature|EthereumBridgeAdapter|FantomBridgeAdapter|FeeCollector|FeeCollectorController|FillQuoteTransformer|FixinCommon|FixinEIP712|FixinERC1155Spender|FixinERC721Spender|FixinProtocolFees|FixinReentrancyGuard|FixinTokenSpender|FlashWallet|FullMigration|FundRecoveryFeature|IBatchFillNativeOrdersFeature|IBootstrapFeature|IBridgeAdapter|IERC1155OrdersFeature|IERC1155Token|IERC165Feature|IERC20Bridge|IERC20Transformer|IERC721OrdersFeature|IERC721Token|IFeature|IFeeRecipient|IFlashWallet|IFundRecoveryFeature|ILiquidityProvider|ILiquidityProviderFeature|ILiquidityProviderSandbox|IMetaTransactionsFeature|IMetaTransactionsFeatureV2|IMooniswapPool|IMultiplexFeature|INativeOrdersEvents|INativeOrdersFeature|IOtcOrdersFeature|IOwnableFeature|IPancakeSwapFeature|IPropertyValidator|ISimpleFunctionRegistryFeature|IStaking|ITakerCallback|ITestSimpleFunctionRegistryFeature|ITokenSpenderFeature|ITransformERC20Feature|IUniswapFeature|IUniswapV2Pair|IUniswapV3Feature|IUniswapV3Pool|IZeroEx|InitialMigration|LibBootstrap|LibCommonRichErrors|LibERC1155OrdersStorage|LibERC20Transformer|LibERC721OrdersStorage|LibFeeCollector|LibLiquidityProviderRichErrors|LibMetaTransactionsRichErrors|LibMetaTransactionsStorage|LibMigrate|LibNFTOrder|LibNFTOrdersRichErrors|LibNativeOrder|LibNativeOrdersRichErrors|LibNativeOrdersStorage|LibOtcOrdersStorage|LibOwnableRichErrors|LibOwnableStorage|LibProxyRichErrors|LibProxyStorage|LibReentrancyGuardStorage|LibSignature|LibSignatureRichErrors|LibSimpleFunctionRegistryRichErrors|LibSimpleFunctionRegistryStorage|LibStorage|LibTransformERC20RichErrors|LibTransformERC20Storage|LibWalletRichErrors|LiquidityProviderFeature|LiquidityProviderSandbox|LogMetadataTransformer|MetaTransactionsFeature|MetaTransactionsFeatureV2|MixinAaveV2|MixinBalancer|MixinBalancerV2Batch|MixinBancorV3|MixinCompound|MixinCryptoCom|MixinCurve|MixinCurveV2|MixinDodo|MixinDodoV2|MixinGMX|MixinKyberDmm|MixinLido|MixinMakerPSM|MixinMooniswap|MixinNerve|MixinPlatypus|MixinSolidly|MixinSynthetix|MixinUniswap|MixinUniswapV2|MixinUniswapV3|MixinZeroExBridge|MooniswapLiquidityProvider|MultiplexFeature|MultiplexLiquidityProvider|MultiplexOtc|MultiplexRfq|MultiplexTransformERC20|MultiplexUniswapV2|MultiplexUniswapV3|NFTOrders|NativeOrdersCancellation|NativeOrdersFeature|NativeOrdersInfo|NativeOrdersProtocolFees|NativeOrdersSettlement|OptimismBridgeAdapter|OtcOrdersFeature|OwnableFeature|PancakeSwapFeature|PayTakerTransformer|PermissionlessTransformerDeployer|PolygonBridgeAdapter|PositiveSlippageFeeTransformer|SimpleFunctionRegistryFeature|TestCurve|TestDelegateCaller|TestFeeCollectorController|TestFeeRecipient|TestFillQuoteTransformerBridge|TestFillQuoteTransformerExchange|TestFillQuoteTransformerHost|TestFixinProtocolFees|TestFixinTokenSpender|TestFullMigration|TestInitialMigration|TestLibNativeOrder|TestLibSignature|TestLiquidityProvider|TestMetaTransactionsNativeOrdersFeature|TestMetaTransactionsTransformERC20Feature|TestMigrator|TestMintTokenERC20Transformer|TestMintableERC1155Token|TestMintableERC20Token|TestMintableERC721Token|TestMooniswap|TestNFTOrderPresigner|TestNativeOrdersFeature|TestNoEthRecipient|TestOrderSignerRegistryWithContractWallet|TestPermissionlessTransformerDeployerSuicidal|TestPermissionlessTransformerDeployerTransformer|TestPropertyValidator|TestRfqOriginRegistration|TestSimpleFunctionRegistryFeatureImpl1|TestSimpleFunctionRegistryFeatureImpl2|TestStaking|TestTokenSpenderERC20Token|TestTransformERC20|TestTransformerBase|TestTransformerDeployerTransformer|TestTransformerHost|TestUniswapV2Factory|TestUniswapV2Pool|TestUniswapV3Factory|TestUniswapV3Feature|TestUniswapV3Pool|TestWeth|TestWethTransformerHost|TransformERC20Feature|Transformer|TransformerDeployer|UniswapFeature|UniswapV3Feature|WethTransformer|ZeroEx|ZeroExOptimized).json"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -51,10 +51,10 @@
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/zero-ex",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.8.5",
|
||||
"@0x/contract-addresses": "^8.6.0",
|
||||
"@0x/contract-addresses": "^8.7.0",
|
||||
"@0x/contracts-erc20": "^3.3.57",
|
||||
"@0x/contracts-gen": "^2.0.50",
|
||||
"@0x/contracts-test-utils": "^5.4.53",
|
||||
"@0x/contracts-test-utils": "^5.4.54",
|
||||
"@0x/dev-utils": "^5.0.2",
|
||||
"@0x/order-utils": "^10.4.28",
|
||||
"@0x/sol-compiler": "^4.8.2",
|
||||
@@ -80,7 +80,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^7.0.0",
|
||||
"@0x/protocol-utils": "^11.22.1",
|
||||
"@0x/protocol-utils": "^11.22.2",
|
||||
"@0x/subproviders": "^8.0.1",
|
||||
"@0x/types": "^3.3.7",
|
||||
"@0x/typescript-typings": "^5.3.1",
|
||||
|
||||
@@ -109,7 +109,6 @@ import * as MetaTransactionsFeatureV2 from '../test/generated-artifacts/MetaTran
|
||||
import * as MixinAaveV2 from '../test/generated-artifacts/MixinAaveV2.json';
|
||||
import * as MixinBalancer from '../test/generated-artifacts/MixinBalancer.json';
|
||||
import * as MixinBalancerV2Batch from '../test/generated-artifacts/MixinBalancerV2Batch.json';
|
||||
import * as MixinBancor from '../test/generated-artifacts/MixinBancor.json';
|
||||
import * as MixinBancorV3 from '../test/generated-artifacts/MixinBancorV3.json';
|
||||
import * as MixinCompound from '../test/generated-artifacts/MixinCompound.json';
|
||||
import * as MixinCryptoCom from '../test/generated-artifacts/MixinCryptoCom.json';
|
||||
@@ -122,10 +121,8 @@ import * as MixinKyberDmm from '../test/generated-artifacts/MixinKyberDmm.json';
|
||||
import * as MixinLido from '../test/generated-artifacts/MixinLido.json';
|
||||
import * as MixinMakerPSM from '../test/generated-artifacts/MixinMakerPSM.json';
|
||||
import * as MixinMooniswap from '../test/generated-artifacts/MixinMooniswap.json';
|
||||
import * as MixinMStable from '../test/generated-artifacts/MixinMStable.json';
|
||||
import * as MixinNerve from '../test/generated-artifacts/MixinNerve.json';
|
||||
import * as MixinPlatypus from '../test/generated-artifacts/MixinPlatypus.json';
|
||||
import * as MixinShell from '../test/generated-artifacts/MixinShell.json';
|
||||
import * as MixinSolidly from '../test/generated-artifacts/MixinSolidly.json';
|
||||
import * as MixinSynthetix from '../test/generated-artifacts/MixinSynthetix.json';
|
||||
import * as MixinUniswap from '../test/generated-artifacts/MixinUniswap.json';
|
||||
@@ -332,7 +329,6 @@ export const artifacts = {
|
||||
MixinAaveV2: MixinAaveV2 as ContractArtifact,
|
||||
MixinBalancer: MixinBalancer as ContractArtifact,
|
||||
MixinBalancerV2Batch: MixinBalancerV2Batch as ContractArtifact,
|
||||
MixinBancor: MixinBancor as ContractArtifact,
|
||||
MixinBancorV3: MixinBancorV3 as ContractArtifact,
|
||||
MixinCompound: MixinCompound as ContractArtifact,
|
||||
MixinCryptoCom: MixinCryptoCom as ContractArtifact,
|
||||
@@ -343,12 +339,10 @@ export const artifacts = {
|
||||
MixinGMX: MixinGMX as ContractArtifact,
|
||||
MixinKyberDmm: MixinKyberDmm as ContractArtifact,
|
||||
MixinLido: MixinLido as ContractArtifact,
|
||||
MixinMStable: MixinMStable as ContractArtifact,
|
||||
MixinMakerPSM: MixinMakerPSM as ContractArtifact,
|
||||
MixinMooniswap: MixinMooniswap as ContractArtifact,
|
||||
MixinNerve: MixinNerve as ContractArtifact,
|
||||
MixinPlatypus: MixinPlatypus as ContractArtifact,
|
||||
MixinShell: MixinShell as ContractArtifact,
|
||||
MixinSolidly: MixinSolidly as ContractArtifact,
|
||||
MixinSynthetix: MixinSynthetix as ContractArtifact,
|
||||
MixinUniswap: MixinUniswap as ContractArtifact,
|
||||
|
||||
@@ -107,7 +107,6 @@ export * from '../test/generated-wrappers/meta_transactions_feature_v2';
|
||||
export * from '../test/generated-wrappers/mixin_aave_v2';
|
||||
export * from '../test/generated-wrappers/mixin_balancer';
|
||||
export * from '../test/generated-wrappers/mixin_balancer_v2_batch';
|
||||
export * from '../test/generated-wrappers/mixin_bancor';
|
||||
export * from '../test/generated-wrappers/mixin_bancor_v3';
|
||||
export * from '../test/generated-wrappers/mixin_compound';
|
||||
export * from '../test/generated-wrappers/mixin_crypto_com';
|
||||
@@ -118,12 +117,10 @@ export * from '../test/generated-wrappers/mixin_dodo_v2';
|
||||
export * from '../test/generated-wrappers/mixin_g_m_x';
|
||||
export * from '../test/generated-wrappers/mixin_kyber_dmm';
|
||||
export * from '../test/generated-wrappers/mixin_lido';
|
||||
export * from '../test/generated-wrappers/mixin_m_stable';
|
||||
export * from '../test/generated-wrappers/mixin_maker_p_s_m';
|
||||
export * from '../test/generated-wrappers/mixin_mooniswap';
|
||||
export * from '../test/generated-wrappers/mixin_nerve';
|
||||
export * from '../test/generated-wrappers/mixin_platypus';
|
||||
export * from '../test/generated-wrappers/mixin_shell';
|
||||
export * from '../test/generated-wrappers/mixin_solidly';
|
||||
export * from '../test/generated-wrappers/mixin_synthetix';
|
||||
export * from '../test/generated-wrappers/mixin_uniswap';
|
||||
|
||||
@@ -263,6 +263,7 @@ contract MetaTransactionTest is LocalTest {
|
||||
function test_transformERC20() external {
|
||||
bytes memory transformCallData = _transformERC20Call(zrx, dai, USER_ADDRESS);
|
||||
IMetaTransactionsFeatureV2.MetaTransactionDataV2 memory mtxData = _getMetaTransaction(transformCallData);
|
||||
LibSignature.Signature memory sig = _mtxSignature(mtxData);
|
||||
|
||||
assertEq(dai.balanceOf(USER_ADDRESS), 1e18);
|
||||
vm.expectEmit(true, false, false, true);
|
||||
@@ -273,10 +274,8 @@ contract MetaTransactionTest is LocalTest {
|
||||
address(this)
|
||||
);
|
||||
|
||||
IMetaTransactionsFeatureV2(address(zeroExDeployed.zeroEx)).executeMetaTransactionV2(
|
||||
mtxData,
|
||||
_mtxSignature(mtxData)
|
||||
);
|
||||
IMetaTransactionsFeatureV2(address(zeroExDeployed.zeroEx)).executeMetaTransactionV2(mtxData, sig);
|
||||
|
||||
assertEq(zrx.balanceOf(USER_ADDRESS), 1e18);
|
||||
assertEq(dai.balanceOf(USER_ADDRESS), 0);
|
||||
assertEq(weth.balanceOf(address(this)), 1);
|
||||
@@ -285,6 +284,7 @@ contract MetaTransactionTest is LocalTest {
|
||||
function test_rfqOrder() external {
|
||||
bytes memory callData = _makeTestRfqOrder(zrx, dai, signerAddress, USER_ADDRESS, signerKey);
|
||||
IMetaTransactionsFeatureV2.MetaTransactionDataV2 memory mtxData = _getMetaTransaction(callData);
|
||||
LibSignature.Signature memory sig = _mtxSignature(mtxData);
|
||||
|
||||
assertEq(dai.balanceOf(USER_ADDRESS), 1e18);
|
||||
vm.expectEmit(true, false, false, true);
|
||||
@@ -295,10 +295,7 @@ contract MetaTransactionTest is LocalTest {
|
||||
address(this)
|
||||
);
|
||||
|
||||
IMetaTransactionsFeatureV2(address(zeroExDeployed.zeroEx)).executeMetaTransactionV2(
|
||||
mtxData,
|
||||
_mtxSignature(mtxData)
|
||||
);
|
||||
IMetaTransactionsFeatureV2(address(zeroExDeployed.zeroEx)).executeMetaTransactionV2(mtxData, sig);
|
||||
|
||||
assertEq(zrx.balanceOf(signerAddress), 0);
|
||||
assertEq(zrx.balanceOf(USER_ADDRESS), 1e18);
|
||||
@@ -310,6 +307,7 @@ contract MetaTransactionTest is LocalTest {
|
||||
function test_fillLimitOrder() external {
|
||||
bytes memory callData = _makeTestLimitOrder(zrx, dai, signerAddress, USER_ADDRESS, signerKey);
|
||||
IMetaTransactionsFeatureV2.MetaTransactionDataV2 memory mtxData = _getMetaTransaction(callData);
|
||||
LibSignature.Signature memory sig = _mtxSignature(mtxData);
|
||||
|
||||
assertEq(dai.balanceOf(USER_ADDRESS), 1e18);
|
||||
vm.expectEmit(true, false, false, true);
|
||||
@@ -320,10 +318,7 @@ contract MetaTransactionTest is LocalTest {
|
||||
address(this)
|
||||
);
|
||||
|
||||
IMetaTransactionsFeatureV2(address(zeroExDeployed.zeroEx)).executeMetaTransactionV2(
|
||||
mtxData,
|
||||
_mtxSignature(mtxData)
|
||||
);
|
||||
IMetaTransactionsFeatureV2(address(zeroExDeployed.zeroEx)).executeMetaTransactionV2(mtxData, sig);
|
||||
|
||||
assertEq(zrx.balanceOf(signerAddress), 0);
|
||||
assertEq(zrx.balanceOf(USER_ADDRESS), 1e18);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
"KyberElasticQuoter": "0x0d125c15d54ca1f8a813c74a81aee34ebb508c1f",
|
||||
"KyberElasticRouter": "0xc1e7dfe73e1598e3910ef4c7845b68a9ab6f4c83",
|
||||
"KyberElasticPool": "0x6038373de7f64da99b2a31951628b7d778b2c3cf",
|
||||
"TraderJoeV2Quoter": "0x3660268Ed43583a2cdd09e3fC7079ff07DBD4Caa",
|
||||
"TraderJoeV2Quoter": "0x64b57F4249aA99a812212cee7DAEFEDC40B203cD",
|
||||
"TraderJoeV2Router": "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30"
|
||||
},
|
||||
"250": {
|
||||
@@ -59,7 +59,7 @@
|
||||
"KyberElasticQuoter": "0x0d125c15d54ca1f8a813c74a81aee34ebb508c1f",
|
||||
"KyberElasticRouter": "0xc1e7dfe73e1598e3910ef4c7845b68a9ab6f4c83",
|
||||
"KyberElasticPool": "0x087abaab9cd85025a8b3916948c69fe173c837ea",
|
||||
"TraderJoeV2Quoter": "0x0000000000000000000000000000000000000000",
|
||||
"TraderJoeV2Router": "0x0000000000000000000000000000000000000000"
|
||||
"TraderJoeV2Quoter": "0x64b57F4249aA99a812212cee7DAEFEDC40B203cD",
|
||||
"TraderJoeV2Router": "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ contract SwapERC20ForERC20Test is Test, ForkUtils, TestUtils {
|
||||
|
||||
function test_swapERC20ForERC20OnTraderJoeV2() public {
|
||||
for (uint256 i = 0; i < chains.length; i++) {
|
||||
// TraderJoeV2 mixin only enabled on Avalanche
|
||||
if (i != 3) {
|
||||
// TraderJoeV2 mixin only enabled on Avalanche and Arbitrum
|
||||
if (i != 3 && i != 6) {
|
||||
continue;
|
||||
}
|
||||
vm.selectFork(forkIds[chains[i]]);
|
||||
|
||||
@@ -147,7 +147,6 @@
|
||||
"test/generated-artifacts/MixinAaveV2.json",
|
||||
"test/generated-artifacts/MixinBalancer.json",
|
||||
"test/generated-artifacts/MixinBalancerV2Batch.json",
|
||||
"test/generated-artifacts/MixinBancor.json",
|
||||
"test/generated-artifacts/MixinBancorV3.json",
|
||||
"test/generated-artifacts/MixinCompound.json",
|
||||
"test/generated-artifacts/MixinCryptoCom.json",
|
||||
@@ -158,12 +157,10 @@
|
||||
"test/generated-artifacts/MixinGMX.json",
|
||||
"test/generated-artifacts/MixinKyberDmm.json",
|
||||
"test/generated-artifacts/MixinLido.json",
|
||||
"test/generated-artifacts/MixinMStable.json",
|
||||
"test/generated-artifacts/MixinMakerPSM.json",
|
||||
"test/generated-artifacts/MixinMooniswap.json",
|
||||
"test/generated-artifacts/MixinNerve.json",
|
||||
"test/generated-artifacts/MixinPlatypus.json",
|
||||
"test/generated-artifacts/MixinShell.json",
|
||||
"test/generated-artifacts/MixinSolidly.json",
|
||||
"test/generated-artifacts/MixinSynthetix.json",
|
||||
"test/generated-artifacts/MixinUniswap.json",
|
||||
|
||||
@@ -295,7 +295,7 @@ In both cases, the ``@0x/protocol-utils`` package simplifies generating these si
|
||||
|
||||
The Orderbook
|
||||
=======================
|
||||
Orders can be hosted by any server and are usually represented as a JSON object off-chain. For example, one off-chain way to post and discover orders is through `0x API <https://0x.org/api>`_.
|
||||
Orders can be hosted by any server and are usually represented as a JSON object off-chain. For example, one off-chain way to post and discover orders is through `0x Orderbook API <https://0x.org/docs/category/orderbook-api>`_.
|
||||
|
||||
Below is a table represention and example of how orders should be formatted off-chain.
|
||||
|
||||
|
||||
@@ -2,21 +2,15 @@
|
||||
Protocol Fees
|
||||
###############################
|
||||
|
||||
.. note::
|
||||
|
||||
As of September 29, 2021, protocol fees have been removed for all order types in both Exchange V4 and V3 in accordance with `ZEIP-91 <https://0x.org/zrx/vote/zeip-91>`_.
|
||||
|
||||
An ETH protocol fee is paid by the Taker each time a `Limit Order <./orders.html#limit-orders>`_ is `filled <./functions.html>`_.
|
||||
The fee is proportional to the gas cost of filling an order and scales linearly with gas price. The cost is currently ``0 * tx.gasprice``.
|
||||
At the end of every Staking Epoch, these fees are aggregated and distributed to the makers as a liquidity reward: the reward is proportional to the maker's collected fees and staked ZRX relative to other makers.
|
||||
To learn more about protocol fees and liquidity incentives, see the `Official Spec <https://github.com/0xProject/0x-protocol-specification/blob/master/staking/staking-specification.md>`_.
|
||||
|
||||
.. note::
|
||||
|
||||
As of September 29, 2021, protocol fees have been removed for all order types in both Exchange V4 and V3 in accordance with `ZEIP-91 <https://0x.org/zrx/vote/zeip-91>`_.
|
||||
|
||||
.. note::
|
||||
|
||||
`RFQ Orders <./orders.html#rfq-orders>`_ are introduced in Exchange V4, and there is currently no protocol fee for filling this type of order.
|
||||
The existing fee mechanics work well for limit orders, where arb bots pay to compete for liquidity; however, it does not translate well to RFQ where makers are matched with a specific taker.
|
||||
We are researching fee models that could be used for RFQ and will keep the community up-to-date on our `Forum <https://forum.0x.org/>`_.
|
||||
|
||||
.. warning::
|
||||
|
||||
In Exchange V3, protocol fees could be paid in ETH or WETH. As of V4, they can only be paid in ETH.
|
||||
@@ -15,6 +15,7 @@ Create an ERC721Order
|
||||
The following code snippet shows how to construct a basic ERC721 sell order in JavaScript. In the following example, the seller indicates that they would like to receive ether by providing the sentinel value `0xeee...`` as the `erc20Token`.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
const { ERC721Order, NFTOrder } = require("@0x/protocol-utils");
|
||||
const utils = require("@0x/utils");
|
||||
|
||||
@@ -48,6 +49,7 @@ The following code snippet shows how to construct a basic ERC721 sell order in J
|
||||
An ERC721 sell order can be created similarly. Note that buy orders must use WETH instead of ether, because the ERC20 `transferFrom` functionality is needed to execute a buy order.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
const { ERC721Order, NFTOrder } = require("@0x/protocol-utils");
|
||||
const utils = require("@0x/utils");
|
||||
|
||||
@@ -97,6 +99,7 @@ Fees are paid by the **buyer**, denominated in the asset paid by the buyer, and
|
||||
The following code snippet shows how to create an ERC721 order with a single fee. Multiple fees can be specified by providing multiple fee objects in the order fees field.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
const { ERC721Order, NFTOrder } = require("@0x/protocol-utils");
|
||||
const utils = require("@0x/utils");
|
||||
|
||||
@@ -130,6 +133,7 @@ The following code snippet shows how to create an ERC721 order with a single fee
|
||||
In 0x V4, it is possible to create a bid for any NFT in a particular collection. The following code snippet shows how to create an order to buy any CryptoCoven $WITCH.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
const { ERC721Order, NFTOrder } = require("@0x/protocol-utils");
|
||||
const utils = require("@0x/utils");
|
||||
|
||||
@@ -169,6 +173,7 @@ Off-chain orders must be signed by the order maker to be filled. For on-chain or
|
||||
Signing an order with a private key is easy: the `ERC721Order` and `ERC1155Order` classes from `@0x/protocol-utils` expose a `getSignatureWithKey` function that take a 0x-prefixed private key string.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
const { ERC721Order, NFTOrder, SignatureType } = require("@0x/protocol-utils");
|
||||
const utils = require("@0x/utils");
|
||||
|
||||
@@ -196,6 +201,7 @@ Signing an order with a private key is easy: the `ERC721Order` and `ERC1155Order
|
||||
**Signing with ethers**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
const { ERC721Order, NFTOrder, SignatureType } = require("@0x/protocol-utils");
|
||||
const utils = require("@0x/utils");
|
||||
const { ethers } = require("ethers");
|
||||
@@ -243,6 +249,7 @@ Signing an order with a private key is easy: the `ERC721Order` and `ERC1155Order
|
||||
Orders can be simultaneously "signed" and listed on-chain using the `preSignERC721Order` or `preSignERC1155Order` functions. Orders can only be signed by the maker address specified in the order.
|
||||
|
||||
.. code-block:: solidity
|
||||
|
||||
/// @dev Approves an ERC721 order on-chain. After pre-signing
|
||||
/// the order, the `PRESIGNED` signature type will become
|
||||
/// valid for that order and signer.
|
||||
@@ -260,6 +267,7 @@ Orders can be simultaneously "signed" and listed on-chain using the `preSignERC7
|
||||
If an order has been pre-signed, it can be filled by providing a “null” signature with the PRESIGNED signature type (see `LibSignature.sol <https://github.com/0xProject/protocol/blob/refactor/nft-orders/contracts/zero-ex/contracts/src/features/libs/LibSignature.sol#L42-L61>`_):
|
||||
|
||||
.. code-block:: solidity
|
||||
|
||||
LibSignature.Signature({
|
||||
signatureType: LibSignature.SignatureType.PRESIGNED,
|
||||
v: uint8(0),
|
||||
@@ -270,6 +278,7 @@ If an order has been pre-signed, it can be filled by providing a “null” sign
|
||||
The pre-sign functions emit the entire order as an event, so that the order is easily indexable by subgraphs and thus easily indexable by subgraphs and thus easily discoverable without the need for an off-chain database.
|
||||
|
||||
.. code-block:: solidity
|
||||
|
||||
/// @dev Emitted when an `ERC721Order` is pre-signed.
|
||||
/// Contains all the fields of the order.
|
||||
event ERC721OrderPreSigned(
|
||||
@@ -311,6 +320,7 @@ Filling an ERC721 Order
|
||||
The basic functions used for filling NFT orders are the following:
|
||||
|
||||
.. code-block:: solidity
|
||||
|
||||
/// @dev Sells an ERC721 asset to fill the given order.
|
||||
/// @param buyOrder The ERC721 buy order.
|
||||
/// @param signature The order signature from the maker.
|
||||
@@ -407,6 +417,7 @@ Cancelling an ERC721 Order
|
||||
All orders, whether off-chain or on-chain, can only be cancelled on-chain. The following contract functions are used to cancel individual ERC721 and ERC1155 orders.
|
||||
|
||||
.. code-block:: solidity
|
||||
|
||||
/// @dev Cancel a single ERC721 order by its nonce. The caller
|
||||
/// should be the maker of the order. Silently succeeds if
|
||||
/// an order with the same nonce has already been filled or
|
||||
@@ -427,6 +438,7 @@ Note that if there are multiple outstanding orders with the same nonce, calling
|
||||
The following functions can be used to cancel multiple orders.
|
||||
|
||||
.. code-block:: solidity
|
||||
|
||||
/// @dev Cancel multiple ERC721 orders by their nonces. The caller
|
||||
/// should be the maker of the orders. Silently succeeds if
|
||||
/// an order with the same nonce has already been filled or
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"version": "8.7.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add Trader Joe V2 MixIn to Arbitrum"
|
||||
}
|
||||
],
|
||||
"timestamp": 1683749017
|
||||
},
|
||||
{
|
||||
"version": "8.6.0",
|
||||
"changes": [
|
||||
|
||||
@@ -6,6 +6,9 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v8.7.0 - _May 10, 2023_
|
||||
|
||||
* Add Trader Joe V2 MixIn to Arbitrum
|
||||
## v8.6.0 - _May 1, 2023_
|
||||
|
||||
* Add Trader Joe V2.1 Router Support for MixIn
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
"wethTransformer": "0x10e968968f49dd66a5efeebbb2edcb9c49c4fc49",
|
||||
"payTakerTransformer": "0xd81e65fc9bb7323bdbef8b2cdddd3b83fe41d630",
|
||||
"affiliateFeeTransformer": "0x970e318b8f074c20bf0cee06970f01dc7a761e50",
|
||||
"fillQuoteTransformer": "0x5d3a221bad31c3f3c07bea2f1de9b3ec17664b69",
|
||||
"fillQuoteTransformer": "0x4a8815c2fc605e3b01aee52aade4d096c4e862c6",
|
||||
"positiveSlippageFeeTransformer": "0x20f935b037e8490d8027f2751f9452725eee01ad"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-addresses",
|
||||
"version": "8.6.0",
|
||||
"version": "8.7.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1683749017,
|
||||
"version": "13.23.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1682976338,
|
||||
"version": "13.23.1",
|
||||
|
||||
@@ -6,6 +6,9 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v13.23.2 - _May 10, 2023_
|
||||
|
||||
* Dependencies updated
|
||||
## v13.23.1 - _May 1, 2023_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-wrappers",
|
||||
"version": "13.23.1",
|
||||
"version": "13.23.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -59,7 +59,7 @@
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.36",
|
||||
"@0x/base-contract": "^7.0.0",
|
||||
"@0x/contract-addresses": "^8.6.0",
|
||||
"@0x/contract-addresses": "^8.7.0",
|
||||
"@0x/json-schemas": "^6.4.4",
|
||||
"@0x/types": "^3.3.7",
|
||||
"@0x/utils": "^7.0.0",
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1683749017,
|
||||
"version": "11.22.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1682976338,
|
||||
"version": "11.22.1",
|
||||
|
||||
@@ -6,6 +6,9 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v11.22.2 - _May 10, 2023_
|
||||
|
||||
* Dependencies updated
|
||||
## v11.22.1 - _May 1, 2023_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/protocol-utils",
|
||||
"version": "11.22.1",
|
||||
"version": "11.22.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -62,8 +62,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.36",
|
||||
"@0x/contract-addresses": "^8.6.0",
|
||||
"@0x/contract-wrappers": "^13.23.1",
|
||||
"@0x/contract-addresses": "^8.7.0",
|
||||
"@0x/contract-wrappers": "^13.23.2",
|
||||
"@0x/json-schemas": "^6.4.4",
|
||||
"@0x/subproviders": "^8.0.1",
|
||||
"@0x/utils": "^7.0.0",
|
||||
|
||||
Reference in New Issue
Block a user