* Add BalancerBridge and Sampler functions * Update sampler artifacts/wrappers * Add Balancer support to AssetSwapper + related refactoring * Make use of GraphQL instead of sampler * "fix" build and add mainnet BalancerBridge tests * address some comments * add balancer cache and fix DexSampler tests * lint * wip: tests for balancer sampler ops * Fix market operation utils test * balancer unit tests * Return a buy quote of 0 if the buy amount exceeds the Balancer pool's balance * Dynamic fee estimation * Update contract addresses, export BalancerBridge wrapper * Update changelogs * Fix bugs discovered via simbot * Fix issues in balancer_utils * override `BigNumber.config` in configured_bignumber.ts * Special case Balancer subops in too * Address some more comments * Address Balancer performance issue * Performance improvements * Address comment * Fix tests Co-authored-by: xianny <xianny@gmail.com>
39 lines
1.4 KiB
Solidity
39 lines
1.4 KiB
Solidity
/*
|
|
|
|
Copyright 2020 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.5.9;
|
|
|
|
|
|
interface IBalancerPool {
|
|
/// @dev Sell `tokenAmountIn` of `tokenIn` and receive `tokenOut`.
|
|
/// @param tokenIn The token being sold
|
|
/// @param tokenAmountIn The amount of `tokenIn` to sell.
|
|
/// @param tokenOut The token being bought.
|
|
/// @param minAmountOut The minimum amount of `tokenOut` to buy.
|
|
/// @param maxPrice The maximum value for `spotPriceAfter`.
|
|
/// @return tokenAmountOut The amount of `tokenOut` bought.
|
|
/// @return spotPriceAfter The new marginal spot price of the given
|
|
/// token pair for this pool.
|
|
function swapExactAmountIn(
|
|
address tokenIn,
|
|
uint tokenAmountIn,
|
|
address tokenOut,
|
|
uint minAmountOut,
|
|
uint maxPrice
|
|
) external returns (uint tokenAmountOut, uint spotPriceAfter);
|
|
} |