Crates.io | astroport-staking |
lib.rs | astroport-staking |
version | 2.2.0 |
source | src |
created_at | 2023-07-20 16:31:53.929032 |
updated_at | 2024-09-27 09:17:07.130553 |
description | Astroport Staking Contract |
homepage | https://astroport.fi |
repository | https://github.com/astroport-fi/astroport |
max_upload_size | |
id | 921507 |
size | 81,685 |
This staking contract allows ASTRO holders to stake their tokens in exchange for xASTRO. The amount of ASTRO they can claim later increases as accrued fees in the Maker contract get swapped to ASTRO which is then sent to stakers.
Initializes the contract with the token code ID used by ASTRO and the ASTRO token address.
{
"token_code_id": 123,
"deposit_token_addr": "terra..."
}
receive
CW20 receive msg.
{
"receive": {
"sender": "terra...",
"amount": "123",
"msg": "<base64_encoded_json_string>"
}
}
Enter
Deposits ASTRO in the xASTRO staking contract.
Execute this message by calling the ASTRO token contract and use a message like this:
{
"send": {
"contract": <StakingContractAddress>,
"amount": "999",
"msg": "base64-encodedStringOfWithdrawMsg"
}
}
In send.msg
, you may encode this JSON string into base64 encoding:
{
"enter": {}
}
leave
Burns xASTRO and unstakes underlying ASTRO (initial staked amount + accrued ASTRO since staking).
Execute this message by calling the xASTRO token contract and use a message like this:
{
"send": {
"contract": <StakingContractAddress>,
"amount": "999",
"msg": "base64-encodedStringOfWithdrawMsg"
}
}
In send.msg
you may encode this JSON string into base64 encoding:
{
"leave": {}
}
All query messages are described below. A custom struct is defined for each query response.
config
Returns the ASTRO and xASTRO addresses.
{
"config": {}
}
get_total_shares
Returns the total amount of xASTRO tokens.
{
"get_total_shares": {}
}
get_total_deposit
Returns the total amount of ASTRO deposits in the staking contract.
{
"get_total_deposit": {}
}