Skip to main content

anchor_token/
collector.rs

1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4use cosmwasm_std::Decimal;
5
6#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
7pub struct InstantiateMsg {
8    pub gov_contract: String, // collected rewards receiver
9    pub astroport_factory: String,
10    pub anchor_token: String,
11    pub reward_factor: Decimal,
12    pub max_spread: Option<Decimal>,
13}
14
15#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
16#[serde(rename_all = "snake_case")]
17pub enum ExecuteMsg {
18    /// Update config interface
19    /// to enable reward_factor update
20    /// ## NOTE:
21    /// for updating `max spread`
22    /// it should be either (true, none) or (true, "0.1")
23    /// if we do not want to update it
24    /// it should be (false, none)
25    UpdateConfig {
26        reward_factor: Option<Decimal>,
27        gov_contract: Option<String>,
28        astroport_factory: Option<String>,
29        max_spread: (bool, Option<Decimal>),
30    },
31    /// Public Message
32    /// Sweep all given denom balance to ANC token
33    /// and execute Distribute message
34    Sweep { denom: String },
35}
36
37#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
38#[serde(rename_all = "snake_case")]
39pub enum QueryMsg {
40    Config {},
41}
42
43// We define a custom struct for each query response
44#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
45pub struct ConfigResponse {
46    pub gov_contract: String, // collected rewards receiver
47    pub astroport_factory: String,
48    pub anchor_token: String,
49    pub reward_factor: Decimal,
50    pub max_spread: Option<Decimal>,
51}
52
53/// We currently take no arguments for migrations
54#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
55pub struct MigrateMsg {
56    pub astroport_factory: String,
57    pub max_spread: Decimal,
58}