# State Transitions

The `x/vesting` module allows for state transitions that create and update a clawback vesting account with `CreateClawbackVestingAccount` or perform a clawback of unvested funds with `Clawback`.

### Create Clawback Vesting Account <a href="#create-clawback-vesting-account" id="create-clawback-vesting-account"></a>

A funder creates a new clawback vesting account defining the address to fund as well as the vesting/lockup schedules. Additionally, new grants can be added to existing clawback vesting accounts with the same message.

1. Funder submits a `MsgCreateClawbackVestingAccount` through one of the clients.
2. Check if
   1. the vesting account address is not blocked
   2. there is at least one vesting or lockup schedule provided. If one of them is absent, default to instant vesting or unlock schedule.
   3. lockup and vesting total amounts are equal
3. Create or update a clawback vesting account and send coins from the funder to the vesting account
   1. if the clawback vesting account already exists and `--merge` is set to true, add a grant to the existing total vesting amount and update the vesting and lockup schedules.
   2. else create a new clawback vesting account

### Clawback <a href="#clawback" id="clawback"></a>

The funding address is the only address that can perform the clawback.

1. Funder submits a `MsgClawback` through one of the clients.
2. Check if
   1. a destination address is given and default to funder address if not
   2. the destination address is not blocked
   3. the account exists and is a clawback vesting account
   4. account funder is same as in msg
3. Transfer unvested tokens from the clawback vesting account to the destination address, update the lockup schedule and remove future vesting events.


---

# 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.metanovaverse.com/protocol-developers/modules/vesting/state-transitions.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.
