idle_moloch/lib/swap-router-contracts/contracts/interfaces/IApproveAndCall.sol

64 lines
2.5 KiB
Solidity

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
pragma abicoder v2;
interface IApproveAndCall {
enum ApprovalType {NOT_REQUIRED, MAX, MAX_MINUS_ONE, ZERO_THEN_MAX, ZERO_THEN_MAX_MINUS_ONE}
/// @dev Lens to be called off-chain to determine which (if any) of the relevant approval functions should be called
/// @param token The token to approve
/// @param amount The amount to approve
/// @return The required approval type
function getApprovalType(address token, uint256 amount) external returns (ApprovalType);
/// @notice Approves a token for the maximum possible amount
/// @param token The token to approve
function approveMax(address token) external payable;
/// @notice Approves a token for the maximum possible amount minus one
/// @param token The token to approve
function approveMaxMinusOne(address token) external payable;
/// @notice Approves a token for zero, then the maximum possible amount
/// @param token The token to approve
function approveZeroThenMax(address token) external payable;
/// @notice Approves a token for zero, then the maximum possible amount minus one
/// @param token The token to approve
function approveZeroThenMaxMinusOne(address token) external payable;
/// @notice Calls the position manager with arbitrary calldata
/// @param data Calldata to pass along to the position manager
/// @return result The result from the call
function callPositionManager(bytes memory data) external payable returns (bytes memory result);
struct MintParams {
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint256 amount0Min;
uint256 amount1Min;
address recipient;
}
/// @notice Calls the position manager's mint function
/// @param params Calldata to pass along to the position manager
/// @return result The result from the call
function mint(MintParams calldata params) external payable returns (bytes memory result);
struct IncreaseLiquidityParams {
address token0;
address token1;
uint256 tokenId;
uint256 amount0Min;
uint256 amount1Min;
}
/// @notice Calls the position manager's increaseLiquidity function
/// @param params Calldata to pass along to the position manager
/// @return result The result from the call
function increaseLiquidity(IncreaseLiquidityParams calldata params) external payable returns (bytes memory result);
}