> For the complete documentation index, see [llms.txt](https://docs-v4.venus.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-v4.venus.io/technical-reference/reference-isolated-pools/utility/max-loops-limit-helper.md).

# MaxLoopsLimitHelper

This reference matches [`MaxLoopsLimitHelper` in `isolated-pools` v4.4.0](https://github.com/VenusProtocol/isolated-pools/blob/v4.4.0/contracts/MaxLoopsLimitHelper.sol). It is an inherited abstract storage/helper module, not a separately deployed contract.

Abstract contract used to avoid collection with too many items that would generate gas errors and DoS.

{% hint style="warning" %}
The internal setter only permits increasing the limit. The public administrator entry point and its permission, if any, belong to the inheriting implementation. Resolve that implementation before assuming a caller can change the value.
{% endhint %}

## Solidity API

### maxLoopsLimit

Maximum number of items accepted by guarded loops. Solidity generates a public getter for this storage field.

```solidity
uint256 public maxLoopsLimit
```

### MaxLoopsLimitUpdated

Emitted after the limit is increased.

```solidity
event MaxLoopsLimitUpdated(uint256 oldMaxLoopsLimit, uint256 newmaxLoopsLimit)
```

### MaxLoopsLimitExceeded

Thrown when a guarded collection is longer than the configured limit.

```solidity
error MaxLoopsLimitExceeded(uint256 loopsLimit, uint256 requiredLoops)
```

### \_setMaxLoopsLimit

Increases the limit. The call reverts unless `limit > maxLoopsLimit`; it cannot reduce the value.

```solidity
function _setMaxLoopsLimit(uint256 limit) internal
```

### \_ensureMaxLoops

Reverts with `MaxLoopsLimitExceeded(maxLoopsLimit, len)` when `len` exceeds the configured limit.

```solidity
function _ensureMaxLoops(uint256 len) internal view
```


---

# 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-v4.venus.io/technical-reference/reference-isolated-pools/utility/max-loops-limit-helper.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.
