# V3AirdropOperator

&#x20;This contract operates each airdrop. LP and token to be airdropped are determined at the time of creation and cannot be modified.

## Code

Github Link: (Will be updated after official launch)<br>

## Events, Read-Only Functions, and State-Changing Functions

{% tabs %}
{% tab title="Read-Only Functions" %}

## Read-Only Functions

**getAirdropStat**

```solidity
function getAirdropStat() external view returns (
    uint256 totalAmount,
    uint256 blockAmount,
    uint256 distributableBlock,
    uint256 endBlock,
    uint256 distributed,
    uint256 remain,
    bool created
) 
```

**Return Values:**

<table><thead><tr><th width="239.66666666666663">Name</th><th width="107">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>totalAmount</code></td><td>uint256</td><td>The total amount of airdrop</td></tr><tr><td><code>blockAmount</code></td><td>uint256</td><td>The airdroped amount of token per block</td></tr><tr><td><code>distributableBlock</code></td><td>uint256</td><td>The block number of available block</td></tr><tr><td><code>endBlock</code></td><td>uint256</td><td>The block number of airdrop ended</td></tr><tr><td><code>distributed</code></td><td>uint256</td><td>The amount of current distributed</td></tr><tr><td><code>remain</code></td><td>uint256</td><td>The amount of remained</td></tr><tr><td><code>created</code></td><td>bool</td><td>intialized</td></tr></tbody></table>

**getDistributionId**

```solidity
function getDistributionId() public view returns (bytes32 id)
```

**Return Values:**[**​**](https://docs.uniswap.org/contracts/v3/reference/periphery/NonfungiblePositionManager#parameters)

<table><thead><tr><th width="119.66666666666666">Name</th><th width="116">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>bytes32</td><td>The ID of the distribution</td></tr></tbody></table>
{% endtab %}

{% tab title="State-Changing Functions" %}

## **State-Changing Functions**

**changeNextOwner**

```solidity
function changeNextOwner(address _nextOwner) external
```

**changeOwner**

```solidity
function changeOwner() external
```

**createDistribution**

```solidity
function createDistribution(
    uint256 totalAmount,
    uint256 blockAmount,
    uint256 startBlock
) external
```

**Parameters:**

<table><thead><tr><th width="175.66666666666666">Name</th><th width="102">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>totalAmount</code></td><td>uint256</td><td>Total number of tokens to be distributed by airdrop</td></tr><tr><td><code>blockAmount</code></td><td>uint256</td><td>Token quantity to be distributed per block</td></tr><tr><td><code>startBlock</code></td><td>uint256</td><td>Airdrop start block number</td></tr></tbody></table>

**deposit**

```solidity
function deposit(uint256 amount) external
```

If there is an issue of token exhaustion or extension during the airdrop process, tokens can be recharged using the AirdropOperator's Deposit function.

* When executing the function, transfer more than the amount of tokens entered into the wallet.
* The token specified when creating the operator is charged.
* When recharging due to exhaustion, it will be applied from the block after recharging.

**refixBlockAmount**

```solidity
function refixBlockAmount(uint256 blockAmount) external
```

* Modify the amount of tokens distributed per block
* It is applied from the block after the transaction is executed.

**withdraw**

```solidity
function withdraw(address _token) external
```

* The remaining tokens can be withdrawn after the Airdrop plan is in progress.
* Withdrawal will be made to the owner's account.
  {% endtab %}
  {% endtabs %}


---

# 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.klayswap.com/developers/contract/v3/v3airdropoperator.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.
