# Counter

Designed to maintain a count, `Counter` offers functionality to incrementally update a value and manage access through ownership and operator privileges. This can be used in scenarios requiring tallying, tracking usage or interactions, and other numerical record-keeping in smart contracts.

#### Functions

#### `value()`

* **Description**: Retrieves the current value of the counter.
* **Returns**: `uint256` representing the current counter value.

#### `owner()`

* **Description**: Fetches the address recognized as the owner of the counter.
* **Returns**: Address of the current owner.

#### `operator()`

* **Description**: Obtains the address designated as the operator of the counter, who is permitted to perform specific actions like adding to the counter.
* **Returns**: Operator's address.

#### `transferOwnership(address newOwner)`

* **Description**: Assigns ownership of the counter to a new address, transferring all associated control and privileges.
* **Parameters**:
  * `newOwner`: The address to be assigned as the new owner of the counter.
* **Restrictions**: Can only be executed by the current owner.

#### `add(uint256 additionalValue)`

* **Description**: Increments the counter by a specified value.
* **Parameters**:
  * `additionalValue`: The amount by which to increase the counter.
* **Restrictions**: Can only be executed by the current operator.

#### `reset()`

* **Description**: Resets the counter value to zero, effectively restarting any count or tally being maintained.
* **Restrictions**: Can only be executed by the current owner.


---

# 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.mellow.finance/mellow-alm/mellow-alm-toolkit/utility-contracts/counter.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.
