interface ILiquidityMigrator {
    struct PermitData {
        bool approveMax;
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

    struct PoolInfo {
        address poolAddress;
        uint32 poolAmp;
    }

    event RemoveLiquidity(
        address indexed tokenA,
        address indexed tokenB,
        address indexed uniPair,
        uint256 liquidity,
        uint256 amountA,
        uint256 amountB
    );

    event Migrated(
        address indexed tokenA,
        address indexed tokenB,
        uint256 dmmAmountA,
        uint256 dmmAmountB,
        uint256 dmmLiquidity,
        PoolInfo info
    );

    /**
     * @dev Migrate tokens from a pair to a Kyber Dmm Pool
     *   Supporting both normal tokens and tokens with fee on transfer
     *   Support create new pool with received tokens from removing, or
     *       add tokens to a given pool address
     * @param uniPair pair for token that user wants to migrate from
     *   it should be compatible with UniswapPair's interface
     * @param tokenA first token of the pool
     * @param tokenB second token of the pool
     * @param liquidity amount of LP tokens to migrate
     * @param amountAMin min amount for tokenA when removing
     * @param amountBMin min amount for tokenB when removing
     * @param dmmAmountAMin min amount for tokenA when adding
     * @param dmmAmountBMin min amount for tokenB when adding
     * @param poolInfo info the the Kyber DMM Pool - (poolAddress, poolAmp)
     *   if poolAddress is 0x0 -> create new pool with amp factor of poolAmp
     *   otherwise add liquidity to poolAddress
     * @param deadline only allow transaction to be executed before the deadline
     */
    function migrateLpToDmmPool(
        address uniPair,
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        uint256 dmmAmountAMin,
        uint256 dmmAmountBMin,
        PoolInfo calldata poolInfo,
        uint256 deadline
    )
        external
        returns (
            uint256 amountA,
            uint256 amountB,
            uint256 addedLiquidity
        );

    /**
     * @dev Migrate tokens from a pair to a Kyber Dmm Pool with permit
     *   User doesn't have to make an approve allowance transaction, just need to sign the data
     *   Supporting both normal tokens and tokens with fee on transfer
     *   Support create new pool with received tokens from removing, or
     *       add tokens to a given pool address
     * @param uniPair pair for token that user wants to migrate from
     *   it should be compatible with UniswapPair's interface
     * @param tokenA first token of the pool
     * @param tokenB second token of the pool
     * @param liquidity amount of LP tokens to migrate
     * @param amountAMin min amount for tokenA when removing
     * @param amountBMin min amount for tokenB when removing
     * @param dmmAmountAMin min amount for tokenA when adding
     * @param dmmAmountBMin min amount for tokenB when adding
     * @param poolInfo info the the Kyber DMM Pool - (poolAddress, poolAmp)
     *   if poolAddress is 0x0 -> create new pool with amp factor of poolAmp
     *   otherwise add liquidity to poolAddress
     * @param deadline only allow transaction to be executed before the deadline
     * @param permitData data of approve allowance
     */
    function migrateLpToDmmPoolWithPermit(
        address uniPair,
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        uint256 dmmAmountAMin,
        uint256 dmmAmountBMin,
        PoolInfo calldata poolInfo,
        uint256 deadline,
        PermitData calldata permitData
    )
        external
        returns (
            uint256 amountA,
            uint256 amountB,
            uint256 addedLiquidity
        );
}
function migrateLpToDmmPool(
    address uniPair,
    address tokenA,
    address tokenB,
    uint256 liquidity,
    uint256 amountAMin,
    uint256 amountBMin,
    uint256 dmmAmountAMin,
    uint256 dmmAmountBMin,
    PoolInfo calldata poolInfo,
    uint256 deadline
)
    external
    returns (
        uint256 amountA,
        uint256 amountB,
        uint256 addedLiquidity
    );

/**
 * @dev Migrate tokens from a pair to a Kyber Dmm Pool
 *   Supporting both normal tokens and tokens with fee on transfer
 *   Support create new pool with received tokens from removing, or
 *       add tokens to a given pool address
 * @param uniPair pair for token that user wants to migrate from
 *   it should be compatible with UniswapPair's interface
 * @param tokenA first token of the pool
 * @param tokenB second token of the pool
 * @param liquidity amount of LP tokens to migrate
 * @param amountAMin min amount for tokenA when removing
 * @param amountBMin min amount for tokenB when removing
 * @param dmmAmountAMin min amount for tokenA when adding
 * @param dmmAmountBMin min amount for tokenB when adding
 * @param poolInfo info the the Kyber DMM Pool - (poolAddress, poolAmp)
 *   if poolAddress is 0x0 -> create new pool with amp factor of poolAmp
 *   otherwise add liquidity to poolAddress
 * @param deadline only allow transaction to be executed before the deadline
 */