github.com/status-im/status-go@v1.1.0/contracts/uniswapV3/interfaces/IUniswapV3Factory.sol (about)

     1  // SPDX-License-Identifier: GPL-2.0-or-later
     2  pragma solidity >=0.5.0;
     3  
     4  /// @title The interface for the Uniswap V3 Factory
     5  /// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees
     6  interface IUniswapV3Factory {
     7      /// @notice Emitted when the owner of the factory is changed
     8      /// @param oldOwner The owner before the owner was changed
     9      /// @param newOwner The owner after the owner was changed
    10      event OwnerChanged(address indexed oldOwner, address indexed newOwner);
    11  
    12      /// @notice Emitted when a pool is created
    13      /// @param token0 The first token of the pool by address sort order
    14      /// @param token1 The second token of the pool by address sort order
    15      /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
    16      /// @param tickSpacing The minimum number of ticks between initialized ticks
    17      /// @param pool The address of the created pool
    18      event PoolCreated(
    19          address indexed token0,
    20          address indexed token1,
    21          uint24 indexed fee,
    22          int24 tickSpacing,
    23          address pool
    24      );
    25  
    26      /// @notice Emitted when a new fee amount is enabled for pool creation via the factory
    27      /// @param fee The enabled fee, denominated in hundredths of a bip
    28      /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee
    29      event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);
    30  
    31      /// @notice Returns the current owner of the factory
    32      /// @dev Can be changed by the current owner via setOwner
    33      /// @return The address of the factory owner
    34      function owner() external view returns (address);
    35  
    36      /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled
    37      /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context
    38      /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee
    39      /// @return The tick spacing
    40      function feeAmountTickSpacing(uint24 fee) external view returns (int24);
    41  
    42      /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist
    43      /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
    44      /// @param tokenA The contract address of either token0 or token1
    45      /// @param tokenB The contract address of the other token
    46      /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
    47      /// @return pool The pool address
    48      function getPool(
    49          address tokenA,
    50          address tokenB,
    51          uint24 fee
    52      ) external view returns (address pool);
    53  
    54      /// @notice Creates a pool for the given two tokens and fee
    55      /// @param tokenA One of the two tokens in the desired pool
    56      /// @param tokenB The other of the two tokens in the desired pool
    57      /// @param fee The desired fee for the pool
    58      /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved
    59      /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments
    60      /// are invalid.
    61      /// @return pool The address of the newly created pool
    62      function createPool(
    63          address tokenA,
    64          address tokenB,
    65          uint24 fee
    66      ) external returns (address pool);
    67  
    68      /// @notice Updates the owner of the factory
    69      /// @dev Must be called by the current owner
    70      /// @param _owner The new owner of the factory
    71      function setOwner(address _owner) external;
    72  
    73      /// @notice Enables a fee amount with the given tickSpacing
    74      /// @dev Fee amounts may never be removed once enabled
    75      /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)
    76      /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount
    77      function enableFeeAmount(uint24 fee, int24 tickSpacing) external;
    78  }