Skip to content

Commit

Permalink
update README for airdrop-token-vesting
Browse files Browse the repository at this point in the history
  • Loading branch information
jgimeno committed Feb 23, 2024
1 parent 63b13a1 commit 502efdb
Showing 1 changed file with 37 additions and 16 deletions.
53 changes: 37 additions & 16 deletions contracts/airdrop-token-vesting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,46 @@ This contract implements vesting accounts for the CW20 and native tokens.

### Master Operations

#### By admin and members

```rust
RegisterVestingAccount {
master_address: Option<String>, // if given, the vesting account can be unregistered
address: String,
vesting_schedule: VestingSchedule,
RewardUsers {
rewards: Vec<RewardUserRequest>,
master_address: Option<String>, // if given, the vesting account can be unregistered
vesting_schedule: VestingSchedule,
},
```
* RegisterVestingAccount - register vesting account
* When creating vesting account, the one can specify the `master_address` to enable deregister feature.

This creates a set of vesting accounts for the given users. The `master_address` is used to enable the deregister feature.
If no `master_address` is given, the deregister feature is disabled.

#### By admin only

```rust
DeregisterVestingAccount {
address: String,
denom: Denom,
vested_token_recipient: Option<String>,
left_vesting_token_recipient: Option<String>,
},
Withdraw {
amount: Uint128,
recipient: String,
},
```

This allows to get part or all of the unallocated amount from the contract and sends it to the `recipient`. Unallocated is equal to the
amount sent on instantiation minus the already rewarded to users.

#### By master_address only

```rust
DeregisterVestingAccount {
address: String,
denom: Denom,
vested_token_recipient: Option<String>,
left_vesting_token_recipient: Option<String>,
},
```

* DeregisterVestingAccount - deregister vesting account
* This interface only executable from the `master_address` of a vesting account.
* It will compute `claimable_amount` and `left_vesting_amount`. Each amount respectively sent to (`vested_token_recipient` or `vesting_account`) and (`left_vesting_token_recipient` or `master_address`).
* It will compute `claimable_amount` and `left_vesting_amount`. Each amount respectively sent to (`vested_token_recipient` or `vesting_account`)
and (`left_vesting_token_recipient` or `master_address`).

```rust
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
Expand All @@ -41,8 +60,6 @@ pub enum Cw20HookMsg {

### Vesting Account Operations

* Claim - send newly vested token to the (`recipient` or `vesting_account`). The `claim_amount` is computed as (`vested_amount` - `claimed_amount`) and `claimed_amount` is updated to `vested_amount`.

```rust
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
Expand All @@ -57,11 +74,15 @@ pub enum ExecuteMsg {
}
```

* Sends newly vested token to the (`recipient` or `vesting_account`). The `claim_amount` is computed
as (`vested_amount` - `claimed_amount`) and `claimed_amount` is updated to `vested_amount`.

If everything is claimed, the vesting account is removed from the contract.

### Deployed Contract Info

TODO for mainnet/testnet


| Field | Value |
| ------------- | ------ |
| code_id | ... |
Expand Down

0 comments on commit 502efdb

Please sign in to comment.