# HooksLibrary

Library to be used when building custom operation hooks

## Functions

### isCallBeforeHook

Check if the current hook call is a before hook call

```solidity
function isCallBeforeHook() internal view returns (bool);
```

**Returns**

| Name     | Type   | Description                                                          |
| -------- | ------ | -------------------------------------------------------------------- |
| `<none>` | `bool` | True if the current hook call is a before hook call, false otherwise |

### isCallAfterHook

Check if the current hook call is an after hook call

```solidity
function isCallAfterHook() internal view returns (bool);
```

**Returns**

| Name     | Type   | Description                                                          |
| -------- | ------ | -------------------------------------------------------------------- |
| `<none>` | `bool` | True if the current hook call is an after hook call, false otherwise |

### isBeforeHook

Check if the provided hook is a before hook

```solidity
function isBeforeHook(address hook) internal pure returns (bool);
```

**Parameters**

| Name   | Type      | Description                      |
| ------ | --------- | -------------------------------- |
| `hook` | `address` | The address of the hook to check |

**Returns**

| Name     | Type   | Description                                                 |
| -------- | ------ | ----------------------------------------------------------- |
| `<none>` | `bool` | True if the provided hook is a before hook, false otherwise |

### isAfterHook

Check if the provided hook is an after hook

```solidity
function isAfterHook(address hook) internal pure returns (bool);
```

**Parameters**

| Name   | Type      | Description                      |
| ------ | --------- | -------------------------------- |
| `hook` | `address` | The address of the hook to check |

**Returns**

| Name     | Type   | Description                                                 |
| -------- | ------ | ----------------------------------------------------------- |
| `<none>` | `bool` | True if the provided hook is an after hook, false otherwise |

### isBeforeAndAfterHook

Check if the provided hook is a before and after hook

```solidity
function isBeforeAndAfterHook(address hook) internal pure returns (bool);
```

**Parameters**

| Name   | Type      | Description                      |
| ------ | --------- | -------------------------------- |
| `hook` | `address` | The address of the hook to check |

**Returns**

| Name     | Type   | Description                                                           |
| -------- | ------ | --------------------------------------------------------------------- |
| `<none>` | `bool` | True if the provided hook is a before and after hook, false otherwise |

## Errors

### HookNotBefore

```solidity
error HookNotBefore();
```

### HookNotAfter

```solidity
error HookNotAfter();
```

### HookNotBeforeAndAfter

```solidity
error HookNotBeforeAndAfter();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aera.finance/the-protocol/periphery/hookslibrary.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
