Compare commits
11 Commits
ewong_prot
...
josh/expan
Author | SHA1 | Date | |
---|---|---|---|
|
ef552ca564 | ||
|
4c4a573bab | ||
|
0556a59212 | ||
|
94fe83b10f | ||
|
fa718b4af9 | ||
|
c191707f18 | ||
|
f9e4551728 | ||
|
2cd405c1cb | ||
|
1fed0c235a | ||
|
5dc28a2bea | ||
|
6c833a9274 |
@@ -110,15 +110,10 @@
|
||||
"./contracts/src/transformers/Transformer.sol",
|
||||
"./contracts/src/transformers/WethTransformer.sol",
|
||||
"./contracts/src/transformers/bridges/AbstractBridgeAdapter.sol",
|
||||
"./contracts/src/transformers/bridges/AvalancheBridgeAdapter.sol",
|
||||
"./contracts/src/transformers/bridges/BSCBridgeAdapter.sol",
|
||||
"./contracts/src/transformers/bridges/BridgeAdapter.sol",
|
||||
"./contracts/src/transformers/bridges/BridgeAdapterGroup1.sol",
|
||||
"./contracts/src/transformers/bridges/BridgeProtocols.sol",
|
||||
"./contracts/src/transformers/bridges/CeloBridgeAdapter.sol",
|
||||
"./contracts/src/transformers/bridges/EthereumBridgeAdapter.sol",
|
||||
"./contracts/src/transformers/bridges/FantomBridgeAdapter.sol",
|
||||
"./contracts/src/transformers/bridges/IBridgeAdapter.sol",
|
||||
"./contracts/src/transformers/bridges/OptimismBridgeAdapter.sol",
|
||||
"./contracts/src/transformers/bridges/PolygonBridgeAdapter.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinAaveV2.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinBalancer.sol",
|
||||
"./contracts/src/transformers/bridges/mixins/MixinBalancerV2Batch.sol",
|
||||
|
Submodule contracts/zero-ex/contracts/deps/forge-std updated: 1680d7fb3e...2a2ce3692b
@@ -307,7 +307,7 @@ contract FillQuoteTransformer is Transformer {
|
||||
if (success) {
|
||||
results.makerTokenBoughtAmount = abi.decode(resultData, (uint256));
|
||||
results.takerTokenSoldAmount = takerTokenFillAmount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fill a single limit order.
|
||||
|
@@ -23,16 +23,6 @@ pragma experimental ABIEncoderV2;
|
||||
import "./IBridgeAdapter.sol";
|
||||
|
||||
abstract contract AbstractBridgeAdapter is IBridgeAdapter {
|
||||
constructor(uint256 expectedChainId, string memory expectedChainName) public {
|
||||
uint256 chainId;
|
||||
assembly {
|
||||
chainId := chainid()
|
||||
}
|
||||
// Allow testing on Ganache
|
||||
if (chainId != expectedChainId && chainId != 1337) {
|
||||
revert(string(abi.encodePacked(expectedChainName, "BridgeAdapter.constructor: wrong chain ID")));
|
||||
}
|
||||
}
|
||||
|
||||
function isSupportedSource(bytes32 source) external override returns (bool isSupported) {
|
||||
BridgeOrder memory placeholderOrder;
|
||||
|
@@ -1,120 +0,0 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
/*
|
||||
|
||||
Copyright 2022 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 "./AbstractBridgeAdapter.sol";
|
||||
import "./BridgeProtocols.sol";
|
||||
import "./mixins/MixinAaveV3.sol";
|
||||
import "./mixins/MixinBalancerV2Batch.sol";
|
||||
import "./mixins/MixinCurve.sol";
|
||||
import "./mixins/MixinCurveV2.sol";
|
||||
import "./mixins/MixinDodoV2.sol";
|
||||
import "./mixins/MixinKyberDmm.sol";
|
||||
import "./mixins/MixinGMX.sol";
|
||||
import "./mixins/MixinNerve.sol";
|
||||
import "./mixins/MixinUniswapV3.sol";
|
||||
import "./mixins/MixinUniswapV2.sol";
|
||||
import "./mixins/MixinZeroExBridge.sol";
|
||||
|
||||
contract ArbitrumBridgeAdapter is
|
||||
AbstractBridgeAdapter(42161, "Arbitrum"),
|
||||
MixinAaveV3,
|
||||
MixinBalancerV2Batch,
|
||||
MixinCurve,
|
||||
MixinCurveV2,
|
||||
MixinDodoV2,
|
||||
MixinKyberDmm,
|
||||
MixinGMX,
|
||||
MixinNerve,
|
||||
MixinUniswapV3,
|
||||
MixinUniswapV2,
|
||||
MixinZeroExBridge
|
||||
{
|
||||
constructor(IEtherTokenV06 weth) public MixinCurve(weth) MixinAaveV3(true) {}
|
||||
|
||||
function _trade(
|
||||
BridgeOrder memory order,
|
||||
IERC20TokenV06 sellToken,
|
||||
IERC20TokenV06 buyToken,
|
||||
uint256 sellAmount,
|
||||
bool dryRun
|
||||
) internal override returns (uint256 boughtAmount, bool supportedSource) {
|
||||
uint128 protocolId = uint128(uint256(order.source) >> 128);
|
||||
if (protocolId == BridgeProtocols.BALANCERV2BATCH) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeBalancerV2Batch(sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.CURVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurve(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.CURVEV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurveV2(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.DODOV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeDodoV2(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.KYBERDMM) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeKyberDmm(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAPV3) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV3(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAPV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV2(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.GMX) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeGMX(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.NERVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeNerve(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNKNOWN) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeZeroExBridge(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.AAVEV3) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeAaveV3(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
}
|
||||
|
||||
emit BridgeFill(order.source, sellToken, buyToken, sellAmount, boughtAmount);
|
||||
}
|
||||
}
|
@@ -1,120 +0,0 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
/*
|
||||
|
||||
Copyright 2022 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 "./AbstractBridgeAdapter.sol";
|
||||
import "./BridgeProtocols.sol";
|
||||
import "./mixins/MixinAaveV3.sol";
|
||||
import "./mixins/MixinCurve.sol";
|
||||
import "./mixins/MixinCurveV2.sol";
|
||||
import "./mixins/MixinGMX.sol";
|
||||
import "./mixins/MixinKyberDmm.sol";
|
||||
import "./mixins/MixinAaveV2.sol";
|
||||
import "./mixins/MixinNerve.sol";
|
||||
import "./mixins/MixinPlatypus.sol";
|
||||
import "./mixins/MixinUniswapV2.sol";
|
||||
import "./mixins/MixinWOOFi.sol";
|
||||
import "./mixins/MixinZeroExBridge.sol";
|
||||
|
||||
contract AvalancheBridgeAdapter is
|
||||
AbstractBridgeAdapter(43114, "Avalanche"),
|
||||
MixinAaveV3,
|
||||
MixinCurve,
|
||||
MixinCurveV2,
|
||||
MixinGMX,
|
||||
MixinKyberDmm,
|
||||
MixinAaveV2,
|
||||
MixinNerve,
|
||||
MixinPlatypus,
|
||||
MixinUniswapV2,
|
||||
MixinWOOFi,
|
||||
MixinZeroExBridge
|
||||
{
|
||||
constructor(IEtherTokenV06 weth) public MixinCurve(weth) MixinAaveV3(false) {}
|
||||
|
||||
function _trade(
|
||||
BridgeOrder memory order,
|
||||
IERC20TokenV06 sellToken,
|
||||
IERC20TokenV06 buyToken,
|
||||
uint256 sellAmount,
|
||||
bool dryRun
|
||||
) internal override returns (uint256 boughtAmount, bool supportedSource) {
|
||||
uint128 protocolId = uint128(uint256(order.source) >> 128);
|
||||
if (protocolId == BridgeProtocols.CURVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurve(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.CURVEV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurveV2(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAPV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV2(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.NERVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeNerve(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.KYBERDMM) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeKyberDmm(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.AAVEV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeAaveV2(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.GMX) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeGMX(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.PLATYPUS) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradePlatypus(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.WOOFI) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeWOOFi(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNKNOWN) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeZeroExBridge(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.AAVEV3) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeAaveV3(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
}
|
||||
|
||||
emit BridgeFill(order.source, sellToken, buyToken, sellAmount, boughtAmount);
|
||||
}
|
||||
}
|
@@ -1,106 +0,0 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
/*
|
||||
|
||||
Copyright 2022 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 "./AbstractBridgeAdapter.sol";
|
||||
import "./BridgeProtocols.sol";
|
||||
import "./mixins/MixinCurve.sol";
|
||||
import "./mixins/MixinDodo.sol";
|
||||
import "./mixins/MixinDodoV2.sol";
|
||||
import "./mixins/MixinKyberDmm.sol";
|
||||
import "./mixins/MixinMooniswap.sol";
|
||||
import "./mixins/MixinNerve.sol";
|
||||
import "./mixins/MixinUniswapV2.sol";
|
||||
import "./mixins/MixinWOOFi.sol";
|
||||
import "./mixins/MixinZeroExBridge.sol";
|
||||
|
||||
contract BSCBridgeAdapter is
|
||||
AbstractBridgeAdapter(56, "BSC"),
|
||||
MixinCurve,
|
||||
MixinDodo,
|
||||
MixinDodoV2,
|
||||
MixinKyberDmm,
|
||||
MixinMooniswap,
|
||||
MixinNerve,
|
||||
MixinUniswapV2,
|
||||
MixinWOOFi,
|
||||
MixinZeroExBridge
|
||||
{
|
||||
constructor(IEtherTokenV06 weth) public MixinCurve(weth) MixinMooniswap(weth) {}
|
||||
|
||||
function _trade(
|
||||
BridgeOrder memory order,
|
||||
IERC20TokenV06 sellToken,
|
||||
IERC20TokenV06 buyToken,
|
||||
uint256 sellAmount,
|
||||
bool dryRun
|
||||
) internal override returns (uint256 boughtAmount, bool supportedSource) {
|
||||
uint128 protocolId = uint128(uint256(order.source) >> 128);
|
||||
if (protocolId == BridgeProtocols.CURVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurve(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAPV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV2(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.MOONISWAP) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeMooniswap(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.DODO) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeDodo(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.DODOV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeDodoV2(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.NERVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeNerve(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.KYBERDMM) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeKyberDmm(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.WOOFI) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeWOOFi(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNKNOWN) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeZeroExBridge(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
}
|
||||
|
||||
emit BridgeFill(order.source, sellToken, buyToken, sellAmount, boughtAmount);
|
||||
}
|
||||
}
|
@@ -0,0 +1,80 @@
|
||||
|
||||
// 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 "./IBridgeAdapter.sol";
|
||||
import "./BridgeProtocols.sol";
|
||||
import "./BridgeAdapterGroup1.sol";
|
||||
import "./BridgeAdapterGroup2.sol";
|
||||
|
||||
|
||||
contract BridgeAdapter is IBridgeAdapter {
|
||||
IBridgeAdapter private immutable adapter1;
|
||||
IBridgeAdapter private immutable adapter2;
|
||||
uint256 private constant ADAPTER_1_LAST_PROTOCOL_ID = 26;
|
||||
uint256 private constant ADAPTER_2_LAST_PROTOCOL_ID = 32;
|
||||
|
||||
constructor(IEtherTokenV06 weth) public {
|
||||
adapter1 = new BridgeAdapterGroup1(weth);
|
||||
adapter2 = new BridgeAdapterGroup2(weth);
|
||||
}
|
||||
|
||||
function trade(
|
||||
BridgeOrder memory order,
|
||||
IERC20TokenV06 sellToken,
|
||||
IERC20TokenV06 buyToken,
|
||||
uint256 sellAmount
|
||||
) public override returns (uint256 boughtAmount) {
|
||||
uint128 protocolId = uint128(uint256(order.source) >> 128);
|
||||
|
||||
IBridgeAdapter adapter;
|
||||
if (protocolId <= ADAPTER_1_LAST_PROTOCOL_ID) {
|
||||
adapter = adapter1;
|
||||
} else if (protocolId <= ADAPTER_2_LAST_PROTOCOL_ID) {
|
||||
adapter = adapter2;
|
||||
} else {
|
||||
revert("unknown protocolId");
|
||||
}
|
||||
|
||||
(bool success, bytes memory resultData) = address(adapter).delegatecall(abi.encodeWithSelector(
|
||||
IBridgeAdapter.trade.selector,
|
||||
order,
|
||||
sellToken,
|
||||
buyToken,
|
||||
sellAmount
|
||||
)
|
||||
);
|
||||
if (success) {
|
||||
return abi.decode(resultData, (uint256));
|
||||
}
|
||||
}
|
||||
|
||||
function isSupportedSource(bytes32 source) external override returns (bool isSupported) {
|
||||
uint128 protocolId = uint128(uint256(source) >> 128);
|
||||
if (protocolId <= ADAPTER_1_LAST_PROTOCOL_ID) {
|
||||
return adapter1.isSupportedSource(source);
|
||||
} else if (protocolId <= ADAPTER_2_LAST_PROTOCOL_ID) {
|
||||
return adapter2.isSupportedSource(source);
|
||||
} else {
|
||||
revert("unknown protocolId");
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
/*
|
||||
|
||||
Copyright 2022 ZeroEx Intl.
|
||||
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.
|
||||
@@ -22,65 +22,66 @@ pragma experimental ABIEncoderV2;
|
||||
|
||||
import "./AbstractBridgeAdapter.sol";
|
||||
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/MixinCompound.sol";
|
||||
import "./mixins/MixinCurve.sol";
|
||||
import "./mixins/MixinCurveV2.sol";
|
||||
import "./mixins/MixinCryptoCom.sol";
|
||||
import "./mixins/MixinDodo.sol";
|
||||
import "./mixins/MixinDodoV2.sol";
|
||||
import "./mixins/MixinKyberDmm.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";
|
||||
import "./mixins/MixinUniswapV3.sol";
|
||||
import "./mixins/MixinZeroExBridge.sol";
|
||||
|
||||
contract EthereumBridgeAdapter is
|
||||
AbstractBridgeAdapter(1, "Ethereum"),
|
||||
MixinAaveV2,
|
||||
MixinBalancer,
|
||||
MixinBalancerV2Batch,
|
||||
MixinBancor,
|
||||
MixinBancorV3,
|
||||
MixinCompound,
|
||||
import "./mixins/MixinZeroExBridge.sol"; //0
|
||||
import "./mixins/MixinCurve.sol"; //1
|
||||
import "./mixins/MixinUniswapV2.sol"; //2
|
||||
import "./mixins/MixinUniswap.sol"; //3
|
||||
import "./mixins/MixinBalancer.sol"; //4
|
||||
import "./mixins/MixinMooniswap.sol"; //6
|
||||
import "./mixins/MixinMStable.sol"; //7
|
||||
import "./mixins/MixinShell.sol"; //9
|
||||
import "./mixins/MixinDodo.sol"; //10
|
||||
import "./mixins/MixinDodoV2.sol"; //11
|
||||
import "./mixins/MixinCryptoCom.sol"; //12
|
||||
import "./mixins/MixinBancor.sol"; //13
|
||||
import "./mixins/MixinNerve.sol"; //15
|
||||
import "./mixins/MixinMakerPSM.sol"; //16
|
||||
import "./mixins/MixinUniswapV3.sol"; //18
|
||||
import "./mixins/MixinKyberDmm.sol"; //19
|
||||
import "./mixins/MixinCurveV2.sol"; //20
|
||||
import "./mixins/MixinLido.sol"; //21
|
||||
import "./mixins/MixinAaveV2.sol"; //23
|
||||
import "./mixins/MixinCompound.sol"; //24
|
||||
import "./mixins/MixinBalancerV2Batch.sol"; //25
|
||||
import "./mixins/MixinGMX.sol"; //26
|
||||
|
||||
contract BridgeAdapterGroup1 is
|
||||
AbstractBridgeAdapter,
|
||||
MixinZeroExBridge,
|
||||
MixinCurve,
|
||||
MixinCurveV2,
|
||||
MixinCryptoCom,
|
||||
MixinUniswapV2,
|
||||
MixinUniswap,
|
||||
MixinBalancer,
|
||||
MixinMooniswap,
|
||||
MixinMStable,
|
||||
MixinShell,
|
||||
MixinDodo,
|
||||
MixinDodoV2,
|
||||
MixinKyberDmm,
|
||||
MixinLido,
|
||||
MixinMakerPSM,
|
||||
MixinMStable,
|
||||
MixinCryptoCom,
|
||||
MixinBancor,
|
||||
MixinNerve,
|
||||
MixinShell,
|
||||
MixinSynthetix,
|
||||
MixinUniswap,
|
||||
MixinUniswapV2,
|
||||
MixinMakerPSM,
|
||||
MixinUniswapV3,
|
||||
MixinZeroExBridge
|
||||
MixinKyberDmm,
|
||||
MixinCurveV2,
|
||||
MixinLido,
|
||||
MixinAaveV2,
|
||||
MixinCompound,
|
||||
MixinBalancerV2Batch,
|
||||
MixinGMX
|
||||
{
|
||||
constructor(
|
||||
IEtherTokenV06 weth
|
||||
)
|
||||
public
|
||||
MixinBancor(weth)
|
||||
MixinBancorV3(weth)
|
||||
MixinCompound(weth)
|
||||
MixinCurve(weth)
|
||||
MixinLido(weth)
|
||||
MixinUniswap(weth)
|
||||
{}
|
||||
MixinMooniswap(weth)
|
||||
MixinCompound(weth)
|
||||
{ }
|
||||
|
||||
function _trade(
|
||||
BridgeOrder memory order,
|
||||
@@ -90,116 +91,116 @@ contract EthereumBridgeAdapter is
|
||||
bool dryRun
|
||||
) internal override returns (uint256 boughtAmount, bool supportedSource) {
|
||||
uint128 protocolId = uint128(uint256(order.source) >> 128);
|
||||
if (protocolId == BridgeProtocols.CURVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurve(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.CURVEV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurveV2(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAPV3) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV3(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAPV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV2(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAP) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswap(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.BALANCER) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeBalancer(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.BALANCERV2BATCH) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeBalancerV2Batch(sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.MAKERPSM) {
|
||||
if (dryRun) {
|
||||
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);
|
||||
}
|
||||
boughtAmount = _tradeDodo(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.DODOV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeDodoV2(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.CRYPTOCOM) {
|
||||
if (dryRun) {
|
||||
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);
|
||||
}
|
||||
boughtAmount = _tradeNerve(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.KYBERDMM) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeKyberDmm(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.LIDO) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeLido(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.AAVEV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeAaveV2(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.COMPOUND) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCompound(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.BANCORV3) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeBancorV3(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.SYNTHETIX) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeSynthetix(sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNKNOWN) {
|
||||
if (protocolId == BridgeProtocols.UNKNOWN) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeZeroExBridge(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.CURVE) { //1
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurve(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAPV2) { //2
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV2(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAP) { //3
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswap(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.BALANCER) { //4
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeBalancer(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.MOONISWAP) { //6
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeMooniswap(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.MSTABLE) { //7
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeMStable(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.SHELL) { //9
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeShell(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.DODO) { //10
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeDodo(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.DODOV2) { //11
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeDodoV2(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.CRYPTOCOM) { //12
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCryptoCom(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.BANCOR) { //13
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeBancor(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.NERVE) { //15
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeNerve(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.MAKERPSM) { //16
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeMakerPsm(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAPV3) { //18
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV3(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.KYBERDMM) { //19
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeKyberDmm(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.CURVEV2) { //20
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurveV2(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.LIDO) { //21
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeLido(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.AAVEV2) { //23
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeAaveV2(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.COMPOUND) { //24
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCompound(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.BALANCERV2BATCH) { //25
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeBalancerV2Batch(sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.GMX) { //26
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeGMX(buyToken, sellAmount, order.bridgeData);
|
||||
}
|
||||
|
||||
emit BridgeFill(order.source, sellToken, buyToken, sellAmount, boughtAmount);
|
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
/*
|
||||
|
||||
Copyright 2022 ZeroEx Intl.
|
||||
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.
|
||||
@@ -22,25 +22,29 @@ pragma experimental ABIEncoderV2;
|
||||
|
||||
import "./AbstractBridgeAdapter.sol";
|
||||
import "./BridgeProtocols.sol";
|
||||
import "./mixins/MixinBalancerV2Batch.sol";
|
||||
import "./mixins/MixinCurve.sol";
|
||||
import "./mixins/MixinCurveV2.sol";
|
||||
import "./mixins/MixinNerve.sol";
|
||||
import "./mixins/MixinUniswapV2.sol";
|
||||
import "./mixins/MixinWOOFi.sol";
|
||||
import "./mixins/MixinZeroExBridge.sol";
|
||||
|
||||
contract FantomBridgeAdapter is
|
||||
AbstractBridgeAdapter(250, "Fantom"),
|
||||
MixinBalancerV2Batch,
|
||||
MixinCurve,
|
||||
MixinCurveV2,
|
||||
MixinNerve,
|
||||
MixinUniswapV2,
|
||||
import "./mixins/MixinPlatypus.sol"; //27
|
||||
import "./mixins/MixinBancorV3.sol"; //28
|
||||
import "./mixins/MixinSolidly.sol"; //29
|
||||
import "./mixins/MixinSynthetix.sol"; //30
|
||||
import "./mixins/MixinWOOFi.sol"; //31
|
||||
import "./mixins/MixinAaveV3.sol"; //32
|
||||
|
||||
contract BridgeAdapterGroup2 is
|
||||
AbstractBridgeAdapter,
|
||||
MixinPlatypus,
|
||||
MixinBancorV3,
|
||||
MixinSolidly,
|
||||
MixinSynthetix,
|
||||
MixinWOOFi,
|
||||
MixinZeroExBridge
|
||||
MixinAaveV3
|
||||
{
|
||||
constructor(IEtherTokenV06 weth) public MixinCurve(weth) {}
|
||||
constructor(
|
||||
IEtherTokenV06 weth
|
||||
)
|
||||
public
|
||||
MixinBancorV3(weth)
|
||||
{ }
|
||||
|
||||
function _trade(
|
||||
BridgeOrder memory order,
|
||||
@@ -50,42 +54,37 @@ contract FantomBridgeAdapter is
|
||||
bool dryRun
|
||||
) internal override returns (uint256 boughtAmount, bool supportedSource) {
|
||||
uint128 protocolId = uint128(uint256(order.source) >> 128);
|
||||
if (protocolId == BridgeProtocols.CURVE) {
|
||||
if (protocolId == BridgeProtocols.PLATYPUS) { //27
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurve(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.CURVEV2) {
|
||||
boughtAmount = _tradePlatypus(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.BANCORV3) { //28
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurveV2(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAPV2) {
|
||||
boughtAmount = _tradeBancorV3(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.SOLIDLY) { //29
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV2(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.BALANCERV2BATCH) {
|
||||
boughtAmount = _tradeSolidly(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.SYNTHETIX) { //30
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeBalancerV2Batch(sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.NERVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeNerve(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.WOOFI) {
|
||||
boughtAmount = _tradeSynthetix(sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.WOOFI) { //31
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeWOOFi(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNKNOWN) {
|
||||
} else if (protocolId == BridgeProtocols.AAVEV3) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeZeroExBridge(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
}
|
||||
boughtAmount = _tradeAaveV3(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
}
|
||||
|
||||
emit BridgeFill(order.source, sellToken, buyToken, sellAmount, boughtAmount);
|
||||
}
|
@@ -43,7 +43,7 @@ library BridgeProtocols {
|
||||
uint128 internal constant COFIX = 14; // Not used: deprecated.
|
||||
uint128 internal constant NERVE = 15;
|
||||
uint128 internal constant MAKERPSM = 16;
|
||||
uint128 internal constant BALANCERV2 = 17;
|
||||
uint128 internal constant BALANCERV2 = 17; // Not used: depracated.
|
||||
uint128 internal constant UNISWAPV3 = 18;
|
||||
uint128 internal constant KYBERDMM = 19;
|
||||
uint128 internal constant CURVEV2 = 20;
|
||||
|
@@ -1,59 +0,0 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
/*
|
||||
|
||||
Copyright 2022 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 "./AbstractBridgeAdapter.sol";
|
||||
import "./BridgeProtocols.sol";
|
||||
import "./mixins/MixinNerve.sol";
|
||||
import "./mixins/MixinUniswapV2.sol";
|
||||
import "./mixins/MixinZeroExBridge.sol";
|
||||
|
||||
contract CeloBridgeAdapter is AbstractBridgeAdapter(42220, "Celo"), MixinNerve, MixinUniswapV2, MixinZeroExBridge {
|
||||
constructor(address _weth) public {}
|
||||
|
||||
function _trade(
|
||||
BridgeOrder memory order,
|
||||
IERC20TokenV06 sellToken,
|
||||
IERC20TokenV06 buyToken,
|
||||
uint256 sellAmount,
|
||||
bool dryRun
|
||||
) internal override returns (uint256 boughtAmount, bool supportedSource) {
|
||||
uint128 protocolId = uint128(uint256(order.source) >> 128);
|
||||
if (protocolId == BridgeProtocols.UNISWAPV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV2(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.NERVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeNerve(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNKNOWN) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeZeroExBridge(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
}
|
||||
|
||||
emit BridgeFill(order.source, sellToken, buyToken, sellAmount, boughtAmount);
|
||||
}
|
||||
}
|
@@ -1,101 +0,0 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
/*
|
||||
Copyright 2022 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 "./AbstractBridgeAdapter.sol";
|
||||
import "./BridgeProtocols.sol";
|
||||
import "./mixins/MixinAaveV3.sol";
|
||||
import "./mixins/MixinBalancerV2Batch.sol";
|
||||
import "./mixins/MixinCurve.sol";
|
||||
import "./mixins/MixinCurveV2.sol";
|
||||
import "./mixins/MixinNerve.sol";
|
||||
import "./mixins/MixinSolidly.sol";
|
||||
import "./mixins/MixinSynthetix.sol";
|
||||
import "./mixins/MixinUniswapV3.sol";
|
||||
import "./mixins/MixinZeroExBridge.sol";
|
||||
|
||||
contract OptimismBridgeAdapter is
|
||||
AbstractBridgeAdapter(10, "Optimism"),
|
||||
MixinAaveV3,
|
||||
MixinBalancerV2Batch,
|
||||
MixinCurve,
|
||||
MixinCurveV2,
|
||||
MixinNerve,
|
||||
MixinSynthetix,
|
||||
MixinUniswapV3,
|
||||
MixinSolidly,
|
||||
MixinZeroExBridge
|
||||
{
|
||||
constructor(IEtherTokenV06 weth) public MixinCurve(weth) MixinAaveV3(true) {}
|
||||
|
||||
function _trade(
|
||||
BridgeOrder memory order,
|
||||
IERC20TokenV06 sellToken,
|
||||
IERC20TokenV06 buyToken,
|
||||
uint256 sellAmount,
|
||||
bool dryRun
|
||||
) internal override returns (uint256 boughtAmount, bool supportedSource) {
|
||||
uint128 protocolId = uint128(uint256(order.source) >> 128);
|
||||
if (protocolId == BridgeProtocols.CURVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurve(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.CURVEV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurveV2(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAPV3) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV3(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.NERVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeNerve(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.SOLIDLY) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeSolidly(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.SYNTHETIX) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeSynthetix(sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNKNOWN) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeZeroExBridge(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.BALANCERV2BATCH) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeBalancerV2Batch(sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.AAVEV3) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeAaveV3(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
}
|
||||
|
||||
emit BridgeFill(order.source, sellToken, buyToken, sellAmount, boughtAmount);
|
||||
}
|
||||
}
|
@@ -1,148 +0,0 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
/*
|
||||
|
||||
Copyright 2022 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 "./AbstractBridgeAdapter.sol";
|
||||
import "./BridgeProtocols.sol";
|
||||
import "./mixins/MixinAaveV3.sol";
|
||||
import "./mixins/MixinAaveV2.sol";
|
||||
import "./mixins/MixinBalancerV2Batch.sol";
|
||||
import "./mixins/MixinCurve.sol";
|
||||
import "./mixins/MixinCurveV2.sol";
|
||||
import "./mixins/MixinDodo.sol";
|
||||
import "./mixins/MixinDodoV2.sol";
|
||||
import "./mixins/MixinKyberDmm.sol";
|
||||
import "./mixins/MixinMStable.sol";
|
||||
import "./mixins/MixinNerve.sol";
|
||||
import "./mixins/MixinSolidly.sol";
|
||||
import "./mixins/MixinUniswapV2.sol";
|
||||
import "./mixins/MixinUniswapV3.sol";
|
||||
import "./mixins/MixinWOOFi.sol";
|
||||
import "./mixins/MixinZeroExBridge.sol";
|
||||
|
||||
contract PolygonBridgeAdapter is
|
||||
AbstractBridgeAdapter(137, "Polygon"),
|
||||
MixinAaveV3,
|
||||
MixinAaveV2,
|
||||
MixinBalancerV2Batch,
|
||||
MixinCurve,
|
||||
MixinCurveV2,
|
||||
MixinDodo,
|
||||
MixinDodoV2,
|
||||
MixinKyberDmm,
|
||||
MixinMStable,
|
||||
MixinNerve,
|
||||
MixinUniswapV2,
|
||||
MixinUniswapV3,
|
||||
MixinSolidly,
|
||||
MixinWOOFi,
|
||||
MixinZeroExBridge
|
||||
{
|
||||
constructor(IEtherTokenV06 weth) public MixinCurve(weth) MixinAaveV3(false) {}
|
||||
|
||||
function _trade(
|
||||
BridgeOrder memory order,
|
||||
IERC20TokenV06 sellToken,
|
||||
IERC20TokenV06 buyToken,
|
||||
uint256 sellAmount,
|
||||
bool dryRun
|
||||
) internal override returns (uint256 boughtAmount, bool supportedSource) {
|
||||
uint128 protocolId = uint128(uint256(order.source) >> 128);
|
||||
if (protocolId == BridgeProtocols.CURVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurve(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.CURVEV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeCurveV2(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAPV3) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV3(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNISWAPV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeUniswapV2(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.BALANCERV2BATCH) {
|
||||
if (dryRun) {
|
||||
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);
|
||||
}
|
||||
boughtAmount = _tradeDodo(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.DODOV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeDodoV2(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.NERVE) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeNerve(sellToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.KYBERDMM) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeKyberDmm(buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.AAVEV2) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeAaveV2(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.SOLIDLY) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeSolidly(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.WOOFI) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeWOOFi(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.UNKNOWN) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeZeroExBridge(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
} else if (protocolId == BridgeProtocols.AAVEV3) {
|
||||
if (dryRun) {
|
||||
return (0, true);
|
||||
}
|
||||
boughtAmount = _tradeAaveV3(sellToken, buyToken, sellAmount, order.bridgeData);
|
||||
}
|
||||
|
||||
emit BridgeFill(order.source, sellToken, buyToken, sellAmount, boughtAmount);
|
||||
}
|
||||
}
|
@@ -82,8 +82,12 @@ contract MixinAaveV3 {
|
||||
|
||||
bool private immutable _isL2;
|
||||
|
||||
constructor(bool isL2) public {
|
||||
_isL2 = isL2;
|
||||
constructor() public {
|
||||
uint256 chain;
|
||||
assembly {
|
||||
chain := chainid()
|
||||
}
|
||||
_isL2 = (chain == 42161 || chain == 10); // is arbitrum or optimism
|
||||
}
|
||||
|
||||
function _tradeAaveV3(
|
||||
|
@@ -41,9 +41,9 @@
|
||||
"typechain": "typechain --target=ethers-v5 --out-dir='typechain-wrappers' './foundry-artifacts/**/*.json'"
|
||||
},
|
||||
"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",
|
||||
"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,BridgeAdapter",
|
||||
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.",
|
||||
"abis": "./test/generated-artifacts/@(AbstractBridgeAdapter|AffiliateFeeTransformer|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|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|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|TestBridge|TestCallTarget|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|TestZeroExFeature|TransformERC20Feature|Transformer|TransformerDeployer|UniswapFeature|UniswapV3Feature|WethTransformer|ZeroEx|ZeroExOptimized).json"
|
||||
"abis": "./test/generated-artifacts/@(AbstractBridgeAdapter|AffiliateFeeTransformer|BatchFillNativeOrdersFeature|BootstrapFeature|BridgeAdapter|BridgeAdapterGroup1|BridgeProtocols|CurveLiquidityProvider|ERC1155OrdersFeature|ERC165Feature|ERC721OrdersFeature|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|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|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|OtcOrdersFeature|OwnableFeature|PancakeSwapFeature|PayTakerTransformer|PermissionlessTransformerDeployer|PositiveSlippageFeeTransformer|SimpleFunctionRegistryFeature|TestBridge|TestCallTarget|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|TestZeroExFeature|TransformERC20Feature|Transformer|TransformerDeployer|UniswapFeature|UniswapV3Feature|WethTransformer|ZeroEx|ZeroExOptimized).json"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@@ -7,18 +7,15 @@ import { ContractArtifact } from 'ethereum-types';
|
||||
|
||||
import * as AbstractBridgeAdapter from '../test/generated-artifacts/AbstractBridgeAdapter.json';
|
||||
import * as AffiliateFeeTransformer from '../test/generated-artifacts/AffiliateFeeTransformer.json';
|
||||
import * as AvalancheBridgeAdapter from '../test/generated-artifacts/AvalancheBridgeAdapter.json';
|
||||
import * as BatchFillNativeOrdersFeature from '../test/generated-artifacts/BatchFillNativeOrdersFeature.json';
|
||||
import * as BootstrapFeature from '../test/generated-artifacts/BootstrapFeature.json';
|
||||
import * as BridgeAdapter from '../test/generated-artifacts/BridgeAdapter.json';
|
||||
import * as BridgeAdapterGroup1 from '../test/generated-artifacts/BridgeAdapterGroup1.json';
|
||||
import * as BridgeProtocols from '../test/generated-artifacts/BridgeProtocols.json';
|
||||
import * as BSCBridgeAdapter from '../test/generated-artifacts/BSCBridgeAdapter.json';
|
||||
import * as CeloBridgeAdapter from '../test/generated-artifacts/CeloBridgeAdapter.json';
|
||||
import * as CurveLiquidityProvider from '../test/generated-artifacts/CurveLiquidityProvider.json';
|
||||
import * as ERC1155OrdersFeature from '../test/generated-artifacts/ERC1155OrdersFeature.json';
|
||||
import * as ERC165Feature from '../test/generated-artifacts/ERC165Feature.json';
|
||||
import * as ERC721OrdersFeature from '../test/generated-artifacts/ERC721OrdersFeature.json';
|
||||
import * as EthereumBridgeAdapter from '../test/generated-artifacts/EthereumBridgeAdapter.json';
|
||||
import * as FantomBridgeAdapter from '../test/generated-artifacts/FantomBridgeAdapter.json';
|
||||
import * as FeeCollector from '../test/generated-artifacts/FeeCollector.json';
|
||||
import * as FeeCollectorController from '../test/generated-artifacts/FeeCollectorController.json';
|
||||
import * as FillQuoteTransformer from '../test/generated-artifacts/FillQuoteTransformer.json';
|
||||
@@ -143,13 +140,11 @@ import * as NativeOrdersInfo from '../test/generated-artifacts/NativeOrdersInfo.
|
||||
import * as NativeOrdersProtocolFees from '../test/generated-artifacts/NativeOrdersProtocolFees.json';
|
||||
import * as NativeOrdersSettlement from '../test/generated-artifacts/NativeOrdersSettlement.json';
|
||||
import * as NFTOrders from '../test/generated-artifacts/NFTOrders.json';
|
||||
import * as OptimismBridgeAdapter from '../test/generated-artifacts/OptimismBridgeAdapter.json';
|
||||
import * as OtcOrdersFeature from '../test/generated-artifacts/OtcOrdersFeature.json';
|
||||
import * as OwnableFeature from '../test/generated-artifacts/OwnableFeature.json';
|
||||
import * as PancakeSwapFeature from '../test/generated-artifacts/PancakeSwapFeature.json';
|
||||
import * as PayTakerTransformer from '../test/generated-artifacts/PayTakerTransformer.json';
|
||||
import * as PermissionlessTransformerDeployer from '../test/generated-artifacts/PermissionlessTransformerDeployer.json';
|
||||
import * as PolygonBridgeAdapter from '../test/generated-artifacts/PolygonBridgeAdapter.json';
|
||||
import * as PositiveSlippageFeeTransformer from '../test/generated-artifacts/PositiveSlippageFeeTransformer.json';
|
||||
import * as SimpleFunctionRegistryFeature from '../test/generated-artifacts/SimpleFunctionRegistryFeature.json';
|
||||
import * as TestBridge from '../test/generated-artifacts/TestBridge.json';
|
||||
@@ -317,15 +312,10 @@ export const artifacts = {
|
||||
Transformer: Transformer as ContractArtifact,
|
||||
WethTransformer: WethTransformer as ContractArtifact,
|
||||
AbstractBridgeAdapter: AbstractBridgeAdapter as ContractArtifact,
|
||||
AvalancheBridgeAdapter: AvalancheBridgeAdapter as ContractArtifact,
|
||||
BSCBridgeAdapter: BSCBridgeAdapter as ContractArtifact,
|
||||
BridgeProtocols: BridgeProtocols as ContractArtifact,
|
||||
CeloBridgeAdapter: CeloBridgeAdapter as ContractArtifact,
|
||||
EthereumBridgeAdapter: EthereumBridgeAdapter as ContractArtifact,
|
||||
FantomBridgeAdapter: FantomBridgeAdapter as ContractArtifact,
|
||||
BridgeAdapter: BridgeAdapter as ContractArtifact,
|
||||
BridgeAdapterGroup1: BridgeAdapterGroup1 as ContractArtifact,
|
||||
IBridgeAdapter: IBridgeAdapter as ContractArtifact,
|
||||
OptimismBridgeAdapter: OptimismBridgeAdapter as ContractArtifact,
|
||||
PolygonBridgeAdapter: PolygonBridgeAdapter as ContractArtifact,
|
||||
MixinAaveV2: MixinAaveV2 as ContractArtifact,
|
||||
MixinBalancer: MixinBalancer as ContractArtifact,
|
||||
MixinBalancerV2Batch: MixinBalancerV2Batch as ContractArtifact,
|
||||
|
@@ -5,18 +5,15 @@
|
||||
*/
|
||||
export * from '../test/generated-wrappers/abstract_bridge_adapter';
|
||||
export * from '../test/generated-wrappers/affiliate_fee_transformer';
|
||||
export * from '../test/generated-wrappers/avalanche_bridge_adapter';
|
||||
export * from '../test/generated-wrappers/b_s_c_bridge_adapter';
|
||||
export * from '../test/generated-wrappers/batch_fill_native_orders_feature';
|
||||
export * from '../test/generated-wrappers/bootstrap_feature';
|
||||
export * from '../test/generated-wrappers/bridge_adapter';
|
||||
export * from '../test/generated-wrappers/bridge_adapter_group1';
|
||||
export * from '../test/generated-wrappers/bridge_protocols';
|
||||
export * from '../test/generated-wrappers/celo_bridge_adapter';
|
||||
export * from '../test/generated-wrappers/curve_liquidity_provider';
|
||||
export * from '../test/generated-wrappers/erc1155_orders_feature';
|
||||
export * from '../test/generated-wrappers/erc165_feature';
|
||||
export * from '../test/generated-wrappers/erc721_orders_feature';
|
||||
export * from '../test/generated-wrappers/ethereum_bridge_adapter';
|
||||
export * from '../test/generated-wrappers/fantom_bridge_adapter';
|
||||
export * from '../test/generated-wrappers/fee_collector';
|
||||
export * from '../test/generated-wrappers/fee_collector_controller';
|
||||
export * from '../test/generated-wrappers/fill_quote_transformer';
|
||||
@@ -141,13 +138,11 @@ export * from '../test/generated-wrappers/native_orders_feature';
|
||||
export * from '../test/generated-wrappers/native_orders_info';
|
||||
export * from '../test/generated-wrappers/native_orders_protocol_fees';
|
||||
export * from '../test/generated-wrappers/native_orders_settlement';
|
||||
export * from '../test/generated-wrappers/optimism_bridge_adapter';
|
||||
export * from '../test/generated-wrappers/otc_orders_feature';
|
||||
export * from '../test/generated-wrappers/ownable_feature';
|
||||
export * from '../test/generated-wrappers/pancake_swap_feature';
|
||||
export * from '../test/generated-wrappers/pay_taker_transformer';
|
||||
export * from '../test/generated-wrappers/permissionless_transformer_deployer';
|
||||
export * from '../test/generated-wrappers/polygon_bridge_adapter';
|
||||
export * from '../test/generated-wrappers/positive_slippage_fee_transformer';
|
||||
export * from '../test/generated-wrappers/simple_function_registry_feature';
|
||||
export * from '../test/generated-wrappers/test_bridge';
|
||||
|
@@ -44,18 +44,15 @@
|
||||
"generated-artifacts/ZeroEx.json",
|
||||
"test/generated-artifacts/AbstractBridgeAdapter.json",
|
||||
"test/generated-artifacts/AffiliateFeeTransformer.json",
|
||||
"test/generated-artifacts/AvalancheBridgeAdapter.json",
|
||||
"test/generated-artifacts/BSCBridgeAdapter.json",
|
||||
"test/generated-artifacts/BatchFillNativeOrdersFeature.json",
|
||||
"test/generated-artifacts/BootstrapFeature.json",
|
||||
"test/generated-artifacts/BridgeAdapter.json",
|
||||
"test/generated-artifacts/BridgeAdapterGroup1.json",
|
||||
"test/generated-artifacts/BridgeProtocols.json",
|
||||
"test/generated-artifacts/CeloBridgeAdapter.json",
|
||||
"test/generated-artifacts/CurveLiquidityProvider.json",
|
||||
"test/generated-artifacts/ERC1155OrdersFeature.json",
|
||||
"test/generated-artifacts/ERC165Feature.json",
|
||||
"test/generated-artifacts/ERC721OrdersFeature.json",
|
||||
"test/generated-artifacts/EthereumBridgeAdapter.json",
|
||||
"test/generated-artifacts/FantomBridgeAdapter.json",
|
||||
"test/generated-artifacts/FeeCollector.json",
|
||||
"test/generated-artifacts/FeeCollectorController.json",
|
||||
"test/generated-artifacts/FillQuoteTransformer.json",
|
||||
@@ -180,13 +177,11 @@
|
||||
"test/generated-artifacts/NativeOrdersInfo.json",
|
||||
"test/generated-artifacts/NativeOrdersProtocolFees.json",
|
||||
"test/generated-artifacts/NativeOrdersSettlement.json",
|
||||
"test/generated-artifacts/OptimismBridgeAdapter.json",
|
||||
"test/generated-artifacts/OtcOrdersFeature.json",
|
||||
"test/generated-artifacts/OwnableFeature.json",
|
||||
"test/generated-artifacts/PancakeSwapFeature.json",
|
||||
"test/generated-artifacts/PayTakerTransformer.json",
|
||||
"test/generated-artifacts/PermissionlessTransformerDeployer.json",
|
||||
"test/generated-artifacts/PolygonBridgeAdapter.json",
|
||||
"test/generated-artifacts/PositiveSlippageFeeTransformer.json",
|
||||
"test/generated-artifacts/SimpleFunctionRegistryFeature.json",
|
||||
"test/generated-artifacts/TestBridge.json",
|
||||
|
Reference in New Issue
Block a user