# Path

### Functions[​](https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/Path#functions) <a href="#functions" id="functions"></a>

#### hasMultiplePools[​](https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/Path#hasmultiplepools) <a href="#hasmultiplepools" id="hasmultiplepools"></a>

```solidity
  function hasMultiplePools(
    bytes path
  ) internal returns (bool)
```

Returns true iff the path contains two or more pools

**Parameters:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/Path#parameters)

| Name   | Type  | Description           |
| ------ | ----- | --------------------- |
| `path` | bytes | The encoded swap path |

**Return Values:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/Path#return-values)

| Type | Description                                         |
| ---- | --------------------------------------------------- |
| bool | if path contains two or more pools, otherwise false |

#### decodeFirstPool[​](https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/Path#decodefirstpool) <a href="#decodefirstpool" id="decodefirstpool"></a>

```solidity
  function decodeFirstPool(
    bytes path
  ) internal returns (address tokenA, address tokenB, uint24 fee)
```

Decodes the first pool in path

**Parameters:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/Path#parameters-1)

| Name   | Type  | Description                 |
| ------ | ----- | --------------------------- |
| `path` | bytes | The bytes encoded swap path |

**Return Values:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/Path#return-values-1)

| Name     | Type    | Description                        |
| -------- | ------- | ---------------------------------- |
| `tokenA` | address | The first token of the given pool  |
| `tokenB` | address | The second token of the given pool |
| `fee`    | uint24  | The fee level of the pool          |

#### getFirstPool[​](https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/Path#getfirstpool) <a href="#getfirstpool" id="getfirstpool"></a>

```solidity
  function getFirstPool(
    bytes path
  ) internal returns (bytes)
```

Gets the segment corresponding to the first pool in the path

**Parameters:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/Path#parameters-2)

| Name   | Type  | Description                 |
| ------ | ----- | --------------------------- |
| `path` | bytes | The bytes encoded swap path |

**Return Values:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/Path#return-values-2)

| Type  | Description                                                                |
| ----- | -------------------------------------------------------------------------- |
| bytes | segment containing all data necessary to target the first pool in the path |

#### skipToken[​](https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/Path#skiptoken) <a href="#skiptoken" id="skiptoken"></a>

```solidity
  function skipToken(
    bytes path
  ) internal returns (bytes)
```

Skips a token + fee element from the buffer and returns the remainder

**Parameters:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/Path#parameters-3)

| Name   | Type  | Description   |
| ------ | ----- | ------------- |
| `path` | bytes | The swap path |

**Return Values:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/Path#return-values-3)

| Type  | Description                                |
| ----- | ------------------------------------------ |
| bytes | remaining token + fee elements in the path |
