# Vesting

This contract gives a possibility to create vesting schedules and distribute ASX tokens between users using the linear distribution during release period.

## Write methods description

### createVestingSchedule()

Creates new vesting schedules in a batch by an owner.

Parameters:

<table><thead><tr><th width="181.33333333333331">Name</th><th width="116">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_accounts</strong></td><td>address[]</td><td>An array of addresses of users for whom new vesting schedules should be created.</td></tr><tr><td><strong>_amounts</strong></td><td>uint256[]</td><td>An array of vesting schedules distribution amounts.</td></tr><tr><td><strong>_lockPeriods</strong></td><td>uint32[]</td><td>An array of lock period durations (in seconds) that should take place before distribution will start.</td></tr><tr><td><strong>_releasePeriods</strong></td><td>uint32[]</td><td>An array of periods (in seconds) during which ASX tokens will be distributed after the lock period.</td></tr></tbody></table>

### release()

Releases ASX tokens for a specified vesting schedule IDs in a batch.

Parameters:

<table><thead><tr><th width="152.33333333333331">Name</th><th width="130">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_vsids</strong></td><td>uint256[]</td><td>An array of vesting schedule IDs.</td></tr><tr><td><strong>_recipients</strong></td><td>address[]</td><td>An array of recipients of unlocked ASX tokens.</td></tr></tbody></table>

### renounceOwnership()

Leaves the contract without owner. It will not be possible to call the owner's functions anymore. Can only be called by the current owner. The method does not take any parameters. Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

### transferOwnership()

Transfers ownership of the contract to the new owner. Can only be called by the current owner.

Parameters:

<table><thead><tr><th width="158.33333333333331">Name</th><th width="113">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_newOwner</strong></td><td>address</td><td>An account that will become the new owner.</td></tr></tbody></table>

### withdraw()

Withdraws unused ASX tokens or othe tokens (including ETH) by an owner.

Parameters:

<table><thead><tr><th width="131.33333333333331">Name</th><th width="94">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_token</strong></td><td>address</td><td>A token to withdraw. If equal to zero address - withdraws ETH.</td></tr><tr><td><strong>_amount</strong></td><td>uint256</td><td>An amount of tokens for withdraw.</td></tr><tr><td><strong>_recipient</strong></td><td>address</td><td>A recipient of withdrawn tokens.</td></tr></tbody></table>

## Read methods description

### getReleasableAmount()

Returns releasable amount for a vesting schedule by provided ID. If no vesting schedule exists with provided ID, returns zero.

Parameters:

<table><thead><tr><th width="149.33333333333331">Name</th><th width="123">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_vsid</strong></td><td>uint256</td><td>An ID of a vesting schedule.</td></tr></tbody></table>

Return:

<table><thead><tr><th width="151.33333333333331">Name</th><th width="108">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_amount</strong></td><td>uint256</td><td>A releasable amount for a specified vesting schedule.</td></tr></tbody></table>

### getToken()

Returns the ASX token address.

Return:

<table><thead><tr><th width="136.33333333333331">Name</th><th width="103">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_token</strong></td><td>address</td><td>The ASX token address.</td></tr></tbody></table>

### getTotalDistributionAmount()

Returns total distribution amount for all vesting schedules.

Return:

<table><thead><tr><th width="130">Name</th><th width="104.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_amount</strong></td><td>uint256</td><td>Total distribution amount for all vesting schedules.</td></tr></tbody></table>

### getTotalReleasedAmount()

Returns total released amount for all vesting schedules.

Return:

<table><thead><tr><th width="135.33333333333331">Name</th><th width="115">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_amount</strong></td><td>uint256</td><td>Total released amount for all vesting schedules.</td></tr></tbody></table>

### getVestingSchedule()

Returns a vesting schedule by its ID. If no vesting schedule exists with provided ID, returns an empty vesting schedule.

Parameters:

<table><thead><tr><th width="133">Name</th><th width="124.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_vsid</strong></td><td>uint256</td><td>An ID of a vesting schedule.</td></tr></tbody></table>

Return:

<table><thead><tr><th width="188.33333333333331">Name</th><th width="169">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_vestingSchedule</strong></td><td>VestingSchedule</td><td>A vesting schedule structure.</td></tr></tbody></table>

### getVestingSchedulesCount()

Returns total vesting schedules count.

Return:

<table><thead><tr><th width="152.33333333333331">Name</th><th width="116">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_count</strong></td><td>uint256</td><td>Total vesting schedules count.</td></tr></tbody></table>

### getWithdrawableAmount()

Returns an amount available for withdrawal (unused ASX tokens amount) by an owner.

Return:

<table><thead><tr><th width="163.33333333333331">Name</th><th width="123">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_amount</strong></td><td>uint256</td><td>A withdrawable amount.</td></tr></tbody></table>

### owner()

Gets an owner address that was granted exclusive access to specific functions with the modifier `onlyOwner`.

Return:

<table><thead><tr><th width="157.33333333333331">Name</th><th width="112">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_owner</strong></td><td>address</td><td>An owner address.</td></tr></tbody></table>


---

# 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.asymetrix.io/resources/developers-docs/vesting.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.
