Skip to main content

anchor_token/
distributor.rs

1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4use cosmwasm_std::Uint128;
5
6#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
7pub struct InstantiateMsg {
8    pub gov_contract: String,   // anchor gov contract
9    pub anchor_token: String,   // anchor token address
10    pub whitelist: Vec<String>, // whitelisted contract addresses to spend distributor
11    pub spend_limit: Uint128,   // spend limit per each `spend` request
12}
13
14#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
15#[serde(rename_all = "snake_case")]
16pub enum ExecuteMsg {
17    UpdateConfig { spend_limit: Option<Uint128> },
18    Spend { recipient: String, amount: Uint128 },
19    AddDistributor { distributor: String },
20    RemoveDistributor { distributor: String },
21}
22
23/// We currently take no arguments for migrations
24#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
25pub struct MigrateMsg {}
26
27#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
28#[serde(rename_all = "snake_case")]
29pub enum QueryMsg {
30    Config {},
31}
32
33// We define a custom struct for each query response
34#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
35pub struct ConfigResponse {
36    pub gov_contract: String,
37    pub anchor_token: String,
38    pub whitelist: Vec<String>,
39    pub spend_limit: Uint128,
40}