Vesting
Overview
The Vesting contract unlocks a token for registered accounts along time-based schedules. Astroport used it to fund ASTRO emissions: the Generator, and later Incentives, had vesting accounts and claimed ASTRO from them to pay LP stakers.
ASTRO emissions are zero under long-term support. Every schedule registered in the Terra and Neutron Vesting contracts ended in 2024.
The vested token is set at instantiate as an AssetInfo: ASTRO (IBC) on Terra and ASTRO (tokenfactory) on Neutron.
Links
- Terra Address: terra1qyuarnzcc6uuft9n9mltraprreke4v8gvxd8u3nslngxhflhru9qw34nc3 (
astroport-vesting1.4.0) - Neutron Address: neutron178d2p84ldlzcl53clc25uy6mx3trazxdy08akhjp3qf5chlmccgq6hv2pl (
astroport-vesting1.4.0) - Contract Repo: https://github.com/astroport-fi/astroport-core/tree/main/contracts/tokenomics/vesting
- contract.rs: https://github.com/astroport-fi/astroport-core/blob/main/contracts/tokenomics/vesting/src/contract.rs
- vesting.rs: https://github.com/astroport-fi/astroport-core/blob/main/packages/astroport/src/vesting.rs
- Tests: https://github.com/astroport-fi/astroport-core/tree/main/contracts/tokenomics/vesting/tests
InstantiateMsg
| Params | Type | Description |
|---|---|---|
owner | String | Address allowed to register vesting accounts and change the owner |
vesting_token | AssetInfo | The token being vested |
ExecuteMsg
claim
Sends the sender's unlocked tokens, across all of its schedules, to recipient (default: the sender). Without amount, everything available is sent; with it, amount must not exceed what's available.
| Params | Type | Description |
|---|---|---|
recipient | Option<String> | The address that receives the tokens. Defaults to the sender |
amount | Option<Uint128> | The amount to claim. Defaults to everything available |
register_vesting_accounts
Owner only. Registers vesting schedules for one or more accounts. The tokens for every schedule must be paid in the same call: for a native vesting token, attach exactly the sum of the schedules' amounts; for a CW20 vesting token, use the CW20 receive hook below.
| Params | Type | Description |
|---|---|---|
address | String | The account receiving the tokens |
schedules | Vec<VestingSchedule> | The account's schedules |
start_point | VestingSchedulePoint | Time (seconds) and amount unlocked at the start. Without an end_point, the whole amount unlocks at time |
end_point | Option<VestingSchedulePoint> | Time and total amount unlocked at the end. Between the two points, tokens unlock linearly |
receive
CW20 receive hook, for a CW20 vesting token. Send the tokens from the owner with a CW20 send whose msg is the base64 of a register_vesting_accounts message (same fields as above).
_7{_7 "send": {_7 "contract": "<vesting contract>",_7 "amount": "1000000000",_7 "msg": "<base64 of {\"register_vesting_accounts\":{\"vesting_accounts\":[...]}}>"_7 }_7}
withdraw_from_active_schedule
Owner only. Takes withdraw_amount of the still-locked tokens out of an account's only active schedule and sends them to recipient (default: the owner). The schedule restarts from now with what's left. Fails if the account has no active schedule or more than one.
_7{_7 "withdraw_from_active_schedule": {_7 "account": "neutron1...",_7 "recipient": "neutron1...",_7 "withdraw_amount": "1000000"_7 }_7}
propose_new_owner, drop_ownership_proposal, claim_ownership
Two-step ownership transfer. The owner proposes a new owner with an expiry in seconds, or drops the proposal; the proposed owner claims ownership.
_6{_6 "propose_new_owner": {_6 "owner": "neutron1...",_6 "expires_in": 86400_6 }_6}
QueryMsg
config
Returns the owner and the vesting token.
Query with {"config":{}}. The example is the live Neutron response.
vesting_account
Returns an account's schedules and how much it has already claimed.
| Params | Type | Description |
|---|---|---|
address | Addr | The account |
info.schedules | Vec<VestingSchedule> | Its schedules |
info.released_amount | Uint128 | The total already claimed |
vesting_accounts
Returns several accounts, paginated. order_by is "asc" or "desc".
_7{_7 "vesting_accounts": {_7 "start_after": null,_7 "limit": 10,_7 "order_by": "asc"_7 }_7}
The response is {"vesting_accounts": [<VestingAccountResponse>, ...]}.
available_amount
Returns the amount an account can claim right now, as a Uint128.
_5{_5 "available_amount": {_5 "address": "neutron173fd8wpfzyqnfnpwq2zhtgdstujrjz2wkprkjfr6gqg4gknctjyq6m3tch"_5 }_5}
timestamp
Returns the current block time in seconds, as a u64.
_3{_3 "timestamp": {}_3}