Skip to content

Commit

Permalink
Revert "Feature/liquidity provider sandbox (#16)"
Browse files Browse the repository at this point in the history
This reverts commit 7403c02.
  • Loading branch information
moodlezoup committed Nov 14, 2020
1 parent d2018f0 commit 9f3bf2f
Show file tree
Hide file tree
Showing 61 changed files with 2,092 additions and 1,027 deletions.
12 changes: 0 additions & 12 deletions contracts/zero-ex/CHANGELOG.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@
{
"note": "Rewrite the ZeroEx contract in Yul",
"pr": 23
},
{
"note": "Update LiquidityProviderFeature to use off-chain registry and sandbox",
"pr": 16
},
{
"note": "Update ILiquidityProvider interface",
"pr": 16
},
{
"note": "Update ProtocolFeeUnfunded event to emit order hash",
"pr": 16
}
],
"timestamp": 1605302002
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,19 @@ library LibLiquidityProviderRichErrors {
minBuyAmount
);
}

function NoLiquidityProviderForMarketError(
address xAsset,
address yAsset
)
internal
pure
returns (bytes memory)
{
return abi.encodeWithSelector(
bytes4(keccak256("NoLiquidityProviderForMarketError(address,address)")),
xAsset,
yAsset
);
}
}

This file was deleted.

139 changes: 0 additions & 139 deletions contracts/zero-ex/contracts/src/external/LiquidityProviderSandbox.sol

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,45 @@ pragma experimental ABIEncoderV2;

/// @dev Feature to swap directly with an on-chain liquidity provider.
interface ILiquidityProviderFeature {
event LiquidityProviderForMarketUpdated(
address indexed xAsset,
address indexed yAsset,
address providerAddress
);

/// @dev Sells `sellAmount` of `inputToken` to the liquidity provider
/// at the given `provider` address.
/// @param inputToken The token being sold.
/// @param outputToken The token being bought.
/// @param provider The address of the on-chain liquidity provider
/// to trade with.
/// @param recipient The recipient of the bought tokens. If equal to
/// address(0), `msg.sender` is assumed to be the recipient.
/// @param sellAmount The amount of `inputToken` to sell.
/// @param minBuyAmount The minimum acceptable amount of `outputToken` to
/// buy. Reverts if this amount is not satisfied.
/// @param auxiliaryData Auxiliary data supplied to the `provider` contract.
/// @return boughtAmount The amount of `outputToken` bought.
function sellToLiquidityProvider(
address inputToken,
address outputToken,
address payable provider,
address recipient,
address makerToken,
address takerToken,
address payable recipient,
uint256 sellAmount,
uint256 minBuyAmount,
bytes calldata auxiliaryData
uint256 minBuyAmount
)
external
payable
returns (uint256 boughtAmount);

/// @dev Sets address of the liquidity provider for a market given
/// (xAsset, yAsset).
/// @param xAsset First asset managed by the liquidity provider.
/// @param yAsset Second asset managed by the liquidity provider.
/// @param providerAddress Address of the liquidity provider.
function setLiquidityProviderForMarket(
address xAsset,
address yAsset,
address providerAddress
)
external;

/// @dev Returns the address of the liquidity provider for a market given
/// (xAsset, yAsset), or reverts if pool does not exist.
/// @param xAsset First asset managed by the liquidity provider.
/// @param yAsset Second asset managed by the liquidity provider.
/// @return providerAddress Address of the liquidity provider.
function getLiquidityProviderForMarket(
address xAsset,
address yAsset
)
external
view
returns (address providerAddress);
}
Loading

0 comments on commit 9f3bf2f

Please sign in to comment.