Vesting
Overview
The Vesting contract progressively unlocks ASTRO that can then be distributed to LP stakers via the Generator contract.
Links
- Contract Address: terra1qyuarnzcc6uuft9n9mltraprreke4v8gvxd8u3nslngxhflhru9qw34nc3
- Testnet Address: terra1703s0etk3u07ur6qjjrxpmjsccfmsfnfwf0h0dket6srz066cemqjxlt78
- 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
Initializes the contract with the address of the ASTRO token.
Params | Type | Description |
---|---|---|
owner | String | Address allowed to change contract parameters |
token_addr | String | The address of the token that's being vested |
ExecuteMsg
claim
Transfer vested tokens from all vesting schedules that have the same VestingContractAddress
(address that's vesting tokens).
Params | Type | Description |
---|---|---|
recipient | Option<String> | The address that receives the vested tokens |
amount | Option<Uint128> | The amount of tokens to claim |
receive
CW20 receive msg.
Params | Type | Description |
---|---|---|
receive | Cw20ReceiveMsg | CW20 receive message |
register_vesting_accounts
Creates vesting schedules for the ASTRO token. Each vesting token should have the Generator contract address as the VestingContractAddress. Also, each schedule will unlock tokens at a different rate according to its time duration.
You should execute this message inside the ASTRO token contract.
Params | Type | Description |
---|---|---|
send | Cw20ExecuteMsg | CW20 receive message |
In send.msg
, you may encode this JSON string into base64 encoding.
Params | Type | Description |
---|---|---|
vesting_accounts | Vec<VestingAccount> | Vesting account to register |
VestingAccount
This structure stores vesting information for a specific address that is getting tokens.
Params | Type | Description |
---|---|---|
address | String | The address that is getting tokens |
schedules | Vec<VestingSchedule> | The vesting schedules targeted at the address |
VestingSchedule
This structure stores parameters for a specific vesting schedule.
Params | Type | Description |
---|---|---|
start_point | VestingSchedulePoint | The start date for the vesting schedule |
end_point | Option<VestingSchedulePoint> | The end point for the vesting schedule |
VestingSchedulePoint
This structure stores the parameters used to create a vesting schedule.
Params | Type | Description |
---|---|---|
time | u64 | The start time for the vesting schedule |
amount | Uint128 | The amount of tokens being vested |
QueryMsg
config
Queries the vesting token contract address (the ASTRO token address).
ConfigResponse
This structure describes a custom struct used to return the contract configuration.
Params | Type | Description |
---|---|---|
owner | Addr | Address allowed to set contract parameters |
token_addr | Addr | The address of the token being vested |
vesting_account
Queries all vesting schedules with their details for a specific vesting recipient.
Params | Type | Description |
---|---|---|
address | String | Vesting account address |
VestingAccountResponse
This structure describes a custom struct used to return vesting data about a specific vesting target.
Params | Type | Description |
---|---|---|
address | Addr | The address that's vesting tokens |
info | VestingInfo | Vesting information |
VestingInfo
Params | Type | Description |
---|---|---|
schedules | Vec<VestingSchedule> | The vesting schedules |
released_amount | Uint128 | The total amount of ASTRO already claimed |
vesting_accounts
Queries all vesting schedules with their details for all vesting recipient. Given fields are optional.
Params | Type | Description |
---|---|---|
start_after | Option<String> | Vesting account address to start after |
limit | Option<u32> | Amount of addresses to list |
order_by | Option<OrderBy> | Order by ascending or descending |
Returns VestingAccountsResponse
OrderBy
This enum describes the types of sorting that can be applied to some piece of data.
Variants | Description |
---|---|
Asc | Order by ascending |
Desc | Order by decending |
available_amount
Queries the claimable amount (vested but not yet claimed) of ASTRO tokens that a vesting target can claim.
Params | Type | Description |
---|---|---|
address | String | Vesting account address |
Returns Uint128
timestamp
Queries the current timestamp.
Returns u64