Skip to content

Commit

Permalink
fix: fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasmatt committed Feb 23, 2024
1 parent e0474f2 commit c1846cc
Showing 1 changed file with 17 additions and 31 deletions.
48 changes: 17 additions & 31 deletions contracts/airdrop-token-vesting/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
## Token Vesting

This contract implements vesting accounts for the CW20 and native tokens.
This contract implements vesting accounts for the native tokens.

Admin and managers are defined at the instantiation of the contracts. Both can
reward users and de-register vesting accounts, but only the admin can withdraw
the unallocated amount from the contract.

### Master Operations

#### By admin and members
#### By admin and managers

```rust
RewardUsers {
rewards: Vec<RewardUserRequest>,
master_address: Option<String>, // if given, the vesting account can be unregistered
vesting_schedule: VestingSchedule,
},
```

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.
This creates a set of vesting accounts for the given users.

#### By admin only

Expand All @@ -29,35 +31,20 @@ If no `master_address` is given, the deregister feature is disabled.
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
#### By admin and managers

```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`)
- DeregisterVestingAccount - deregister 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`).

```rust
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum Cw20HookMsg {
/// Register vesting account with token transfer
RegisterVestingAccount {
master_address: Option<String>, // if given, the vesting account can be unregistered
address: String,
vesting_schedule: VestingSchedule,
},
}
```

### Vesting Account Operations

```rust
Expand All @@ -68,13 +55,12 @@ pub enum ExecuteMsg {
/// VestingAccount Operations ///
////////////////////////
Claim {
denoms: Vec<Denom>,
recipient: Option<String>,
},
}
```

* Sends newly vested token to the (`recipient` or `vesting_account`). The `claim_amount` is computed
- 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.
Expand All @@ -83,9 +69,9 @@ pub enum ExecuteMsg {

TODO for mainnet/testnet

| Field | Value |
| ------------- | ------ |
| code_id | ... |
| contract_addr | ... |
| rpc_url | ... |
| chain_id | ... |
| Field | Value |
| ------------- | ----- |
| code_id | ... |
| contract_addr | ... |
| rpc_url | ... |
| chain_id | ... |

0 comments on commit c1846cc

Please sign in to comment.