> For the complete documentation index, see [llms.txt](https://docs.ariaprotocol.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ariaprotocol.xyz/technical-docs/contract-docs/aria/claim/ariatokenclaim.md).

# AriaTokenClaim

**Inherits:** OwnableUpgradeable, UUPSUpgradeable

**Author:** Aria Protocol

Merkle claim for Aria Token

## State Variables

### claimRoot

Retreive the current claim root.

```solidity
bytes32 public claimRoot;
```

### ariaToken

Address of the aria erc20 token.

```solidity
IERC20 public ariaToken;
```

### tokensClaimed

Mapping of address to boolean of if an address has claim their tokens.

```solidity
mapping(address => bool) public tokensClaimed;
```

## Functions

### constructor

**Note:** oz-upgrades-unsafe-allow: constructor

```solidity
constructor();
```

### initialize

```solidity
function initialize(address _ariaToken, bytes32 _claimRoot, address _owner) external initializer;
```

### claim

Claim aria tokens.

```solidity
function claim(uint256 amount, bytes32[] calldata proof) public;
```

**Parameters**

| Name     | Type        | Description                                          |
| -------- | ----------- | ---------------------------------------------------- |
| `amount` | `uint256`   | Number of tokens claimable by a user.                |
| `proof`  | `bytes32[]` | Merkle proof proving a user is able to claim tokens. |

### updateClaimRoot

Updates the claim root.

*Only callable by owner.*

```solidity
function updateClaimRoot(bytes32 _claimRoot) external onlyOwner;
```

**Parameters**

| Name         | Type      | Description     |
| ------------ | --------- | --------------- |
| `_claimRoot` | `bytes32` | New claim root. |

### withdraw

Withdraws all tokens held by contract

*The zero address denotes ETH*

*Only callable by owner.*

```solidity
function withdraw(address _tokenAddress) external onlyOwner;
```

**Parameters**

| Name            | Type      | Description                   |
| --------------- | --------- | ----------------------------- |
| `_tokenAddress` | `address` | Address of tokens to withdraw |

### \_authorizeUpgrade

Internal function called when trying to perform upgrade

*Only callable by owner.*

```solidity
function _authorizeUpgrade(address) internal virtual override onlyOwner;
```

## Events

### TokensClaimed

```solidity
event TokensClaimed(bytes32 indexed root, address indexed claimer, uint256 amount);
```


---

# 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.ariaprotocol.xyz/technical-docs/contract-docs/aria/claim/ariatokenclaim.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.
