Remove Mooniswap on Ethereum Mainnet (#529)
* Remove Mooniswap from EthereumBridgeAdapter * Remove Mooniswap sampling on mainnet * Update CHANGELOG.json
This commit is contained in:
parent
6ca14ed7b2
commit
ee2c069889
@ -37,7 +37,6 @@ import "./mixins/MixinDodoV2.sol";
|
||||
import "./mixins/MixinKyberDmm.sol";
|
||||
import "./mixins/MixinLido.sol";
|
||||
import "./mixins/MixinMakerPSM.sol";
|
||||
import "./mixins/MixinMooniswap.sol";
|
||||
import "./mixins/MixinMStable.sol";
|
||||
import "./mixins/MixinNerve.sol";
|
||||
import "./mixins/MixinShell.sol";
|
||||
@ -64,7 +63,6 @@ contract EthereumBridgeAdapter is
|
||||
MixinKyberDmm,
|
||||
MixinLido,
|
||||
MixinMakerPSM,
|
||||
MixinMooniswap,
|
||||
MixinMStable,
|
||||
MixinNerve,
|
||||
MixinShell,
|
||||
@ -81,7 +79,6 @@ contract EthereumBridgeAdapter is
|
||||
MixinCompound(weth)
|
||||
MixinCurve(weth)
|
||||
MixinLido(weth)
|
||||
MixinMooniswap(weth)
|
||||
MixinUniswap(weth)
|
||||
{}
|
||||
|
||||
@ -165,14 +162,6 @@ contract EthereumBridgeAdapter is
|
||||
sellAmount,
|
||||
order.bridgeData
|
||||
);
|
||||
} else if (protocolId == BridgeProtocols.MOONISWAP) {
|
||||
if (dryRun) { return (0, true); }
|
||||
boughtAmount = _tradeMooniswap(
|
||||
sellToken,
|
||||
buyToken,
|
||||
sellAmount,
|
||||
order.bridgeData
|
||||
);
|
||||
} else if (protocolId == BridgeProtocols.MSTABLE) {
|
||||
if (dryRun) { return (0, true); }
|
||||
boughtAmount = _tradeMStable(
|
||||
|
@ -13,6 +13,10 @@
|
||||
{
|
||||
"note": "Replace Beethoven X subgraph URL",
|
||||
"pr": 519
|
||||
},
|
||||
{
|
||||
"note": "Remove Mooniswap on Ethereum mainnet",
|
||||
"pr": 529
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -32,16 +32,13 @@ import {
|
||||
import { assert } from '../utils/assert';
|
||||
import {
|
||||
CURVE_LIQUIDITY_PROVIDER_BY_CHAIN_ID,
|
||||
MOONISWAP_LIQUIDITY_PROVIDER_BY_CHAIN_ID,
|
||||
NATIVE_FEE_TOKEN_BY_CHAIN_ID,
|
||||
} from '../utils/market_operation_utils/constants';
|
||||
import { poolEncoder } from '../utils/market_operation_utils/orders';
|
||||
import {
|
||||
CurveFillData,
|
||||
ERC20BridgeSource,
|
||||
FinalUniswapV3FillData,
|
||||
LiquidityProviderFillData,
|
||||
MooniswapFillData,
|
||||
NativeRfqOrderFillData,
|
||||
OptimizedMarketBridgeOrder,
|
||||
OptimizedMarketOrder,
|
||||
@ -307,30 +304,6 @@ export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase {
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
this.chainId === ChainId.Mainnet &&
|
||||
isDirectSwapCompatible(quote, optsWithDefaults, [ERC20BridgeSource.Mooniswap])
|
||||
) {
|
||||
const fillData = slippedOrders[0].fillData as MooniswapFillData;
|
||||
return {
|
||||
calldataHexString: this._exchangeProxy
|
||||
.sellToLiquidityProvider(
|
||||
isFromETH ? ETH_TOKEN_ADDRESS : sellToken,
|
||||
isToETH ? ETH_TOKEN_ADDRESS : buyToken,
|
||||
MOONISWAP_LIQUIDITY_PROVIDER_BY_CHAIN_ID[this.chainId],
|
||||
NULL_ADDRESS,
|
||||
sellAmount,
|
||||
minBuyAmount,
|
||||
poolEncoder.encode([fillData.poolAddress]),
|
||||
)
|
||||
.getABIEncodedTransactionData(),
|
||||
ethAmount: isFromETH ? sellAmount : ZERO_AMOUNT,
|
||||
toAddress: this._exchangeProxy.address,
|
||||
allowanceTarget: this.contractAddresses.exchangeProxy,
|
||||
gasOverhead: ZERO_AMOUNT,
|
||||
};
|
||||
}
|
||||
|
||||
// RFQT VIP
|
||||
if (
|
||||
[ChainId.Mainnet, ChainId.Polygon].includes(this.chainId) &&
|
||||
|
@ -89,7 +89,6 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.Bancor,
|
||||
ERC20BridgeSource.BancorV3,
|
||||
ERC20BridgeSource.MStable,
|
||||
ERC20BridgeSource.Mooniswap,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Shell,
|
||||
ERC20BridgeSource.MultiHop,
|
||||
@ -120,7 +119,6 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.UniswapV2,
|
||||
ERC20BridgeSource.UniswapV3,
|
||||
ERC20BridgeSource.Curve,
|
||||
ERC20BridgeSource.Mooniswap,
|
||||
]),
|
||||
[ChainId.Rinkeby]: new SourceFilters([ERC20BridgeSource.Native]),
|
||||
[ChainId.Kovan]: new SourceFilters([ERC20BridgeSource.Native]),
|
||||
@ -239,7 +237,6 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
// ERC20BridgeSource.Bancor, // FIXME: Bancor Buys not implemented in Sampler
|
||||
ERC20BridgeSource.BancorV3,
|
||||
ERC20BridgeSource.MStable,
|
||||
ERC20BridgeSource.Mooniswap,
|
||||
ERC20BridgeSource.Shell,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.MultiHop,
|
||||
@ -270,7 +267,6 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.UniswapV2,
|
||||
ERC20BridgeSource.UniswapV3,
|
||||
ERC20BridgeSource.Curve,
|
||||
ERC20BridgeSource.Mooniswap,
|
||||
]),
|
||||
[ChainId.Goerli]: new SourceFilters([
|
||||
ERC20BridgeSource.Native,
|
||||
@ -2003,7 +1999,6 @@ export const KNIGHTSWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
|
||||
export const MOONISWAP_REGISTRIES_BY_CHAIN_ID = valueByChainId(
|
||||
{
|
||||
[ChainId.Mainnet]: ['0xbaf9a5d4b0052359326a6cdab54babaa3a3a9643'],
|
||||
[ChainId.BSC]: ['0xd41b24bba51fac0e4827b6f94c0d6ddeb183cd64'],
|
||||
},
|
||||
[] as string[],
|
||||
@ -2073,14 +2068,6 @@ export const MAKER_PSM_INFO_BY_CHAIN_ID = valueByChainId<PsmInfo>(
|
||||
},
|
||||
);
|
||||
|
||||
export const MOONISWAP_LIQUIDITY_PROVIDER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
{
|
||||
[ChainId.Mainnet]: '0xa2033d6ba88756ce6a87584d69dc87bda9a4f889',
|
||||
[ChainId.Ropsten]: '0x87e0393aee0fb8c10b8653c6507c182264fe5a34',
|
||||
},
|
||||
NULL_ADDRESS,
|
||||
);
|
||||
|
||||
export const BANCOR_REGISTRY_BY_CHAIN_ID = valueByChainId<string>(
|
||||
{
|
||||
[ChainId.Mainnet]: '0x52Ae12ABe5D8BD778BD5397F99cA900624CfADD4',
|
||||
|
Loading…
x
Reference in New Issue
Block a user