1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
use crate::xastro_token::InstantiateMarketingInfo;
use cosmwasm_schema::{cw_serde, QueryResponses};
use cosmwasm_std::{Addr, Uint128};
use cw20::Cw20ReceiveMsg;
/// This structure describes the parameters used for creating a contract.
#[cw_serde]
pub struct InstantiateMsg {
/// The contract owner address
pub owner: String,
/// CW20 token code identifier
pub token_code_id: u64,
/// The ASTRO token contract address
pub deposit_token_addr: String,
/// the marketing info of type [`InstantiateMarketingInfo`]
pub marketing: Option<InstantiateMarketingInfo>,
}
/// This structure describes the execute messages available in the contract.
#[cw_serde]
pub enum ExecuteMsg {
/// Receive receives a message of type [`Cw20ReceiveMsg`] and processes it depending on the received template.
Receive(Cw20ReceiveMsg),
}
/// This structure describes the query messages available in the contract.
#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
/// Config returns the contract configuration specified in a custom [`ConfigResponse`] structure
#[returns(ConfigResponse)]
Config {},
#[returns(Uint128)]
TotalShares {},
#[returns(Uint128)]
TotalDeposit {},
}
#[cw_serde]
pub struct ConfigResponse {
/// The ASTRO token address
pub deposit_token_addr: Addr,
/// The xASTRO token address
pub share_token_addr: Addr,
}
/// This structure describes a migration message.
#[cw_serde]
pub struct MigrateMsg {}
/// This structure describes a CW20 hook message.
#[cw_serde]
pub enum Cw20HookMsg {
/// Deposits ASTRO in exchange for xASTRO
Enter {},
/// Burns xASTRO in exchange for ASTRO
Leave {},
}