Integrated CREAM into asset-swapper

This commit is contained in:
Alex Kroeger
2020-10-13 20:27:08 -07:00
parent c6b9ea5723
commit c72aa653e8
14 changed files with 357 additions and 7 deletions

View File

@@ -65,6 +65,10 @@
{
"note": "Added `Shell` into FQT",
"pr": 2722
},
{
"note": "Added `CREAM` into FQT",
"pr": 2715
}
]
},

View File

@@ -46,6 +46,7 @@ contract BridgeAdapter is
{
address private immutable BALANCER_BRIDGE_ADDRESS;
address private immutable CREAM_BRIDGE_ADDRESS;
address private immutable CURVE_BRIDGE_ADDRESS;
address private immutable KYBER_BRIDGE_ADDRESS;
address private immutable MOONISWAP_BRIDGE_ADDRESS;
@@ -93,6 +94,7 @@ contract BridgeAdapter is
SHELL_BRIDGE_ADDRESS = addresses.shellBridge;
UNISWAP_BRIDGE_ADDRESS = addresses.uniswapBridge;
UNISWAP_V2_BRIDGE_ADDRESS = addresses.uniswapV2Bridge;
CREAM_BRIDGE_ADDRESS = addresses.creamBridge;
}
function trade(
@@ -170,6 +172,12 @@ contract BridgeAdapter is
sellAmount,
bridgeData
);
} else if (bridgeAddress == CREAM_BRIDGE_ADDRESS) {
boughtAmount = _tradeBalancer(
buyToken,
sellAmount,
bridgeData
);
} else {
boughtAmount = _tradeZeroExBridge(
bridgeAddress,

View File

@@ -24,6 +24,7 @@ contract MixinAdapterAddresses
struct AdapterAddresses {
// Bridges
address balancerBridge;
address creamBridge;
address curveBridge;
address kyberBridge;
address mooniswapBridge;

View File

@@ -75,6 +75,7 @@ blockchainTests.resets('FillQuoteTransformer', env => {
weth: NULL_ADDRESS,
shellBridge: NULL_ADDRESS,
shell: NULL_ADDRESS,
creamBridge: NULL_ADDRESS,
},
);
transformer = await FillQuoteTransformerContract.deployFrom0xArtifactAsync(