> For the complete documentation index, see [llms.txt](https://docs.vulpefi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vulpefi.com/aggregation-protocol/limit-order-protocol/smart-contracts/helpers/predicatehelper.md).

# PredicateHelper

A helper contract for executing boolean functions on arbitrary target call results

## Functions[​](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#functions) <a href="#functions" id="functions"></a>

### or[​](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#or) <a href="#or" id="or"></a>

```javascript
function or(
  address[] targets,
  bytes[] data
) external returns (bool)
```

Calls every target with corresponding data

**Parameters:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#parameters)

| Name      | Type       | Description |
| --------- | ---------- | ----------- |
| `targets` | address\[] |             |
| `data`    | bytes\[]   |             |

**Return Values:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#return-values)

| Name     | Type | Description                                                |
| -------- | ---- | ---------------------------------------------------------- |
| `Result` | bool | True if call to any target returned True. Otherwise, false |

### and[​](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#and) <a href="#and" id="and"></a>

```javascript
function and(
  address[] targets,
  bytes[] data
) external returns (bool)
```

Calls every target with corresponding data

**Parameters:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#parameters-1)

| Name      | Type       | Description |
| --------- | ---------- | ----------- |
| `targets` | address\[] |             |
| `data`    | bytes\[]   |             |

**Return Values:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#return-values-1)

| Name     | Type | Description                                                  |
| -------- | ---- | ------------------------------------------------------------ |
| `Result` | bool | True if calls to all targets returned True. Otherwise, false |

### eq[​](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#eq) <a href="#eq" id="eq"></a>

```javascript
function eq(
  uint256 value,
  address target,
  bytes data
) external returns (bool)
```

Calls target with specified data and tests if it's equal to the value

**Parameters:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#parameters-2)

| Name     | Type    | Description   |
| -------- | ------- | ------------- |
| `value`  | uint256 | Value to test |
| `target` | address |               |
| `data`   | bytes   |               |

**Return Values:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#return-values-2)

| Name     | Type | Description                                                                |
| -------- | ---- | -------------------------------------------------------------------------- |
| `Result` | bool | True if call to target returns the same value as `value`. Otherwise, false |

### lt[​](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#lt) <a href="#lt" id="lt"></a>

```javascript
function lt(
  uint256 value,
  address target,
  bytes data
) external returns (bool)
```

Calls target with specified data and tests if it's lower than value

**Parameters:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#parameters-3)

| Name     | Type    | Description   |
| -------- | ------- | ------------- |
| `value`  | uint256 | Value to test |
| `target` | address |               |
| `data`   | bytes   |               |

**Return Values:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#return-values-3)

| Name     | Type | Description                                                                        |
| -------- | ---- | ---------------------------------------------------------------------------------- |
| `Result` | bool | True if call to target returns value which is lower than `value`. Otherwise, false |

### gt[​](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#gt) <a href="#gt" id="gt"></a>

```javascript
function gt(
  uint256 value,
  address target,
  bytes data
) external returns (bool)
```

Calls target with specified data and tests if it's bigger than value

**Parameters:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#parameters-4)

| Name     | Type    | Description   |
| -------- | ------- | ------------- |
| `value`  | uint256 | Value to test |
| `target` | address |               |
| `data`   | bytes   |               |

**Return Values:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#return-values-4)

| Name     | Type | Description                                                                         |
| -------- | ---- | ----------------------------------------------------------------------------------- |
| `Result` | bool | True if call to target returns value which is bigger than `value`. Otherwise, false |

### timestampBelow[​](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#timestampbelow) <a href="#timestampbelow" id="timestampbelow"></a>

```javascript
function timestampBelow(
  uint256 time
) external returns (bool)
```

Checks passed time against block timestamp

**Parameters:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#parameters-5)

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| `time` | uint256 |             |

**Return Values:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/PredicateHelper#return-values-5)

| Name     | Type | Description                                                            |
| -------- | ---- | ---------------------------------------------------------------------- |
| `Result` | bool | True if current block timestamp is lower than `time`. Otherwise, false |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.vulpefi.com/aggregation-protocol/limit-order-protocol/smart-contracts/helpers/predicatehelper.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
