# Path

Path is \[pool\_addr, tokenAIn, pool\_addr, tokenAIn ...], alternating 20 bytes and then one byte for the tokenAIn bool.

### State Variables <a href="#state-variables" id="state-variables"></a>

#### ADDR\_SIZE <a href="#addr_size" id="addr_size"></a>

The length of the bytes encoded address.

```solidity
uint256 private constant ADDR_SIZE = 20;
```

#### BOOL\_SIZE <a href="#bool_size" id="bool_size"></a>

The length of the bytes encoded bool.

```solidity
uint256 private constant BOOL_SIZE = 1;
```

#### NEXT\_OFFSET <a href="#next_offset" id="next_offset"></a>

The offset of a single token address and pool address.

```solidity
uint256 private constant NEXT_OFFSET = ADDR_SIZE + BOOL_SIZE;
```

### Functions <a href="#functions" id="functions"></a>

#### hasMultiplePools <a href="#hasmultiplepools" id="hasmultiplepools"></a>

Returns true iff the path contains two or more pools.

```solidity
function hasMultiplePools(bytes memory path) internal pure returns (bool);
```

**Parameters**

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

**Returns**

| Name     | Type   | Description                                               |
| -------- | ------ | --------------------------------------------------------- |
| `<none>` | `bool` | True if path contains two or more pools, otherwise false. |

#### decodeFirstPool <a href="#decodefirstpool" id="decodefirstpool"></a>

Decodes the first pool in path.

```solidity
function decodeFirstPool(bytes memory path) internal pure returns (IMaverickV2Pool pool, bool tokenAIn);
```

**Parameters**

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

#### decodeNextPoolAddress <a href="#decodenextpooladdress" id="decodenextpooladdress"></a>

```solidity
function decodeNextPoolAddress(bytes memory path) internal pure returns (address pool);
```

#### skipToken <a href="#skiptoken" id="skiptoken"></a>

Skips a token + pool element from the buffer and returns the remainder.

```solidity
function skipToken(bytes memory path) internal pure returns (bytes memory);
```

**Parameters**

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

**Returns**

| Name     | Type    | Description                                      |
| -------- | ------- | ------------------------------------------------ |
| `<none>` | `bytes` | The remaining token + pool elements in the path. |

<br>
