The vxASTRO contract allows xASTRO token holders to stake their tokens in order to boost their governance power as well as the amount of ASTRO they can get from Generator emissions. Voting power is boosted according to how long someone locks their xASTRO for.
Maximum lock time is 2 years, which gives the maximum possible boost of 2.5. For example, if a token holder locks 100 xASTRO for 2 years, they get 250 vxASTRO. Their vxASTRO balance then goes down every week for the next 2 years (unless they relock) until it reaches zero.
Initialize the contract with the initial owner and the address of the xASTRO token.
{
"owner": "terra...",
"deposit_token_addr": "terra..."
}Create new lock/vxASTRO position, deposit more xASTRO in the user's vxASTRO position or deposit on behalf of another address.
{
"receive": {
"sender": "terra...",
"amount": "123",
"msg": "<base64_encoded_json_string>"
}
}An example of extending the lock time for a vxASTRO position by 1 week.
{
"extend_lock_time": {
"time": 604800
}
}Withdraw the whole amount of xASTRO if the lock for a vxASTRO position expired.
{
"withdraw": {}
}Create a request to change contract ownership. The validity period of the offer is set by the expires_in variable.
Only the current contract owner can execute this method.
{
"propose_new_owner": {
"owner": "terra...",
"expires_in": 1234567
}
}Delete the contract ownership transfer proposal. Only the current contract owner can execute this method.
{
"drop_ownership_proposal": {}
}Used to claim contract ownership. Only the newly proposed contract owner can execute this method.
{
"claim_ownership": {}
}Updates the list of addresses that are prohibited from staking in vxASTRO or if they are already staked, from voting with their vxASTRO in the Astral Assembly. Only the contract owner can execute this method.
{
"append_addrs": ["terra...", "terra...", "terra..."],
"remove_addrs": ["terra...", "terra..."]
}Updates contract parameters.
{
"new_guardian": "terra..."
}All query messages are described below. A custom struct is defined for each query response.
Returns the total supply of vxASTRO at the current block.
{
"voting_power_response": {
"voting_power": 100
}
}Returns a user's vxASTRO balance at the current block.
Request:
{
"user_voting_power": {
"user": "terra..."
}
}Response:
{
"voting_power_response": {
"voting_power": 10
}
}Returns the total vxASTRO supply at a specific timestamp (in seconds).
Request:
{
"total_voting_power_at": {
"time": 1234567
}
}Response:
{
"voting_power_response": {
"voting_power": 10
}
}Returns the user's vxASTRO balance at a specific timestamp (in seconds).
Request:
{
"user_voting_power_at": {
"user": "terra...",
"time": 1234567
}
}Response:
{
"voting_power_response": {
"voting_power": 10
}
}Returns the information about a user's vxASTRO position.
Request:
{
"lock_info": {
"user": "terra..."
}
}Response:
{
"lock_info_response": {
"amount": 10,
"coefficient": 2.5,
"start": 2600,
"end": 2704
}
}Returns the contract's config.
{
"config_response": {
"owner": "terra...",
"deposit_token_addr" : "terra..."
}
}Returns blacklisted voters.
{
"blacklisted_voters": {
"start_after": "terra...",
"limit": 5
}
}Checks if specified addresses are blacklisted
{
"check_voters_are_blacklisted": {
"voters": ["terra...", "terra..."]
}
}