Mars Protocol
Search…
⌃K

Vesting

The Vesting contract handles vesting for contributor token allocations and their voting power for council proposals.

Config

Key
Type
Description
address_provider_address
String
Address provider contract address
unlock_schedule
Schedule
Schedule for token unlocking; this schedule is the same for all users

Schedule

Schedule for token unlocking; this schedule is the same for all users.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema, Copy)]
pub struct Schedule {
pub start_time: u64,
pub cliff: u64,
pub duration: u64,
}
Key
Type
Description
start_time
u64
Time when vesting/unlocking starts
cliff
u64
Time when vesting/unlocking starts
duration
u64
Duration of the vesting/unlocking process. At time start_time + duration, the tokens are vested/unlocked in full

InstantiateMsg

Rust
JSON
use super::*;
pub type InstantiateMsg = Config<String>;
{
"config": {
"address_provider_address": "terra...",
"schedule": {
"start_time": 123,
"cliff": 123,
"duration": 123
}
},
}

ExecuteMsg

Receive

Implementation of cw20 receive msg.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
Receive(Cw20ReceiveMsg)
}
{
"receive":
}

Withdraw

Withdraw unlocked MARS token.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
Withdraw {}
}
{
"withdraw": {}
}

ReceiveMsg

CreateAllocation

Creates a new allocation for a recipient.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ReceiveMsg {
CreateAllocation {
user_address: String,
vest_schedule: Schedule
}
}
{
"create_allocation": {
"user_address": "terra...",
"vest_schedule":
}
}
Key
Type
Description
user_address
String
User address
vest_schedule
Schedule
Vesting schedule

QueryMsg

Config

Get contract config.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Config {}
}
{
"config": {}
}

Allocation

Status of an allocation.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Allocation {
user_address: String
}
}
{
"allocation": {
"user_address": "terra..."
}
}
Key
Text
Text
user_address
String
User address to query allocation

VotingPowerAt

A user's locked voting power at a certain height, which equals the user's total allocated Mars token amount minus the amount they have already withdrawn up to that height.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
VotingPowerAt {
user_address: String,
block: u64
}
}
{
"voting_power_at": {
"user_address": "terra...",
"block": 999
}
}
Key
Type
Description
user_address
String
User address to query voting power
block
u64
Block height to query voting power

TotalVotingPowerAt

Total locked voting power owned by the vesting contract at a certain height. Used by Martian Council to calculate a governance proposal's quorum.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
TotalVotingPowerAt {
block: u64
}
}
{
"total_voting_power_at": {
"block": 999
}
}
Key
Type
Description
block
u64
Block height to query total voting power